radicale: Redirect to well-known URLs according to version

- Radicale 1 needs to have /radicale/.well-known/*dav to the URLs where as
  Radicale 2 needs to have /radicale to be the URLs. Hence have two separate
  apache configuration files.

- Use expr= when setting X-REMOTE-USER header to set the authenticated user name
  properly. Without this all users are using a single user '(null)' data.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-01-06 17:58:00 -05:00
1 parent 49acfa5ad1
commit 7cf279ccd0
3 files changed
+39 -15

No files matched your search

+14 -3
View File
@@ -77,7 +77,7 @@ def subcommand_setup(_):
action_utils.service_enable('radicale')
action_utils.service_restart('radicale')
action_utils.webserver_enable('radicale-plinth')
action_utils.webserver_enable(_get_web_config(current_version))
def subcommand_configure(arguments):
@@ -92,12 +92,12 @@ def subcommand_configure(arguments):
def subcommand_enable(_):
"""Start service."""
action_utils.service_enable('radicale')
action_utils.webserver_enable('radicale-plinth')
action_utils.webserver_enable(_get_web_config())
def subcommand_disable(_):
"""Stop service."""
action_utils.webserver_disable('radicale-plinth')
action_utils.webserver_disable(_get_web_config())
action_utils.service_disable('radicale')
@@ -113,6 +113,17 @@ def _get_version():
return LV(version)
def _get_web_config(current_version=None):
"""Return the name of the webserver configuration based on version."""
if current_version is None:
current_version = _get_version()
if current_version and current_version < VERSION_2:
return 'radicale-plinth'
return 'radicale2-freedombox'
def load_augeas():
"""Initialize Augeas."""
aug = augeas.Augeas(flags=augeas.Augeas.NO_LOAD +