fix(calibre-web): keep /usr/bin resolving for the manual workaround

CodeRabbit spotted that an install already storing "/usr/bin" stays broken:
that value is not empty, so the cont-init statement leaves it alone, and with
the symlink only in /opt/kepubify it no longer resolves under 0.6.27.

The case is real and narrow. A failed save never persists the value --
_configuration_result() calls config.load() on the error path, discarding it --
so the only way to hold "/usr/bin" is a save that succeeded, which requires
having first applied the workaround published in the issue thread:

    ln -sf /usr/bin/kepubify /usr/bin/kepubify-linux-64bit

Anyone who did that, and anyone copying that comment, would have been broken
again by this PR.

Fixed with one more symlink rather than CodeRabbit's suggested migration of
"/usr/bin" back to NULL, because that would overwrite a path the user set by
hand. Making their setting keep working is better than resetting it. Verified
against the 0.6.27 resolution logic:

    symlink in /opt only   stored '/usr/bin' -> ''
    plus /usr/bin symlink  stored '/usr/bin' -> '/usr/bin/kepubify-linux-64bit'
                           autodetect        -> '/opt/kepubify'

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
alexbelgium
2026-09-04 08:50:34 +02:00
parent cf37b469c0
commit b9761d9dd3
2 changed files with 8 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
## 0.6.27.4 (2026-09-04)
- Fix: Kobo sync could not be enabled, failing with "Kepubify binary not found" even when the path was set by hand. The LinuxServer base image installs the converter as `/usr/bin/kepubify` with `curl -o`, which leaves it mode 0644 and gives it a name calibre-web does not accept : `binary_helper.py` only takes `kepubify-linux-64bit` or `kepubify-linux-32bit`, and only when `os.access(X_OK)` passes. The addon now makes the binary executable and publishes it as `/opt/kepubify/kepubify-linux-64bit`, the directory calibre-web's own autodetection already probes, so the path is filled in without any manual step (https://github.com/alexbelgium/hassio-addons/issues/3040)
- Fix: on installs created before that change, calibre-web had already run its autodetection once, found nothing usable and stored an empty path, and it never retries. An empty path is now reset so calibre-web detects the converter itself at the next start. A path set by hand is left alone
- Fix: `/usr/bin` also keeps working as a converter path, so the setting stored by anyone who applied the manual `ln -sf /usr/bin/kepubify /usr/bin/kepubify-linux-64bit` workaround keeps resolving after the update instead of silently breaking again
## 0.6.27.3 (2026-08-30)
- Doc: explain in the README that Calibre-Web's optional extras (metadata, kobo, gdrive, gmail, goodreads, ldap, oauth, comics) are already installed by the LinuxServer base image, that `pip install calibreweb[...]` inside the container is useless and not persistent, and that the cover fields on the Edit Metadata page are gated on `Enable Uploads` plus the user's `Upload` permission (https://github.com/alexbelgium/hassio-addons/issues/1143)

View File

@@ -51,13 +51,17 @@ RUN chmod 744 /ha_lsio.sh && if grep -qr "lsio" /etc; then /ha_lsio.sh "$CONFIGL
# defects have to be fixed, which is why enabling Kobo sync failed with "Kepubify binary not
# found" even when the path was set by hand. Publish it under an accepted name in /opt/kepubify,
# the directory calibre-web's own autodetect_kepubify_binary() already probes, so calibre-web
# fills the setting in itself. Unguarded on purpose: if a future base image stops shipping the
# binary, the build must fail here rather than ship a silently broken add-on.
# fills the setting in itself. The second link keeps /usr/bin working as well : that is the value
# already stored by anyone who applied the "ln -sf /usr/bin/kepubify /usr/bin/kepubify-linux-64bit"
# workaround, and their setting is not empty, so it is left alone below and has to keep resolving.
# Unguarded on purpose: if a future base image stops shipping the binary, the build must fail here
# rather than ship a silently broken add-on.
RUN \
usermod --home /config abc \
&& chmod 0755 /usr/bin/kepubify \
&& mkdir -p /opt/kepubify \
&& ln -s /usr/bin/kepubify /opt/kepubify/kepubify-linux-64bit
&& ln -s /usr/bin/kepubify /opt/kepubify/kepubify-linux-64bit \
&& ln -s /usr/bin/kepubify /usr/bin/kepubify-linux-64bit
##################
# 3 Install apps #