Skip to content
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

env-config: allow setting AD config from docker environment #431

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MarlinMr
Copy link
Contributor

@MarlinMr MarlinMr commented Apr 19, 2024

This MR allows you to set Active Directory settings from the docker environment.

  • Default config needs to be evaluated.
  • Commits needs to be squashed

@MarlinMr MarlinMr changed the title WIP: env-config: allow setting AD config from docker environment env-config: allow setting AD config from docker environment Apr 25, 2024
@MarlinMr
Copy link
Contributor Author

Maybe having default values is a dumb idea? Maybe it should be blank by default? Perhaps that breaks current deployments of it's not blank?

@crazy-max
Copy link
Member

crazy-max commented May 4, 2024

I don't think we should have explicit envs for each LibreNMS config in this image but instead use live config as shown in https://github.com/librenms/docker?tab=readme-ov-file#live-config

In your case you could create a /data/config/ad.php file with your Active Directory config.

@murrant
Copy link
Member

murrant commented May 6, 2024

The problem is when you set stuff in config.php (via includes like this too), it completely disables the webui settings.
Placing an if around them would fix that though and only set them if the env variables are set.

A word of caution too. There are no immediate plans, but LibreNMS may scrap it's custom auth code and use upstream auth code. This may affect the available options so take care not to make any env that are overly specific to LibreNMS' implementation.

@MarlinMr
Copy link
Contributor Author

MarlinMr commented May 6, 2024

The reason this is my preferred method, is simply that it allows setting settings via docker environment, which in turn allows all settings to be deployed easily from central docker management software.

It completely disables webui settings, yes, but that's not needed as it is set in the docker env anyhow. That's ofc only "not a problem" for those who want to use docker env, yes. Putting it inside an if could be a good idea, sure.

@murrant
Copy link
Member

murrant commented May 19, 2024

There are already two methods to set config settings inside containers (without running lnms config:set)
Perhaps making those work for your use case is better than expanding the environment variables to cover the thousands of settings that LibreNMS has.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants