From 94539cf074488759a500efe4402ae0b47da2eadb Mon Sep 17 00:00:00 2001 From: nesquena-hermes Date: Sat, 26 Sep 2026 05:01:24 +0000 Subject: [PATCH] docs(zh): correct the .env precedence note for start.ps1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new "改完密码先验证一下" note said start.sh, start.ps1 and bootstrap.py all let repo-.env values override an inline HERMES_WEBUI_PASSWORD. That holds for start.sh (`set -a; source .env` runs before anything else), but start.ps1 skips any .env key that is already set in the environment (start.ps1:70-72), so on native Windows the `$env:HERMES_WEBUI_PASSWORD` shown in this section wins. start.ps1 runs server.py directly, so the suggested HERMES_WEBUI_PRESERVE_ENV=1 did not apply to it either. Keep the useful advice (check the login page actually asks for the new password, and look for a stale value in .env), state the correct precedence for each launcher, and drop the PRESERVE_ENV suggestion. Co-authored-by: happy5318 <34227488+happy5318@users.noreply.github.com> --- docs/remote-access-zh.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/remote-access-zh.md b/docs/remote-access-zh.md index b9d701c7..d4b37260 100644 --- a/docs/remote-access-zh.md +++ b/docs/remote-access-zh.md @@ -160,13 +160,13 @@ $env:HERMES_WEBUI_PASSWORD = "你的密码" > **绑定 `0.0.0.0` 前先设密码**:一旦绑定所有接口,任何能路由到该端口的设备 > 都能触达界面,密码认证是唯一防线。参见文末"安全边界"。 > -> **改完密码先验证一下**:`start.sh` / `start.ps1` / `bootstrap.py` 都会 -> 加载仓库根目录的 `.env`,且 `.env` 里的值会**覆盖**命令行内联的 -> `HERMES_WEBUI_PASSWORD=`。如果你以前在 `.env` 里写过旧密码、现在又 -> 想换成新的,单纯在命令行里 export 是没用的——`.env` 里的旧值会盖掉它。 -> 改完密码后用浏览器打开登录页确认**真的要求输入密码**,没有跳过直接 -> 进入主界面就说明 `.env` 还在用旧值,需要先清理或显式 -> `HERMES_WEBUI_PRESERVE_ENV=1`(仅 `bootstrap.py` 支持)再启动。 +> **改完密码先验证一下**:`start.ps1` 会加载仓库根目录的 `.env`,但 +> **已经设置的环境变量优先**——上面用 `$env:HERMES_WEBUI_PASSWORD` +> 设的值会生效,`.env` 里的同名项被跳过。Linux / WSL 下的 `start.sh` +> 恰好相反:它会先 `source` 一遍 `.env`,**`.env` 里的值会覆盖**命令行 +> 内联的 `HERMES_WEBUI_PASSWORD=`。无论用哪个启动脚本,改完密码后都用 +> 浏览器打开登录页,确认**真的要求输入密码**且新密码能登录;不对的话, +> 先检查仓库根目录的 `.env` 里是否还留着旧值。 ### 3. Windows 防火墙