diff --git a/openclaw_assistant/Dockerfile b/openclaw_assistant/Dockerfile index b9d9db1..e460de4 100644 --- a/openclaw_assistant/Dockerfile +++ b/openclaw_assistant/Dockerfile @@ -48,6 +48,7 @@ RUN npm config set fund false && npm config set audit false \ COPY run.sh /run.sh COPY nginx.conf.tpl /etc/nginx/nginx.conf.tpl +COPY landing.html.tpl /etc/nginx/landing.html.tpl RUN chmod +x /run.sh \ && mkdir -p /run/nginx diff --git a/openclaw_assistant/config.yaml b/openclaw_assistant/config.yaml index 2853ab6..ee0562d 100644 --- a/openclaw_assistant/config.yaml +++ b/openclaw_assistant/config.yaml @@ -1,5 +1,5 @@ name: OpenClaw Assistant -version: "0.5.4" +version: "0.5.6" slug: openclaw_assistant description: Run OpenClaw Assistant (OpenClaw-compatible) as a Home Assistant add-on. url: https://github.com/techartdev/OpenClawHomeAssistant diff --git a/openclaw_assistant/landing.html.tpl b/openclaw_assistant/landing.html.tpl new file mode 100644 index 0000000..99228bf --- /dev/null +++ b/openclaw_assistant/landing.html.tpl @@ -0,0 +1,60 @@ + + + + + + OpenClaw Assistant + + + +
+

OpenClaw Assistant

+ +
+ Open Gateway Web UI + Open Terminal (full page) +
+ +
+ Tip: The gateway UI is intentionally opened outside of Ingress to avoid websocket/proxy issues. + Configure gateway_public_url in the add-on options, then complete onboarding in the terminal. +
+ + + +
+ +
+
+ + diff --git a/openclaw_assistant/nginx.conf.tpl b/openclaw_assistant/nginx.conf.tpl index f0091de..e48f913 100644 --- a/openclaw_assistant/nginx.conf.tpl +++ b/openclaw_assistant/nginx.conf.tpl @@ -44,64 +44,11 @@ http { } # Landing page (shown inside HA Ingress) - # - Shows the web terminal (if enabled) - # - Provides a button to open the Gateway Web UI in a separate tab (not embedded) + # Served as a real HTML file to avoid fragile quoting inside nginx.conf. location = / { + root /etc/nginx/html; default_type text/html; - - # NOTE: __GATEWAY_PUBLIC_URL__ is configured via add-on option gateway_public_url. - # We keep it flexible because the right URL depends on how the user exposes HA/gateway - # (Nabu Casa, DuckDNS, LAN, etc.). - - return 200 ' - OpenClaw Assistant - - -
-

OpenClaw Assistant

-
- Open Gateway Web UI - Open Terminal (full page) -
-
- Tip: The gateway UI is intentionally opened outside of Ingress to avoid websocket/proxy issues. - Configure gateway_public_url in the add-on options, then complete onboarding in the terminal. -
- -
- -
-
- '; + try_files /index.html =404; } # (Optional) Gateway UI via ingress has been intentionally removed. diff --git a/openclaw_assistant/run.sh b/openclaw_assistant/run.sh index 201d301..b8c266a 100644 --- a/openclaw_assistant/run.sh +++ b/openclaw_assistant/run.sh @@ -179,6 +179,7 @@ import os from pathlib import Path tpl = Path('/etc/nginx/nginx.conf.tpl').read_text() +landing_tpl = Path('/etc/nginx/landing.html.tpl').read_text() public_url = os.environ.get('GW_PUBLIC_URL','') # Best-effort: read token from OpenClaw config if it exists and is strict JSON. @@ -193,11 +194,17 @@ try: except Exception: token = '' -conf = tpl.replace('__GATEWAY_TOKEN__', token) -conf = conf.replace('__GATEWAY_PUBLIC_URL__', public_url) -conf = conf.replace('__GW_PUBLIC_URL_PATH__', '' if public_url.endswith('/') else '/') +gw_path = '' if public_url.endswith('/') else '/' +conf = tpl Path('/etc/nginx/nginx.conf').write_text(conf) + +landing = landing_tpl.replace('__GATEWAY_TOKEN__', token) +landing = landing.replace('__GATEWAY_PUBLIC_URL__', public_url) +landing = landing.replace('__GW_PUBLIC_URL_PATH__', gw_path) + +Path('/etc/nginx/html').mkdir(parents=True, exist_ok=True) +Path('/etc/nginx/html/index.html').write_text(landing) PY echo "Starting ingress proxy (nginx) on :8099 ..."