forked from zxlwq/notes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
55 lines (42 loc) · 2.25 KB
/
Copy path.env.example
File metadata and controls
55 lines (42 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# =============================================================================
# 必填(所有 PostgreSQL / Neon 后端:server、Vercel、EdgeOne、Docker)
# =============================================================================
# 登录密码(必填)
PASSWORD=123456
# JWT 签名密钥(生产必填,与 PASSWORD 独立;本地开发可省略)
JWT_SECRET=your-random-secret-key
# 数据库连接(Cloudflare D1 部署无需此项,改为在 Pages 绑定 NOTESD)
# 若在 Cloudflare Pages 同时配置 DATABASE_URL,将把 D1 笔记/设置/排序异步同步至 PostgreSQL,便于迁移到 Vercel / Docker 等平台
DATABASE_URL=postgresql://username:password@host:port/database
# =============================================================================
# 可选
# =============================================================================
# 会话有效期(秒,默认 604800 = 7 天);Cookie 为 SameSite=Strict + HttpOnly
# SESSION_TTL_SEC=86400
# 生产 CORS 白名单(逗号分隔)。未设置时回显请求 Origin;无 Origin 则 *
# ALLOWED_ORIGINS=https://notes.example.com
# Express 后端日志保留天数(默认 30,启动时自动清理过期记录)
LOG_RETENTION_DAYS=30
# Edge Functions 调试日志(生产环境留空;开发可设 true)
# DEBUG=true
# ENVIRONMENT=development
# =============================================================================
# 备份(可选)
# =============================================================================
# WebDAV 备份
WEBDAV_URL=https://notes.example.com/dav/
WEBDAV_USER=admin
WEBDAV_PASS=123456
# GitHub Gist 备份
GIT_TOKEN=github_token
# Cloudflare R2 备份
ACCOUNT_ID=your_account_id
ACCESS_KEY_ID=AccessKeyID
SECRET_ACCESS_KEY=SecretAccessKey
# =============================================================================
# 平台说明
# =============================================================================
# server/ / Docker → 需要 PASSWORD + DATABASE_URL
# Vercel / EdgeOne → 需要 PASSWORD + DATABASE_URL(Neon)
# Cloudflare Pages → 需要 PASSWORD + 绑定 D1(NOTESD);可选 DATABASE_URL 同步至 Neon/PostgreSQL
# Cloudflare R2 备份 → 在 Pages 绑定 R2 桶(NOTESR),无需 ACCOUNT_ID 等 env