Compare commits

..

12 Commits

Author SHA1 Message Date
github-actions
97c4f8ad8b GitHub bot: changelog [nobuild] 2026-05-12 12:30:16 +00:00
Alexandre
e937f6d555 Update config.yaml 2026-05-12 14:26:50 +02:00
Alexandre
68f990f7df Simplify VPN checks and streamline qBittorrent startup 2026-05-12 14:26:40 +02:00
github-actions
91bb34d206 GitHub bot: changelog [nobuild] 2026-05-12 12:23:26 +00:00
Alexandre
d118eccf6f Update config.yaml 2026-05-12 14:16:57 +02:00
Alexandre
d1f9725ec0 Check if VPN services are already running before start 2026-05-12 14:16:45 +02:00
Alexandre
1f82a63b69 Revert 2026-05-12 14:12:09 +02:00
github-actions
f59266ad57 GitHub bot: changelog [nobuild] 2026-05-12 10:23:59 +00:00
Alexandre
3b643c5613 Update config.yaml 2026-05-12 12:19:21 +02:00
Alexandre
a247c0c782 Merge pull request #2706 from alexbelgium/copilot/fix-qbittorrent-wireguard-connection
qbittorrent: Fix WireGuard "RTNETLINK answers: File exists" crash loop on S6 service restart
2026-05-12 08:52:00 +02:00
copilot-swe-agent[bot]
cf584b9c07 Fix WireGuard RTNETLINK File exists crash loop on S6 service restart
Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/caef8dfd-90cd-45ac-a539-6049bb90fd9b

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
2026-05-12 06:32:12 +00:00
copilot-swe-agent[bot]
58a042996c Initial plan 2026-05-12 06:28:09 +00:00
4 changed files with 16 additions and 51 deletions

View File

@@ -1,7 +1,12 @@
## 5.2.0-19 (13-05-2026)
- OpenVPN: simplify recursive routing fix — use a single blackhole route for the VPN server IP in table 1000 (no AWK, no ipcalc, no physical device detection required)
## 5.2.0-8 (12-05-2026)
- Minor bugs fixed
## 5.2.0-7 (12-05-2026)
- Minor bugs fixed
## 5.2.0-6 (12-05-2026)
- Minor bugs fixed
## 5.2.0-3 (2026-05-12)
- Fix WireGuard "RTNETLINK answers: File exists" crash loop: clean up stale interface and routing rules before re-establishing the tunnel on S6 service restart
## 5.2.0-2 (2026-05-10)
- Fix startup loop on aarch64: drop s6-notifyoncheck wrapper so s6 supervises qbittorrent-nox directly (LSIO arm64 image has no notification-fd, causing EBADF restart loop)

View File

@@ -143,4 +143,4 @@ schema:
slug: qbittorrent
udev: true
url: https://github.com/alexbelgium/hassio-addons
version: "5.2.0-19"
version: "5.2.0-8"

View File

@@ -44,11 +44,6 @@ fi
bashio::log.info "Starting qBittorrent..."
if [ -f /etc/s6-overlay/s6-rc.d/svc-qbittorrent/notification-fd ]; then
exec \
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost ${WEBUI_PORT}" \
s6-setuidgid abc /app/qbittorrent-nox --webui-port="${WEBUI_PORT}" > "${QB_OUTPUT}"
else
sleep 10
exec s6-setuidgid abc /app/qbittorrent-nox --webui-port="${WEBUI_PORT}" > "${QB_OUTPUT}"
fi
exec \
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost ${WEBUI_PORT}" \
s6-setuidgid abc /app/qbittorrent-nox --webui-port="${WEBUI_PORT}" > "${QB_OUTPUT}"

View File

@@ -535,32 +535,9 @@ _openvpn_down() {
pkill -f "openvpn --config ${config["ConfigFile"]}" || true
# Safety-net cleanup in case the --down callback was never invoked
_routing_del || true
# Safety-net: remove blackhole route for VPN server if postdown was never invoked
if [ -f "${OPENVPN_STATE_DIR}/server_ip" ]; then
local saved_ip
saved_ip=$(cat "${OPENVPN_STATE_DIR}/server_ip" 2>/dev/null || true)
if [ -n "${saved_ip}" ]; then
ip -4 route del blackhole "${saved_ip}/32" table "${config["Table"]}" 2>/dev/null || true
fi
rm -f "${OPENVPN_STATE_DIR}/server_ip"
fi
}
_openvpn_postup() {
# Prevent recursive routing: add a blackhole route for the VPN server IP in
# table 1000. qBittorrent is bound to tun0, so its traffic is policy-routed
# into table 1000 (rule: from <tun_ip> -> table 1000). Without this, packets
# destined for the VPN server go through tun0, OpenVPN detects the loop and
# drops them. The blackhole makes qBittorrent's traffic to the server IP fail
# immediately (EHOSTUNREACH) instead of looping. OpenVPN itself is not bound
# to tun0, so its traffic uses the main table and reaches the server normally.
if [ -n "${trusted_ip:-}" ]; then
bashio::log.info "Adding blackhole route for VPN server ${trusted_ip} in table ${config["Table"]} to prevent recursive routing."
ip -4 route add blackhole "${trusted_ip}/32" table "${config["Table"]}" 2>/dev/null \
&& echo "${trusted_ip}" > "${OPENVPN_STATE_DIR}/server_ip" \
|| bashio::log.warning "Could not add blackhole route for VPN server ${trusted_ip}."
fi
_openpvn_postup() {
# Add routing rules for VPN interface and DNS servers
_routing_add || return 1
# Add firewall rules for VPN interface (only when UPnP port mapping is enabled)
@@ -571,19 +548,7 @@ _openvpn_postup() {
_resolvconf "update" || return 1
}
_openvpn_postdown() {
# Remove blackhole route for VPN server (added in postup to prevent recursive routing)
local server_ip=""
if [ -n "${trusted_ip:-}" ]; then
server_ip="${trusted_ip}"
elif [ -f "${OPENVPN_STATE_DIR}/server_ip" ]; then
server_ip=$(cat "${OPENVPN_STATE_DIR}/server_ip" 2>/dev/null || true)
fi
if [ -n "${server_ip}" ]; then
ip -4 route del blackhole "${server_ip}/32" table "${config["Table"]}" 2>/dev/null || true
rm -f "${OPENVPN_STATE_DIR}/server_ip"
fi
_openpvn_postdown() {
# Update resolv.conf to remove VPN DNS servers
_resolvconf "reset" || true
# Remove routing rules for VPN interface and DNS servers
@@ -639,10 +604,10 @@ openvpn() {
bashio::log.info "OpenVPN on interface ${config["Interface"]} is down."
bashio::exit.ok 'OpenVPN stopped.'
elif [ "${mode}" = "postup" ]; then
_openvpn_postup
_openpvn_postup
bashio::exit.ok 'OpenVPN routes added.'
elif [ "${mode}" = "postdown" ]; then
_openvpn_postdown
_openpvn_postdown
bashio::exit.ok 'OpenVPN routes deleted.'
else
bashio::log.error "Invalid OpenVPN mode specified. Use 'up', 'down', 'postup', or 'postdown'."