diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..8d5b396 --- /dev/null +++ b/.env.example @@ -0,0 +1,12 @@ +# Forumlify 环境变量示例 +# 复制为 .env 并按需修改 + +# PostgreSQL 连接串(默认与 docker-compose.yml 一致) +DATABASE_URL=postgresql://forumlify:123456@localhost:5432/forumlify + +# JWT 签名密钥(生产环境务必修改为随机长字符串) +JWT_SECRET=forumlify-secret-key-change-me-in-production + +# 可选:监听端口/地址(也可在 config.js 中设置 SERVER_PORT / SERVER_HOST) +# PORT=3000 +# HOST=0.0.0.0 diff --git a/.gitignore b/.gitignore index 097a6e6..4f2257d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,8 @@ out/ uploads/ *.log .DS_Store -.env + +# .env 允许提交到仓库(项目约定) +# 仅忽略本地覆盖文件 +.env.local +.env.*.local