nex_buddy/.env.example

53 lines
1.9 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# ---- 运行环境 ----
# 全部配置走环境变量/.env,不写进代码仓库(见 01-总体设计.md 第 8 节)
APP_ENV=dev
APP_VERSION=0.1.0
# ---- 端口(开发期) ----
# scripts/dev.sh 起后端、vite 起前端都读这里。localhost 的 CORS 源会自动跟随
# FRONTEND_PORT;手机/局域网访问走 Vite 代理,不需要额外配置 CORS。
BACKEND_PORT=8100
FRONTEND_PORT=5174
# ---- 数据库 ----
DATABASE_URL=postgresql+asyncpg://postgres:sagacity@192.168.124.203:5432/nex_buddy
# ---- 缓存 ----
REDIS_URL=redis://192.168.124.203:6379/9
# ---- 和风天气 ----
# Key 直接可用;Host 是账号专属的,登录控制台 → 设置 复制(形如 abc1234xyz.re.qweatherapi.com)
# 旧的 devapi/api.qweather.com 已返回 403 Invalid Host
QWEATHER_KEY=HE2204271924421425
QWEATHER_HOST=
# ---- 业务参数 ----
SESSION_TTL_SECONDS=604800
PAIR_CODE_TTL_SECONDS=600
WEATHER_CACHE_SECONDS=1800
DEFAULT_CITY=杭州
# ---- 资源目录 ----
# 默认是项目根 data/;服务器/容器部署可指向宿主机挂载点
# DATA_DIR=/srv/nex_buddy/data
# ---- Docker 部署(可选) ----
# 宿主机资源目录(Compose 挂载到容器 /app/data),默认 ./data
# NEX_BUDDY_DATA_DIR=/srv/nex_buddy/data
# Web 对外端口,默认 80
# HTTP_PORT=80
# 仅 docker-deploy.sh --full 使用;请务必改掉默认口令
# POSTGRES_DB=nex_buddy
# POSTGRES_USER=nex_buddy
# POSTGRES_PASSWORD=change-me
# 构建加速(默认已用国内源,可覆盖)
# PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
# APT_MIRROR=mirrors.tuna.tsinghua.edu.cn
# NPM_REGISTRY=https://registry.npmmirror.com
# ---- CORS(一般不用配) ----
# Web 与 API 同域部署(Nginx 反代 / 已配 WEB_BASE_URL)时不需要 CORS,
# 保持不设置即可。只有 Web 与 API 确实不同域时才需要:
# CORS_ORIGINS=https://app.example.com
# 注意写完整源(协议 + 域名 + 端口),不要用 *。