Skip to main content

webui-csrf-origin

Fix CSRF origin mismatch when Hermes WebUI is proxied through NaN.builders or other reverse proxies.

跳到安装

来源信息

仓库
Ntizar/NtizarBrainMasterMind
最近来源活动
2026年7月7日 07:40
检测到的 SKILL.md 语言
西班牙语
星标
2
分支
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
webui-csrf-origin
description
Fix CSRF origin mismatch when Hermes WebUI is proxied through NaN.builders or other reverse proxies.
# WebUI CSRF Origin Mismatch ## Cuándo aplicar Si el WebUI de Hermes (puerto 8787) funciona por Telegram pero da **server error / 500 / "Cross-origin mismatch"** desde la web de NaN.builders (`https://webui-ntizar-ntizar.apps.nan.builders/`), el problema es CSRF. ## Causa El WebUI valida `Origin`/`Referer` contra `Host` en cada POST. Cuando NaN.builders hace proxy, el Origin del navegador es `https://webui-ntizar-ntizar.apps.nan.builders` pero el Host interno del contenedor es diferente → el WebUI rechaza la petición. ## Diagnóstico ```bash # Verificar si HERMES_WEBUI_ALLOWED_ORIGINS está configurado cat /proc/199/environ 2>/dev/null | tr '\0' '\n' | grep -i ALLOWED_ORIGINS # Si no devuelve nada → ese es el problema ``` ## Solución ```bash # Añadir la variable de entorno al contenedor # En Kubernetes, actualizar el deployment con: kubectl set env deployment/ntizar-agent \ HERMES_WEBUI_ALLOWED_ORIGINS=https://webui-ntizar-ntizar.apps.nan.builders # O editar el deployment directamente: kubectl edit deployment ntizar-agent # Añadir en spec.template.spec.containers[0].env: # - name: HERMES_WEBUI_ALLOWED_ORIGINS # value: "https://webui-ntizar-ntizar.apps.nan.builders" ``` Después de cambiar la variable, el contenedor se reinicia automáticamente (rolling update). ## Notas - El valor debe incluir el esquema (`https://`), no solo el dominio. - Si se usan múltiples dominios, separar por comas: `https://a.com,https://b.com`. - El WebUI también respeta `X-Forwarded-Host` y `X-Real-Host` como fallback para proxies reverso. - Esta protección existe para prevenir CSRF en despliegues públicos.
在 GitHub 查看