Ingress: use X-Ingress-Path for token redirect w/ trailing slash; bump 0.3.8

This commit is contained in:
root
2026-01-30 02:05:57 +02:00
parent 582e5f367a
commit 9fa6090655
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: Moltbot Assistant name: Moltbot Assistant
version: "0.3.7" version: "0.3.8"
slug: moltbot_assistant slug: moltbot_assistant
description: Run Moltbot Assistant (Clawdbot-compatible) as a Home Assistant add-on. description: Run Moltbot Assistant (Clawdbot-compatible) as a Home Assistant add-on.
url: https://github.com/techartdev/ClawdHAAddOn url: https://github.com/techartdev/ClawdHAAddOn
+8
View File
@@ -37,8 +37,16 @@ http {
# out of ingress (to the HA host root). So we use a *relative* redirect. # out of ingress (to the HA host root). So we use a *relative* redirect.
# Only redirect the root document to add token in the browser URL. # Only redirect the root document to add token in the browser URL.
# NOTE: Home Assistant Ingress can expose the add-on at a path like:
# /hassio/ingress/<slug>
# which may not end in a slash. Some clients compute relative URLs (including WS)
# incorrectly if the URL doesn't end in '/'. HA often provides the original ingress
# path via X-Ingress-Path; if present, redirect to that path with a trailing slash.
location = / { location = / {
if ($arg_token = "") { if ($arg_token = "") {
if ($http_x_ingress_path != "") {
return 302 $http_x_ingress_path/?token=__GATEWAY_TOKEN__;
}
return 302 ?token=__GATEWAY_TOKEN__; return 302 ?token=__GATEWAY_TOKEN__;
} }