Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Uses environment variables as fallback when no config file is used. #35
In our project we rather set the configurations as environment variables instead of using them hardcoded in a file, following the 12 factor app recommendations for configuration.
This PR is a proposal to use the environment variables as fallback when no config file is been used.
I'm going for a different approach here, with a local configuration file being optionally put aside. This works well inside icinga-vagrant already.
I really like the environment variable addition though. I'll implement this in a slightly different patch, making them the default if set. This probably allows for easier Docker containers too, or for local development tests.
Keep in mind, that I'll be using the same variable names as known from the debug console in Icinga 2. This makes it easier for everyone - https://www.icinga.com/docs/icinga2/latest/doc/11-cli-commands/#cli-command-console
In addition to your idea, I'll also add CERT_PATH and NODENAME.
I'm also going to refactor the code, this needs separate functions called in initialize().