diff options
author | drebs <drebs@leap.se> | 2017-02-21 14:16:26 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2017-02-27 14:28:24 -0300 |
commit | 7eb1ffa1d49a7e0016c5980da71151e715abc77a (patch) | |
tree | 7ace24e9c93a20294278549434173b4e1915c2bf | |
parent | a96801e7f3f4e6aeeb08355f7bac4f47b2454dac (diff) |
[feat] add configurable blobs path in server
- Resolves: #8777
-rw-r--r-- | server/src/leap/soledad/server/_blobs.py | 10 | ||||
-rw-r--r-- | server/src/leap/soledad/server/_config.py | 1 | ||||
-rw-r--r-- | testing/tests/server/test_config.py | 3 |
3 files changed, 13 insertions, 1 deletions
diff --git a/server/src/leap/soledad/server/_blobs.py b/server/src/leap/soledad/server/_blobs.py index 0424aae0..ae09f409 100644 --- a/server/src/leap/soledad/server/_blobs.py +++ b/server/src/leap/soledad/server/_blobs.py @@ -19,14 +19,24 @@ Blobs Server implementation. """ from twisted.web import resource +from ._config import get_config + __all__ = ['blobs_resource'] +_config = get_config() +DEFAULT_BLOBS_PATH = _config['blobs_path'] + + class BlobsResource(resource.Resource): isLeaf = True + def __init__(self, blobs_path=DEFAULT_BLOBS_PATH): + resource.Resource.__init__(self) + self._blobs_path = blobs_path + def render_GET(self, request): return 'blobs is not implemented yet!' diff --git a/server/src/leap/soledad/server/_config.py b/server/src/leap/soledad/server/_config.py index 1818c38d..e89e70d6 100644 --- a/server/src/leap/soledad/server/_config.py +++ b/server/src/leap/soledad/server/_config.py @@ -29,6 +29,7 @@ CONFIG_DEFAULTS = { 'admin_netrc': '/etc/couchdb/couchdb-admin.netrc', 'batching': True, 'blobs': False, + 'blobs_path': '/srv/leap/soledad/blobs', }, 'database-security': { 'members': ['soledad'], diff --git a/testing/tests/server/test_config.py b/testing/tests/server/test_config.py index 133057f5..d2a8a9de 100644 --- a/testing/tests/server/test_config.py +++ b/testing/tests/server/test_config.py @@ -64,5 +64,6 @@ class ConfigurationParsingTest(unittest.TestCase): 'admin_netrc': '/etc/couchdb/couchdb-soledad-admin.netrc', 'batching': False, - 'blobs': False} + 'blobs': False, + 'blobs_path': '/srv/leap/soledad/blobs'} self.assertDictEqual(expected, config['soledad-server']) |