added proxy configuration to haos addon config ui

This commit is contained in:
macm1
2026-02-22 19:54:51 +03:00
parent c3ba720d0b
commit ab33e6702f
8 changed files with 44 additions and 1 deletions
+5 -1
View File
@@ -41,6 +41,10 @@ options:
# Optional: Home Assistant long-lived token (for local HA API scripts/tools)
homeassistant_token: ""
# Optional: outbound HTTP/HTTPS proxy for OpenClaw network access.
# Example: "http://192.168.2.1:3128"
http_proxy: ""
# Optional: Router SSH defaults (leave empty if you don't need router automation)
# This is a generic SSH configuration intended for a router/firewall or any network device
# reachable from inside the HA host LAN.
@@ -91,6 +95,7 @@ schema:
terminal_port: int(1024,65535)?
gateway_public_url: str?
homeassistant_token: str?
http_proxy: str?
router_ssh_host: str
router_ssh_user: str
@@ -104,4 +109,3 @@ schema:
enable_openai_api: bool?
allow_insecure_auth: bool?
force_ipv4_dns: bool?
+15
View File
@@ -20,6 +20,7 @@ fi
TZNAME=$(jq -r '.timezone // "Europe/Sofia"' "$OPTIONS_FILE")
GW_PUBLIC_URL=$(jq -r '.gateway_public_url // empty' "$OPTIONS_FILE")
HA_TOKEN=$(jq -r '.homeassistant_token // empty' "$OPTIONS_FILE")
ADDON_HTTP_PROXY=$(jq -r '.http_proxy // empty' "$OPTIONS_FILE")
ENABLE_TERMINAL=$(jq -r '.enable_terminal // true' "$OPTIONS_FILE")
TERMINAL_PORT_RAW=$(jq -r '.terminal_port // 7681' "$OPTIONS_FILE")
@@ -57,6 +58,20 @@ export TZ="$TZNAME"
# Reduce risk of secrets ending up in logs
set +x
# Optional outbound proxy from add-on settings.
# If set, apply it to both HTTP and HTTPS for Node/undici/OpenClaw tooling.
if [ -n "$ADDON_HTTP_PROXY" ]; then
if [[ "$ADDON_HTTP_PROXY" =~ ^https?://[^[:space:]]+$ ]]; then
export HTTP_PROXY="$ADDON_HTTP_PROXY"
export HTTPS_PROXY="$ADDON_HTTP_PROXY"
export http_proxy="$ADDON_HTTP_PROXY"
export https_proxy="$ADDON_HTTP_PROXY"
echo "INFO: Outbound HTTP/HTTPS proxy enabled from add-on configuration."
else
echo "WARN: Invalid http_proxy value in add-on options; expected URL like http://host:port"
fi
fi
# Optional network hardening/workaround: force IPv4-first DNS ordering for Node.js.
# Helps in environments where IPv6 resolves but has no working egress.
if [ "$FORCE_IPV4_DNS" = "true" ] || [ "$FORCE_IPV4_DNS" = "1" ]; then
+4
View File
@@ -19,6 +19,10 @@ configuration:
name: Home Assistant токен
description: Опционално - дълготраен токен на Home Assistant за локални API скриптове/инструменти
http_proxy:
name: Изходящ HTTP прокси
description: Опционално - URL на прокси за изходящи HTTP/HTTPS заявки (пример - http://192.168.2.1:3128)
router_ssh_host:
name: SSH хост на рутер
description: Опционално - SSH име на хост или IP адрес на рутер/защитна стена
+4
View File
@@ -19,6 +19,10 @@ configuration:
name: Home Assistant Token
description: Optional - Langlebiger Home Assistant Token für lokale API-Skripte/Tools
http_proxy:
name: Ausgehender HTTP-Proxy
description: Optional - Proxy-URL für ausgehende HTTP/HTTPS-Anfragen (Beispiel - http://192.168.2.1:3128)
router_ssh_host:
name: Router SSH-Host
description: Optional - SSH-Hostname oder IP-Adresse des Routers/der Firewall
+4
View File
@@ -19,6 +19,10 @@ configuration:
name: Home Assistant Token
description: Optional - Home Assistant long-lived token for local HA API scripts/tools
http_proxy:
name: Outbound HTTP Proxy
description: Optional - Proxy URL for outbound HTTP/HTTPS requests (example - http://192.168.2.1:3128)
router_ssh_host:
name: Router SSH Host
description: Optional - Router/firewall SSH hostname or IP address
+4
View File
@@ -19,6 +19,10 @@ configuration:
name: Token de Home Assistant
description: Opcional - Token de larga duración de Home Assistant para scripts/herramientas de API local
http_proxy:
name: Proxy HTTP de salida
description: Opcional - URL de proxy para solicitudes HTTP/HTTPS salientes (ejemplo - http://192.168.2.1:3128)
router_ssh_host:
name: Host SSH del router
description: Opcional - Nombre de host SSH o dirección IP del router/firewall
+4
View File
@@ -19,6 +19,10 @@ configuration:
name: Token Home Assistant
description: Opcjonalnie - długoterminowy token Home Assistant dla lokalnych skryptów/narzędzi API HA
http_proxy:
name: Wychodzący proxy HTTP
description: Opcjonalnie - URL proxy dla wychodzących żądań HTTP/HTTPS (przykład - http://192.168.2.1:3128)
router_ssh_host:
name: Host SSH routera
description: Opcjonalnie - nazwa hosta SSH routera/firewalla lub adres IP
@@ -19,6 +19,10 @@ configuration:
name: Token do Home Assistant
description: Opcional - Token de longa duração do Home Assistant para scripts/ferramentas da API local do HA
http_proxy:
name: Proxy HTTP de saída
description: Opcional - URL de proxy para requisições HTTP/HTTPS de saída (exemplo - http://192.168.2.1:3128)
router_ssh_host:
name: Host SSH do Roteador
description: Opcional - Nome do host ou endereço IP do roteador/firewall via SSH