-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reset FTL config values to default if they are not set in environment variables? #1422
Comments
Agree with this issue and solution, however I can see people disliking the settings they select from the Pihole interface being lost at reboot of container when they have persistent data enabled. Especially if auto updating of container is enabled in their setups. This is my suggesting on how to integrate this with persistent data. At restart / startup of Pihole docker container: Data Management:
Workflow at Reboot:
This is just a concept workflow. |
I entirely forgot about this issue.. We ended up doing something clever in FTL with the environment variables... Short version: If the value is set by environment variable, then the user is not allowed to set this in the web interface (or erven directly in the e.g on my own |
Im not sure if this issue is solved because I have been debugging Pihole last few days and I noticed that if i change a default via environment variable it sets the setting, but if i comment out the variable and reboot Pihole, it does not revert that setting to default. Ive been having to redefine the environment variable to turn it off or completely deleting my persistent data and letting it rebuild upon reboot. |
Which image are you using? latest |
Hmm, OK - just tested this myself with Digging in now... @DL6ER has something changed somewhere? |
Yup
|
Looking at it, this more or less behaves as designed. It's a tough one to balance. Having the value set in the environment prevents any other process from manipulating that value. This is a good compromise to prevent settings from being changed by someone in the web interface when they have forgotten that they have also set it in the environment. High-level: If environment set, environment wins. The difficult part of the balance is actually what to do once that value is no longer set in the environment. When the value has been set previously, we can observe the following line above it in the
However, once we unset that variable, that line in the In theory we know that the setting was once controlled by environment variable, but it is no longer. So it shouldn't be beyond the realms of possibility to say "Well, we no longer know what this value should be, so lets go back to default" - but it is very easy for me to say that from the point of view of someone who isn't very good at writing |
That sounds logical to me. I think I copied in the output from a Vaultwarden instance that faces this same dilemma and shows how the startup output looks and how the administrative web interface differs when values are set via environment variables. Let me know if I should add that to this discussion thread. |
@DL6ER has worked his magic in pi-hole/FTL#1979 Now, when unsetting a config value that was previously forced by environment variable, it is restored to default. |
Confirmed working on my end with |
If you start the container with, for example,
FTLCONF_debug_all: 'true'
, and then stop the container and remove that environment variable -debug.all
will still be enabled in FTL.As it stands, if you want to turn it off again you have to explicitly set
FTLCONF_debug_all: 'false'
, which is far from ideal.Perhaps we should add in some code that sets the FTL config to default on every container start, and applies any
FTLCONF
environment variables onto that.This would mean though that any customisations made to this file in a volume mounted directory would be overwritten on every restart. Perhaps this is OK.
The text was updated successfully, but these errors were encountered: