|
@@ -211,21 +211,21 @@ class CFG(object):
|
211
|
211
|
|
212
|
212
|
def __init__(self):
|
213
|
213
|
"""Parse configuration file."""
|
|
214
|
+ mandatory_msg = \
|
|
215
|
+ 'ERROR: {} configuration is mandatory. Set it before continuing.'
|
214
|
216
|
self.DEPOT_STORAGE_DIR = tg.config.get(
|
215
|
217
|
'depot_storage_dir',
|
216
|
218
|
)
|
217
|
219
|
if not self.DEPOT_STORAGE_DIR:
|
218
|
220
|
raise Exception(
|
219
|
|
- 'ERROR: depot_storage_dir configuration is mandatory. '
|
220
|
|
- 'Set it before continuing.'
|
|
221
|
+ mandatory_msg.format('depot_storage_dir')
|
221
|
222
|
)
|
222
|
223
|
self.DEPOT_STORAGE_NAME = tg.config.get(
|
223
|
224
|
'depot_storage_name',
|
224
|
225
|
)
|
225
|
226
|
if not self.DEPOT_STORAGE_NAME:
|
226
|
227
|
raise Exception(
|
227
|
|
- 'ERROR: depot_storage_name configuration is mandatory. '
|
228
|
|
- 'Set it before continuing.'
|
|
228
|
+ mandatory_msg.format('depot_storage_name')
|
229
|
229
|
)
|
230
|
230
|
self.PREVIEW_CACHE_DIR = tg.config.get(
|
231
|
231
|
'preview_cache_dir',
|
|
@@ -382,8 +382,11 @@ class CFG(object):
|
382
|
382
|
))
|
383
|
383
|
self.RADICALE_SERVER_FILE_SYSTEM_FOLDER = tg.config.get(
|
384
|
384
|
'radicale.server.filesystem.folder',
|
385
|
|
- './radicale/collections',
|
386
|
385
|
)
|
|
386
|
+ if not self.RADICALE_SERVER_FILE_SYSTEM_FOLDER:
|
|
387
|
+ raise Exception(
|
|
388
|
+ mandatory_msg.format('radicale.server.filesystem.folder')
|
|
389
|
+ )
|
387
|
390
|
self.RADICALE_SERVER_ALLOW_ORIGIN = tg.config.get(
|
388
|
391
|
'radicale.server.allow_origin',
|
389
|
392
|
None,
|
|
@@ -404,7 +407,10 @@ class CFG(object):
|
404
|
407
|
|
405
|
408
|
self.RADICALE_CLIENT_BASE_URL_HOST = tg.config.get(
|
406
|
409
|
'radicale.client.base_url.host',
|
407
|
|
- None,
|
|
410
|
+ 'http://{}:{}'.format(
|
|
411
|
+ self.RADICALE_SERVER_HOST,
|
|
412
|
+ self.RADICALE_SERVER_PORT,
|
|
413
|
+ ),
|
408
|
414
|
)
|
409
|
415
|
|
410
|
416
|
self.RADICALE_CLIENT_BASE_URL_PREFIX = tg.config.get(
|