diff --git a/README.md b/README.md index 9df5800..1446062 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,8 @@ 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-FTL.conf with settings described in the . Replace `.` with `_`, e.g for `dns.dnssec=true` use `FTLCONF_dns_dnssec: 'true'`| +|`FTLCONF_ENV_ONLY`|unset|``|If set to true, FTL will use default values for all config values unless explicitly set as an environment variable| | `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 4c0e480..5e919e1 100644 --- a/src/bash_functions.sh +++ b/src/bash_functions.sh @@ -113,64 +113,6 @@ fix_capabilities() { fi } - - -apply_FTL_Configs_From_Env(){ - # Get all exported environment variables starting with FTLCONF_ as a prefix and call the setFTLConfigValue - # function with the environment variable's suffix as the key. This allows applying any pihole-FTL.conf - # setting defined here: https://docs.pi-hole.net/ftldns/configfile/ - 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//_/.}" - - - # Special handling for some FTL Config values - case "$name" in - # Convert the semicolon separated list to a JSON array - "dns.upstreams") - value='["'${value//;/\",\"}'"]' - ;; - # The following config names have an underscore in them, - # so we need to re-convert the dot back to an underscore - "webserver.tls.rev.proxy") - name="webserver.tls.rev_proxy" - ;; - "webserver.api.totp.secret") - name="webserver.api.totp_secret" - ;; - "webserver.api.allow.destructive") - name="webserver.api.allow_destructive" - ;; - "misc.delay.startup") - name="misc.delay_startup" - ;; - "misc.dnsmasq.lines") - name="misc.dnsmasq_lines" - ;; - esac - - # Mask the value if it is a password, else display the value as is - if [ "$name" == "webserver.api.password" ]; then - masked_value=$(printf "%${#value}s" | tr " " "*") - else - masked_value=$value - fi - - if pihole-FTL --config "${name}" "${value}" > /ftlconfoutput; then - echo " ${TICK} Applied pihole-FTL setting $name=$masked_value" - else - echo " ${CROSS} Error Applying pihole-FTL setting $name=$masked_value" - echo " ${INFO} $(cat /ftlconfoutput)" - fi - done - echo "================================================================" - echo "" -} - setup_FTL_query_logging(){ if [ "${QUERY_LOGGING_OVERRIDE}" == "false" ]; then echo " [i] Disabling Query Logging" @@ -180,10 +122,8 @@ setup_FTL_query_logging(){ echo " [i] Enabling Query Logging" setFTLConfigValue dns.queryLogging true fi - } - load_web_password_secret() { # If WEBPASSWORD is not set at all, attempt to read password from WEBPASSWORD_FILE, # allowing secrets to be passed via docker secrets diff --git a/src/start.sh b/src/start.sh index 49ad304..303a012 100644 --- a/src/start.sh +++ b/src/start.sh @@ -53,8 +53,6 @@ start() { # validate_env || exit 1 ensure_basic_configuration - apply_FTL_Configs_From_Env - # Web interface setup # =========================== # load_web_password_secret