From 7eb1ffa1d49a7e0016c5980da71151e715abc77a Mon Sep 17 00:00:00 2001 From: drebs Date: Tue, 21 Feb 2017 14:16:26 -0300 Subject: [feat] add configurable blobs path in server - Resolves: #8777 --- server/src/leap/soledad/server/_blobs.py | 10 ++++++++++ server/src/leap/soledad/server/_config.py | 1 + 2 files changed, 11 insertions(+) (limited to 'server/src') 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'], -- cgit v1.2.3