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 12 additions and 56 deletions

View File

@@ -1,11 +1,12 @@
## 5.2.0-18 (13-05-2026)
- Simplify VPN endpoint route pinning to minimal helpers (single endpoint, no tracking list).
## 5.2.0-17 (13-05-2026)
- Fix VPN endpoint routing by pinning OpenVPN/WireGuard server IPs to the pre-VPN main route, preventing recursive tunnel routing drops.
## 5.2.0-16 (13-05-2026)
## 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-18"
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

@@ -149,28 +149,6 @@ _resolve_hostname() {
echo "${ips[@]}"
}
_endpoint_route_add() {
local ip="$1"
local rt via dev
rt="$(ip route get "${ip}" 2>/dev/null | head -n1)"
via="$(awk '{for(i=1;i<=NF;i++) if($i=="via"){print $(i+1);exit}}' <<< "${rt}")"
dev="$(awk '{for(i=1;i<=NF;i++) if($i=="dev"){print $(i+1);exit}}' <<< "${rt}")"
[ -z "${dev}" ] && { bashio::log.error "No route to VPN endpoint ${ip}."; return 1; }
if [ -n "${via}" ]; then
ip route replace "${ip}" via "${via}" dev "${dev}" || return 1
else
ip route replace "${ip}" dev "${dev}" || return 1
fi
bashio::log.info "Pinned VPN endpoint ${ip} to pre-VPN route (dev ${dev})."
}
_endpoint_route_del() {
local ip
ip="$(cat "${config["EndpointIPFile"]}" 2>/dev/null)"
[ -n "${ip}" ] && ip route del "${ip}" 2>/dev/null || true
rm -f "${config["EndpointIPFile"]}" || true
}
_routing_add() {
bashio::log.info "Adding routing rules for VPN interface ${config["Interface"]}..."
@@ -366,8 +344,6 @@ _wireguard_up() {
fi
_cmd "ip link set ${config["Interface"]} up" || return 1
_endpoint_route_add "${config["EndpointIP"]}" || return 1
echo "${config["EndpointIP"]}" > "${config["EndpointIPFile"]}"
# Add routing rules for VPN interface and DNS servers
_routing_add || return 1
@@ -382,7 +358,6 @@ _wireguard_up() {
}
_wireguard_down() {
_endpoint_route_del || true
# Update resolv.conf to remove VPN DNS servers
_resolvconf "reset" || true
# Remove routing rules for VPN interface and DNS servers
@@ -424,7 +399,6 @@ wireguard() {
config["Interface"]="${interface}"
config["ConfigFile"]="${config_file}"
config["Table"]="${config["Table"]:-1000}"
config["EndpointIPFile"]="${WIREGUARD_STATE_DIR}/endpoint-ip"
config["ListenPort"]="${config["ListenPort"]:-51820}"
config["EndpointHost"]="${config["Endpoint"]%:*}"
config["EndpointPort"]="${config["Endpoint"]##*:}"
@@ -511,8 +485,6 @@ _openvpn_check() {
}
_openvpn_up() {
local endpoint_ip result=0
bashio::log.warning "This script force OpenvPN to ignore any routes and DNS settings pushed by the server."
bashio::log.warning "Default route will be inserted into custom routing table: ${config["Table"]}"
bashio::log.warning "This routing table will be used for traffic from the VPN interface and to the configured DNS servers."
@@ -526,15 +498,6 @@ _openvpn_up() {
echo "${config["MySelf"]} openvpn postdown" >> ${config["PostDownScript"]}
chmod 755 ${config["PostDownScript"]}
endpoint_ip="$(awk '/^[[:space:]]*remote[[:space:]]/ {print $2; exit}' "${config["ConfigFile"]}")"
if [ -n "${endpoint_ip}" ]; then
_check_host "${endpoint_ip}" || result=$?
[ "${result}" -eq 3 ] && endpoint_ip="$(_resolve_hostname "${endpoint_ip}" | awk '{print $1}')"
if [ -n "${endpoint_ip}" ]; then
_endpoint_route_add "${endpoint_ip}" && echo "${endpoint_ip}" > "${config["EndpointIPFile"]}"
fi
fi
# Define logging
declare -A verbosity=(
["fatal"]=1
@@ -570,7 +533,6 @@ _openvpn_up() {
_openvpn_down() {
# Terminate OpenVPN process
pkill -f "openvpn --config ${config["ConfigFile"]}" || true
_endpoint_route_del || true
# Safety-net cleanup in case the --down callback was never invoked
_routing_del || true
}
@@ -595,7 +557,6 @@ _openpvn_postdown() {
if bashio::config.true 'vpn_upnp_enabled'; then
_firewall_del || true
fi
_endpoint_route_del || true
}
openvpn() {
@@ -625,7 +586,6 @@ openvpn() {
config["Interface"]="${interface}"
config["ConfigFile"]="${config_file}"
config["Table"]="${config["Table"]:-1000}"
config["EndpointIPFile"]="${OPENVPN_STATE_DIR}/endpoint-ip"
config["PostUpScript"]="${OPENVPN_STATE_DIR}/up.sh"
config["PostDownScript"]="${OPENVPN_STATE_DIR}/down.sh"