mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
radicale: Explicitly set the auth type to accommodate radicale 3.5
Helps: #2501 Helps: Debian #1100995 - With radicale's Debian packaging for version 3.5 (trixie) the auth/type configuration value is no longer set to remote_user by default[1]. FreedomBox's setup depends on this. So, set this value explicitly including for bookworm. Links: 1) https://tracker.debian.org/media/packages/r/radicale/changelog-3.5.0-1 Tests: - Install on bookworm and testing VMs and run functional tests. Web UI works. - On bookworm VM, install radicale and perform dist-upgrade. Upgrade succeeds. Radicale is at version 3.5.0-1. The file /etc/radicale/config *does not* contains auth/type as 'remote_user'. This is because unattended-upgrades has unexpectedly upgraded radicale and overwrote the configuration file. This is being investigated separately. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
176690d0b9
commit
f8e78f33d3
@ -43,7 +43,7 @@ class RadicaleApp(app_module.App):
|
|||||||
|
|
||||||
app_id = 'radicale'
|
app_id = 'radicale'
|
||||||
|
|
||||||
_version = 3
|
_version = 4
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""Create components for the app."""
|
"""Create components for the app."""
|
||||||
@ -102,6 +102,7 @@ class RadicaleApp(app_module.App):
|
|||||||
def setup(self, old_version):
|
def setup(self, old_version):
|
||||||
"""Install and configure the app."""
|
"""Install and configure the app."""
|
||||||
super().setup(old_version)
|
super().setup(old_version)
|
||||||
|
privileged.setup()
|
||||||
if not old_version:
|
if not old_version:
|
||||||
self.enable()
|
self.enable()
|
||||||
|
|
||||||
@ -117,6 +118,7 @@ class RadicaleApp(app_module.App):
|
|||||||
|
|
||||||
rights = get_rights_value()
|
rights = get_rights_value()
|
||||||
install(['radicale'], force_configuration='new')
|
install(['radicale'], force_configuration='new')
|
||||||
|
privileged.setup()
|
||||||
privileged.configure(rights)
|
privileged.configure(rights)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|||||||
@ -12,6 +12,20 @@ CONFIG_FILE = '/etc/radicale/config'
|
|||||||
LOG_PATH = '/var/log/radicale'
|
LOG_PATH = '/var/log/radicale'
|
||||||
|
|
||||||
|
|
||||||
|
@privileged
|
||||||
|
def setup():
|
||||||
|
"""Configure authentication to Apache remote user.
|
||||||
|
|
||||||
|
For radicale < 3.5 (bookworm), this was set by configuration shipped with
|
||||||
|
Debian. For radicale >= 3.5 (trixie), this needs to be explicitly. For
|
||||||
|
simplicity, set is unconditionally.
|
||||||
|
"""
|
||||||
|
aug = load_augeas()
|
||||||
|
aug.set('auth/type', 'remote_user')
|
||||||
|
aug.save()
|
||||||
|
action_utils.service_try_restart('uwsgi')
|
||||||
|
|
||||||
|
|
||||||
@privileged
|
@privileged
|
||||||
def configure(rights_type: str):
|
def configure(rights_type: str):
|
||||||
"""Set the radicale rights type to a particular value."""
|
"""Set the radicale rights type to a particular value."""
|
||||||
@ -20,7 +34,7 @@ def configure(rights_type: str):
|
|||||||
rights_type = 'from_file'
|
rights_type = 'from_file'
|
||||||
|
|
||||||
aug = load_augeas()
|
aug = load_augeas()
|
||||||
aug.set('/files' + CONFIG_FILE + '/rights/type', rights_type)
|
aug.set('rights/type', rights_type)
|
||||||
aug.save()
|
aug.save()
|
||||||
|
|
||||||
action_utils.service_try_restart('uwsgi')
|
action_utils.service_try_restart('uwsgi')
|
||||||
@ -38,10 +52,8 @@ def load_augeas():
|
|||||||
"""Initialize Augeas."""
|
"""Initialize Augeas."""
|
||||||
aug = augeas.Augeas(flags=augeas.Augeas.NO_LOAD +
|
aug = augeas.Augeas(flags=augeas.Augeas.NO_LOAD +
|
||||||
augeas.Augeas.NO_MODL_AUTOLOAD)
|
augeas.Augeas.NO_MODL_AUTOLOAD)
|
||||||
|
|
||||||
# INI file lens
|
# INI file lens
|
||||||
aug.set('/augeas/load/Puppet/lens', 'Puppet.lns')
|
aug.transform('Puppet', CONFIG_FILE)
|
||||||
aug.set('/augeas/load/Puppet/incl[last() + 1]', CONFIG_FILE)
|
aug.set('/augeas/context', '/files' + CONFIG_FILE)
|
||||||
|
|
||||||
aug.load()
|
aug.load()
|
||||||
return aug
|
return aug
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user