33 lines
2.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

PORT=3088
# Windows 本机路径包含空格时,Prisma SQLite 请使用完整绝对路径;Docker 会覆盖为 /app/data。
DATABASE_URL=file:D:/AI Code/YouYiDianNotificationCenter/data/notifications.db
# 管理 API Bearer Secret,只允许通知中心维护人持有;Bearer 方式放在 Authorization 头。
# 若这两项未配置,服务会安全回退到 legacy `YYD_NOTIFICATION_PROJECTS_JSON` 内存模式,旧 `/v1/*` 保持可用,但不挂载数据库 admin API。
YYD_NOTIFICATION_ADMIN_API_SECRET=
# 旧变量兼容别名;新部署请只配置 YYD_NOTIFICATION_ADMIN_API_SECRET。
YYD_NOTIFICATION_ADMIN_TOKEN=
# 数据库存储的项目密钥使用该 32 字节密钥加密;推荐使用 64 位 hex(例如 openssl rand -hex 32)。
YYD_NOTIFICATION_CONFIG_ENCRYPTION_KEY=
# “由壹点”机器人所属企业内部应用的凭证,仅允许配置在通知中心。
DINGTALK_APP_KEY=
DINGTALK_APP_SECRET=
DINGTALK_ROBOT_CODE=
DINGTALK_CORP_ID=
# 通知中心经公网访问的 HTTPS 基地址,可包含反向代理路径前缀。
YYD_NOTIFICATION_PUBLIC_BASE_URL=https://sc.example.com/notification-center
# 登录票据只能设置为 30~60 秒;无效值会收紧为 60 秒。
DINGTALK_LOGIN_TICKET_TTL_SECONDS=60
# 每个项目必须使用不同密钥;allowedHosts 用于限制卡片跳转域名。
# login 省略或 enabled=false 时保持原直接跳转,不启用免登中转。
# 该环境变量只用于首次或补录导入:启动期和 /admin/runtime/import-env 都只导入缺失项目,不覆盖数据库里已存在项目、已轮换密钥或手工维护的 recipients。
# 生产环境请使用足够长的随机密钥,不要把真实值提交到 Git。
YYD_NOTIFICATION_PROJECTS_JSON=[{"code":"material_library","name":"素材库","secret":"replace-with-random-secret","allowedHosts":["sc.example.com"],"recipients":[{"alias":"示例花名","userId":"replace-with-dingtalk-user-id"}]},{"code":"fixed_asset","name":"固定资产","secret":"replace-with-another-random-secret","allowedHosts":["asset.example.com"],"login":{"enabled":true,"callbackUrl":"https://asset.example.com/api/dingtalk/broker-login","allowedRedirectPathPrefixes":["/workflows/disposals","/dashboard"]}},{"code":"furniture_platform","name":"家具业务系统","secret":"replace-with-furniture-random-secret","allowedHosts":["cp.example.com"]},{"code":"script_monitor","name":"脚本监控","secret":"replace-with-script-monitor-random-secret","allowedHosts":["cp.example.com"]}]
WORKER_ENABLED=true
WORKER_INTERVAL_MS=1000
READ_STATUS_INTERVAL_MS=5000