cloudcli-taskwork-public/scripts/dev-host-proxy.sh
bvn13 8de74a96d1 chore: bump both submodules and let the proxy wrapper allow a published host
cloudcli moves to d12813e1, which carries the fix this workspace was missing:
PluginsProvider and TasksSettingsProvider sit above ProtectedRoute and fetched
exactly once, on mount, so in a browser holding no token yet the request landed
on the login screen, came back 401, and nothing asked again — the whole session
then ran with an empty plugin list and no Tasks section until a reload.
plugin-taskwork moves to fdae5240, which keeps a task draft that loses focus.

dev-host-proxy.sh gains ALLOWED_HOST. Publishing the dev host under a name
rather than localhost — a port forward, a reverse proxy — otherwise ends at
Vite's "Blocked request. This host is not allowed.". The value goes into the
variable Vite reads for exactly this, so vite.config.js needs no local patch,
and leaving ALLOWED_HOST unset passes an empty string, which Vite ignores.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-20 12:43:01 +03:00

35 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
HTTP_PROXY_PORT=${HTTP_PROXY_PORT:-25345}
# Proxy settings (v2rayN / local HTTP proxy)
export HTTP_PROXY="${HTTP_PROXY:-http://127.0.0.1:${HTTP_PROXY_PORT}}"
export HTTPS_PROXY="${HTTPS_PROXY:-http://127.0.0.1:${HTTP_PROXY_PORT}}"
export NO_PROXY="${NO_PROXY:-localhost,127.0.0.1,::1,.corp.local,ahcode-01.digital.achrf.ru}"
# Some libs read lowercase variants
export http_proxy="$HTTP_PROXY"
export https_proxy="$HTTPS_PROXY"
export no_proxy="$NO_PROXY"
# Reaching the host through a name rather than localhost — publishing it behind
# a port forward or a reverse proxy — needs that name allowed: Vite answers
# "Blocked request. This host is not allowed." to every other Host header.
#
# ALLOWED_HOST carries it. The variable Vite reads is its own escape hatch: it
# appends the value to server.allowedHosts, so cloudcli/vite.config.js stays
# untouched. One name per run — the value is appended whole, commas are not
# split. Unset means an empty string, which Vite ignores, so leaving it alone
# keeps the default localhost-only behaviour.
export __VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS="${ALLOWED_HOST:-}"
echo "-------"
echo "HTTP_PROXY=${HTTP_PROXY}"
echo "ALLOWED_HOST=${ALLOWED_HOST:-(none, localhost only)}"
echo "-------"
# Run claude with args
bash dev-host.sh "$@"