From 11801de288c706cd6e3b7418dfd2526405925435 Mon Sep 17 00:00:00 2001 From: Veiko Aasa Date: Sat, 30 Jan 2021 10:38:42 +0200 Subject: [PATCH] calibre: Fix freedombox.local inaccessible after enabling app After enabling the calibre app, the app uses IP 127.0.0.1 to advertise ODPS feeds via BonJour/mDNS. It breaks accessing freedombox.local as it now points to 127.0.0.1. This MR disables the BonJour in Calibre. Fixes #2027. Tests performed on both Debian stable and testing containers: - Check the accessability of freedombox.local: 1) Before applying patch: - Start the container, check on the host that freedombox.local points to correct IP address of the container: ``` host$ avahi-resolve -4 --name freedombox.local freedombox.local 10.42.1.166 ``` - Enable the calibre app. Check on the host that freedombox.local points to wrong ip address 127.0.0.1: ``` host$ avahi-resolve -4 --name freedombox.local freedombox.local 127.0.0.1 ``` 2) Stop the calibre app, apply patch (update the calibre systemd service file, reload systemd), restart the Service Discovery app, check on the host that freedombox.local points to correct address. 3) Start the calibre app, check on the host that freedombox.local points to correct address. - All the calibre functional tests pass. Signed-off-by: Veiko Aasa Reviewed-by: Sunil Mohan Adapa --- .../data/lib/systemd/system/calibre-server-freedombox.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plinth/modules/calibre/data/lib/systemd/system/calibre-server-freedombox.service b/plinth/modules/calibre/data/lib/systemd/system/calibre-server-freedombox.service index 8133549ef..0ac7a7026 100644 --- a/plinth/modules/calibre/data/lib/systemd/system/calibre-server-freedombox.service +++ b/plinth/modules/calibre/data/lib/systemd/system/calibre-server-freedombox.service @@ -10,7 +10,7 @@ CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SETUID CAP_SETGID CAP_SE DevicePolicy=closed Environment=HOME="/var/lib/calibre-server-freedombox" Environment=DEFAULT_LIBRARY="/var/lib/calibre-server-freedombox/libraries/Library" -Environment=ARGS="--listen-on 127.0.0.1 --url-prefix /calibre --port 8844 --enable-local-write --disable-auth" +Environment=ARGS="--listen-on 127.0.0.1 --url-prefix /calibre --port 8844 --enable-local-write --disable-auth --disable-use-bonjour" ExecStartPre=sh -e -c "files=$$(ls ${HOME}/libraries/*/metadata.db 2>/dev/null || true); [ \"x$${files}\" = \"x\" ] && (mkdir -p \"${DEFAULT_LIBRARY}\" && calibredb --with-library=\"${DEFAULT_LIBRARY}\" list_categories > /dev/null) || true" ExecStart=sh -e -c "files=${HOME}/libraries/*/metadata.db; libraries=$$(dirname $${files}) ; exec /usr/bin/calibre-server $ARGS $${libraries}" Restart=on-failure