Skip to content

Add config option to bypass checkDataDirectoryPermissions #3245

@jarofgreen

Description

@jarofgreen

During install Nextcloud checks the data directory has permission 0770 and won't let the install proceed without that.

It seems it might be good to allow this check to be skipped, in the same way that the admin can go to "Additional settings" and turn off the check for common passwords. (But this check should be on by default as is the other check.)

Skipping this has to be configured in config.php and not the admin panel; as you can't finish the install if this check fails you can't get to the admin panel! So you must be able to turn it off in config.php.

To add a feature to skip this check, replace this line:

 $errors = array_merge( $errors, self::checkDataDirectoryPermissions( $CONFIG_DATADIRECTORY ) );

in function checkServer in https://github.com/nextcloud/server/blob/master/lib/private/legacy/util.php#L699 (currently line number 699 and 718) with:

if ($config->getSystemValue('check_data_directory_permissions', true)) {
     $errors = array_merge( $errors, self::checkDataDirectoryPermissions( $CONFIG_DATADIRECTORY ) );
}

This will run the check by default, but then the admin can add

'check_data_directory_permissions' => false

to config.php to skip it.

Goggling "please change the permissions to 0770 so that the" shows this is a common problem, with some problems caused by people using external drives with a different file system - http://askubuntu.com/questions/380767/please-change-the-permissions-to-0770-so-that-the-directory Tho it is true some problems seem to be caused by things like bad FTP uploads and there you definitely want file permissions sorted out properly.

I personally ran into this problem as I was running Nextcloud in Vagrant for testing, and my Vagrant mount options meant I couldn't simply use chmod to fix the problem. So I took a deeper look at it.

EDIT: I originally suggested wthout dashes but this seems to have lead to confusion as with dashes is now the official way - added in dashes to try and avoid confusing others.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions