From 2c7319c22080d60085004748b9eda493ce03e609 Mon Sep 17 00:00:00 2001 From: xfy Date: Mon, 22 Jun 2026 13:20:31 +0800 Subject: [PATCH] docs(env): translate .env.example comments to Chinese MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 纯文档翻译,无行为变化。把英文注释全部译为中文,保持原有中文注释 (限流段)和变量名、默认值、文件结构不变。 --- .env.example | 65 ++++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/.env.example b/.env.example index 1016297..d876f70 100644 --- a/.env.example +++ b/.env.example @@ -19,57 +19,56 @@ RATE_LIMIT_COMMENT_BURST=5 RATE_LIMIT_UNKNOWN_PER_SEC=30 RATE_LIMIT_UNKNOWN_BURST=100 -# Security -# Trusted origin for CSRF checks on write requests (POST/PUT/PATCH/DELETE). -# Set to your production origin, e.g. https://your-domain.example. -# Unset: falls back to the request Host header + X-Forwarded-Proto (behind a reverse proxy). +# Security 安全相关 +# 写请求(POST/PUT/PATCH/DELETE)CSRF 校验的可信来源。 +# 生产环境设为你的源站,例如 https://your-domain.example。 +# 不设:回退到请求的 Host 头 + X-Forwarded-Proto(在反向代理后生效)。 APP_BASE_URL= -# Set true/1/yes to add the Secure flag to the session cookie (enable in HTTPS production). +# 设为 true/1/yes 给会话 cookie 加上 Secure 标志(HTTPS 生产环境启用)。 COOKIE_SECURE=false -# Number of reverse proxies in front of the app; used to extract the real client IP -# from X-Forwarded-For. 0 when serving directly; 1 behind one proxy (e.g. nginx/Caddy). +# 应用前方的反向代理层数;用于从 X-Forwarded-For 中提取真实客户端 IP。 +# 直接对外服务时为 0;经过一层代理(如 nginx/Caddy)时为 1。 TRUSTED_PROXY_COUNT=0 -# Per-query timeout in seconds; slow queries are canceled to protect the connection pool. +# 单条查询的超时秒数;慢查询会被取消以保护连接池。 STATEMENT_TIMEOUT_SECS=30 -# WebP encoding configuration -# Quality: 0.0 (smallest) to 100.0 (best), default 85.0 +# WebP 编码配置 +# 质量:0.0(最小体积)到 100.0(最佳质量),默认 85.0 WEBP_QUALITY=85.0 -# Method: 0 (fastest) to 6 (best quality), default 2 +# 方法:0(最快)到 6(最佳质量),默认 2 WEBP_METHOD=2 -# Maximum concurrent sessions per user (default: 5, minimum: 1) +# 每用户最大并发会话数(默认 5,最小 1) MAX_SESSIONS_PER_USER=5 -# Database connection pool size (default: 20) +# 数据库连接池大小(默认 20) DB_POOL_SIZE=20 -# Startup DB connection retry window in seconds (default: 30). -# How long the server waits for PostgreSQL to become reachable at startup before giving up. -# Useful when the DB starts slower than the app (docker-compose without healthchecks, cold -# local Postgres, etc.). Only affects startup; runtime connection retries are separate and -# fast-fail to avoid cascading failures. +# 启动时数据库连接重试窗口,单位秒(默认 30)。 +# 服务器在启动期间等待 PostgreSQL 可达的最长时间,超时则放弃。 +# 适用于 DB 启动比 app 慢的场景(docker-compose 无 healthcheck、本机冷启动 Postgres 等)。 +# 仅影响启动;运行时连接重试走独立的快速失败策略,以避免级联故障。 MIGRATE_STARTUP_TIMEOUT_SECS=30 -# SSR page cache duration in seconds (default: 3600). -# src/ssr_cache.rs maintains a global generation counter bumped on every post write, but -# Dioxus 0.7 does not expose an API to wire it into the incremental SSR cache key. Until such -# an API is available, this TTL is the only effective SSR cache invalidation mechanism. +# SSR 页面缓存时长,单位秒(默认 3600)。 +# src/ssr_cache.rs 维护了一个全局 generation 计数器,每次文章写入时自增, +# 但 Dioxus 0.7 暴露的 API 无法把它接入增量 SSR 缓存的 key。在该 API 可用前, +# 此 TTL 是唯一有效的 SSR 缓存失效手段。 SSR_CACHE_SECS=3600 -# Compression algorithms for HTTP responses. -# Comma-separated list, case-insensitive. Supported: gzip, brotli (or br), deflate, zstd. -# Use "all" to enable everything (default when unset); use "none" or "off" to disable. +# HTTP 响应压缩算法。 +# 逗号分隔,大小写不敏感。支持:gzip、brotli(或 br)、deflate、zstd。 +# 用 "all" 启用全部(不设时的默认);用 "none" 或 "off" 关闭。 COMPRESSION_ALGORITHMS=gzip,brotli,deflate,zstd -# Image serving cache headers (hardcoded defaults) -# Uploaded image assets are served with Cache-Control: public, max-age=31536000, immutable. -# Processed variants (?w=, ?format=, etc.) are cached for 24 hours. -# To invalidate a cached raw upload, change its file path. -# To refresh a processed variant, change its processing parameters. +# 图片响应的缓存头(硬编码默认值) +# 上传的原始图片资源以 Cache-Control: public, max-age=31536000, immutable 提供。 +# 处理变体(?w=、?format= 等)缓存 24 小时。 +# 要使已缓存的原始上传失效,请更改其文件路径。 +# 要刷新某个处理变体,请更改其处理参数。 -# Image disk cache limits -# Max total size in MB (default: 1024) +# 图片磁盘缓存上限 +# 最大总容量,单位 MB(默认 1024) IMAGE_DISK_CACHE_MAX_MB=1024 -# Max file age in hours before forced deletion (default: 168) +# 文件被强制删除前的最大存在时长,单位小时(默认 168,即 7 天) IMAGE_DISK_CACHE_MAX_AGE_HOURS=168