Browse Source

Setups properly Radicale by default

Adrien Panay 7 years ago
parent
commit
85e3153762
2 changed files with 13 additions and 7 deletions
  1. 1 1
      tracim/development.ini.base
  2. 12 6
      tracim/tracim/config/app_cfg.py

+ 1 - 1
tracim/development.ini.base View File

@@ -215,7 +215,7 @@ email.processing_mode = sync
215 215
 # radicale.server.host = 0.0.0.0
216 216
 # radicale.server.port = 5232
217 217
 # radicale.server.ssl = false
218
-# radicale.server.filesystem.folder = ./radicale/collections
218
+radicale.server.filesystem.folder = %(here)s/radicale/collections/
219 219
 # radicale.server.allow_origin = *
220 220
 # radicale.server.realm_message = Tracim Calendar - Password Required
221 221
 ## url can be extended like http://127.0.0.1:5232/calendar

+ 12 - 6
tracim/tracim/config/app_cfg.py View File

@@ -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(