summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2015-09-30 15:27:21 -0300
committerVictor Shyba <victor.shyba@gmail.com>2015-10-01 10:59:01 -0300
commit7a0dba8b7008aca8652f7b334352d9ca63cb2054 (patch)
tree247173a5d649e23202c5d13aebf2aeb71007b4c2 /server/src
parent4964eed77748d65df30847a5fe0a608a163af7e0 (diff)
[feat] read netrc path from configuration file
netrc file was hardcoded inside create-user-db. Now it reads the path from /etc/leap/soledad-server.conf as done on server process. The new configuration property is called 'admin_netrc'.
Diffstat (limited to 'server/src')
-rw-r--r--server/src/leap/soledad/server/__init__.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/server/src/leap/soledad/server/__init__.py b/server/src/leap/soledad/server/__init__.py
index bb1c6db0..1273d15c 100644
--- a/server/src/leap/soledad/server/__init__.py
+++ b/server/src/leap/soledad/server/__init__.py
@@ -283,19 +283,20 @@ def load_configuration(file_path):
@return: A dictionary with the configuration.
@rtype: dict
"""
- conf = {
+ defaults = {
'couch_url': 'http://localhost:5984',
- 'create_cmd': None
+ 'create_cmd': None,
+ 'admin_netrc': '/etc/couchdb/couchdb-admin.netrc',
}
config = configparser.ConfigParser()
config.read(file_path)
if 'soledad-server' in config:
- for key in conf:
+ for key in defaults:
if key in config['soledad-server']:
- conf[key] = config['soledad-server'][key]
+ defaults[key] = config['soledad-server'][key]
# TODO: implement basic parsing/sanitization of options comming from
# config file.
- return conf
+ return defaults
# ----------------------------------------------------------------------------