From e992b7fedd8e85f64819f6bc8a5b5677d1cc57b6 Mon Sep 17 00:00:00 2001 From: argszero Date: Thu, 3 Dec 2026 20:15:49 +0800 Subject: [PATCH] chore(release): v0.7.37 Cut v0.7.37 over the one commit since v0.7.36: the admin sharing overview (#457), which adds an admin-only GET /api/admin/sharings and a fifth "Sharing overview" tab in the admin view. Version string moved 0.7.36 -> 0.7.37 in the five carriers (8 places) and a matching CHANGELOG section. No schema change: SCHEMA_VERSION stays 18. cargo test 617/0 (616 at v0.7.36); fmt and clippy clean. --- CHANGELOG.md | 11 +++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- Dockerfile | 6 +++--- docker-compose.yml | 4 ++-- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75b0186..397a6bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes are recorded here. Versions follow [SemVer](https://semver.org/). +## v0.7.37 (2026-12-03) + +自 v0.7.36 起累计 1 个提交(#457)。**无 schema 变更(仍 18)**。这一版补上管理员侧的一块盲区:共享了哪些模型,此前只能从扁平的 key 列表里用眼睛拼。 + +- **管理端新增「共享概览」标签(#457,`bb6461b`)** — 宿主问的两个问题互为反面(「谁在共享」与「哪些模型被共享」),所以一次聚合同时答完:新端点 `GET /api/admin/sharings` 只读、非管理员一律 403,返回形状与 `GET /api/admin/usage` 一致 —— `users[]` 按共享者聚合并列出各自名下的模型,`models[]` 按 `(provider, model)` 聚合并列出共享者人数与名单,`totals` 给出去重后的两个数与三种状态的 key 数。数据源是 `keys` 表(一行=一次上架),共享者取 `owner_id`。管理界面在原有四个标签后加第五个「共享概览」,统计卡 + 两张表 + 搜索框,中英双包。 +- **两处刻意的口径** — ①`status = 'off'` 的行退出两张表(它不供货),但仍照实计入 `keys.off`,所以没有任何一行被隐藏,只是不再被算作「正在共享」;②`encrypted_key` 这一列**根本不进 `SELECT`**(连解密脱敏都不做),响应因此在结构上不可能带出明文、掩码或密文 —— 管理员在这里看到的是「谁 · 哪个模型 · 几条 · 用掉多少」。 +- **零 schema 变更、零新索引** — 聚合读的都是已有列;`keys.owner_id` 刻意不加索引(上架表里一个成员的条数是个位数,全表扫比动 `SCHEMA_VERSION` 便宜)。 +- 新测试 `routes::tests::admin_sharings_lists_who_shared_what` 一条四条断言:非管理员 403;成员各一条且只列自己的模型;两人共享同一模型时人数是 2 而不是 2 条上架;`off` 行退出名册但仍被计数、且响应里没有任何 key 值。 + +`cargo test` **616 → 617**。UI 资产令牌:`app.js` `?v=20261203-1`、`i18n.js` `?v=20261203-1`、`style.css` `?v=20261012-1`、`api.js` `?v=20261012-1`、`data.js` `?v=20261017-2`。 + ## v0.7.36 (2026-12-03) 自 v0.7.35 起累计 5 个提交(#449–#454)。**无 schema 变更(仍 18)**。这一版全在「说的事和做的不一致」上:两处门禁放过了它本该拦下的写法、两处散文把不存在的机制说成事实,另有一处端点不认协议自己的凭据。 diff --git a/Cargo.lock b/Cargo.lock index 3c2ae70..c4cdf54 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -51,7 +51,7 @@ dependencies = [ [[package]] name = "aitokenpool" -version = "0.7.36" +version = "0.7.37" dependencies = [ "aes-gcm", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 6c34141..b4fda19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aitokenpool" -version = "0.7.36" +version = "0.7.37" edition = "2021" description = "AI Token 共享池 — 企业 key 池 + 公共共享市场" license = "MIT" diff --git a/Dockerfile b/Dockerfile index 3445b28..34f31b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -# AITokenPool — multi-stage release image (v0.7.36) +# AITokenPool — multi-stage release image (v0.7.37) # -# Build: docker build -t aitokenpool:0.7.36 . +# Build: docker build -t aitokenpool:0.7.37 . # Run: docker run -p 8080:8080 -v "$PWD/atp-data:/data" \ # -e ATP_MASTER_KEY="$(openssl rand -hex 32)" \ -# aitokenpool:0.7.36 +# aitokenpool:0.7.37 # # Notes: # - unified data dir (rant 2026-08-19T20:53:23): ATP_DATA_DIR=/data holds diff --git a/docker-compose.yml b/docker-compose.yml index c160a15..f9651e8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -# AITokenPool — Docker Compose 一键部署(v0.7.36) +# AITokenPool — Docker Compose 一键部署(v0.7.37) # # 快速开始: # export ATP_MASTER_KEY=$(openssl rand -hex 32) # 必填,见下方说明 @@ -16,7 +16,7 @@ services: aitokenpool: build: . - image: aitokenpool:0.7.36 + image: aitokenpool:0.7.37 ports: - "8080:8080" volumes: