diff --git a/Containers/mastercontainer/start.sh b/Containers/mastercontainer/start.sh index c57b4207..6542d788 100755 --- a/Containers/mastercontainer/start.sh +++ b/Containers/mastercontainer/start.sh @@ -165,7 +165,15 @@ if [ -n "$TRUSTED_CACERTS_DIR" ]; then if ! echo "$TRUSTED_CACERTS_DIR" | grep -q "^/" || echo "$TRUSTED_CACERTS_DIR" | grep -q "/$"; then echo "You've set TRUSTED_CACERTS_DIR but not to an allowed value. It should be an absolute path to a directory that starts with '/' but not end with '/'. -It is set to '$TRUSTED_CACERTS_DIR '." +It is set to '$TRUSTED_CACERTS_DIR'." + exit 1 + fi +fi +if [ -n "$NEXTCLOUD_STARTUP_APPS" ]; then + if ! echo "$NEXTCLOUD_STARTUP_APPS" | grep -q "^[a-z _-]\+$"; then + echo "You've set NEXTCLOUD_STARTUP_APPS but not to an allowed value. +It needs to be a string. Allowed are small letters a-z, spaces, hyphens and '_'. +It is set to '$NEXTCLOUD_STARTUP_APPS'." exit 1 fi fi diff --git a/Containers/nextcloud/entrypoint.sh b/Containers/nextcloud/entrypoint.sh index 3f7af70e..c0f365c0 100644 --- a/Containers/nextcloud/entrypoint.sh +++ b/Containers/nextcloud/entrypoint.sh @@ -229,12 +229,12 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then # php /var/www/html/occ config:app:set updatenotification notify_groups --value="[]" # Install some apps by default - php /var/www/html/occ app:install twofactor_totp - php /var/www/html/occ app:install deck - php /var/www/html/occ app:install tasks - php /var/www/html/occ app:install calendar - php /var/www/html/occ app:install contacts - php /var/www/html/occ app:install apporder + if [ -n "$STARTUP_APPS" ]; then + read -ra STARTUP_APPS_ARRAY <<< "$STARTUP_APPS" + for app in "${STARTUP_APPS_ARRAY[@]}"; do + php /var/www/html/occ app:install "$app" + done + fi #upgrade else diff --git a/docker-compose.yml b/docker-compose.yml index f047f341..7808a1b2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,6 +28,7 @@ services: # - NEXTCLOUD_MAX_TIME=3600 # Can be adjusted if you need more. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-max-execution-time-for-nextcloud # - TRUSTED_CACERTS_DIR=/path/to/my/cacerts # CA certificates in this directory will be trusted by the OS of the nexcloud container (Useful e.g. for LDAPS) See See https://github.com/nextcloud/all-in-one#how-to-trust-user-defiend-certification-authorities-ca # - COLLABORA_SECCOMP_DISABLED=false # Setting this to true allows to disable Collabora's Seccomp feature. See https://github.com/nextcloud/all-in-one#how-to-disable-collaboras-seccomp-feature + # - NEXTCLOUD_STARTUP_APPS=twofactor_totp deck tasks calendar contacts apporder # Allows to modify the Nextcloud apps that are installed on starting AIO the first time # # Optional: Caddy reverse proxy. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md # # You can find further examples here: https://github.com/nextcloud/all-in-one/discussions/588 diff --git a/manual-install/update-yaml.sh b/manual-install/update-yaml.sh index d8945f7b..5706114f 100644 --- a/manual-install/update-yaml.sh +++ b/manual-install/update-yaml.sh @@ -75,6 +75,7 @@ sed -i 's|NC_DOMAIN=|NC_DOMAIN=yourdomain.com # TODO! Needs to be chang sed -i 's|NEXTCLOUD_PASSWORD=|NEXTCLOUD_PASSWORD= # TODO! This is the password of the initially created Nextcloud admin with username "admin".|' sample.conf sed -i 's|TIMEZONE=|TIMEZONE=Europe/Berlin # TODO! This is the timezone that your containers will use.|' sample.conf sed -i 's|COLLABORA_SECCOMP_POLICY=|COLLABORA_SECCOMP_POLICY=--o:security.seccomp=true # Changing the value to false allows to disable the seccomp feature of the Collabora container.|' sample.conf +sed -i 's|NEXTCLOUD_STARTUP_APPS=|NEXTCLOUD_STARTUP_APPS=twofactor_totp deck tasks calendar contacts apporder # Allows to modify the Nextcloud apps that are installed on starting AIO the first time|' sample.conf sed -i 's|=$|= # TODO! This needs to be a unique and good password!|' sample.conf cat sample.conf diff --git a/php/containers.json b/php/containers.json index 50fe1d1e..a3ceef47 100644 --- a/php/containers.json +++ b/php/containers.json @@ -156,7 +156,8 @@ "FULLTEXTSEARCH_ENABLED=%FULLTEXTSEARCH_ENABLED%", "FULLTEXTSEARCH_HOST=nextcloud-aio-fulltextsearch", "PHP_MAX_TIME=%NEXTCLOUD_MAX_TIME%", - "TRUSTED_CACERTS_DIR=%TRUSTED_CACERTS_DIR%" + "TRUSTED_CACERTS_DIR=%TRUSTED_CACERTS_DIR%", + "STARTUP_APPS=%NEXTCLOUD_STARTUP_APPS%" ], "maxShutdownTime": 10, "restartPolicy": "unless-stopped" diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index b1f3b560..45233349 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -700,6 +700,14 @@ class ConfigurationManager return false; } + public function GetNextcloudStartupApps() : string { + $apps = getenv('NEXTCLOUD_STARTUP_APPS'); + if (is_string($apps)) { + return trim($apps); + } + return 'twofactor_totp deck tasks calendar contacts apporder'; + } + public function GetCollaboraDictionaries() : string { $config = $this->GetConfig(); if(!isset($config['collabora_dictionaries'])) { diff --git a/php/src/Docker/DockerActionManager.php b/php/src/Docker/DockerActionManager.php index 19fa4789..59f7602d 100644 --- a/php/src/Docker/DockerActionManager.php +++ b/php/src/Docker/DockerActionManager.php @@ -328,6 +328,8 @@ class DockerActionManager $replacements[1] = $this->configurationManager->GetApacheMaxSize(); } elseif ($out[1] === 'COLLABORA_SECCOMP_POLICY') { $replacements[1] = $this->configurationManager->GetCollaboraSeccompPolicy(); + } elseif ($out[1] === '%NEXTCLOUD_STARTUP_APPS%') { + $replacements[1] = $this->configurationManager->GetNextcloudStartupApps(); } else { $replacements[1] = $this->configurationManager->GetSecret($out[1]); } diff --git a/readme.md b/readme.md index 742e0fec..f3167415 100644 --- a/readme.md +++ b/readme.md @@ -446,6 +446,9 @@ If you get an error during the domain validation which states that your ip-addre ### How to run this with docker rootless? You can run AIO also with docker rootless. How to do this is documented here: [docker-rootless.md](https://github.com/nextcloud/all-in-one/blob/main/docker-rootless.md) +### How to change the Nextcloud apps that are installed on the first startup? +You might want to adjust the Nextcloud apps that are installed upon the first startup of the Nextcloud container. You can do so by adding `-e NEXTCLOUD_STARTUP_APPS=twofactor_totp deck tasks calendar contacts apporder` to the docker run command of the mastercontainer and customize the value to your fitting. It must be a string with small letters a-z, spaces and hyphens or '_'. + ### Huge docker logs When your containers run for a few days without a restart, the container logs that you can view from the AIO interface can get really huge. You can limit the loge sizes by enabling logrotate for docker container logs. Feel free to enable this by following those instructions: https://sandro-keil.de/blog/logrotate-for-docker-container/ diff --git a/tests/QA/060-environmental-variables.md b/tests/QA/060-environmental-variables.md index 323c236e..d3b7ebf4 100644 --- a/tests/QA/060-environmental-variables.md +++ b/tests/QA/060-environmental-variables.md @@ -14,5 +14,6 @@ - [ ] When starting the mastercontainer with `-e TRUSTED_CACERTS_DIR=/path/to/my/cacerts`, the resulting nextcloud container should trust all the Certification Authorities, whose certificates are included in the directory `/path/to/my/cacerts` on the host. See https://github.com/nextcloud/all-in-one#how-to-trust-user-defiend-certification-authorities-ca - [ ] When starting the mastercontainer with `-e COLLABORA_SECCOMP_DISABLED=true`, the resulting collabora container should have `--o:security.seccomp=false` applied to it. +- [ ] When starting the mastercontainer with `-e NEXTCLOUD_STARTUP_APPS=deck`, the resulting Nextcloud should have only installed the deck app and not the other apps that get installed by default. Default are `twofactor_totp deck tasks calendar contacts apporder`. You can now continue with [070-timezone-change.md](./070-timezone-change.md)