From 56b3c854e40057654abf93f27f91910c04f37bd0 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 16 May 2023 12:14:05 -0700 Subject: [PATCH] sharing: Use drop-in config component for /etc files Tests: - Config files are all symlinks in /etc/ - Sharing folders works Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- debian/freedombox.maintscript | 1 + plinth/modules/sharing/__init__.py | 8 +++++++- .../etc/apache2/includes/freedombox-sharing.conf | 0 3 files changed, 8 insertions(+), 1 deletion(-) rename plinth/modules/sharing/data/{ => usr/share/freedombox}/etc/apache2/includes/freedombox-sharing.conf (100%) diff --git a/debian/freedombox.maintscript b/debian/freedombox.maintscript index 94aaf81f5..881b393fd 100644 --- a/debian/freedombox.maintscript +++ b/debian/freedombox.maintscript @@ -131,3 +131,4 @@ rm_conffile /etc/apache2/conf-available/searx-freedombox-auth.conf 23.10~ rm_conffile /etc/apache2/conf-available/searx-freedombox.conf 23.10~ rm_conffile /etc/fail2ban/fail2ban.d/freedombox.conf 23.10~ rm_conffile /etc/fail2ban/jail.d/freedombox.conf 23.10~ +rm_conffile /etc/apache2/includes/freedombox-sharing.conf 23.10~ diff --git a/plinth/modules/sharing/__init__.py b/plinth/modules/sharing/__init__.py index 68b062425..9cb5d4efc 100644 --- a/plinth/modules/sharing/__init__.py +++ b/plinth/modules/sharing/__init__.py @@ -5,6 +5,7 @@ from django.utils.translation import gettext_lazy as _ from plinth import app as app_module from plinth import cfg, menu +from plinth.config import DropinConfigs from plinth.modules.apache.components import Webserver from plinth.modules.backups.components import BackupRestore from plinth.utils import format_lazy @@ -24,7 +25,7 @@ class SharingApp(app_module.App): app_id = 'sharing' - _version = 2 + _version = 3 def __init__(self): """Create components for the app.""" @@ -39,6 +40,11 @@ class SharingApp(app_module.App): parent_url_name='apps') self.add(menu_item) + dropin_configs = DropinConfigs('dropin-configs-sharing', [ + '/etc/apache2/includes/freedombox-sharing.conf', + ]) + self.add(dropin_configs) + webserver = Webserver('webserver-sharing', 'sharing-freedombox') self.add(webserver) diff --git a/plinth/modules/sharing/data/etc/apache2/includes/freedombox-sharing.conf b/plinth/modules/sharing/data/usr/share/freedombox/etc/apache2/includes/freedombox-sharing.conf similarity index 100% rename from plinth/modules/sharing/data/etc/apache2/includes/freedombox-sharing.conf rename to plinth/modules/sharing/data/usr/share/freedombox/etc/apache2/includes/freedombox-sharing.conf