-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
Ability to set configuration through environment variables #687
Comments
Hey @zodac , Great idea, but I would need some help. This was discussed in this issue: #669 (comment) Quote:
|
Hmm... I haven't gone through the code in depth, but is there a check for the initial run of the system? If not, that could be added, and the environment variables only applied the very first time. That would allow the UI updates to not be overridden on a restart? I did see something in main.py for some variables being defaulted, like SCAN_SUBNETS. Could we do something like that for all values in app.conf, and only use default values where no environment variable is set? |
Sure, that's possible, but again, this has to be done dynamically - something like:
Think about what the priority of those values should be, e.g.: app.conf fvalue > env value > default value. Not sure, think about it :) Here is probably the place where ENV variables should be checked: NetAlertX/server/initialise.py Line 31 in f9b1608
|
if I may jump in...
|
@zodac @FlyingToto @sbe-arg I just pushed an experimental implementation of this. If you have time, please check the - APP_CONF_OVERRIDE={"SCAN_SUBNETS":"['192.168.1.0/24 --interface=eth1']","UI_dark_mode":"True"}
The JSON can't have spaces between key:value pairs. |
Realeased as experimental, so closing for now |
Is there an existing issue for this?
Am I willing to test this? 🧪
netlertx-dev
image when requested within 48h and report bugs to help deliver a great user experience for everyone and not to break existing installations.Can I help implement this? 👩💻👨💻
Is your feature request related to a problem? Please describe
It would be great if we could configure NetAlertX through environment variables. If I'm deploying a fresh install, having to reconfigure everything from the UI can be a bit of a pain.
Describe the solution you'd like
If an environment variable is set matching a value in app.conf (such as SCAN_SUBNETS or SMTP_RUN), it populates the application configuration on first start-up.
Describe alternatives you've considered
Configuring an app.conf file and passing that into the container is also an option, though the current one says not to update it, and might break on upgrades.
Anything else?
I didn't see any issues around this, so apologies if it's been brought up before. The UI does mention each parameter in the appropriate settings section, so perhaps it is meant to work already, and I haven't configured things correctly?
The text was updated successfully, but these errors were encountered: