You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds notes on setting web interface password using the
FTLCONF_webserver_api_password environment variable or the
WEBPASSWORD_FILE environment variable. Examples are provided.
Signed-off-by: Bradley G Smith <[email protected]>
Copy file name to clipboardexpand all lines: docs/docker/configuration.md
+106-17
Original file line number
Diff line number
Diff line change
@@ -4,22 +4,6 @@ The recommended way to configure the Pi-hole docker container is by utilizing [e
4
4
5
5
## Environment Variables
6
6
7
-
### Recommended Variables
8
-
9
-
#### `TZ` (Default: `UTC`)
10
-
11
-
Set your [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) to make sure logs rotate at local midnight instead of at UTC midnight.
To set a specific password for the web interface, use the environment variable `FTLCONF_webserver_api_password` (per the quick-start example). If this variable is not detected, and you have not already set one previously inside the container via `pihole setpassword` or `pihole-FTL --config webserver.api.password`, then a random password will be assigned on startup, and will be printed to the log. You can find this password with the command `docker logs pihole | grep random password` on your host to find this password.
- Upstream DNS server(s) for Pi-hole to forward queries to, separated by a semicolon
20
-
- Supports non-standard ports with #[port number] e.g `127.0.0.1#5053;8.8.8.8;8.8.4.4`
21
-
- Supports Docker service names and links instead of IPs e.g `upstream0;upstream1` where upstream0 and upstream1 are the service names of or links to docker services
22
-
23
7
### Configuring FTL Via The Environment
24
8
25
9
While FTL's configuration file can be manually edited, set via the CLI (`pihole-FTL --config setting.name=value`), or set via the web interface - the recommended approach is to do this via environment variables
@@ -38,7 +22,6 @@ Array type configs should be delimited with `;`
38
22
!!! note
39
23
All FTL settings that are set via environment variables effectively become read-only, meaning that you will not be able to change them via the web interface or CLI. This is to ensure a "single source of truth" on the config. If you later unset or remove an environment variable, then FTL will revert to the default value for that setting
40
24
41
-
42
25
An example of how some of these variables may look in your compose file
43
26
44
27
```yaml
@@ -51,6 +34,22 @@ An example of how some of these variables may look in your compose file
51
34
FTLCONF_debug_api: 'true'
52
35
```
53
36
37
+
### Recommended Variables
38
+
39
+
#### `TZ` (Default: `UTC`)
40
+
41
+
Set your [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) to make sure logs rotate at local midnight instead of at UTC midnight.
To set a specific password for the web interface, use the environment variable `FTLCONF_webserver_api_password` (per the quick-start example). If this variable is not detected, and you have not already set one previously inside the container via `pihole setpassword` or `pihole-FTL --config webserver.api.password`, then a random password will be assigned on startup, and will be printed to the log. You can find this password with the command `docker logs pihole | grep random password` on your host to find this password. See [Notes On Web Interface Password](#notes-on-web-interface-password) below for usage examples.
- Upstream DNS server(s) for Pi-hole to forward queries to, separated by a semicolon
50
+
- Supports non-standard ports with #[port number] e.g `127.0.0.1#5053;8.8.8.8;8.8.4.4`
51
+
- Supports Docker service names and links instead of IPs e.g `upstream0;upstream1` where upstream0 and upstream1 are the service names of or links to docker services
52
+
54
53
### Other Variables
55
54
56
55
#### `TAIL_FTL_LOG` (Default: `1`)
@@ -85,3 +84,93 @@ Adding packages here is the same as running `apk add <package>` inside the conta
85
84
#### `PH_VERBOSE` (Default: `0`)
86
85
87
86
Setting this environment variable to `1` will set `-x`, making the scripts that run on container startup more verbose. Useful for debugging only.
87
+
88
+
#### `WEBPASSWORD_FILE` (Default: unset)
89
+
90
+
Set the web interface password using [Docker Compose Secrets](https://docs.docker.com/compose/how-tos/use-secrets/) if using Compose or [Docker Swarm secrets](https://docs.docker.com/engine/swarm/secrets/) if using Docker Swarm. If `FTLCONF_webserver_api_password` is set, `WEBPASSWORD_FILE` is ignored. If `FTLCONF_webserver_api_password` is empty, and `WEBPASSWORD_FILE` is set to a valid readable file path, then `FTLCONF_webserver_api_password` will be set to the contents of `WEBPASSWORD_FILE`. See [Notes On Web Interface Password](#notes-on-web-interface-password) below for usage examples.
91
+
92
+
## Notes On Web Interface Password
93
+
94
+
The web interface password can be set using the `FTLCONF_webserver_api_password` environment variable as documented above or using the `WEBPASSWORD_FILE` environment variable using [Docker Compose Secrets](https://docs.docker.com/compose/how-tos/use-secrets/) or [Docker Swarm secrets](https://docs.docker.com/engine/swarm/secrets/).
95
+
96
+
### `FTLCONF_webserver_api_password` Examples
97
+
98
+
The `FTLCONF_webserver_api_password` variable can be set in a `docker run` command or as an environment attribute in a Docker Compose yaml file.
Set using an [environment variable](https://docs.docker.com/compose/how-tos/environment-variables/) called, for example, `ADMIN_PASSWORD`. The value of `ADMIN_PASSWORD` can be set in the shell of the `docker compose` command or in an `.env` file. See the link above for detailed information.
Or define ADMIN_PASSWORD in `.env` file. The `.env` file is placed in the same directory where the Compose yaml file (e.g. `compose.yaml`) is located.
134
+
135
+
```bash
136
+
$ cat .env
137
+
ADMIN_PASSWORD=correct horse battery staple
138
+
$ docker compose -f compose.yaml
139
+
```
140
+
141
+
### `WEBPASSWORD_FILE` Example
142
+
143
+
1. Create a text file called `pihole_password.txt` containing the password in the same directory containing the Compose yaml file (e.g `compose.yaml`).
144
+
145
+
```bash
146
+
$cat pihole_password.txt
147
+
correct horse battery staple
148
+
```
149
+
150
+
1. Amend compose yaml file with Docker Secrets attributes.
0 commit comments