Dmitry Beresnev commited on
Commit Β·
1c6354b
1
Parent(s): 844d8b8
add proxy, fix dockerfile
Browse filesFiles changed (2)
- Dockerfile+1-1
- app.py+22-8
40 unmodified lines4142434440 unmodified linesEXPOSE 7860CMD ["sh", "-c", "( ${OPENCLAW_BIN} gateway run --port ${OPENCLAW_PORT} --bind loopback --allow-unconfigured --dev --verbose || ${OPENCLAW_BIN} gateway --port ${OPENCLAW_PORT} --bind loopback --allow-unconfigured --dev --verbose ) > /tmp/openclaw-gateway.log 2> /tmp/openclaw-gateway.err.log & uv run streamlit run app.py --server.address=0.0.0.0 --server.port=8501 > /tmp/streamlit.log 2>&1 & exec caddy run --config /app/Caddyfile --adapter caddyfile"]40 unmodified lines4142434440 unmodified linesEXPOSE 7860CMD ["sh", "-c", "( while true; do ${OPENCLAW_BIN} gateway run --port ${OPENCLAW_PORT} --bind loopback --allow-unconfigured --dev --verbose || ${OPENCLAW_BIN} gateway --port ${OPENCLAW_PORT} --bind loopback --allow-unconfigured --dev --verbose; echo \"[gateway] exited with $?; restarting in 2s\"; sleep 2; done ) > /tmp/openclaw-gateway.log 2> /tmp/openclaw-gateway.err.log & uv run streamlit run app.py --server.address=0.0.0.0 --server.port=8501 > /tmp/streamlit.log 2>&1 & exec caddy run --config /app/Caddyfile --adapter caddyfile"]
32 unmodified lines333435363738360 unmodified lines39940040140240340440540640740840941041141241341441541641741832 unmodified linesGATEWAY_BOOT_LOG_PATH = Path(os.getenv("OPENCLAW_GATEWAY_LOG_PATH", "/tmp/openclaw-gateway.log"))GATEWAY_ERR_LOG_PATH = Path(os.getenv("OPENCLAW_GATEWAY_ERR_LOG_PATH", "/tmp/openclaw-gateway.err.log"))EXTERNAL_GATEWAY_MANAGED = os.getenv("EXTERNAL_GATEWAY_MANAGED", "0") == "1"SUPERVISOR_LOG_PATH = Path("/tmp/supervisord.log")STREAMLIT_ERR_LOG_PATH = Path("/tmp/streamlit.err.log")CADDY_ERR_LOG_PATH = Path("/tmp/caddy.err.log")360 unmodified linesst.subheader("OpenClaw Standard UI")std_ui_status_col, std_ui_embed_col = st.columns([1, 3])with std_ui_status_col:ui_ok = Falseui_status_text = "Unavailable"std_ui_url = with_token(OPENCLAW_STANDARD_UI_URL, OPENCLAW_GATEWAY_TOKEN)try:ui_resp = requests.get(std_ui_url, timeout=2, allow_redirects=True)# 401/403 means gateway is up but auth is required.ui_ok = ui_resp.status_code < 500if ui_resp.status_code in (401, 403):ui_status_text = f"Available (auth required, HTTP {ui_resp.status_code})"else:ui_status_text = "Available" if ui_ok else f"HTTP {ui_resp.status_code}"except Exception:ui_ok = Falsest.markdown(f"Status: {'π’' if ui_ok else 'π΄'} {ui_status_text}")st.caption(f"URL: {std_ui_url}")if OPENCLAW_STANDARD_UI_PUBLIC_URL:st.caption(f"Public URL: {OPENCLAW_STANDARD_UI_PUBLIC_URL}")32 unmodified lines33343536373839360 unmodified lines40040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143232 unmodified linesGATEWAY_BOOT_LOG_PATH = Path(os.getenv("OPENCLAW_GATEWAY_LOG_PATH", "/tmp/openclaw-gateway.log"))GATEWAY_ERR_LOG_PATH = Path(os.getenv("OPENCLAW_GATEWAY_ERR_LOG_PATH", "/tmp/openclaw-gateway.err.log"))EXTERNAL_GATEWAY_MANAGED = os.getenv("EXTERNAL_GATEWAY_MANAGED", "0") == "1"OPENCLAW_PROXY_LOCAL_URL = os.getenv("OPENCLAW_PROXY_LOCAL_URL", "http://127.0.0.1:7860/openclaw/")SUPERVISOR_LOG_PATH = Path("/tmp/supervisord.log")STREAMLIT_ERR_LOG_PATH = Path("/tmp/streamlit.err.log")CADDY_ERR_LOG_PATH = Path("/tmp/caddy.err.log")360 unmodified linesst.subheader("OpenClaw Standard UI")std_ui_status_col, std_ui_embed_col = st.columns([1, 3])with std_ui_status_col:local_ok = Falseproxy_ok = Falselocal_status = "Unavailable"proxy_status = "Unavailable"std_ui_url = with_token(OPENCLAW_STANDARD_UI_URL, OPENCLAW_GATEWAY_TOKEN)try:ui_resp = requests.get(std_ui_url, timeout=2, allow_redirects=True)local_ok = ui_resp.status_code < 500if ui_resp.status_code in (401, 403):local_status = f"Available (auth required, HTTP {ui_resp.status_code})"else:local_status = "Available" if local_ok else f"HTTP {ui_resp.status_code}"except Exception:local_ok = Falsetry:proxy_resp = requests.get(OPENCLAW_PROXY_LOCAL_URL, timeout=2, allow_redirects=True)proxy_ok = proxy_resp.status_code < 500proxy_status = "Available" if proxy_ok else f"HTTP {proxy_resp.status_code}"except Exception:proxy_ok = Falsest.markdown(f"Gateway Local ({std_ui_url}): {'π’' if local_ok else 'π΄'} {local_status}")st.markdown(f"Gateway Via Proxy ({OPENCLAW_PROXY_LOCAL_URL}): "f"{'π’' if proxy_ok else 'π΄'} {proxy_status}")st.caption(f"URL: {std_ui_url}")if OPENCLAW_STANDARD_UI_PUBLIC_URL:st.caption(f"Public URL: {OPENCLAW_STANDARD_UI_PUBLIC_URL}")
Dockerfile+1-1
app.py+22-8