Rev_proxy cannot be set from env vars

The issue here is that underscores ( _ ) are used as a way to define pihole.toml vars in docker env var which are later replaced with dots ( . ) when translating them to pihole.toml variables. However rev_proxy already contains an underscore leading to a wrong pihole.toml variable translation.

[โœ—] Error Applying pihole-FTL setting webserver.tls.rev.proxy=true
  [i]   Unknown config option: webserver.tls.rev.proxy

A solution here would be to rename rev_proxy to revProxy

1 Like

Good spot. Thanks for reporting.

Ah yes, very good spot. I guess we need to stick to a naming convention somewhere along the line. @DL6ER - how do you feel about not allowing underscores in FTL config items?

It is annoying that one cannot use . in environment variables on the docker side of things so we needed to do something. Replacing _ for . felt like the best way at the time - does anyone have a suggestion for something else?

I would rather not have to have a predefined list of all the possible config values as environment variables, as that becomes difficult to maintain

Other settings that will cause conflicts:

webserver.tls.rev_proxy
webserver.api.totp_secret
webserver.api.allow_destructive
misc.delay_startup
misc.dnsmasq_lines

Or maybe we just have a few special cases that can be handled differently.

i.e if we detect FTLCONF_webserver_tls_rev_proxy, we explicitly convert that to webserver.tls.rev_proxy

That might be the better workaround

Edit: There is already some special handling in the function, some more wont hurt.

Maybe there is another possibility. Folks on docker realized that not having . is an issue and fixed it
https://github.com/docker/compose/issues/8862

and

This was part of compose-go v 1.2.8. (released 22/06/2022)

This component is included in docker-compose with v 2.6.1. (23/06/2022)
https://docs.docker.com/compose/release-notes/#261

So with a fairly recent docker version, this should not be an issue anymore.

IIRC I could use them in the docker compose definition, but as soon as you start to try and access them in the shell, they get cut off at the first .

Hmmmm

Although, we could use printenv instead of declare -px, which does show the environment variables that have a . in them.

Now I am conflicted.

Two options:

https://github.com/pi-hole/docker-pi-hole/pull/1456

https://github.com/pi-hole/docker-pi-hole/pull/1457

Currently discussing the merits of each

Merged the former of the two, which will prevent the need for any breaking changes for the time being.

@milouk you should be able to use FTLCONF_webserver_tls_rev_proxy once the CI process finishes and updates the :development-v6 tag.

https://github.com/pi-hole/docker-pi-hole/actions/runs/6538429323

nice! thanks will test and report if I stumble upon any other issue :slight_smile: