diff --git a/README.md b/README.md index 9df5800..fbad67d 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ services: restart: unless-stopped ``` 2. Run `docker compose up -d` to build and start pi-hole (Syntax may be `docker-compose` on older systems) -3. If using Docker's default `bridge` network setting, set the environment variable `FTLCONF_dns_listeningMode` to `all` +3. If using Docker's default `bridge` network setting, set the environment variable `FTLCONF_dns.listeningMode` to `all` [Here is an equivalent docker run script](https://github.com/pi-hole/docker-pi-hole/blob/master/examples/docker_run.sh). @@ -90,8 +90,8 @@ There are other environment variables if you want to customize various things in | Variable | Default | Value | Description | | -------- | ------- | ----- | ---------- | | `TZ` | UTC | `` | 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. -| `FTLCONF_webserver_api_password` | random | `` | http://pi.hole/admin password. Run `docker logs pihole \| grep random` to find your random pass. -| `FTLCONF_dns_upstreams` | `8.8.8.8;8.8.4.4` | IPs delimited by `;` | Upstream DNS server(s) for Pi-hole to forward queries to, separated by a semicolon
(supports non-standard ports with `#[port number]`) e.g `127.0.0.1#5053;8.8.8.8;8.8.4.4`
(supports [Docker service names and links](https://docs.docker.com/compose/networking/) instead of IPs) e.g `upstream0;upstream1` where `upstream0` and `upstream1` are the service names of or links to docker services
Note: The existence of this environment variable assumes this as the _sole_ management of upstream DNS. Upstream DNS added via the web interface will be overwritten on container restart/recreation | +| `FTLCONF_webserver.api.password` | random | `` | http://pi.hole/admin password. Run `docker logs pihole \| grep random` to find your random pass. +| `FTLCONF_dns.upstreams` | `8.8.8.8;8.8.4.4` | IPs delimited by `;` | Upstream DNS server(s) for Pi-hole to forward queries to, separated by a semicolon
(supports non-standard ports with `#[port number]`) e.g `127.0.0.1#5053;8.8.8.8;8.8.4.4`
(supports [Docker service names and links](https://docs.docker.com/compose/networking/) instead of IPs) e.g `upstream0;upstream1` where `upstream0` and `upstream1` are the service names of or links to docker services
Note: The existence of this environment variable assumes this as the _sole_ management of upstream DNS. Upstream DNS added via the web interface will be overwritten on container restart/recreation | ### Optional Variables @@ -104,7 +104,7 @@ There are other environment variables if you want to customize various things in | -------- | ------- | ----- | ---------- | | `SKIPGRAVITYONBOOT` | unset | `` | Use this option to skip updating the Gravity Database when booting up the container. By default this environment variable is not set so the Gravity Database will be updated when the container starts up. Setting this environment variable to 1 (or anything) will cause the Gravity Database to not be updated when container starts up. | `FTL_CMD` | `no-daemon` | `no-daemon -- ` | Customize the options with which dnsmasq gets started. e.g. `no-daemon -- --dns-forward-max 300` to increase max. number of concurrent dns queries on high load setups. | -| `FTLCONF_[SETTING]` | unset | As per documentation | Customize pihole-FTL.conf with settings described in the . Replace `.` with `_`, e.g for `dns.dnssec=true` use `FTLCONF_dns_dnssec: 'true'` +| `FTLCONF_[SETTING]` | unset | As per documentation | Customize pihole.toml with settings described in the . e.g for `dns.dnssec=true` use `FTLCONF_dns.dnssec: 'true'` | `PIHOLE_UID` | `999` | Number | Overrides image's default pihole user id to match a host user id
**IMPORTANT**: id must not already be in use inside the container! | | `PIHOLE_GID` | `999` | Number | Overrides image's default pihole group id to match a host group id
**IMPORTANT**: id must not already be in use inside the container!| | `DNSMASQ_USER` | unset | `` | Allows changing the user that FTLDNS runs as. Default: `pihole`, some systems such as Synology NAS may require you to change this to `root` (See [#963](https://github.com/pi-hole/docker-pi-hole/issues/963)) | diff --git a/src/bash_functions.sh b/src/bash_functions.sh index 1911bea..1aa5e36 100644 --- a/src/bash_functions.sh +++ b/src/bash_functions.sh @@ -122,11 +122,10 @@ apply_FTL_Configs_From_Env(){ echo "" echo "==========Applying settings from environment variables==========" source /opt/pihole/COL_TABLE - declare -px | grep FTLCONF_ | sed -E 's/declare -x FTLCONF_([^=]+)=\"(|.+)\"/\1 \2/' | while read -r name value - do - # Replace underscores with dots in the name to match pihole-FTL expectiations - name="${name//_/.}" + # Loop through all environment variables that start with "FTLCONF_" + printenv | grep "^FTLCONF_" | sed -n 's/^FTLCONF_\([^=]*\)=\(.*\)/\1 \2/p' | while read -r name value + do # Special handing for the value if the name is dns.upstreams if [ "$name" == "dns.upstreams" ]; then value='["'${value//;/\",\"}'"]'