You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm interested by Solid and want to host my own POD (I host everything myself).
My production environment runs Docker and all the configuration is done through environment variables. I checked the documentation and I didn't found anything about it. Was this possibility already discussed ? Is this out-of-scope ?
I haven't used Docker to any extent, but I sat here struggling a few minutes ago and really wanted an environment variable so that I could point at a different config file... :-) So, yes, I'd really be in favour of having that!
Would you want to have environment variables for all the config options, or just basic pointers to config file(s)?
And what I propose is a third level of overrides, so we can have the same global configuration but override some parts depending of the environment or the server architecture.
I think you should base it on the release/v5.0.0 branch, so hopefully we can release it with that one. Also be aware that in version 6, we are going to rework the code extensively, (see #788 for detailed discussion), so we can't guarantee that the code will make it into that, but a good config system is on my list of architectural elements that we require. I think we will also rely more on other people's code for such.
Actually, that was the library I had in mind. And I agree with @sramam, I used it in multiple projects in the past and it's really powerful. I will submit a PR in the coming days, I just need to understand the code ;)
I read the full discussion on #788 and I think you should look closely to node-config to be part of the rewrite/refactor since it's one of the best config system I used.
node-config seemed a little opinionated to pull in to an existing project since it wants your config file to live in config/${NODE_ENV}.json.
Given that we already have a list of options we want to support, I looped over this in ~20 lines of code to accomplish this without any 3rd party libraries.
If this is close to acceptable, I'd love to respond to any feedback on that PR.
Activity
kjetilk commentedon Oct 3, 2018
I haven't used Docker to any extent, but I sat here struggling a few minutes ago and really wanted an environment variable so that I could point at a different config file... :-) So, yes, I'd really be in favour of having that!
Would you want to have environment variables for all the config options, or just basic pointers to config file(s)?
he8us commentedon Oct 3, 2018
IMHO, every configuration option should be configurable via the environment.
I'm an addict of the 12 Factors methodology and the Chapter 3 explain what I have in mind: https://12factor.net/config
To be more specific we have the defaults:
which can be overriden by the
config.jsonfileAnd what I propose is a third level of overrides, so we can have the same global configuration but override some parts depending of the environment or the server architecture.
kjetilk commentedon Oct 3, 2018
OK, that sounds great to me!
I think you should base it on the
release/v5.0.0branch, so hopefully we can release it with that one. Also be aware that in version 6, we are going to rework the code extensively, (see #788 for detailed discussion), so we can't guarantee that the code will make it into that, but a good config system is on my list of architectural elements that we require. I think we will also rely more on other people's code for such.sramam commentedon Oct 3, 2018
I'm new to the project and haven't looked at the code yet, but would something like node-config be useful in this context?
I've used node-config before and it works really nicely for the purpose.
It does allow the config to be an actual javascript file, with attendant risks of "developer creativity".
kjetilk commentedon Oct 3, 2018
Yes, that does look reasonable!
he8us commentedon Oct 3, 2018
Actually, that was the library I had in mind. And I agree with @sramam, I used it in multiple projects in the past and it's really powerful. I will submit a PR in the coming days, I just need to understand the code ;)
I read the full discussion on #788 and I think you should look closely to node-config to be part of the rewrite/refactor since it's one of the best config system I used.
kjetilk commentedon Oct 3, 2018
Ok, great stuff! Go for it! I hope we can bring the code into 6.0.0 too!
m14t commentedon Oct 20, 2018
I just created PR #879 for this.
node-config seemed a little opinionated to pull in to an existing project since it wants your config file to live in
config/${NODE_ENV}.json.Given that we already have a list of options we want to support, I looped over this in ~20 lines of code to accomplish this without any 3rd party libraries.
If this is close to acceptable, I'd love to respond to any feedback on that PR.
I hope I didn't steal your thunder @he8us!