From d118102c11b279db7ab116f76c00052cda7a3b33 Mon Sep 17 00:00:00 2001 From: macm1 Date: Sun, 22 Feb 2026 21:21:11 +0300 Subject: [PATCH] Add NO_PROXY defaults for http_proxy and document behavior --- DOCS.md | 4 +++- openclaw_assistant/run.sh | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/DOCS.md b/DOCS.md index 15ddcf4..c3c306b 100644 --- a/DOCS.md +++ b/DOCS.md @@ -217,7 +217,7 @@ All options are set via **Settings → Apps/Add-ons → OpenClaw Assistant → C | Option | Type | Default | Description | |---|---|---|---| | `homeassistant_token` | string | _(empty)_ | Optional HA long-lived access token (use at own risk, can be very unsecure but very powerful). Saved to `/config/secrets/homeassistant.token` for use by scripts/skills | -| `http_proxy` | string | _(empty)_ | Optional outbound proxy URL for HTTP/HTTPS requests from OpenClaw and Node tools. Example: `http://192.168.2.1:3128` | +| `http_proxy` | string | _(empty)_ | Optional outbound proxy URL for HTTP/HTTPS requests from OpenClaw and Node tools. Example: `http://192.168.2.1:3128`. When set, the add-on also applies `NO_PROXY/no_proxy` defaults for localhost and private network ranges. | ### Router SSH @@ -616,6 +616,8 @@ If Telegram is configured but polling fails with network fetch errors: 2. Restart the add-on after changing configuration. 3. Check logs for `INFO: Outbound HTTP/HTTPS proxy enabled from add-on configuration.` 4. If you see `WARN: Invalid http_proxy value`, fix the URL format and restart. +5. Local traffic bypass is applied automatically via `NO_PROXY/no_proxy` defaults: + `localhost,127.0.0.1,::1,192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,.local` ### Skills disappearing after update diff --git a/openclaw_assistant/run.sh b/openclaw_assistant/run.sh index d425437..fa89a64 100644 --- a/openclaw_assistant/run.sh +++ b/openclaw_assistant/run.sh @@ -62,11 +62,17 @@ set +x # 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 + # Keep local traffic direct to avoid accidental proxying of loopback/LAN services. + DEFAULT_NO_PROXY="localhost,127.0.0.1,::1,192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,.local" + export HTTP_PROXY="$ADDON_HTTP_PROXY" export HTTPS_PROXY="$ADDON_HTTP_PROXY" export http_proxy="$ADDON_HTTP_PROXY" export https_proxy="$ADDON_HTTP_PROXY" + export NO_PROXY="${NO_PROXY:+${NO_PROXY},}${DEFAULT_NO_PROXY}" + export no_proxy="${no_proxy:+${no_proxy},}${DEFAULT_NO_PROXY}" echo "INFO: Outbound HTTP/HTTPS proxy enabled from add-on configuration." + echo "INFO: Applied NO_PROXY defaults for localhost/private network ranges." else echo "WARN: Invalid http_proxy value in add-on options; expected URL like http://host:port" fi