From 4f0dd7733baff235309b641517ec786cb8bb0f3d Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 16 May 2023 12:07:36 -0700 Subject: [PATCH] rssbridge: Use drop-in config component for /etc files Tests: - Config files are all symlinks in /etc/ - Web interface works Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- debian/freedombox.maintscript | 1 + plinth/modules/rssbridge/__init__.py | 8 +++++++- .../etc/apache2/conf-available/rss-bridge.conf | 0 3 files changed, 8 insertions(+), 1 deletion(-) rename plinth/modules/rssbridge/data/{ => usr/share/freedombox}/etc/apache2/conf-available/rss-bridge.conf (100%) diff --git a/debian/freedombox.maintscript b/debian/freedombox.maintscript index 6cd35d02c..e3888f0de 100644 --- a/debian/freedombox.maintscript +++ b/debian/freedombox.maintscript @@ -126,3 +126,4 @@ rm_conffile /etc/dpkg/origins/freedombox 23.10~ rm_conffile /etc/apache2/conf-available/radicale2-freedombox.conf 23.10~ rm_conffile /etc/apache2/conf-available/roundcube-freedombox.conf 23.10~ rm_conffile /etc/fail2ban/jail.d/roundcube-auth-freedombox.conf 23.10~ +rm_conffile /etc/apache2/conf-available/rss-bridge.conf 23.10~ diff --git a/plinth/modules/rssbridge/__init__.py b/plinth/modules/rssbridge/__init__.py index 7b84a8af8..083c39448 100644 --- a/plinth/modules/rssbridge/__init__.py +++ b/plinth/modules/rssbridge/__init__.py @@ -7,6 +7,7 @@ from django.utils.translation import gettext_lazy as _ from plinth import app as app_module from plinth import cfg, frontpage, menu +from plinth.config import DropinConfigs from plinth.modules.apache.components import Webserver from plinth.modules.backups.components import BackupRestore from plinth.modules.firewall.components import Firewall @@ -36,7 +37,7 @@ class RSSBridgeApp(app_module.App): app_id = 'rssbridge' - _version = 1 + _version = 2 def __init__(self): """Create components for the app.""" @@ -67,6 +68,11 @@ class RSSBridgeApp(app_module.App): packages = Packages('packages-rssbridge', ['rss-bridge']) self.add(packages) + dropin_configs = DropinConfigs('dropin-configs-rssbridge', [ + '/etc/apache2/conf-available/rss-bridge.conf', + ]) + self.add(dropin_configs) + firewall = Firewall('firewall-rssbridge', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) diff --git a/plinth/modules/rssbridge/data/etc/apache2/conf-available/rss-bridge.conf b/plinth/modules/rssbridge/data/usr/share/freedombox/etc/apache2/conf-available/rss-bridge.conf similarity index 100% rename from plinth/modules/rssbridge/data/etc/apache2/conf-available/rss-bridge.conf rename to plinth/modules/rssbridge/data/usr/share/freedombox/etc/apache2/conf-available/rss-bridge.conf