fix: bind SSL proxies to SERVER_IP for VPN/remote access

local-ssl-proxy was binding to 0.0.0.0 which doesn't work reliably for
cross-network access (VPN, remote clients). Now binds to SERVER_IP from
inventory.env, ensuring the proxy is reachable from all networks that can
reach the server's main IP address.
This commit is contained in:
2026-04-21 15:27:28 +03:00
parent 2daeb1e2ae
commit fcff97bae2

View File

@@ -114,8 +114,11 @@ ALLOWED_DEV_ORIGINS="$ALLOWED_DEV_ORIGINS" npm run dev -- -p $FRONTEND_PORT &
cd ..
# 6. Start Proxies (Crucial for Mobile/Tablet Camera & Sync)
npx local-ssl-proxy --source $BACKEND_SSL_PORT --target $BACKEND_PORT --hostname 0.0.0.0 > /dev/null 2>&1 &
npx local-ssl-proxy --source $FRONTEND_SSL_PORT --target $FRONTEND_PORT --hostname 0.0.0.0 > /dev/null 2>&1 &
# Bind to SERVER_IP (not 0.0.0.0) so VPN/remote clients can reach the server
PROXY_HOSTNAME=${SERVER_IP:-0.0.0.0}
echo "🔐 Starting SSL proxies on $PROXY_HOSTNAME..."
npx local-ssl-proxy --source $BACKEND_SSL_PORT --target $BACKEND_PORT --hostname $PROXY_HOSTNAME > /dev/null 2>&1 &
npx local-ssl-proxy --source $FRONTEND_SSL_PORT --target $FRONTEND_PORT --hostname $PROXY_HOSTNAME > /dev/null 2>&1 &
# 7. Print Unified Access Banner