From 500cfca6d4b8a0ab0da19e904f2dcf0dd2f97d79 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 16 May 2023 12:09:33 -0700 Subject: [PATCH] searx: Use drop-in config component for /etc files Tests: - Config files are all symlinks in /etc/ - Web interface works - Web interface authentication works Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- debian/freedombox.maintscript | 2 ++ plinth/modules/searx/__init__.py | 9 ++++++++- .../apache2/conf-available/searx-freedombox-auth.conf | 0 .../etc/apache2/conf-available/searx-freedombox.conf | 0 4 files changed, 10 insertions(+), 1 deletion(-) rename plinth/modules/searx/data/{ => usr/share/freedombox}/etc/apache2/conf-available/searx-freedombox-auth.conf (100%) rename plinth/modules/searx/data/{ => usr/share/freedombox}/etc/apache2/conf-available/searx-freedombox.conf (100%) diff --git a/debian/freedombox.maintscript b/debian/freedombox.maintscript index e3888f0de..0784752f1 100644 --- a/debian/freedombox.maintscript +++ b/debian/freedombox.maintscript @@ -127,3 +127,5 @@ 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~ +rm_conffile /etc/apache2/conf-available/searx-freedombox-auth.conf 23.10~ +rm_conffile /etc/apache2/conf-available/searx-freedombox.conf 23.10~ diff --git a/plinth/modules/searx/__init__.py b/plinth/modules/searx/__init__.py index d0a127b81..7536e3457 100644 --- a/plinth/modules/searx/__init__.py +++ b/plinth/modules/searx/__init__.py @@ -7,6 +7,7 @@ from django.utils.translation import gettext_lazy as _ from plinth import app as app_module from plinth import frontpage, menu +from plinth.config import DropinConfigs from plinth.modules.apache.components import Uwsgi, Webserver from plinth.modules.backups.components import BackupRestore from plinth.modules.firewall.components import Firewall @@ -28,7 +29,7 @@ class SearxApp(app_module.App): app_id = 'searx' - _version = 5 + _version = 6 def __init__(self): """Create components for the app.""" @@ -62,6 +63,12 @@ class SearxApp(app_module.App): packages = Packages('packages-searx', ['searx', 'libjs-bootstrap']) self.add(packages) + dropin_configs = DropinConfigs('dropin-configs-searx', [ + '/etc/apache2/conf-available/searx-freedombox-auth.conf', + '/etc/apache2/conf-available/searx-freedombox.conf', + ]) + self.add(dropin_configs) + firewall = Firewall('firewall-searx', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) diff --git a/plinth/modules/searx/data/etc/apache2/conf-available/searx-freedombox-auth.conf b/plinth/modules/searx/data/usr/share/freedombox/etc/apache2/conf-available/searx-freedombox-auth.conf similarity index 100% rename from plinth/modules/searx/data/etc/apache2/conf-available/searx-freedombox-auth.conf rename to plinth/modules/searx/data/usr/share/freedombox/etc/apache2/conf-available/searx-freedombox-auth.conf diff --git a/plinth/modules/searx/data/etc/apache2/conf-available/searx-freedombox.conf b/plinth/modules/searx/data/usr/share/freedombox/etc/apache2/conf-available/searx-freedombox.conf similarity index 100% rename from plinth/modules/searx/data/etc/apache2/conf-available/searx-freedombox.conf rename to plinth/modules/searx/data/usr/share/freedombox/etc/apache2/conf-available/searx-freedombox.conf