mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
radicale: Add support for radicale 2.x
- Remove obsolete base_prefix and well-known configs. - Use http_x_remote_user auth type. - Rewrite /radicale to /radicale/. - Add ProxyPassReverse. - Set X-Script-Name and X-Remote-User request headers. Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
2 files changed
+23
-9
No files matched your search
+11
-8
@@ -29,7 +29,7 @@ from plinth import action_utils
|
||||
|
||||
CONFIG_FILE = '/etc/radicale/config'
|
||||
DEFAULT_FILE = '/etc/default/radicale'
|
||||
DEFAULT_FILE_DEPRECATED_VERSION = LV('2.1.10')
|
||||
VERSION_2 = LV('2')
|
||||
|
||||
|
||||
def parse_arguments():
|
||||
@@ -57,18 +57,21 @@ def subcommand_setup(_):
|
||||
|
||||
aug = load_augeas()
|
||||
|
||||
if current_version and current_version < DEFAULT_FILE_DEPRECATED_VERSION:
|
||||
if current_version and current_version < VERSION_2:
|
||||
aug.set('/files' + DEFAULT_FILE + '/ENABLE_RADICALE', 'yes')
|
||||
|
||||
aug.set('/files' + CONFIG_FILE + '/server/hosts',
|
||||
'127.0.0.1:5232, [::1]:5232')
|
||||
aug.set('/files' + CONFIG_FILE + '/server/base_prefix', '/radicale/')
|
||||
aug.set('/files' + CONFIG_FILE + '/well-known/caldav',
|
||||
'/radicale/%(user)s/caldav/')
|
||||
aug.set('/files' + CONFIG_FILE + '/well-known/carddav',
|
||||
'/radicale/%(user)s/carddav/')
|
||||
aug.set('/files' + CONFIG_FILE + '/auth/type', 'remote_user')
|
||||
aug.set('/files' + CONFIG_FILE + '/rights/type', 'owner_only')
|
||||
if current_version and current_version < VERSION_2:
|
||||
aug.set('/files' + CONFIG_FILE + '/server/base_prefix', '/radicale/')
|
||||
aug.set('/files' + CONFIG_FILE + '/well-known/caldav',
|
||||
'/radicale/%(user)s/caldav/')
|
||||
aug.set('/files' + CONFIG_FILE + '/well-known/carddav',
|
||||
'/radicale/%(user)s/carddav/')
|
||||
aug.set('/files' + CONFIG_FILE + '/auth/type', 'remote_user')
|
||||
else:
|
||||
aug.set('/files' + CONFIG_FILE + '/auth/type', 'http_x_remote_user')
|
||||
|
||||
aug.save()
|
||||
|
||||
|
||||
Reference in new issue
Block a user