Skip to content

Commit cb8afbb

Browse files
Merge pull request #2321 from nextcloud/jtr/feat-docs-readme-occ-config
feat(readme): Viewing merged config via `occ config:list system`
2 parents abd813f + 090934d commit cb8afbb

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ If mounting additional volumes under `/var/www/html`, you should consider:
103103
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).
104104

105105

106-
## Using the Nextcloud command-line interface
106+
## Using the Nextcloud command-line interface (`occ`)
107+
107108
To use the [Nextcloud command-line interface](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html) (aka. `occ` command):
108109
```console
109110
$ docker exec --user www-data CONTAINER_ID php occ
@@ -112,6 +113,23 @@ or for docker compose:
112113
```console
113114
$ docker compose exec --user www-data app php occ
114115
```
116+
or even shorter:
117+
```console
118+
$ docker compose exec -u33 app ./occ
119+
```
120+
Note: substitute `82` for `33` if using the Alpine-based images.
121+
122+
## Viewing the Nextcloud configuration (`config.php`)
123+
124+
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.
125+
126+
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).
127+
128+
```console
129+
$ docker compose exec -u33 app ./occ config:list system
130+
```
131+
132+
The `--private` flag can also be specified, in order to output all configuration values including passwords and secrets.
115133

116134
## Auto configuration via environment variables
117135
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!

0 commit comments

Comments
 (0)