> For the complete documentation index, see [llms.txt](https://summerain-1.gitbook.io/summerain/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://summerain-1.gitbook.io/summerain/zh-cn/fa-bu-shuo-ming/v2.0.6.md).

# V2.0.6

> 开发预发布版本。此版本从 `dev` 分支发布，后续修改可能较为频繁， 并且不会被默认的 `latest` 镜像选中。

## 概述

v2.0.6 将需要重启才能生效的后端性能限制迁移到部署环境变量。每个限制只在启动时读取和 校验一次，不能通过管理员 API 修改，不会返回给前端，并在启动日志中以不含凭据的方式输出摘要。

配置错误现在会在连接 MySQL 或 Redis 之前终止进程，因此非法部署会快速失败， 而不是带着意外的资源行为启动。

此版本不新增数据库结构版本，不改变 HTTP 或上传 API，也不改变图片处理配方。

## 变更

### 启动级限制

* `MAX_JSON_BODY_BYTES` 限制普通 JSON 请求体。默认 1048576，范围 1 KiB 到 16 MiB。
* `V2_INIT_MAX_JSON_BYTES` 限制 V2 上传清单。默认 65536，范围 1 KiB 到 1 MiB， 且不得超过 `MAX_JSON_BODY_BYTES`。
* `V2_BATCH_STATUS_MAX_JSON_BYTES` 限制批量状态查询请求。默认 16384， 范围 1 KiB 到 256 KiB，且不得超过 `MAX_JSON_BODY_BYTES`。
* `V2_MAX_ACTIVE_SESSIONS_PER_USER` 限制单用户并发的 V2 上传会话。默认 8，范围 1 到 32。
* `V1_DYNAMIC_GENERATION_CONCURRENCY` 决定 V1 动态转换信号量大小。默认 2，范围 1 到 16。
* `V1_DYNAMIC_GENERATION_QUEUE_DEPTH` 决定 V1 等待队列深度。默认 4，范围 0 到 64。
* `V1_BACKGROUND_FORMAT_CONCURRENCY` 决定 V1 后台格式转换 worker 数量。默认 1，范围 1 到 8。

### 接线与可观测性

* V1 动态转换和后台格式信号量在启动时按校验后的配置创建。
* V2 活动会话上限改为按配置执行，不再使用代码常量。
* 全局 JSON 中间件和 V2 上传处理器使用配置的请求体限制。
* 启动日志按配置分组输出非敏感摘要行；凭据、密钥和连接串不会出现在日志中。

### 部署示例

* `backend/.env.example` 记录了所有新增变量，依赖锁校验会断言它们存在。

## 验证

* 后端 `go test ./...`：通过。
* 后端 `go vet ./...`：通过。
* 后端 `go build ./...`：通过。
* 单元测试覆盖默认值、可接受边界、非法值、JSON 限制关系，以及启动摘要不包含密钥。
* 运行时检查：非法值在启动前以明确错误退出；自定义值出现在启动日志中。
* Python requirements 锁文件校验：通过。
* GitBook 文档与翻译校验：通过。

## 安装

开发镜像必须显式拉取：

```bash
docker pull jaykserks/summerain:dev-v2.0.6
```

等效的精确开发标签：

```
jaykserks/summerain:dev-2.0.6
```

滚动的 `dev` 标签也会指向最新一次成功的开发构建。此版本不会修改 `latest`、`main` 以及稳定的语义化版本别名。

从 v2.0.5 升级不需要数据库迁移或 API 迁移。

## 已知限制

* 这些限制只在启动时读取，修改后需要重启。
* V1 响应大小限制和生成超时仍是代码常量，计划在后续版本提供。
* 完整的固定图片配方仍属于服务器端职责，计划在后续版本提供。
* 动图支持仍计划在后续版本提供。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://summerain-1.gitbook.io/summerain/zh-cn/fa-bu-shuo-ming/v2.0.6.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
