6 Commits

Author SHA1 Message Date
github-actions
3ee3b8d490 GitHub bot: changelog 2026-03-24 14:20:20 +00:00
github-actions
e2a1153082 Github bot : issues linked to readme 2026-03-24 14:15:20 +00:00
Alexandre
4d49783d96 Merge pull request #2610 from alexbelgium/copilot/fix-openvpn-connection-issue-again
qbittorrent: fix OpenVPN startup broken by unconditional firewall rules (v5.1.4-19)
2026-03-24 15:14:59 +01:00
github-actions
4312f9561c Github bot : issues linked to readme 2026-03-24 14:14:36 +00:00
copilot-swe-agent[bot]
cdbf511aca Fix OpenVPN broken by unconditional firewall rules; guard _firewall_add/del behind vpn_upnp_enabled; bump version to 5.1.4-19
Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/cd0a7e2e-8b4d-4fe1-9ddc-64a8127f64cf
2026-03-24 10:28:49 +00:00
copilot-swe-agent[bot]
8788fb2601 Initial plan 2026-03-24 10:26:00 +00:00
3 changed files with 20 additions and 11 deletions

View File

@@ -1,6 +1,5 @@
## 5.1.4-19 (24-03-2026) ## 5.1.4-19 (24-03-2026)
- Fix OpenVPN not connecting: restore missing openvpn package in Dockerfile - Minor bugs fixed
## 5.1.4-18 (22-03-2026) ## 5.1.4-18 (22-03-2026)
- Minor bugs fixed - Minor bugs fixed
## 5.1.4-17 (17-02-2026) ## 5.1.4-17 (17-02-2026)

View File

@@ -113,7 +113,7 @@ RUN chmod 744 /ha_automodules.sh && /ha_automodules.sh "$MODULES" && rm /ha_auto
# && chmod a+x /etc/s6-overlay/s6-rc.d/$SCRIPTSNAME/* ; done; fi # && chmod a+x /etc/s6-overlay/s6-rc.d/$SCRIPTSNAME/* ; done; fi
# Manual apps # Manual apps
ARG PACKAGES="openvpn ipcalc wireguard-tools libnatpmp iptables ip6tables" ARG PACKAGES="ipcalc wireguard-tools libnatpmp iptables ip6tables"
# Automatic apps & bashio # Automatic apps & bashio
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_autoapps.sh" "/ha_autoapps.sh" ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_autoapps.sh" "/ha_autoapps.sh"

View File

@@ -347,8 +347,10 @@ _wireguard_up() {
# Add routing rules for VPN interface and DNS servers # Add routing rules for VPN interface and DNS servers
_routing_add || return 1 _routing_add || return 1
# Add firewall rules for VPN interface # Add firewall rules for VPN interface (only when UPnP port mapping is enabled)
_firewall_add || return 1 if bashio::config.true 'vpn_upnp_enabled'; then
_firewall_add || bashio::log.warning "Firewall rules could not be applied (non-fatal)."
fi
# Update resolv.conf with VPN DNS servers # Update resolv.conf with VPN DNS servers
_resolvconf "update" || return 1 _resolvconf "update" || return 1
# Wait for handshake to be established before returning success # Wait for handshake to be established before returning success
@@ -360,8 +362,10 @@ _wireguard_down() {
_resolvconf "reset" || true _resolvconf "reset" || true
# Remove routing rules for VPN interface and DNS servers # Remove routing rules for VPN interface and DNS servers
_routing_del || true _routing_del || true
# Remove firewall rules for VPN interface # Remove firewall rules for VPN interface (only when UPnP port mapping is enabled)
_firewall_del || true if bashio::config.true 'vpn_upnp_enabled'; then
_firewall_del || true
fi
_cmd "ip link set ${config["Interface"]} down" 2>/dev/null || true _cmd "ip link set ${config["Interface"]} down" 2>/dev/null || true
_cmd "ip link del ${config["Interface"]}" 2>/dev/null || true _cmd "ip link del ${config["Interface"]}" 2>/dev/null || true
@@ -521,13 +525,17 @@ _openvpn_up() {
_openvpn_down() { _openvpn_down() {
# Terminate OpenVPN process # Terminate OpenVPN process
pkill -f "openvpn --config ${config["ConfigFile"]}" || true pkill -f "openvpn --config ${config["ConfigFile"]}" || true
# Safety-net cleanup in case the --down callback was never invoked
_routing_del || true
} }
_openpvn_postup() { _openpvn_postup() {
# Add routing rules for VPN interface and DNS servers # Add routing rules for VPN interface and DNS servers
_routing_add || return 1 _routing_add || return 1
# Add firewall rules for VPN interface # Add firewall rules for VPN interface (only when UPnP port mapping is enabled)
_firewall_add || return 1 if bashio::config.true 'vpn_upnp_enabled'; then
_firewall_add || bashio::log.warning "Firewall rules could not be applied (non-fatal)."
fi
# Update resolv.conf with VPN DNS servers # Update resolv.conf with VPN DNS servers
_resolvconf "update" || return 1 _resolvconf "update" || return 1
} }
@@ -537,8 +545,10 @@ _openpvn_postdown() {
_resolvconf "reset" || true _resolvconf "reset" || true
# Remove routing rules for VPN interface and DNS servers # Remove routing rules for VPN interface and DNS servers
_routing_del || true _routing_del || true
# Remove firewall rules for VPN interface # Remove firewall rules for VPN interface (only when UPnP port mapping is enabled)
_firewall_del || true if bashio::config.true 'vpn_upnp_enabled'; then
_firewall_del || true
fi
} }
openvpn() { openvpn() {