From 98be58eb41eb1369a8e1dde2a88b11d25fcda7b7 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 16 May 2023 13:58:24 -0700 Subject: [PATCH] calibre: Use drop-in config component for /etc files Tests: - Config files are all symlinks in /etc/ - calibre web interface is available Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- debian/freedombox.maintscript | 1 + plinth/modules/calibre/__init__.py | 8 +++++++- .../etc/apache2/conf-available/calibre-freedombox.conf | 0 3 files changed, 8 insertions(+), 1 deletion(-) rename plinth/modules/calibre/data/{ => usr/share/freedombox}/etc/apache2/conf-available/calibre-freedombox.conf (100%) diff --git a/debian/freedombox.maintscript b/debian/freedombox.maintscript index e1ed7df47..5c950391d 100644 --- a/debian/freedombox.maintscript +++ b/debian/freedombox.maintscript @@ -91,6 +91,7 @@ rm_conffile /etc/apache2/conf-available/php-fpm-freedombox.conf 23.10~ rm_conffile /etc/fail2ban/jail.d/apache-auth-freedombox.conf 23.10~ rm_conffile /etc/apache2/conf-available/bepasty-freedombox.conf 23.10~ rm_conffile /etc/uwsgi/apps-available/bepasty-freedombox.ini 23.10~ +rm_conffile /etc/apache2/conf-available/calibre-freedombox.conf 23.10~ rm_conffile /etc/apache2/conf-available/deluge-plinth.conf 23.10~ rm_conffile /etc/dovecot/conf.d/15-freedombox-mail.conf 23.10~ rm_conffile /etc/dovecot/conf.d/05-freedombox-passdb.conf 23.10~ diff --git a/plinth/modules/calibre/__init__.py b/plinth/modules/calibre/__init__.py index 86106e361..dd5558e05 100644 --- a/plinth/modules/calibre/__init__.py +++ b/plinth/modules/calibre/__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.daemon import Daemon from plinth.modules.apache.components import Webserver from plinth.modules.backups.components import BackupRestore @@ -41,7 +42,7 @@ class CalibreApp(app_module.App): app_id = 'calibre' - _version = 2 + _version = 3 DAEMON = 'calibre-server-freedombox' @@ -75,6 +76,11 @@ class CalibreApp(app_module.App): packages = Packages('packages-calibre', ['calibre']) self.add(packages) + dropin_configs = DropinConfigs('dropin-configs-calibre', [ + '/etc/apache2/conf-available/calibre-freedombox.conf', + ]) + self.add(dropin_configs) + firewall = Firewall('firewall-calibre', info.name, ports=['http', 'https'], is_external=True) self.add(firewall) diff --git a/plinth/modules/calibre/data/etc/apache2/conf-available/calibre-freedombox.conf b/plinth/modules/calibre/data/usr/share/freedombox/etc/apache2/conf-available/calibre-freedombox.conf similarity index 100% rename from plinth/modules/calibre/data/etc/apache2/conf-available/calibre-freedombox.conf rename to plinth/modules/calibre/data/usr/share/freedombox/etc/apache2/conf-available/calibre-freedombox.conf