mirror of
https://github.com/RhenCloud/Cloud-Index.git
synced 2025-12-06 15:26:10 +08:00
feat: 重构配置管理,集中管理环境变量并优化存储后端实现
This commit is contained in:
43
.env.example
43
.env.example
@@ -9,43 +9,38 @@
|
||||
STORAGE_TYPE=r2
|
||||
|
||||
# ==================== Cloudflare R2 配置 ====================
|
||||
# R2 账户 ID
|
||||
R2_ACCOUNT_ID=your-account-id
|
||||
|
||||
# R2 访问凭证
|
||||
ACCESS_KEY_ID=YOUR_R2_ACCESS_KEY_ID
|
||||
SECRET_ACCESS_KEY=YOUR_R2_SECRET_ACCESS_KEY
|
||||
R2_ACCESS_KEY_ID=YOUR_R2_ACCESS_KEY_ID
|
||||
R2_SECRET_ACCESS_KEY=YOUR_R2_SECRET_ACCESS_KEY
|
||||
|
||||
# R2 存储桶名称
|
||||
R2_BUCKET_NAME=drive
|
||||
|
||||
# R2 Endpoint URL
|
||||
R2_ENDPOINT_URL=https://<your-account-id>.r2.cloudflarestorage.com
|
||||
|
||||
# R2 区域 (默认: auto)
|
||||
R2_REGION=auto
|
||||
|
||||
# R2 公共访问 URL (可选,例如: https://pub-<bucket-name>.r2.dev)
|
||||
R2_PUBLIC_URL=https://pub-<bucket-name>.r2.dev
|
||||
|
||||
# R2 预签名 URL 过期时间(秒,默认: 3600)
|
||||
R2_PRESIGN_EXPIRES=3600
|
||||
# R2 公共访问域名 (可选,例如: https://pub-<bucket-name>.r2.dev)
|
||||
R2_PUBLIC_DOMAIN=https://pub-<bucket-name>.r2.dev
|
||||
|
||||
# ==================== GitHub 存储配置 ====================
|
||||
# GitHub 仓库所有者
|
||||
GITHUB_REPO_OWNER=your-username
|
||||
|
||||
# GitHub 仓库名称
|
||||
GITHUB_REPO_NAME=your-repo
|
||||
# GitHub 仓库 (格式: owner/repo)
|
||||
GITHUB_REPO=your-username/your-repo
|
||||
|
||||
# GitHub 访问令牌 (需要 repo 权限)
|
||||
GITHUB_ACCESS_TOKEN=your-access-token
|
||||
GITHUB_TOKEN=your-access-token
|
||||
|
||||
# GitHub 分支名称 (默认: main)
|
||||
GITHUB_BRANCH=main
|
||||
|
||||
# GitHub Raw 文件反向代理 URL (可选,用于加速访问)
|
||||
# 例如: https://raw.fastgit.org 或 https://ghproxy.com/https://raw.githubusercontent.com
|
||||
# 留空则使用官方 raw.githubusercontent.com
|
||||
GITHUB_RAW_PROXY_URL=
|
||||
|
||||
# ==================== 应用配置 ====================
|
||||
# 服务器配置
|
||||
HOST=0.0.0.0
|
||||
PORT=5000
|
||||
DEBUG=false
|
||||
|
||||
# 缩略图缓存时间(秒,默认: 3600)
|
||||
THUMB_TTL_SECONDS=3600
|
||||
|
||||
# 预签名 URL 过期时间(秒,默认: 3600)
|
||||
PRESIGNED_URL_EXPIRES=3600
|
||||
THUMB_TTL_SECONDS=3600
|
||||
|
||||
Reference in New Issue
Block a user