2 ms·
> "Instead of burying all config under environment variables, why not try doing it like this?", and slowly build something better, step by step Use named files
by zabzonk 6y ago
> "Instead of burying all config under environment variables, why not try doing it like this?", and slowly build something better, step by step
Use named files, that can be version controlled and documented, but are under direct access from the actual program and can be reported as an error if (for example) they are not found.
- bayindirh 6y agoActually, this is how I do: 1. Make the thing completely configurable with a file. 2. Add an optional switch to select the location of the config file. 3. Always ship a well commented, sensible config file with the application. Document environment variables there, if any. 4. If it makes sense, add the ability generate a default config file if it's missing. 5. Always add a logger, with good debug and error output (Dovecot is my inspiration and role model there). 6. Document everything in the code, and in the documentation if possible (external documentation is not my strong part yet. I can't write it fast enough).