Parcourir la source

【维护,构建】升级 dsh 版本至 0.2.2-rc.5

Merge pull request #25 from Xidong-AI/auto-upgrade/dsh
PJ568 il y a 1 semaine
Parent
commit
f8664eeaef
4 fichiers modifiés avec 15 ajouts et 15 suppressions
  1. 1 1
      Dockerfile
  2. 6 6
      README.md
  3. 7 7
      README.zh.md
  4. 1 1
      docker-compose.yml

+ 1 - 1
Dockerfile

@@ -20,7 +20,7 @@
 # so agents can compile native modules (e.g. plugin node-pty) at runtime as a fallback.
 # See the runtime stage notes for the trade-off.
 
-ARG DSH_VERSION=0.2.2-rc.1
+ARG DSH_VERSION=0.2.2-rc.5
 
 # Caddy 官方镜像
 # 静态二进制,与平台无关

+ 6 - 6
README.md

@@ -9,7 +9,7 @@ Containerized deployment of the [DeepSeek Harness](https://github.com/deepseek-a
 ## Features
 
 - Self-contained single container: dsh (loopback only, inside the container) + Caddy pure reverse proxy (Host/Origin rewritten to loopback for the dsh anti-DNS-rebinding fence)
-- **Authentication since dsh 0.2.2-rc.1**: moved into dsh itself. On first start, dsh prints a one-time `?token=…` URL; the browser exchanges it for a persistent cookie (survives restarts). Caddy basic auth was removed in 0.2.2-rc.1+ (would have intercepted the browser's first redirect and hidden the token URL)
+- **Authentication since dsh 0.2.2-rc.5**: moved into dsh itself. On first start, dsh prints a one-time `?token=…` URL; the browser exchanges it for a persistent cookie (survives restarts). Caddy basic auth was removed in 0.2.2-rc.5+ (would have intercepted the browser's first redirect and hidden the token URL)
 - Configuration and project/session data persisted: bind mount `./data` → `/home/node` (the whole HOME: settings.yaml, API Key, profiles, sessions, storages, plus agent-installed tools under `~/.x-cmd.root`)
 - Runs as non-root (uid 1000); dsh is not exposed directly
 - Built-in health check: `docker compose ps` shows the real service health (`starting`/`healthy`/`unhealthy`), exchanging the one-time token for a cookie and probing dsh
@@ -30,14 +30,14 @@ cp .env.example .env    # edit DEEPSEEK_API_KEY (DSH_AUTH_USER/PASSWORD are now
 docker compose up -d    # pull the latest image and start
 ```
 
-> ⚠️ **升级警告 — 升级到含 dsh 0.2.2-rc.1+ 鉴权迁移的版本时,必须先 `git pull` 同步 `docker-compose.yml` / `Caddyfile` / `entrypoint.sh` / `entrypoint.sh 内的 token 抓取后台任务`,仅 `docker compose pull` 拉新 image 配旧 compose 文件会导致 healthcheck 永远 unhealthy 且 web 服务裸奔 (无鉴权)。** 具体见 PR #7 的 commit message 与 DESIGN.md §10 的版本演进记录。
+> ⚠️ **升级警告 — 升级到含 dsh 0.2.2-rc.5+ 鉴权迁移的版本时,必须先 `git pull` 同步 `docker-compose.yml` / `Caddyfile` / `entrypoint.sh` / `entrypoint.sh 内的 token 抓取后台任务`,仅 `docker compose pull` 拉新 image 配旧 compose 文件会导致 healthcheck 永远 unhealthy 且 web 服务裸奔 (无鉴权)。** 具体见 PR #7 的 commit message 与 DESIGN.md §10 的版本演进记录。
 
 ### Option 2: Build locally
 
 ```bash
 docker compose up -d --build
 # or pin a dsh version:
-docker build --build-arg DSH_VERSION=0.2.2-rc.1 -t dsh-web:latest .
+docker build --build-arg DSH_VERSION=0.2.2-rc.5 -t dsh-web:latest .
 ```
 
 After startup, **read the one-time launch URL** with one of:
@@ -56,8 +56,8 @@ Then open the printed URL (e.g. `http://<host>:3080/?token=…`) in a browser. T
 
 | Variable | Required | Default | Description |
 | --- | --- | --- | --- |
-| `DSH_AUTH_USER` | No (since 0.2.2-rc.1) | `admin` | Was: Basic Auth username. Now kept only for rollback to ≤0.1.1 series; ignored on 0.2.2-rc.1+ |
-| `DSH_AUTH_PASSWORD` | No (since 0.2.2-rc.1) | None | Was: Basic Auth plaintext password (bcrypt hash auto-generated). Now kept only for rollback to ≤0.1.1 series |
+| `DSH_AUTH_USER` | No (since 0.2.2-rc.5) | `admin` | Was: Basic Auth username. Now kept only for rollback to ≤0.1.1 series; ignored on 0.2.2-rc.5+ |
+| `DSH_AUTH_PASSWORD` | No (since 0.2.2-rc.5) | None | Was: Basic Auth plaintext password (bcrypt hash auto-generated). Now kept only for rollback to ≤0.1.1 series |
 | `DEEPSEEK_API_KEY` | Yes | None | DeepSeek API Key (referenced by the provider via apiKeyEnv) |
 | `DSH_WEB_PORT` | No | `3080` | Host port exposed to the outside (change it when it conflicts with an existing service) |
 | `DSH_TRUSTED_HOSTS` | No | Empty | Comma-separated extra trusted hosts, injected into the profile's `cordis.patch.yml` (only when the file is absent or still the empty template; user-maintained files are skipped — edit the file directly); by default Caddy rewrites Host/Origin to loopback, which covers normal access |
@@ -126,7 +126,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends <pkg> \
 
 ## Changing the Password / Resetting Auth
 
-**dsh 0.2.2-rc.1+ (current)**: dsh's persistent cookie is the auth, kept in `./data/.dsh/.credentials.yaml`. To reset after a suspected leak, you **must** rebuild the data volume — `docker compose down -v && docker compose up -d`. The next browser visit uses a new one-time token URL (`docker exec dsh-web cat /home/node/.dsh/web-launch-url.txt`).
+**dsh 0.2.2-rc.5+ (current)**: dsh's persistent cookie is the auth, kept in `./data/.dsh/.credentials.yaml`. To reset after a suspected leak, you **must** rebuild the data volume — `docker compose down -v && docker compose up -d`. The next browser visit uses a new one-time token URL (`docker exec dsh-web cat /home/node/.dsh/web-launch-url.txt`).
 
 > ⚠️ `down -v` is destructive: it also wipes `./data/.dsh/` (settings, profiles, sessions, agent-installed tools under `~/.x-cmd.root`). There is no lighter reset path — the entrypoint's token-extraction background task is one-shot (`grep -m1`), so a single-file `.credentials.yaml` delete plus container restart will NOT refresh the token URL. If you need to preserve session data, take a backup of `./data/.dsh/` before `down -v` and restore specific subpaths afterwards (e.g. `.dsh/profiles/`, `.dsh/AGENTS.md`).
 

+ 7 - 7
README.zh.md

@@ -9,7 +9,7 @@
 ## 特性
 
 - 单容器自包含:dsh(仅容器内 loopback)+ Caddy 纯反代(无鉴权,Host/Origin 改写为 loopback 配合 dsh 防 DNS rebinding 的 fence)
-- **dsh 0.2.2-rc.1+ 鉴权**:迁回 dsh 自身。dsh 启动时打印一次性 `?token=…` URL,浏览器首次访问该 URL 后 303 跳转并 Set-Cookie,cookie 持久化在数据卷(容器重启后仍有效)。Caddy basic auth 自 0.2.2-rc.1 起移除(旧版会拦截首次重定向、把 dsh 的 token URL 藏住,浏览器根本拿不到)
+- **dsh 0.2.2-rc.5+ 鉴权**:迁回 dsh 自身。dsh 启动时打印一次性 `?token=…` URL,浏览器首次访问该 URL 后 303 跳转并 Set-Cookie,cookie 持久化在数据卷(容器重启后仍有效)。Caddy basic auth 自 0.2.2-rc.5 起移除(旧版会拦截首次重定向、把 dsh 的 token URL 藏住,浏览器根本拿不到)
 - 配置与项目/会话数据持久化:bind mount `./data` → `/home/node`(整个 HOME:settings.yaml、API Key、profiles、sessions、storages,及 agent 自装工具 `~/.x-cmd.root`)
 - 非 root 运行(uid 1000),dsh 不直接对外暴露
 - 内置健康检查:`docker compose ps` 直接可见服务真实健康状态(抓 dsh 一次性 token 换 cookie 后探测 dsh 响应,`starting`/`healthy`/`unhealthy`)
@@ -26,18 +26,18 @@
 ```bash
 git clone https://github.com/Xidong-AI/deepseek-harness-web-docker
 cd deepseek-harness-web-docker
-cp .env.example .env    # 编辑 DEEPSEEK_API_KEY(DSH_AUTH_USER/PASSWORD 自 0.2.2-rc.1 起可选,仅回退到 ≤0.1.1 系列时需要)
+cp .env.example .env    # 编辑 DEEPSEEK_API_KEY(DSH_AUTH_USER/PASSWORD 自 0.2.2-rc.5 起可选,仅回退到 ≤0.1.1 系列时需要)
 docker compose up -d    # 拉取 latest 镜像并启动
 ```
 
-> ⚠️ **升级警告 — 升级到含 dsh 0.2.2-rc.1+ 鉴权迁移的版本时,必须先 `git pull` 同步 `docker-compose.yml` / `Caddyfile` / `entrypoint.sh` 内的 token 抓取后台任务,仅 `docker compose pull` 拉新 image 配旧 compose 文件会导致 healthcheck 永远 unhealthy 且 web 服务裸奔 (无鉴权)。** 具体见 PR #7 的 commit message 与 DESIGN.md §10 的版本演进记录。
+> ⚠️ **升级警告 — 升级到含 dsh 0.2.2-rc.5+ 鉴权迁移的版本时,必须先 `git pull` 同步 `docker-compose.yml` / `Caddyfile` / `entrypoint.sh` 内的 token 抓取后台任务,仅 `docker compose pull` 拉新 image 配旧 compose 文件会导致 healthcheck 永远 unhealthy 且 web 服务裸奔 (无鉴权)。** 具体见 PR #7 的 commit message 与 DESIGN.md §10 的版本演进记录。
 
 ### 方式二:本地构建
 
 ```bash
 docker compose up -d --build
 # 或指定 dsh 版本:
-docker build --build-arg DSH_VERSION=0.2.2-rc.1 -t dsh-web:latest .
+docker build --build-arg DSH_VERSION=0.2.2-rc.5 -t dsh-web:latest .
 ```
 
 启动后**先取一次性启动 URL**,任选一种方式:
@@ -56,8 +56,8 @@ docker exec dsh-web cat /home/node/.dsh/web-launch-url.txt
 
 | 变量 | 必填 | 默认 | 说明 |
 | --- | --- | --- | --- |
-| `DSH_AUTH_USER` | 否(自 0.2.2-rc.1) | `admin` | 旧版 basic auth 用户名;0.2.2-rc.1+ 已忽略,仅作回退兼容位 |
-| `DSH_AUTH_PASSWORD` | 否(自 0.2.2-rc.1) | 无 | 旧版 basic auth 明文密码(容器启动时自动生成 bcrypt 哈希);0.2.2-rc.1+ 已忽略,仅作回退兼容位 |
+| `DSH_AUTH_USER` | 否(自 0.2.2-rc.5) | `admin` | 旧版 basic auth 用户名;0.2.2-rc.5+ 已忽略,仅作回退兼容位 |
+| `DSH_AUTH_PASSWORD` | 否(自 0.2.2-rc.5) | 无 | 旧版 basic auth 明文密码(容器启动时自动生成 bcrypt 哈希);0.2.2-rc.5+ 已忽略,仅作回退兼容位 |
 | `DEEPSEEK_API_KEY` | 是 | 无 | DeepSeek API Key(provider 经 apiKeyEnv 引用) |
 | `DSH_WEB_PORT` | 否 | `3080` | 宿主机对外端口(与已有服务冲突时修改) |
 | `DSH_TRUSTED_HOSTS` | 否 | 空 | 逗号分隔的额外受信 Host,注入 profile 的 `cordis.patch.yml`(仅当该文件不存在或仍为空模板时自动注入;已维护则跳过,请直接编辑该文件);默认靠 Caddy 改写 Host/Origin 为 loopback 已覆盖常规访问 |
@@ -126,7 +126,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends <pkg> \
 
 ## 修改密码 / 重置鉴权
 
-**dsh 0.2.2-rc.1+(当前)**:dsh 持久 cookie 是鉴权载体,存于 `./data/.dsh/.credentials.yaml`。怀疑泄露需重置时,**必须**重建数据卷 — `docker compose down -v && docker compose up -d`。下次浏览器访问需用新的一次性 token URL(`docker exec dsh-web cat /home/node/.dsh/web-launch-url.txt`)。
+**dsh 0.2.2-rc.5+(当前)**:dsh 持久 cookie 是鉴权载体,存于 `./data/.dsh/.credentials.yaml`。怀疑泄露需重置时,**必须**重建数据卷 — `docker compose down -v && docker compose up -d`。下次浏览器访问需用新的一次性 token URL(`docker exec dsh-web cat /home/node/.dsh/web-launch-url.txt`)。
 
 > ⚠️ `down -v` 是破坏性操作:会同时清空 `./data/.dsh/`(settings、profiles、sessions,及 agent 自装工具 `~/.x-cmd.root`)。目前没有更轻量的重置路径 — entrypoint 的 token 抓取后台任务是单次执行(`grep -m1`),仅删 `.credentials.yaml` 后重启容器**不会**重抓 token URL。如需保留会话数据,先备份 `./data/.dsh/`,重置后按需恢复子路径(如 `.dsh/profiles/`、`.dsh/AGENTS.md`)。
 

+ 1 - 1
docker-compose.yml

@@ -13,7 +13,7 @@ services:
     build:
       context: .
       args:
-        DSH_VERSION: ${DSH_VERSION:-0.2.2-rc.1}
+        DSH_VERSION: ${DSH_VERSION:-0.2.2-rc.5}
     container_name: dsh-web
     restart: unless-stopped
     ports: