From 9b63f3e4dccf071b5ffaf7b7d228d3a829e135da Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 21 Oct 2024 17:38:50 -0400 Subject: [PATCH 1/9] fix(examples): volumes must match (insecure-mariadb-apache) Signed-off-by: Josh --- .examples/docker-compose/insecure/mariadb/apache/compose.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.examples/docker-compose/insecure/mariadb/apache/compose.yaml b/.examples/docker-compose/insecure/mariadb/apache/compose.yaml index 4d0fd8fd..daa51590 100644 --- a/.examples/docker-compose/insecure/mariadb/apache/compose.yaml +++ b/.examples/docker-compose/insecure/mariadb/apache/compose.yaml @@ -23,6 +23,7 @@ services: - 127.0.0.1:8080:80 volumes: - nextcloud:/var/www/html:z + # NOTE: The `volumes` config of the `cron` and `app` containers must match environment: - MYSQL_HOST=db - REDIS_HOST=redis @@ -37,6 +38,7 @@ services: restart: always volumes: - nextcloud:/var/www/html:z + # NOTE: The `volumes` config of the `cron` and `app` containers must match entrypoint: /cron.sh depends_on: - db From abf51f1cd76ba2d4f4c9598882e67bf03e2739a9 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 21 Oct 2024 17:43:54 -0400 Subject: [PATCH 2/9] fix(examples): volumes must match (insecure-mariadb-fpm) Signed-off-by: Josh --- .examples/docker-compose/insecure/mariadb/fpm/compose.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.examples/docker-compose/insecure/mariadb/fpm/compose.yaml b/.examples/docker-compose/insecure/mariadb/fpm/compose.yaml index 06b12afb..25e5b717 100644 --- a/.examples/docker-compose/insecure/mariadb/fpm/compose.yaml +++ b/.examples/docker-compose/insecure/mariadb/fpm/compose.yaml @@ -21,6 +21,7 @@ services: restart: always volumes: - nextcloud:/var/www/html:z + # NOTE: The `volumes` config of the `cron` and `app` containers must match environment: - MYSQL_HOST=db - REDIS_HOST=redis @@ -37,6 +38,7 @@ services: - 127.0.0.1:8080:80 volumes: - nextcloud:/var/www/html:z,ro + # NOTE: The `volumes` included here should match those of the `app` container (unless you know what you're doing) depends_on: - app @@ -45,6 +47,7 @@ services: restart: always volumes: - nextcloud:/var/www/html:z + # NOTE: The `volumes` config of the `cron` and `app` containers must match entrypoint: /cron.sh depends_on: - db From 9395077d115d88817618652603519b5f53bdd6aa Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 21 Oct 2024 17:45:19 -0400 Subject: [PATCH 3/9] fix(examples): volumes must match (insecure-postgres-apache) Signed-off-by: Josh --- .../docker-compose/insecure/postgres/apache/compose.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.examples/docker-compose/insecure/postgres/apache/compose.yaml b/.examples/docker-compose/insecure/postgres/apache/compose.yaml index 646261d0..19c75ba4 100644 --- a/.examples/docker-compose/insecure/postgres/apache/compose.yaml +++ b/.examples/docker-compose/insecure/postgres/apache/compose.yaml @@ -18,6 +18,7 @@ services: - 127.0.0.1:8080:80 volumes: - nextcloud:/var/www/html:z + # NOTE: The `volumes` config of the `cron` and `app` containers must match environment: - POSTGRES_HOST=db - REDIS_HOST=redis @@ -32,6 +33,7 @@ services: restart: always volumes: - nextcloud:/var/www/html:z + # NOTE: The `volumes` config of the `cron` and `app` containers must match entrypoint: /cron.sh depends_on: - db @@ -39,4 +41,4 @@ services: volumes: db: - nextcloud: \ No newline at end of file + nextcloud: From e3dc1f3d62fcda80f35ae38a8748e75f3b50692e Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 21 Oct 2024 17:47:11 -0400 Subject: [PATCH 4/9] fix(examples): volumes must match (insecure-postgres-fpm) Signed-off-by: Josh --- .examples/docker-compose/insecure/postgres/fpm/compose.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.examples/docker-compose/insecure/postgres/fpm/compose.yaml b/.examples/docker-compose/insecure/postgres/fpm/compose.yaml index b5071d5c..4e268cab 100644 --- a/.examples/docker-compose/insecure/postgres/fpm/compose.yaml +++ b/.examples/docker-compose/insecure/postgres/fpm/compose.yaml @@ -16,6 +16,7 @@ services: restart: always volumes: - nextcloud:/var/www/html:z + # NOTE: The `volumes` config of the `cron` and `app` containers must match environment: - POSTGRES_HOST=db - REDIS_HOST=redis @@ -32,6 +33,7 @@ services: - 127.0.0.1:8080:80 volumes: - nextcloud:/var/www/html:z,ro + # NOTE: The `volumes` included here should match those of the `app` container (unless you know what you're doing) depends_on: - app @@ -40,6 +42,7 @@ services: restart: always volumes: - nextcloud:/var/www/html:z + # NOTE: The `volumes` config of the `cron` and `app` containers must match entrypoint: /cron.sh depends_on: - db From 60f205abeab9ad60df5d9a44cf8bdc8fa5536a73 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 21 Oct 2024 17:49:39 -0400 Subject: [PATCH 5/9] fix(examples): volumes must match (with-nginx-proxy-mariadb-apache) Signed-off-by: Josh --- .../docker-compose/with-nginx-proxy/mariadb/apache/compose.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb/apache/compose.yaml b/.examples/docker-compose/with-nginx-proxy/mariadb/apache/compose.yaml index 7a221407..2a0d57a5 100644 --- a/.examples/docker-compose/with-nginx-proxy/mariadb/apache/compose.yaml +++ b/.examples/docker-compose/with-nginx-proxy/mariadb/apache/compose.yaml @@ -21,6 +21,7 @@ services: restart: always volumes: - nextcloud:/var/www/html:z + # NOTE: The `volumes` config of the `cron` and `app` containers must match environment: - VIRTUAL_HOST= - LETSENCRYPT_HOST= @@ -45,6 +46,7 @@ services: restart: always volumes: - nextcloud:/var/www/html:z + # NOTE: The `volumes` config of the `cron` and `app` containers must match entrypoint: /cron.sh depends_on: - db From 7e188da4fa2f24edf41dd0efee49a2cdf3105eff Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 21 Oct 2024 17:51:06 -0400 Subject: [PATCH 6/9] fix(examples): volumes must match (with-nginx-proxy-mariadb-fpm) Signed-off-by: Josh --- .../docker-compose/with-nginx-proxy/mariadb/fpm/compose.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/compose.yaml b/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/compose.yaml index ff7a5388..20db19a9 100644 --- a/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/compose.yaml +++ b/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/compose.yaml @@ -21,6 +21,7 @@ services: restart: always volumes: - nextcloud:/var/www/html:z + # NOTE: The `volumes` config of the `cron` and `app` containers must match environment: - MYSQL_HOST=db - REDIS_HOST=redis @@ -36,6 +37,7 @@ services: restart: always volumes: - nextcloud:/var/www/html:z,ro + # NOTE: The `volumes` included here should match those of the `app` container (unless you know what you're doing) environment: - VIRTUAL_HOST= - LETSENCRYPT_HOST= @@ -51,6 +53,7 @@ services: restart: always volumes: - nextcloud:/var/www/html:z + # NOTE: The `volumes` config of the `cron` and `app` containers must match entrypoint: /cron.sh depends_on: - db From 24b67696829f015a2d7a03b4be9b190aeb274ca6 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 21 Oct 2024 17:52:21 -0400 Subject: [PATCH 7/9] fix(examples): volumes must match (with-nginx-proxy-postgres-apache) Signed-off-by: Josh --- .../with-nginx-proxy/postgres/apache/compose.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.examples/docker-compose/with-nginx-proxy/postgres/apache/compose.yaml b/.examples/docker-compose/with-nginx-proxy/postgres/apache/compose.yaml index a3dece4b..2eb4f638 100644 --- a/.examples/docker-compose/with-nginx-proxy/postgres/apache/compose.yaml +++ b/.examples/docker-compose/with-nginx-proxy/postgres/apache/compose.yaml @@ -16,6 +16,7 @@ services: restart: always volumes: - nextcloud:/var/www/html:z + # NOTE: The `volumes` config of the `cron` and `app` containers must match environment: - VIRTUAL_HOST= - LETSENCRYPT_HOST= @@ -37,6 +38,7 @@ services: restart: always volumes: - nextcloud:/var/www/html:z + # NOTE: The `volumes` config of the `cron` and `app` containers must match entrypoint: /cron.sh depends_on: - db From 9b245ac4a1c401a9890bd8ffa903058d2c83cf20 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 21 Oct 2024 17:53:55 -0400 Subject: [PATCH 8/9] fix(examples): volumes must match (with-nginx-proxy-postgres-fpm) Signed-off-by: Josh --- .../docker-compose/with-nginx-proxy/postgres/fpm/compose.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.examples/docker-compose/with-nginx-proxy/postgres/fpm/compose.yaml b/.examples/docker-compose/with-nginx-proxy/postgres/fpm/compose.yaml index 09a80e7d..80be65a6 100644 --- a/.examples/docker-compose/with-nginx-proxy/postgres/fpm/compose.yaml +++ b/.examples/docker-compose/with-nginx-proxy/postgres/fpm/compose.yaml @@ -18,6 +18,7 @@ services: restart: always volumes: - nextcloud:/var/www/html:z + # NOTE: The `volumes` config of the `cron` and `app` containers must match environment: - POSTGRES_HOST=db - REDIS_HOST=redis @@ -33,6 +34,7 @@ services: restart: always volumes: - nextcloud:/var/www/html:z,ro + # NOTE: The `volumes` included here should match those of the `app` container (unless you know what you're doing) environment: - VIRTUAL_HOST= - LETSENCRYPT_HOST= @@ -48,6 +50,7 @@ services: restart: always volumes: - nextcloud:/var/www/html:z + # NOTE: The `volumes` config of the `cron` and `app` containers must match entrypoint: /cron.sh depends_on: - db From 090934d9b0e1eec99479f84ab0e0b0bf8ff74857 Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 22 Oct 2024 09:15:05 -0400 Subject: [PATCH 9/9] feat(readme): Viewing merged config via `occ config:list system` Signed-off-by: Josh --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d8f41dcb..ab6608ad 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,8 @@ If mounting additional volumes under `/var/www/html`, you should consider: You should note that data inside the main folder (`/var/www/html`) will be overridden/removed during installation and upgrades, unless listed in [upgrade.exclude](https://github.com/nextcloud/docker/blob/master/upgrade.exclude). The additional volumes officially supported are already in that list, but custom volumes will need to be added by you. We suggest mounting custom storage volumes outside of `/var/www/html` and if possible read-only so that making this adjustment is unnecessary. If you must do so, however, you may build a custom image with a modified `/upgrade.exclude` file that incorporates your custom volume(s). -## Using the Nextcloud command-line interface +## Using the Nextcloud command-line interface (`occ`) + To use the [Nextcloud command-line interface](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html) (aka. `occ` command): ```console $ docker exec --user www-data CONTAINER_ID php occ @@ -112,6 +113,23 @@ or for docker compose: ```console $ docker compose exec --user www-data app php occ ``` +or even shorter: +```console +$ docker compose exec -u33 app ./occ +``` +Note: substitute `82` for `33` if using the Alpine-based images. + +## Viewing the Nextcloud configuration (`config.php`) + +The image takes advantage of Nextcloud's [Multiple config.php support](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#multiple-config-php-file) to inject auto configuration environment variables and set image specific config values. + +This means that merely viewing your `config.php` will not give you an accurate view of your running config. Instead, you should use Nextcloud's [`occ config:list system` command](https://docs.nextcloud.com/server/latest/admin_manual/occ_command.html#config-commands-label) to get get a complete view of your merged configuration. This has the added benefit of automatically omitting sensitive values such as passwords and secrets from the output by default (e.g. useful for shared publicly or assisting others when troubleshooting or reporting a bug). + +```console +$ docker compose exec -u33 app ./occ config:list system +``` + +The `--private` flag can also be specified, in order to output all configuration values including passwords and secrets. ## Auto configuration via environment variables The Nextcloud image supports auto configuration via environment variables. You can preconfigure everything that is asked on the install page on first run. To enable auto configuration, set your database connection via the following environment variables. You must specify all of the environment variables for a given database or the database environment variables defaults to SQLITE. ONLY use one database type!