Commit Graph

14 Commits

Author SHA1 Message Date
Ojus Save
aa0621ae38 fix(render): completely rewrite startup script for reliability
- Remove all complex permission testing
- Use HOME/.clawdbot as default (always writable)
- Add explicit checks for node and dist/index.js
- Simplify error handling
- Better logging
2026-01-28 10:10:18 -08:00
Ojus Save
0e1641f87b fix(render): ensure script is executable and improve permission testing
- Add chmod +x for render-start.sh in Dockerfile
- Improve permission testing with touch/rm
- Better error handling
2026-01-28 10:10:18 -08:00
Ojus Save
df160aec5a fix(render): simplify script and fix permission checks
- Use set +e for permission testing, check exit codes explicitly
- Default to HOME/.clawdbot which is always writable
- Use heredoc for config file writing (more reliable)
- Add debug output for user/UID
- Remove duplicate echo statements
2026-01-28 10:10:18 -08:00
Ojus Save
3c1e781ab0 fix(render): disable set -e during permission testing
- Disable set -e for entire permission testing section
- Re-enable set -e after config is written
- Simpler logic without complex conditionals
- More reliable error handling
2026-01-28 10:10:18 -08:00
Ojus Save
c23dd3e3e3 fix(render): simplify permission handling with set +e/-e toggle
- Use for loop to try directories in order
- Temporarily disable set -e for permission tests
- Write config file directly to test writability
- More robust error handling that works with set -e
2026-01-28 10:10:18 -08:00
Ojus Save
041e279427 fix(render): improve permission handling and error checking
- Use touch/rm test instead of -w flag for better compatibility
- Clean up unused variables
- Add clearer fallback chain with logging
- Ensure script handles all edge cases gracefully
2026-01-28 10:10:18 -08:00
Ojus Save
4b37990554 fix(render): handle permission errors when running as non-root user
- Check if CLAWDBOT_STATE_DIR or /data/.clawdbot is writable
- Fall back to $HOME/.clawdbot if permissions fail
- Update CLAWDBOT_STATE_DIR export to match actual directory used
- Prevents Docker failures when running as node user (non-root)
2026-01-28 10:10:18 -08:00
Ojus Save
bf39de591c debug: verify config is readable and disable cache 2026-01-28 10:10:12 -08:00
Ojus Save
eec4567f0c fix: explicitly set CLAWDBOT_CONFIG_PATH to ensure config is loaded 2026-01-28 10:10:12 -08:00
Ojus Save
6df64ae4f7 debug: write config to both locations 2026-01-28 10:10:12 -08:00
Ojus Save
744371091b debug: add verbose output to startup script 2026-01-28 10:10:12 -08:00
Ojus Save
e56581caf2 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
2026-01-28 10:10:12 -08:00
Ojus Save
453e40d25f fix(render): pass password from env var to gateway command 2026-01-28 10:10:12 -08:00
Ojus Save
9eaaa2b0d0 fix(render): add startup script to configure trusted proxies and insecure UI auth
- Create render-start.sh that writes config before starting gateway
- Configure gateway.trustedProxies for Render's internal network
- Enable gateway.controlUi.allowInsecureAuth to skip device pairing
2026-01-28 10:10:12 -08:00