From 55effa204e934f70e6feffc76ac5faa6b4e8e60f Mon Sep 17 00:00:00 2001 From: O96u Date: Wed, 26 Aug 2026 17:14:50 +0800 Subject: [PATCH] =?UTF-8?q?release:=20v1.1.2=20=E2=80=94=20activity=20logs?= =?UTF-8?q?,=20storage=20filter,=20upload=20rate=20limits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bump version and changelog; fix lint issues before release. --- CHANGELOG.md | 21 ++- README.en.md | 5 +- README.md | 5 +- app/pages/logs.vue | 254 ++++++++++++++++---------------- package-lock.json | 4 +- package.json | 2 +- server/api/logs/index.get.ts | 4 +- server/utils/image-response.ts | 3 +- server/utils/rate-limit.test.ts | 4 +- 9 files changed, 161 insertions(+), 141 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39a2eb7..795162a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ 本仓库自 **v1.0.0** 起作为正式版维护;此前历史提交已归档重置。 +## [1.1.2] - 2026-08-26 + +### 新增 + +- 操作日志页(`/logs`):记录上传/删除,管理员可查看全部用户并筛选 +- 图库记录支持按存储后端筛选 +- 上传 IP / API Token 限流(15 分钟窗口) + +### 改进 + +- 操作日志记录存储后端;图库卡片可展示存储来源 +- 存储筛选下拉固定「本地磁盘」排在第二位 +- 系统设置页版本号链接至 GitHub Releases + +### 修复 + +- 修复删除存储后端后确认弹窗闪出空名称 + ## [1.1.1] - 2026-08-26 ### 修复 @@ -95,8 +113,9 @@ ### 路线图 -- **v1.1.1**(当前 `main`):会话校验与存储占位修复、Docker 日志增强 +- **v1.1.2**(当前 `main`):操作日志、图库存储筛选、上传限流 +[1.1.2]: https://github.com/O96u/PicHost/releases/tag/v1.1.2 [1.1.1]: https://github.com/O96u/PicHost/releases/tag/v1.1.1 [1.1.0]: https://github.com/O96u/PicHost/releases/tag/v1.1.0 [1.0.4]: https://github.com/O96u/PicHost/releases/tag/v1.0.4 diff --git a/README.en.md b/README.en.md index 2610a5c..92931ce 100644 --- a/README.en.md +++ b/README.en.md @@ -32,7 +32,7 @@ | Branch | Notes | | ------ | ----- | -| [**main**](https://github.com/O96u/PicHost/tree/main) (default) | **v1.1.1** — local disk + multi-backend object storage (R2 / COS / OSS / AWS), [`/storage`](docs/README.md) UI, hybrid URLs | +| [**main**](https://github.com/O96u/PicHost/tree/main) (default) | **v1.1.2** — local disk + multi-backend object storage (R2 / COS / OSS / AWS), [`/storage`](docs/README.md) UI, hybrid URLs | | [**cloudflare**](https://github.com/O96u/PicHost/tree/cloudflare) | **Cloudflare R2–only line** — streamlined for deployments that use R2 exclusively | Use **main** for the full product and multiple cloud backends. @@ -193,7 +193,8 @@ npm test # Unit tests | Version | Plan | | ---------- | -------------------------------------------------------------- | -| **v1.1.1** | Session check fixes, storage placeholder cleanup, Docker logging (current `main`) | +| **v1.1.2** | Activity logs, gallery storage filter, upload rate limits (current `main`) | +| **v1.1.1** | Session check fixes, storage placeholder cleanup, Docker logging | | **v1.1.0** | Multi-backend object storage, hybrid URLs, storage UI | | **v1.0.4** | Password visibility toggle, legacy ADMIN_SECRET migration | | **v1.0.3** | CI and Docker multi-arch build fixes | diff --git a/README.md b/README.md index 8079efb..833dbc3 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ | 分支 | 说明 | | ---- | ---- | -| [**main**](https://github.com/O96u/PicHost/tree/main)(默认) | **v1.1.1** 主线:本地磁盘 + 多对象存储后端(R2 / COS / OSS / AWS)、[`/storage`](docs/README.md) 存储管理、混合直链 | +| [**main**](https://github.com/O96u/PicHost/tree/main)(默认) | **v1.1.2** 主线:本地磁盘 + 多对象存储后端(R2 / COS / OSS / AWS)、[`/storage`](docs/README.md) 存储管理、混合直链 | | [**cloudflare**](https://github.com/O96u/PicHost/tree/cloudflare) | **Cloudflare R2 专用线**:面向「只用 R2」的部署,预设与配置更聚焦 R2 | 日常使用、需要管理多种存储后端,请直接用 **main**。 @@ -198,7 +198,8 @@ npm test # 单元测试 | 版本 | 说明 | | ---------- | ------------------------------------------------- | -| **v1.1.1** | 会话校验与存储占位修复、Docker 日志增强(当前 main) | +| **v1.1.2** | 操作日志、图库存储筛选、上传限流(当前 main) | +| **v1.1.1** | 会话校验与存储占位修复、Docker 日志增强 | | **v1.1.0** | S3 / R2 多后端对象存储、混合直链、存储管理页 | | **v1.0.4** | 密码显示切换、遗留 ADMIN_SECRET 迁移对齐 | | **v1.0.3** | CI 与 Docker 多架构构建修复 | diff --git a/app/pages/logs.vue b/app/pages/logs.vue index f3c7899..db9eee3 100644 --- a/app/pages/logs.vue +++ b/app/pages/logs.vue @@ -426,138 +426,138 @@ watch(isAuthenticated, async (authed, prev) => { diff --git a/package-lock.json b/package-lock.json index 33d3029..14ce9f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pichost", - "version": "1.1.1", + "version": "1.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pichost", - "version": "1.1.1", + "version": "1.1.2", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index a73c900..7a039fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pichost", - "version": "1.1.1", + "version": "1.1.2", "description": "Self-hosted image hosting for your NAS / home server — Nuxt admin UI, local disk or S3-compatible storage, server-side WebP compression, referer protection, Twikoo/EasyImage compatible.", "homepage": "https://github.com/O96u/PicHost#readme", "repository": { diff --git a/server/api/logs/index.get.ts b/server/api/logs/index.get.ts index b6b18bc..ffef5c1 100644 --- a/server/api/logs/index.get.ts +++ b/server/api/logs/index.get.ts @@ -93,8 +93,8 @@ export default defineEventHandler(async (event) => { summary, users: userMap ? Array.from(userMap.entries()) - .map(([id, username]) => ({ id, username })) - .sort((a, b) => a.username.localeCompare(b.username)) + .map(([id, username]) => ({ id, username })) + .sort((a, b) => a.username.localeCompare(b.username)) : undefined } } catch (error) { diff --git a/server/utils/image-response.ts b/server/utils/image-response.ts index 810918d..645295e 100644 --- a/server/utils/image-response.ts +++ b/server/utils/image-response.ts @@ -5,9 +5,8 @@ import type { StoredImage } from './storage' import { getImageBaseUrl } from './env' import { getActiveBackendRow } from './storage/resolver' import { getStorageBackendRow, getStorageBackendFromEnv } from './storage-backends' -import type { StorageBackendType } from './storage/types' +import type { StorageBackendType, StorageBackendRow } from './storage/types' import { buildObjectKey, parseS3Config } from './storage/s3' -import type { StorageBackendRow } from './storage/types' export function resolveImageOwner( userId: number | null | undefined, diff --git a/server/utils/rate-limit.test.ts b/server/utils/rate-limit.test.ts index 4b06dea..be06817 100644 --- a/server/utils/rate-limit.test.ts +++ b/server/utils/rate-limit.test.ts @@ -1,11 +1,11 @@ import { describe, expect, it, vi } from 'vitest' +import { checkUploadRateLimit } from './rate-limit' + vi.mock('./logger', () => ({ clientIp: (event: { __ip?: string }) => event.__ip ?? '127.0.0.1' })) -import { checkUploadRateLimit } from './rate-limit' - function mockEvent(ip = '127.0.0.1', authToken = '') { return { __ip: ip,