topfans/backend/.env.example
Lenticular Studio Agent af7908e72e feat: 接入微达API中转站,重构镭射卡生图流程
- 替换中转站从 xbcl.link 到 weda.cc
- prompt 模板改为镭射卡全图生成(去掉 6 层合成/抠图依赖)
- 4 路并发调用 + 原图展示 = 5 张 variant
- 前端提示词中译英支持
- 全局 Vue errorHandler
- WebSocket 鉴权失败跳登录
- 删除已弃用的 laserCompositor 微服务

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 22:43:49 +08:00

109 lines
4.3 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.

# ==================== Server Configuration ====================
# Gin运行模式: debug, release, test
GIN_MODE=release
# API网关端口
SERVER_PORT=8080
# ==================== JWT Configuration ====================
# JWT密钥 - 生产环境请修改为安全的随机字符串
JWT_SECRET=
# ==================== Dubbo Service URLs ====================
# 各微服务的Dubbo连接地址直连模式
DUBBO_USER_SERVICE_URL=tri://127.0.0.1:20000
DUBBO_SOCIAL_SERVICE_URL=tri://127.0.0.1:20001
DUBBO_ASSET_SERVICE_URL=tri://127.0.0.1:20003
DUBBO_GALLERY_SERVICE_URL=tri://127.0.0.1:20004
DUBBO_ACTIVITY_SERVICE_URL=tri://127.0.0.1:20005
DUBBO_TASK_SERVICE_URL=tri://127.0.0.1:20006
DUBBO_STARBOOK_SERVICE_URL=tri://127.0.0.1:20007
# ==================== Database Configuration ====================
# PostgreSQL数据库配置
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=postgres
DB_NAME=topfans
# ==================== Redis Configuration ====================
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_DB=0
# ==================== OSS Configuration ====================
# 阿里云OSS配置
OSS_REGION=cn-shanghai
OSS_BUCKET_NAME=your-bucket-name
OSS_STS_ROLE_ARN=acs:ram::1234567890123456:role/your-oss-role-name
OSS_ACCESS_KEY_ID=your-access-key-id
OSS_ACCESS_KEY_SECRET=your-access-key-secret
OSS_AVATAR_DIR=avatar/
OSS_ASSET_DIR=asset/
OSS_TOKEN_EXPIRE_TIME=3600
# ==================== Service Ports ====================
# 各服务端口用于flag参数
# User Service: 20000
# Social Service: 20001
# Asset Service: 20003
# Gallery Service: 20004
# Activity Service: 20005
# ==================== Logging ====================
# 环境: development, production
ENV=development
# 日志级别: debug, info, warn, error
LOG_LEVEL=info
# ==================== MiniMax API Configuration ====================
MINIMAX_API_KEY=
MINIMAX_API_URL=https://api.minimaxi.com/v1/image_generation
# ==================== Segment (镭射卡抠图) ====================
# auto=自部署HTTP(若有)→imageseg→IVPDimageseg=VIAPI SegmentHDBodyivpd=旧版 IVPD SegmentImage
SEGMENT_PROVIDER=imageseg
# 自部署 rembghttp://127.0.0.1:7000/api/remove
SEGMENT_INFERENCE_URL=
# ==================== WebSocket ====================
# AI Chat WebSocket 路径(用于 Nginx 反向代理)
# 完整连接 URL = ws://<host>:<port><WS_AI_CHAT_PATH>?token=Bearer_xxx
# 需与 frontend/.env.{development,production} 的 VITE_WS_AI_CHAT_PATH 保持一致
# Nginx 反代示例:
# location /ai-chat {
# proxy_pass http://gateway:8080;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# }
WS_AI_CHAT_PATH=/ai-chat
# ==================== Dify AI Workflow ====================
# Dify API 地址(自部署或云服务)
DIFY_API_BASE=http://localhost/v1
# Dify App API Keylaser_card_variants_v1 工作流)
DIFY_API_KEY=app-tIfFhFwj3xnbRurK1oxxBXnA
# Dify 工作流名称relay-dify 模式时使用的 Dify app用于 prompt 增强)
DIFY_WORKFLOW=laser_prompt_enhancer_v2
# ==================== 镭射卡生成器 ====================
# LASER_GEN_PROVIDER:
# minimax (默认) - 后端直连 MiniMax, 并行 5 variant 生成背景+装饰, 再调 compositor 合成
# dify - 调 Dify laser_card_variants_v1 工作流, 由 Dify 内部分发
# openai - 后端直连 OpenAI /v1/images/edits, 5 路并发 + 直接落 OSS (不调 compositor)
# relay-dify - Dify 增强 prompt → 中转站 edits → 落 OSS单张调试可扩展
LASER_GEN_PROVIDER=openai
# ==================== OpenAI Images API (LASER_GEN_PROVIDER=openai 时使用) ====================
# 必填:OpenAI API Key(去 https://platform.openai.com/api-keys 生成)
OPENAI_API_KEY=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
# 可选:API 端点(默认官方地址;如使用代理或自建兼容服务可改)
OPENAI_BASE_URL=https://api.openai.com/v1
# 可选:模型名(默认 gpt-image-1.5;可选 gpt-image-1 / dall-e-3)
OPENAI_MODEL=gpt-image-1.5
# laser-compositor 内网地址
# 注意7000 端口在 macOS 上被 AirPlay Receiver 占用,因此改用 7002
LASER_COMPOSITOR_URL=http://127.0.0.1:7002
# laser-compositor 监听端口(与 URL 端口一致)
COMPOSITOR_PORT=7002