mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-19 22:16:49 +00:00
Merge pull request #2232 from nextcloud/enh/noid/fix-datdir-permissions
fix the datadir permission problems during install
This commit is contained in:
commit
92dd734993
5 changed files with 10 additions and 22 deletions
|
|
@ -216,6 +216,12 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We do our own permission check so the permission check is not needed
|
# We do our own permission check so the permission check is not needed
|
||||||
|
cat << DATADIR_PERMISSION_CONF > /var/www/html/config/datadir.permission.config.php
|
||||||
|
<?php
|
||||||
|
\$CONFIG = array (
|
||||||
|
'check_data_directory_permissions' => false
|
||||||
|
);
|
||||||
|
DATADIR_PERMISSION_CONF
|
||||||
php /var/www/html/occ config:system:set check_data_directory_permissions --value=false --type=bool
|
php /var/www/html/occ config:system:set check_data_directory_permissions --value=false --type=bool
|
||||||
|
|
||||||
# Try to force generation of appdata dir:
|
# Try to force generation of appdata dir:
|
||||||
|
|
@ -238,6 +244,9 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# This autoconfig is not needed anymore and should be able to be overwritten by the user
|
||||||
|
rm /var/www/html/config/datadir.permission.config.php
|
||||||
|
|
||||||
# unset admin password
|
# unset admin password
|
||||||
unset ADMIN_PASSWORD
|
unset ADMIN_PASSWORD
|
||||||
|
|
||||||
|
|
@ -299,11 +308,6 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set the permission check to its default value again if not set
|
|
||||||
if [ "$SKIP_DATA_DIRECTORY_PERMISSION_CHECK" != yes ]; then
|
|
||||||
php /var/www/html/occ config:system:set check_data_directory_permissions --value=true --type=bool
|
|
||||||
fi
|
|
||||||
|
|
||||||
#upgrade
|
#upgrade
|
||||||
else
|
else
|
||||||
touch "$NEXTCLOUD_DATA_DIR/update.failed"
|
touch "$NEXTCLOUD_DATA_DIR/update.failed"
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,6 @@ 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_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|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|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_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|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
|
sed -i 's|TALK_PORT=|TALK_PORT=3478 # This allows to adjust the port that the talk container is using.|' sample.conf
|
||||||
|
|
|
||||||
|
|
@ -161,8 +161,7 @@
|
||||||
"TRUSTED_CACERTS_DIR=%NEXTCLOUD_TRUSTED_CACERTS_DIR%",
|
"TRUSTED_CACERTS_DIR=%NEXTCLOUD_TRUSTED_CACERTS_DIR%",
|
||||||
"STARTUP_APPS=%NEXTCLOUD_STARTUP_APPS%",
|
"STARTUP_APPS=%NEXTCLOUD_STARTUP_APPS%",
|
||||||
"ADDITIONAL_APKS=%NEXTCLOUD_ADDITIONAL_APKS%",
|
"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",
|
"restart": "unless-stopped",
|
||||||
"devices": [
|
"devices": [
|
||||||
|
|
|
||||||
|
|
@ -738,14 +738,6 @@ class ConfigurationManager
|
||||||
return false;
|
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 {
|
public function GetNextcloudStartupApps() : string {
|
||||||
$apps = getenv('NEXTCLOUD_STARTUP_APPS');
|
$apps = getenv('NEXTCLOUD_STARTUP_APPS');
|
||||||
if (is_string($apps)) {
|
if (is_string($apps)) {
|
||||||
|
|
|
||||||
|
|
@ -348,12 +348,6 @@ class DockerActionManager
|
||||||
$replacements[1] = $this->configurationManager->GetNextcloudAdditionalApks();
|
$replacements[1] = $this->configurationManager->GetNextcloudAdditionalApks();
|
||||||
} elseif ($out[1] === 'NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS') {
|
} elseif ($out[1] === 'NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS') {
|
||||||
$replacements[1] = $this->configurationManager->GetNextcloudAdditionalPhpExtensions();
|
$replacements[1] = $this->configurationManager->GetNextcloudAdditionalPhpExtensions();
|
||||||
} elseif ($out[1] === 'SKIP_DATA_DIRECTORY_PERMISSION_CHECK') {
|
|
||||||
if ($this->configurationManager->shouldDataDirectoryPermissionCheckGetSkipped()) {
|
|
||||||
$replacements[1] = 'yes';
|
|
||||||
} else {
|
|
||||||
$replacements[1] = '';
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$secret = $this->configurationManager->GetSecret($out[1]);
|
$secret = $this->configurationManager->GetSecret($out[1]);
|
||||||
if ($secret === "") {
|
if ($secret === "") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue