-
Notifications
You must be signed in to change notification settings - Fork 47
Making configuration more extendable / migrating configuration system to nconf #2
base: master
Are you sure you want to change the base?
Conversation
Any thoughts on this one @couch ? |
It's more of an idea than a complete pull request. You'd probably want to tweak it a bit. At a minimal, I think moving the configuration data to outside of the application logic ( via I've been working on some generic node.js application installer / configuration logic which operates under the assumption that the application will load configuration from an external source ( in this case, a file ). |
I'm thinking, you'll probably want to create a Whenever you have time, let me know your thoughts and I'd be glad to tweak the pull request. |
@Marak I'm interested if your suggestions are We do have a working implementation similar to what you've mentioned above. We have a config folder which has a base The config folder: https://github.com/twitter/ospriet/tree/master/app/config Is this what you're after? |
Changes are to make application more configurable. To answer your question, no that is not what I am after. Currently application configuration is stored in Common JS files and logic for application configuration is coupled to application logic. This is not very extendable. Moving configuration to externally loaded JSON file allows application to be configured from external sources. Moving configuration system to use multi-transport dynamic getters ( as The current way configuration is setup makes it hard to programmatically update configuration for application. This is very important when trying to streamline the process of application installation and configuration, as the configuration will probably be set via some sort of installation wizard ( opposed to manually editing application code source by hand ). |
@dustinsenos - Just to note, you mentioned https://github.com/twitter/ospriet/blob/master/app/config/application.js |
@Marak that makes much more sense. Thanks for the clarification. And yes, sounds like an excellent direction to go. It appears Ospriet is reproducing a small fraction of what Would love to see us move in this direction. As you've mentioned an installation wizard would be great for ospriet, and it sounds like this would be excellent first steps to get there. (My bad with the Common JS / JSON, I shouldn't have relied on memory when I typed that comment) |
Cool! I'll add some more commits to this pull request so that it's on parity with |
@Marak Apologies for the delay in response here, was wrapped up in hackweek last week. As @dustinsenos mentioned, I think adopting |
|
Hi there!
This pull request contains commits that enable the use
nconf
for configuration of theospriet
application.While there is nothing wrong with the current way
ospriet
handles configuration, I feel these changes could help increase the extendable of the application.config.json
allows third-party programs to interact withospriet
configurationnconf
has built in support for pulling configuration from argument parsing ( argv ) and ENV variablesnconf
has the ability to dynamically read / write configuration data at run-timesee: https://github.com/flatiron/nconf
Note: A documentation update will be required if this pull request is merged. I'd be happy to update the documentation accordingly
Not sure if this will get merged, but I wanted to outline a few changes and I figured code would be the easiest way to explain.
Let me know if you have any questions or comments!