Dmitry Beresnev commited on
Commit ·
d0088e6
1
Parent(s): aade3ff
fix dockerfile, supervisord and app
Browse filesFiles changed (3)
- Dockerfile+3
- app.py+29-8
- supervisord.conf+1-1
38 unmodified lines39404142434438 unmodified linesENV OPENCLAW_GATEWAY_ERR_LOG_PATH=/tmp/openclaw-gateway.err.logENV OPENCLAW_DISABLE_BONJOUR=1ENV OPENCLAW_DISABLE_MDNS=1RUN mkdir -p /app/vault /app/.openclaw/state38 unmodified lines39404142434445464738 unmodified linesENV OPENCLAW_GATEWAY_ERR_LOG_PATH=/tmp/openclaw-gateway.err.logENV OPENCLAW_DISABLE_BONJOUR=1ENV OPENCLAW_DISABLE_MDNS=1ENV OPENCLAW_ONBOARD_NONINTERACTIVE=1ENV OPENCLAW_CUSTOM_BASE_URL=https://researchengineering-agi.hf.space/v1ENV OPENCLAW_CUSTOM_MODEL_ID=deepseek-chatRUN mkdir -p /app/vault /app/.openclaw/state
31 unmodified lines323334353637295 unmodified lines33333433533633733833934034134234334468 unmodified lines4134144154164174184194204214221 unmodified line424425426427428429110 unmodified lines54054154254354454554624 unmodified lines57157257357457557657731 unmodified linesOPENCLAW_STANDARD_UI_PUBLIC_URL = os.getenv("OPENCLAW_STANDARD_UI_PUBLIC_URL", "/openclaw/")OPENCLAW_GATEWAY_TOKEN = os.getenv("OPENCLAW_GATEWAY_TOKEN", "")OPENCLAW_STATE_CONFIG_PATH = Path(os.getenv("OPENCLAW_STATE_CONFIG_PATH", "/app/.openclaw/state/openclaw.json"))GATEWAY_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"295 unmodified linesreturn resp.json()def with_token(url: str, token: str) -> str:if not token:return urlparts = urlsplit(url)query = dict(parse_qsl(parts.query, keep_blank_values=True))query.setdefault("token", token)return urlunsplit((parts.scheme, parts.netloc, parts.path, urlencode(query), parts.fragment))68 unmodified lines# 3) Validate token candidates against browser UI endpoint.for token in deduped:try:probe_url = with_token(OPENCLAW_STANDARD_UI_URL, token)resp = requests.get(probe_url, timeout=2, allow_redirects=True)if resp.status_code < 400:return tokenexcept Exception:continue1 unmodified linereturn resolve_gateway_token()def build_strategy_frame(data: pd.DataFrame, fast_period: int, slow_period: int) -> pd.DataFrame:frame = pd.DataFrame(index=data.index)frame["Close"] = data["Close"]110 unmodified lineslocal_status = "Unavailable"proxy_status = "Unavailable"gateway_token = resolve_ui_token()std_ui_url = with_token(OPENCLAW_STANDARD_UI_URL, gateway_token)try:ui_resp = requests.get(std_ui_url, timeout=2, allow_redirects=True)local_ok = ui_resp.status_code < 50024 unmodified linesst.caption(f"Public URL: {OPENCLAW_STANDARD_UI_PUBLIC_URL}")with std_ui_embed_col:public_ui_url = with_token(OPENCLAW_STANDARD_UI_PUBLIC_URL, gateway_token)if public_ui_url and proxy_ok:st.caption(f"Embedded URL: {mask_token_in_url(public_ui_url)}")components.iframe(public_ui_url, height=560, scrolling=True)31 unmodified lines3233343536373839404142295 unmodified lines33833934034134234334434534634734834968 unmodified lines4184194204214224234244254264274281 unmodified line430431432433434435436437438439440441442443444445446447448449110 unmodified lines56056156256356456556656724 unmodified lines59259359459559659759831 unmodified linesOPENCLAW_STANDARD_UI_PUBLIC_URL = os.getenv("OPENCLAW_STANDARD_UI_PUBLIC_URL", "/openclaw/")OPENCLAW_GATEWAY_TOKEN = os.getenv("OPENCLAW_GATEWAY_TOKEN", "")OPENCLAW_STATE_CONFIG_PATH = Path(os.getenv("OPENCLAW_STATE_CONFIG_PATH", "/app/.openclaw/state/openclaw.json"))OPENCLAW_UI_QUERY_KEYS = [k.strip()for k in os.getenv("OPENCLAW_UI_QUERY_KEYS", "token,auth,access_token").split(",")if k.strip()]GATEWAY_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"295 unmodified linesreturn resp.json()def with_token(url: str, token: str, query_key: str = "token") -> str:if not token:return urlparts = urlsplit(url)query = dict(parse_qsl(parts.query, keep_blank_values=True))query.setdefault(query_key, token)return urlunsplit((parts.scheme, parts.netloc, parts.path, urlencode(query), parts.fragment))68 unmodified lines# 3) Validate token candidates against browser UI endpoint.for token in deduped:try:for key in OPENCLAW_UI_QUERY_KEYS:probe_url = with_token(OPENCLAW_STANDARD_UI_URL, token, key)resp = requests.get(probe_url, timeout=2, allow_redirects=True)if resp.status_code < 400:return tokenexcept Exception:continue1 unmodified linereturn resolve_gateway_token()def resolve_ui_query_key(token: str) -> str:if not token:return OPENCLAW_UI_QUERY_KEYS[0] if OPENCLAW_UI_QUERY_KEYS else "token"for key in OPENCLAW_UI_QUERY_KEYS:try:probe_url = with_token(OPENCLAW_STANDARD_UI_URL, token, key)resp = requests.get(probe_url, timeout=2, allow_redirects=True)if resp.status_code < 400:return keyexcept Exception:continuereturn OPENCLAW_UI_QUERY_KEYS[0] if OPENCLAW_UI_QUERY_KEYS else "token"def build_strategy_frame(data: pd.DataFrame, fast_period: int, slow_period: int) -> pd.DataFrame:frame = pd.DataFrame(index=data.index)frame["Close"] = data["Close"]110 unmodified lineslocal_status = "Unavailable"proxy_status = "Unavailable"gateway_token = resolve_ui_token()gateway_query_key = resolve_ui_query_key(gateway_token)std_ui_url = with_token(OPENCLAW_STANDARD_UI_URL, gateway_token, gateway_query_key)try:ui_resp = requests.get(std_ui_url, timeout=2, allow_redirects=True)local_ok = ui_resp.status_code < 50024 unmodified linesst.caption(f"Public URL: {OPENCLAW_STANDARD_UI_PUBLIC_URL}")with std_ui_embed_col:public_ui_url = with_token(OPENCLAW_STANDARD_UI_PUBLIC_URL, gateway_token, gateway_query_key)if public_ui_url and proxy_ok:st.caption(f"Embedded URL: {mask_token_in_url(public_ui_url)}")components.iframe(public_ui_url, height=560, scrolling=True)
4 unmodified lines5678910114 unmodified linesuser=root[program:openclaw]command=/bin/sh -lc "python /app/scripts/bootstrap_gateway_token.py && openclaw gateway run --port 18789 --allow-unconfigured --dev"autorestart=truestartsecs=5startretries=204 unmodified lines5678910114 unmodified linesuser=root[program:openclaw]command=/bin/sh -lc "AUTH_FILE=/app/.openclaw/state/agents/dev/agent/auth-profiles.json; if [ \"${OPENCLAW_ONBOARD_NONINTERACTIVE:-1}\" = \"1\" ] && [ ! -s \"$AUTH_FILE\" ]; then echo '[onboard] running non-interactive setup'; openclaw onboard --non-interactive --mode local --auth-choice custom-api-key --custom-base-url \"${OPENCLAW_CUSTOM_BASE_URL}\" --custom-model-id \"${OPENCLAW_CUSTOM_MODEL_ID}\" --gateway-port 18789 --gateway-bind loopback --skip-skills --accept-risk --secret-input-mode plaintext || true; fi; python /app/scripts/bootstrap_gateway_token.py; exec openclaw gateway run --port 18789 --allow-unconfigured --dev"autorestart=truestartsecs=5startretries=20
Dockerfile+3
app.py+29-8
supervisord.conf+1-1