fix(render): use startup script to configure trustedProxies
The key difference from the wrapper: - Wrapper strips proxy headers before forwarding to internal gateway - Direct deployment needs trustedProxies config to trust Render's proxy IPs This script: 1. Creates config with gateway.trustedProxies for Render's internal IPs 2. Sets allowInsecureAuth for Control UI access 3. Starts gateway with token auth
This commit is contained in:
parent
f9d14cbba5
commit
e56581caf2
@ -3,7 +3,7 @@ services:
|
|||||||
name: moltbot
|
name: moltbot
|
||||||
runtime: docker
|
runtime: docker
|
||||||
plan: starter
|
plan: starter
|
||||||
dockerCommand: node dist/index.js gateway --port 8080 --bind lan --auth token --allow-unconfigured
|
dockerCommand: /bin/sh scripts/render-start.sh
|
||||||
envVars:
|
envVars:
|
||||||
- key: PORT
|
- key: PORT
|
||||||
value: "8080"
|
value: "8080"
|
||||||
|
|||||||
@ -3,12 +3,14 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Create config directory
|
# Create config directory
|
||||||
mkdir -p "$CLAWDBOT_STATE_DIR"
|
mkdir -p "${CLAWDBOT_STATE_DIR:-/data/.clawdbot}"
|
||||||
|
|
||||||
# Write config file with Render-specific settings
|
# Write config file with Render-specific settings
|
||||||
cat > "$CLAWDBOT_STATE_DIR/clawdbot.json" << 'EOF'
|
# trustedProxies allows Render's internal proxy IPs to be trusted
|
||||||
|
cat > "${CLAWDBOT_STATE_DIR:-/data/.clawdbot}/clawdbot.json" << 'EOF'
|
||||||
{
|
{
|
||||||
"gateway": {
|
"gateway": {
|
||||||
|
"mode": "local",
|
||||||
"trustedProxies": ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"],
|
"trustedProxies": ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"],
|
||||||
"controlUi": {
|
"controlUi": {
|
||||||
"allowInsecureAuth": true
|
"allowInsecureAuth": true
|
||||||
@ -17,12 +19,13 @@ cat > "$CLAWDBOT_STATE_DIR/clawdbot.json" << 'EOF'
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "Config written to $CLAWDBOT_STATE_DIR/clawdbot.json"
|
echo "Config written to ${CLAWDBOT_STATE_DIR:-/data/.clawdbot}/clawdbot.json"
|
||||||
|
cat "${CLAWDBOT_STATE_DIR:-/data/.clawdbot}/clawdbot.json"
|
||||||
|
|
||||||
# Start the gateway with password from env var
|
# Start the gateway with token from env var
|
||||||
exec node dist/index.js gateway \
|
exec node dist/index.js gateway \
|
||||||
--port 8080 \
|
--port 8080 \
|
||||||
--bind lan \
|
--bind lan \
|
||||||
--auth password \
|
--auth token \
|
||||||
--password "$CLAWDBOT_GATEWAY_PASSWORD" \
|
--token "$CLAWDBOT_GATEWAY_TOKEN" \
|
||||||
--allow-unconfigured
|
--allow-unconfigured
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user