Browse Source

Radicale file system path in configuration

Bastien Sevajol (Algoo) 8 years ago
parent
commit
7fed65eaa1
3 changed files with 10 additions and 0 deletions
  1. 1 0
      tracim/development.ini.base
  2. 4 0
      tracim/tracim/config/app_cfg.py
  3. 5 0
      tracim/tracim/lib/daemons.py

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

@@ -187,6 +187,7 @@ email.notification.smtp.password = your_smtp_password
187 187
 # radicale.server.host = 0.0.0.0
188 188
 # radicale.server.port = 5232
189 189
 # radicale.server.ssl = false
190
+# radicale.server.filesystem.folder = ~/.config/radicale/collections
190 191
 ## If '', current host will be used
191 192
 # radicale.client.host = ''
192 193
 # radicale.client.port = 5232

+ 4 - 0
tracim/tracim/config/app_cfg.py View File

@@ -206,6 +206,10 @@ class CFG(object):
206 206
         self.RADICALE_SERVER_PORT = tg.config.get('radicale.server.port', 5232)
207 207
         # Note: Other parameters needed to work in SSL (cert file, etc)
208 208
         self.RADICALE_SERVER_SSL = asbool(tg.config.get('radicale.server.ssl', False))
209
+        self.RADICALE_SERVER_FILE_SYSTEM_FOLDER = tg.config.get(
210
+            'radicale.server.filesystem.folder',
211
+            '~/.config/radicale/collections'
212
+        )
209 213
 
210 214
         # If None, current host will be used
211 215
         self.RADICALE_CLIENT_HOST = tg.config.get('radicale.client.host', None)

+ 5 - 0
tracim/tracim/lib/daemons.py View File

@@ -83,9 +83,13 @@ class RadicaleDaemon(Daemon):
83 83
         server.serve_forever()
84 84
 
85 85
     def _prepare_config(self):
86
+        from tracim.config.app_cfg import CFG
87
+        cfg = CFG.get_instance()
88
+
86 89
         tracim_auth = 'tracim.lib.radicale.auth'
87 90
         tracim_rights = 'tracim.lib.radicale.rights'
88 91
         tracim_storage = 'tracim.lib.radicale.storage'
92
+        fs_path = cfg.RADICALE_SERVER_FILE_SYSTEM_FOLDER
89 93
 
90 94
         radicale_config.set('auth', 'type', 'custom')
91 95
         radicale_config.set('auth', 'custom_handler', tracim_auth)
@@ -95,6 +99,7 @@ class RadicaleDaemon(Daemon):
95 99
 
96 100
         radicale_config.set('storage', 'type', 'custom')
97 101
         radicale_config.set('storage', 'custom_handler', tracim_storage)
102
+        radicale_config.set('storage', 'filesystem_folder', fs_path)
98 103
 
99 104
     def _get_server(self):
100 105
         from tracim.config.app_cfg import CFG