fix datadir permission check

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-02-27 14:48:49 +01:00
parent bcdb692dd1
commit ee06a04f51
5 changed files with 21 additions and 1 deletions

View file

@ -212,6 +212,10 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
exit 1
fi
if [ "$SKIP_DATA_DIRECTORY_PERMISSION_CHECK" = yes ]; then
php /var/www/html/occ config:system:set check_data_directory_permissions --value=false --type=bool
fi
# Try to force generation of appdata dir:
php /var/www/html/occ maintenance:repair

View file

@ -71,6 +71,7 @@ sed -i 's|APACHE_MAX_SIZE=|APACHE_MAX_SIZE=10737418240 # This needs to
sed -i 's|NEXTCLOUD_MAX_TIME=|NEXTCLOUD_MAX_TIME=3600 # This allows to change the upload time limit of the Nextcloud container|' sample.conf
sed -i 's|NEXTCLOUD_TRUSTED_CACERTS_DIR=|NEXTCLOUD_TRUSTED_CACERTS_DIR=/usr/local/share/ca-certificates/my-custom-ca # Nextcloud container will trust all the Certification Authorities, whose certificates are included in the given directory.|' sample.conf
sed -i 's|UPDATE_NEXTCLOUD_APPS=|UPDATE_NEXTCLOUD_APPS="no" # When setting to "yes" (with quotes), it will automatically update all installed Nextcloud apps upon container startup on saturdays.|' sample.conf
sed -i 's|SKIP_DATA_DIRECTORY_PERMISSION_CHECK=|SKIP_DATA_DIRECTORY_PERMISSION_CHECK="no" # When setting to "yes" (with quotes), it will skip the datadir permission check upon the initial Nextcloud installation.|' sample.conf
sed -i 's|APACHE_PORT=|APACHE_PORT=443 # Changing this to a different value than 443 will allow you to run it behind a web server or reverse proxy (like Apache, Nginx and else).|' sample.conf
sed -i 's|APACHE_IP_BINDING=|APACHE_IP_BINDING=0.0.0.0 # This can be changed to e.g. 127.0.0.1 if you want to run AIO behind a web server or reverse proxy (like Apache, Nginx and else) and if that is running on the same host and using localhost to connect|' sample.conf
sed -i 's|TALK_PORT=|TALK_PORT=3478 # This allows to adjust the port that the talk container is using.|' sample.conf

View file

@ -160,7 +160,8 @@
"TRUSTED_CACERTS_DIR=%NEXTCLOUD_TRUSTED_CACERTS_DIR%",
"STARTUP_APPS=%NEXTCLOUD_STARTUP_APPS%",
"ADDITIONAL_APKS=%NEXTCLOUD_ADDITIONAL_APKS%",
"ADDITIONAL_PHP_EXTENSIONS=%NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS%"
"ADDITIONAL_PHP_EXTENSIONS=%NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS%",
"SKIP_DATA_DIRECTORY_PERMISSION_CHECK=%SKIP_DATA_DIRECTORY_PERMISSION_CHECK%"
],
"restart": "unless-stopped",
"devices": [

View file

@ -736,6 +736,14 @@ class ConfigurationManager
return false;
}
public function shouldDataDirectoryPermissionCheckGetSkipped() : bool {
$datadir = $this->GetNextcloudDatadirMount();
if ($datadir === 'nextcloud_aio_nextcloud_datadir' || str_starts_with($datadir, '/run/desktop/mnt/host/')) {
return true;
}
return false;
}
public function GetNextcloudStartupApps() : string {
$apps = getenv('NEXTCLOUD_STARTUP_APPS');
if (is_string($apps)) {

View file

@ -348,6 +348,12 @@ class DockerActionManager
$replacements[1] = $this->configurationManager->GetNextcloudAdditionalApks();
} elseif ($out[1] === 'NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS') {
$replacements[1] = $this->configurationManager->GetNextcloudAdditionalPhpExtensions();
} elseif ($out[1] === 'SKIP_DATA_DIRECTORY_PERMISSION_CHECK') {
if ($this->configurationManager->shouldDataDirectoryPermissionCheckGetSkipped()) {
$replacements[1] = 'yes';
} else {
$replacements[1] = '';
}
} else {
$secret = $this->configurationManager->GetSecret($out[1]);
if ($secret === "") {