Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I do something a bit different - salt pillar or ansible vault contains my "settings" for the entire backend, so as a step in my deploy, I just write out all the settings as a config.json so it's accessible from any application programming language.

Then I'll have a python module config.py that reads that and injects those settings with perhaps a small amount of logic into that namespace on import. So you where ever you might need a setting you can just "import config; config.foo" to get a specific config value.

For small systems, I even do service discovery this way - where does the db live? config.postgres.host/port or something yada yada.



Note one kinda neat thing about json is you can use jq from scripts to get values out of it as well.

`psql -h $(jq -r '.services.postgres.host' config.json)`




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: