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

Sometimes configuration is fairly complex (e.g. nested map data structures) which gets pretty complex with simple key/value env variables.

I'm thinking of things like config for nginx, Apache, Kubernetes, etc.



I've had rare cases of needing nested data structures in the environment. My solution was to specify them as JSON strings and load the value in code. It works.

    USER='{
        "name": "joe",
        "email":"joe@example.com"
    }'


Indeed, I only had "simple" cases in mind. But hey... shouldn't the complex config files paths be specified through env vars ? ;)




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

Search: