mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-04-06 14:16:25 +02:00
Fix env vars not propagated to s6-overlay v3 services and disable forwarder when VPN not configured
- Add /etc/s6-overlay/s6-rc.d/*/run to the injection list in 00-global_var.sh so environment variables reach s6 v3 service run scripts (used by hotio containers) - Disable service-forwarder in 90-vpn.sh default case (no VPN provider) - Add VPN_AUTO_PORT_FORWARD=false check to explicitly disable forwarder Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/95bdc987-dd03-486d-bf05-6172624d1238 Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
8ce91f7e3e
commit
44ebe0e22f
@@ -234,7 +234,7 @@ cp "$ENV_FILE" "$ETC_ENV_FILE"
|
||||
################################################################################
|
||||
# Inject into scripts and shells (best-effort)
|
||||
################################################################################
|
||||
for f in /etc/services.d/*/run /etc/cont-init.d/*.sh /entrypoint.sh /etc/bash.bashrc "${GLOBAL_VAR_FILES:-}"; do
|
||||
for f in /etc/services.d/*/run /etc/s6-overlay/s6-rc.d/*/run /etc/cont-init.d/*.sh /entrypoint.sh /etc/bash.bashrc "${GLOBAL_VAR_FILES:-}"; do
|
||||
[[ -f "$f" ]] && inject_block "$f"
|
||||
done
|
||||
|
||||
|
||||
@@ -23,5 +23,12 @@ case "$VPN_PROVIDER" in
|
||||
sed -i "1a sleep infinity" /etc/s6*/s6*/service-privoxy/run
|
||||
sed -i "1a sleep infinity" /etc/s6*/s6*/service-proton/run
|
||||
sed -i "1a sleep infinity" /etc/s6*/s6*/service-pia/run
|
||||
sed -i "1a sleep infinity" /etc/s6*/s6*/service-forwarder/run
|
||||
;;
|
||||
esac
|
||||
|
||||
# Disable port forwarder when VPN_AUTO_PORT_FORWARD is explicitly false
|
||||
VPN_AUTO_PORT_FORWARD="${VPN_AUTO_PORT_FORWARD:-}"
|
||||
if [ "${VPN_AUTO_PORT_FORWARD,,}" = "false" ]; then
|
||||
sed -i "1a sleep infinity" /etc/s6*/s6*/service-forwarder/run 2>/dev/null || true
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user