added proxy configuration to haos addon config ui
This commit is contained in:
@@ -41,6 +41,10 @@ options:
|
|||||||
# Optional: Home Assistant long-lived token (for local HA API scripts/tools)
|
# Optional: Home Assistant long-lived token (for local HA API scripts/tools)
|
||||||
homeassistant_token: ""
|
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)
|
# 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
|
# This is a generic SSH configuration intended for a router/firewall or any network device
|
||||||
# reachable from inside the HA host LAN.
|
# reachable from inside the HA host LAN.
|
||||||
@@ -91,6 +95,7 @@ schema:
|
|||||||
terminal_port: int(1024,65535)?
|
terminal_port: int(1024,65535)?
|
||||||
gateway_public_url: str?
|
gateway_public_url: str?
|
||||||
homeassistant_token: str?
|
homeassistant_token: str?
|
||||||
|
http_proxy: str?
|
||||||
|
|
||||||
router_ssh_host: str
|
router_ssh_host: str
|
||||||
router_ssh_user: str
|
router_ssh_user: str
|
||||||
@@ -104,4 +109,3 @@ schema:
|
|||||||
enable_openai_api: bool?
|
enable_openai_api: bool?
|
||||||
allow_insecure_auth: bool?
|
allow_insecure_auth: bool?
|
||||||
force_ipv4_dns: bool?
|
force_ipv4_dns: bool?
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ fi
|
|||||||
TZNAME=$(jq -r '.timezone // "Europe/Sofia"' "$OPTIONS_FILE")
|
TZNAME=$(jq -r '.timezone // "Europe/Sofia"' "$OPTIONS_FILE")
|
||||||
GW_PUBLIC_URL=$(jq -r '.gateway_public_url // empty' "$OPTIONS_FILE")
|
GW_PUBLIC_URL=$(jq -r '.gateway_public_url // empty' "$OPTIONS_FILE")
|
||||||
HA_TOKEN=$(jq -r '.homeassistant_token // 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")
|
ENABLE_TERMINAL=$(jq -r '.enable_terminal // true' "$OPTIONS_FILE")
|
||||||
TERMINAL_PORT_RAW=$(jq -r '.terminal_port // 7681' "$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
|
# Reduce risk of secrets ending up in logs
|
||||||
set +x
|
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.
|
# Optional network hardening/workaround: force IPv4-first DNS ordering for Node.js.
|
||||||
# Helps in environments where IPv6 resolves but has no working egress.
|
# Helps in environments where IPv6 resolves but has no working egress.
|
||||||
if [ "$FORCE_IPV4_DNS" = "true" ] || [ "$FORCE_IPV4_DNS" = "1" ]; then
|
if [ "$FORCE_IPV4_DNS" = "true" ] || [ "$FORCE_IPV4_DNS" = "1" ]; then
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ configuration:
|
|||||||
name: Home Assistant токен
|
name: Home Assistant токен
|
||||||
description: Опционално - дълготраен токен на Home Assistant за локални API скриптове/инструменти
|
description: Опционално - дълготраен токен на Home Assistant за локални API скриптове/инструменти
|
||||||
|
|
||||||
|
http_proxy:
|
||||||
|
name: Изходящ HTTP прокси
|
||||||
|
description: Опционално - URL на прокси за изходящи HTTP/HTTPS заявки (пример - http://192.168.2.1:3128)
|
||||||
|
|
||||||
router_ssh_host:
|
router_ssh_host:
|
||||||
name: SSH хост на рутер
|
name: SSH хост на рутер
|
||||||
description: Опционално - SSH име на хост или IP адрес на рутер/защитна стена
|
description: Опционално - SSH име на хост или IP адрес на рутер/защитна стена
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ configuration:
|
|||||||
name: Home Assistant Token
|
name: Home Assistant Token
|
||||||
description: Optional - Langlebiger Home Assistant Token für lokale API-Skripte/Tools
|
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:
|
router_ssh_host:
|
||||||
name: Router SSH-Host
|
name: Router SSH-Host
|
||||||
description: Optional - SSH-Hostname oder IP-Adresse des Routers/der Firewall
|
description: Optional - SSH-Hostname oder IP-Adresse des Routers/der Firewall
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ configuration:
|
|||||||
name: Home Assistant Token
|
name: Home Assistant Token
|
||||||
description: Optional - Home Assistant long-lived token for local HA API scripts/tools
|
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:
|
router_ssh_host:
|
||||||
name: Router SSH Host
|
name: Router SSH Host
|
||||||
description: Optional - Router/firewall SSH hostname or IP address
|
description: Optional - Router/firewall SSH hostname or IP address
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ configuration:
|
|||||||
name: Token de Home Assistant
|
name: Token de Home Assistant
|
||||||
description: Opcional - Token de larga duración de Home Assistant para scripts/herramientas de API local
|
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:
|
router_ssh_host:
|
||||||
name: Host SSH del router
|
name: Host SSH del router
|
||||||
description: Opcional - Nombre de host SSH o dirección IP del router/firewall
|
description: Opcional - Nombre de host SSH o dirección IP del router/firewall
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ configuration:
|
|||||||
name: Token Home Assistant
|
name: Token Home Assistant
|
||||||
description: Opcjonalnie - długoterminowy token Home Assistant dla lokalnych skryptów/narzędzi API HA
|
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:
|
router_ssh_host:
|
||||||
name: Host SSH routera
|
name: Host SSH routera
|
||||||
description: Opcjonalnie - nazwa hosta SSH routera/firewalla lub adres IP
|
description: Opcjonalnie - nazwa hosta SSH routera/firewalla lub adres IP
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ configuration:
|
|||||||
name: Token do Home Assistant
|
name: Token do Home Assistant
|
||||||
description: Opcional - Token de longa duração do Home Assistant para scripts/ferramentas da API local do HA
|
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:
|
router_ssh_host:
|
||||||
name: Host SSH do Roteador
|
name: Host SSH do Roteador
|
||||||
description: Opcional - Nome do host ou endereço IP do roteador/firewall via SSH
|
description: Opcional - Nome do host ou endereço IP do roteador/firewall via SSH
|
||||||
|
|||||||
Reference in New Issue
Block a user