feat(calibre-web): optional Ingress login as the Home Assistant user (#3074)

Add the opt-in login_with_ha_user option. When enabled, the ingress nginx
forwards the Supervisor's X-Remote-User-Name as calibre-web's
X-WebAuth-User, so each Home Assistant user lands on the calibre-web
account of the same name instead of the shared ingress_user. Off by
default: ingress_user and every other setting behave as before.

Closes #3072

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Alexandre
2026-09-19 08:49:07 +02:00
committed by GitHub
parent f5b6c9279b
commit a6303bd7a0
4 changed files with 15 additions and 1 deletions

View File

@@ -1,4 +1,7 @@
- Migrate legacy add-on configuration map names to current app configuration terminology.
## 0.6.27.5 (2026-09-19)
- New: optional `login_with_ha_user` option. When enabled, Ingress logs you into calibre-web as your Home Assistant username, which the Supervisor forwards with every ingress request, instead of the fixed `ingress_user`. A calibre-web account with the same name must exist; otherwise the normal calibre-web login page is shown. Off by default, so existing installs keep logging in as `ingress_user` exactly as before (https://github.com/alexbelgium/hassio-addons/issues/3072)
## 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)

View File

@@ -69,6 +69,7 @@ Default password: admin123
| `DOCKER_MODS` | str | | Docker modifications to apply |
| `OAUTHLIB_RELAX_TOKEN_SCOPE` | str | | OAuth token scope relaxation |
| `ingress_user` | str | | Username for ingress authentication |
| `login_with_ha_user` | bool | `false` | Log in through Ingress as your Home Assistant username instead of `ingress_user` |
| `localdisks` | str | | Local drives to mount (e.g., `sda1,sdb1,MYNAS`) |
| `networkdisks` | str | | SMB shares to mount (e.g., `//SERVER/SHARE`) |
| `cifsusername` | str | | SMB username for network shares |

View File

@@ -112,9 +112,10 @@ schema:
cifsusername: str?
ingress_user: str?
localdisks: str?
login_with_ha_user: bool?
networkdisks: str?
slug: calibre-web
udev: true
url: https://github.com/alexbelgium/hassio-addons/tree/master/calibre_web
version: "0.6.27.4"
version: "0.6.27.5"
video: true

View File

@@ -45,6 +45,15 @@ if bashio::config.has_value 'ingress_user'; then
ingress_user=$(bashio::config 'ingress_user')
fi
# Log in as the Home Assistant user instead : the Supervisor sends its username with every
# ingress request (X-Remote-User-Name). No username, or no calibre-web account with that name,
# leaves the header empty or unmatched and calibre-web shows its normal login page.
if bashio::config.true 'login_with_ha_user'; then
# shellcheck disable=SC2016
ingress_user='$http_x_remote_user_name'
bashio::log.info "Ingress logs in as the Home Assistant username"
fi
ingress_port=$(bashio::addon.ingress_port)
ingress_interface=$(bashio::addon.ip_address)
#ha_port=$(bashio::core.port)