-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require write permissions only for relevant directories #40
Comments
Git actually only stores the executable bit, not r/w permissions (https://stackoverflow.com/questions/3207728/retaining-file-permissions-with-git). So we can't store the permissions in the repo unfortunately. The requirement/error essage for r/w permissions should still be fixed. I will add a paragraph to the wiki about the ideal permissions setup (everything owned by |
Bumping this issue https://github.com/shaarli/Shaarli/blob/master/index.php#L110 Can we check only ifrequired directories exist/are writable instead? |
Yes, we can check every directories individually. If it doesn't exist, we can create it though. The only issue is if it's not writable. |
Hi all! Suggestion:
|
Closes shaarli#40 TODO: - factorize duplicated code - see whether having incorrect permissions for minor dirs should be blocking Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Closes shaarli#40 TODO: - factorize duplicated code - see whether having incorrect permissions for minor dirs should be blocking Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Closes shaarli#40 Additions: - FileUtils: IOException - ApplicationUtils: - check if Shaarli resources are accessible with sufficient permissions - redirect to an error summary when needed - index.php: - check access permissions and redirect to an error page if needed: - before running the first installation Modifications: - LinkDB: - factorize datastore write code - check if the datastore (exists AND is writeable) OR (doesn't exist AND its parent dir is writable) - raise an IOException if needed TODO: - index.php: - check access permissions and redirect to an error page if needed: - in case the datastore cannot be created/written - see whether having incorrect permissions for minor dirs should be blocking - add a Tools page to check resource access permissions Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Closes shaarli#40 Additions: - FileUtils: IOException - ApplicationUtils: - check if Shaarli resources are accessible with sufficient permissions - redirect to an error summary when needed - index.php: - check access permissions and redirect to an error page if needed: - before running the first installation Modifications: - LinkDB: - factorize datastore write code - check if the datastore (exists AND is writeable) OR (doesn't exist AND its parent dir is writable) - raise an IOException if needed TODO: - index.php: - check access permissions and redirect to an error page if needed: - in case the datastore cannot be created/written - see whether having incorrect permissions for minor dirs should be blocking - add a Tools page to check resource access permissions Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Relates to shaarli#40 Additions: - FileUtils: IOException - ApplicationUtils: - check if Shaarli resources are accessible with sufficient permissions - index.php: - check access permissions and redirect to an error page if needed: - before running the first installation Modifications: - LinkDB: - factorize datastore write code - check if the datastore (exists AND is writeable) OR (doesn't exist AND its parent dir is writable) - raise an IOException if needed Signed-off-by: VirtualTam <virtualtam@flibidi.net>
It contains mostly read only information about the current Shaarli instance, PHP version, extensions, file and folder permissions, etc. Also action buttons to clear the cache or sync thumbnails. Part of the content of this page is also displayed on the install page, to check server requirement before installing Shaarli config file. Fixes shaarli#40 Fixes shaarli#185
It contains mostly read only information about the current Shaarli instance, PHP version, extensions, file and folder permissions, etc. Also action buttons to clear the cache or sync thumbnails. Part of the content of this page is also displayed on the install page, to check server requirement before installing Shaarli config file. Fixes shaarli#40 Fixes shaarli#185
It contains mostly read only information about the current Shaarli instance, PHP version, extensions, file and folder permissions, etc. Also action buttons to clear the cache or sync thumbnails. Part of the content of this page is also displayed on the install page, to check server requirement before installing Shaarli config file. Fixes shaarli#40 Fixes shaarli#185
It is recommended to not give write access to all files to the webserver process (see https://wiki.debian.org/Apache/Hardening#File_permissions). The dirs for which write permissions are required are
cache
,data
,pagecache
andtmp
, so we should only check these.This allows to install shaarli with user/group
someuser:www-data
and permissions640
(750
for dirs), except for these read/write dirs. The permissions can be stored in the git repository (so no extra chmod/chown commands required at install)This was requested at sebsauvage#181, and discussed at #11 (comment)
The text was updated successfully, but these errors were encountered: