-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get config defaults from config file #72
Comments
Hm, CouchDB's config files are written in Erlang, but I feel like ours should be written in JSON. This would also give us a nice 1-to-1 correspondence with what's shown in the actual So yeah, I'm definitely +1 on this; it's a little silly for the settings not to persist after the server is shut down. I just want to make sure we figure out a good format first, since ideally people should feel comfortable modifying the file directly. |
The current _config implementation in express-pouchdb saves its data as a pretty printed config.json file in the current working directory. I tried using a config parser library to emulate .ini style config files like in CouchDB, but couldn't get that to work reliably, and JSON seems fine. Example (you should be able to get something similar using the current express-pouchdb master branch):
(The password is just 'test', nothing sensitive...) |
Ah, in that case, that is amazing. If you could document that in either the express-pouchdb or pouchdb-server, that would be really helpful. This |
I think the best use case would be as a fallback for the command-line arguments. That way it's backwards compatible, easy to make a small change, but also possible to just ignore the command line args and use As for options like |
#81 is the first PR that actually implements part of this, everything else pointing at this was work getting everything in good shape to actually do so. Things still on the todo list are:
|
Looks like this was fixed? Although it seems to be undocumented still. |
I still want to add support for the things on the todo list of my previous port. And documentation (just added that one.) |
With #82 the remaining TODO list is:
|
Suggested config option names for the remaining CLI arguments: {
"pouchdb_server": { //or just 'pouchdb'? Don't really have a strong opinion.
"level_backend": "riakdown",
"level_prefix": "riak://localhost:8087/",
"in_memory": true,
"proxy": "http://localhost:5984/" //new
}
} I'm inclined not to add support for --user and --pass, in fact, I think it would be best to remove those options now express-pouchdb has full session/security/validation support. |
+1 for removing them now that we have better configuration |
--log is in the same position, I removed them all in #84. (With some extra code to make express-pouchdb's log also an esthetically good replacement.) |
The last bit of this landed: e1611e6. Fixed now. |
Since commit pouchdb/express-pouchdb#103, app.couchConfig exists and is set by express-pouchdb. Now some command line options match 'couchdb' settings. How about using the config file as defaults for the command line options? This allows a second convenient and persistent way of setting them. Candidates would be:
[cors]
methods = ...
credentials = ...
headers = ...
origins is probably also specifyable in 'corser'?
[httpd]
port = ...
bind_address? (would be new, but nice)
[couchdb]
database_dir = ...
The text was updated successfully, but these errors were encountered: