[R5] /assets 上传与下载 #5

Closed
opened 2026-11-08 23:06:07 +00:00 by keith · 1 comment
Owner

部署背景

单域名 https://wire.treeden.app:根路径由 wire-webapp 提供静态前端(Express 服务);/api/* 与 /ws/* 由 Caddy 反代到 wire-rs,并剥离前缀(handle_path)。前端配置 BACKEND_REST=https://wire.treeden.app/api、BACKEND_WS=wss://wire.treeden.app/ws。

现象与冒烟证据

wire-rs 未实现 /assets,头像与文件消息无法使用。

冒烟测试(2026-11-09,wire-rs ccecae5 release 构建):/healthz 200、/api-version 200(supported 0–19,development 19)、POST /register 201、POST /login 200(zuid cookie:Path=/access; Secure; HttpOnly; SameSite=Lax)、GET /self 200、POST /access 200、GET /conversations 200、/await WebSocket 101;而 /v6/self 404、/feature-configs 404、/properties 404、/teams 404、/list-connections 404、/notifications/last 404、/calls/config/v2 404、/system/settings/unauthorized 404、/conversations/list-ids 400(被当作会话 ID 解析)、/mls/public-keys 400(未配置 removal key)。

期望行为

实现资源上传/下载(本地文件存储即可),返回与参考实现一致的 key/token。

涉及文件/模块

  • src/http.rs
  • src/assets/(新增)
  • migrations/

工作量估计

L(3–5 天)

## 部署背景 单域名 https://wire.treeden.app:根路径由 wire-webapp 提供静态前端(Express 服务);`/api/*` 与 `/ws/*` 由 Caddy 反代到 wire-rs,并剥离前缀(handle_path)。前端配置 `BACKEND_REST=https://wire.treeden.app/api`、`BACKEND_WS=wss://wire.treeden.app/ws`。 ## 现象与冒烟证据 wire-rs 未实现 `/assets`,头像与文件消息无法使用。 冒烟测试(2026-11-09,wire-rs `ccecae5` release 构建):`/healthz` 200、`/api-version` 200(supported 0–19,development 19)、`POST /register` 201、`POST /login` 200(`zuid` cookie:`Path=/access; Secure; HttpOnly; SameSite=Lax`)、`GET /self` 200、`POST /access` 200、`GET /conversations` 200、`/await` WebSocket 101;而 `/v6/self` 404、`/feature-configs` 404、`/properties` 404、`/teams` 404、`/list-connections` 404、`/notifications/last` 404、`/calls/config/v2` 404、`/system/settings/unauthorized` 404、`/conversations/list-ids` 400(被当作会话 ID 解析)、`/mls/public-keys` 400(未配置 removal key)。 ## 期望行为 实现资源上传/下载(本地文件存储即可),返回与参考实现一致的 key/token。 ## 涉及文件/模块 - `src/http.rs` - `src/assets/(新增)` - `migrations/` ## 工作量估计 L(3–5 天)
keith changed title from [R6] /assets 上传与下载 to [R5] /assets 上传与下载 2026-11-08 23:40:44 +00:00
Author
Owner

已实现并通过 M11 验收

/assets 本地上传/下载/删除:手写有界 multipart/mixed 解析(上限 25 MiB)、token 与 public 两种生命周期、路径穿越防护、迁移 0010 元数据持久化。

已知限制:本地文件无 GC;expires 只存不判;下载有界缓冲;错误标签为项目定稿(如 413 asset-too-large);ASSETS_DIR 未设置时资产路由返回 500。

M11 accepted · commit 56437e7 · doc docs/milestones/M11.md · gates: default 886 / test:db 177 (14 suites) / interop 971 / live 14 (×3, no flake) · integration agent 221 real-process assertions.

## 已实现并通过 M11 验收 `/assets` 本地上传/下载/删除:手写有界 multipart/mixed 解析(上限 25 MiB)、token 与 public 两种生命周期、路径穿越防护、迁移 0010 元数据持久化。 已知限制:本地文件无 GC;`expires` 只存不判;下载有界缓冲;错误标签为项目定稿(如 `413 asset-too-large`);`ASSETS_DIR` 未设置时资产路由返回 500。 M11 accepted · commit `56437e7` · doc `docs/milestones/M11.md` · gates: default **886** / test:db **177 (14 suites)** / interop **971** / live **14** (×3, no flake) · integration agent 221 real-process assertions.
keith closed this issue 2026-11-09 14:02:18 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
keith/wire-rs#5
No description provided.