# TapCanvas API (NestJS + Node.js) env # HTTP port (default: 8788) PORT=8788 # Preferred: Postgres (Prisma) # Example: postgres://postgres:postgres@127.0.0.1:5432/tapcanvas DATABASE_URL= # Docker compose (container-internal DSN; host should be `postgres`) # DATABASE_URL_DOCKER=postgresql://tapcanvas:tapcanvas@postgres:5432/tapcanvas?schema=public # Docker Compose database identity. Production compose requires a non-empty password. # POSTGRES_DB=tapcanvas # POSTGRES_USER=tapcanvas # POSTGRES_PASSWORD= # POSTGRES_PORT=5432 # pgvector is required for all runtime knowledge search/read/catalog operations. # Override this image if your registry mirrors pgvector under another path. # POSTGRES_IMAGE=pgvector/pgvector:pg16 # Optional second database for apps/new-api when sharing this same compose stack # NEW_API_POSTGRES_DB=tapcanvas_new_api # NEW_API_SQL_DSN=postgresql://tapcanvas:tapcanvas@postgres:5432/tapcanvas_new_api # NEW_API_PORT=4455 # NEW_API_IMAGE=tapcanvas/new-api:local # Production compose requires all three values and fails before startup when one is missing. # NEW_API_INTERNAL_TOKEN= # NEW_API_SESSION_SECRET= # NEW_API_CRYPTO_SECRET= # Gemini 通过 Worker 时设置为: # NEW_API_GEMINI_BASE_URL=https://generativelanguage.beqlee.icu # NEW_API_GEMINI_CODE_ASSIST_BASE_URL=https://cloudcode-pa.beqlee.icu # NEW_API_GEMINI_CODE_ASSIST_DAILY_BASE_URL=https://daily-cloudcode-pa.beqlee.icu # OAuth 客户端与端点覆盖(可选) # NEW_API_GEMINI_OAUTH_CLIENT_ID= # NEW_API_GEMINI_OAUTH_CLIENT_SECRET= # NEW_API_GEMINI_AI_STUDIO_OAUTH_CLIENT_ID= # NEW_API_GEMINI_AI_STUDIO_OAUTH_CLIENT_SECRET= # NEW_API_GEMINI_CODE_ASSIST_OAUTH_CLIENT_ID= # NEW_API_GEMINI_CODE_ASSIST_OAUTH_CLIENT_SECRET= # NEW_API_GEMINI_ANTIGRAVITY_OAUTH_CLIENT_ID= # NEW_API_GEMINI_ANTIGRAVITY_OAUTH_CLIENT_SECRET= # NEW_API_GEMINI_OAUTH_AUTHORIZE_URL=https://accounts.google.com/o/oauth2/v2/auth # NEW_API_GEMINI_OAUTH_TOKEN_URL=https://oauth2.beqlee.icu/token # NEW_API_GEMINI_OAUTH_USERINFO_URL=https://www.googleapis.com/oauth2/v3/userinfo # NEW_API_GEMINI_OAUTH_AI_STUDIO_REDIRECT_URI=http://localhost:1455/auth/callback # NEW_API_GEMINI_OAUTH_CODE_ASSIST_REDIRECT_URI=https://codeassist.google.com/authcode # Optional base images for building apps/new-api locally. # The default Bun image is a real Bun runtime so a clean clone can build the # dashboard inside Docker. Override only when using a compatible mirror: # NEW_API_BUN_IMAGE=docker.io/oven/bun:1.3.11 # NEW_API_NODE_IMAGE=docker.io/library/node:22.19.0-bookworm-slim # NEW_API_GO_IMAGE=docker.m.daocloud.io/library/golang:1.26.1-alpine # NEW_API_RUNTIME_IMAGE=docker.m.daocloud.io/library/debian:bookworm-slim # Optional backup dir override (inside api container) # PG_BACKUP_DIR=/app/backups # Optional backup retention count (production compose default: 30, keep newest predeploy dumps only) # PG_BACKUP_KEEP_LATEST=30 # Optional: SQLite source path (only for sqlite->postgres migration script) # TAPCANVAS_DB_PATH=.data/tapcanvas.sqlite # JWT secret. `dev-secret` is local development only; production compose requires an explicit value. JWT_SECRET=dev-secret # Exact browser origins allowed to send credentialed cross-origin requests, comma-separated. # Same-origin requests are always accepted. Local Web port 5175 is accepted only by a local API. # CORS_ALLOWED_ORIGINS=https://studio.example.com # Optional: email login channel # EMAIL_LOGIN_DEBUG=1 # Optional: Redis for workers # - Local host run: redis://127.0.0.1:6379 # - Docker Compose network: redis://redis:6379 # REDIS_URL=redis://127.0.0.1:6379 # Optional remote build integration. Ordinary local development does not need any # variable in this block; leave the whole block unset unless you intentionally send # user workspaces to Vercel Sandbox. When enabled, configure it as one complete set. # This process only orchestrates; user project commands run in Vercel Sandbox. # After configuring the complete set, enable the worker explicitly: # docker-compose --profile codex-remote-build up -d codex-remote-builder # CODEX_REMOTE_BUILD_PROVIDER=vercel-sandbox # Exactly one Vercel credential mode; do not leave values from the other mode set: # VERCEL_OIDC_TOKEN= # Or all three: # VERCEL_TOKEN= # VERCEL_TEAM_ID= # VERCEL_PROJECT_ID= # Private, non-public S3-compatible bucket for short-lived source archives. # CODEX_SOURCE_S3_ACCESS_KEY_ID= # CODEX_SOURCE_S3_SECRET_ACCESS_KEY= # CODEX_SOURCE_S3_SESSION_TOKEN= # CODEX_SOURCE_S3_ENDPOINT_URL=https://s3.example.com # CODEX_SOURCE_S3_REGION=auto # CODEX_SOURCE_S3_BUCKET=tapcanvas-codex-source # AES-256-GCM task envelope key: `openssl rand -base64 32` # CODEX_REMOTE_BUILD_ENVELOPE_KEY= # Optional Redis queue controls; defaults shown. # CODEX_ENQUEUE_QPS=1 # CODEX_MAX_QUEUE_DEPTH_PER_USER=10 # CODEX_MAX_QUEUE_DEPTH_GLOBAL=100 # CODEX_QUEUE_LEASE_TTL_MS=30000 # 独立 workflow-runtime-worker 的最大并行节点数(范围 1..32,默认 8)。 # WORKFLOW_NODE_WORKER_CONCURRENCY=8 # Worker 内部控制端口由 Compose 固定为 8790;API 通过 # WORKFLOW_RUNTIME_REMOTE_BASE_URL 代理 start/cancel/resume,普通部署无需覆盖。 # WORKFLOW_RUNTIME_PORT=8790 # CODEX_BRIDGE_ONLINE_TTL_SECONDS=45 # CODEX_TASK_TTL_SECONDS=604800 # CODEX_RECENT_TASK_LIMIT=50 # Internal service delegation secret. Production compose requires an explicit value. INTERNAL_WORKER_TOKEN=change-me # API-to-agents-bridge authentication secret. Production compose requires an explicit value. # AGENTS_BRIDGE_TOKEN= # Object storage is optional in the Node API. When no provider contract is set, # generated media is written to the repository assets/public directory and served # by the backend at /assets/local/*. If a provider is selected, its contract must # be complete; incomplete configuration fails explicitly instead of falling back. # OBJECT_STORAGE_PROVIDER=tos # Primary: Volcengine TOS. All six values are required when provider=tos. # TOS_ACCESS_KEY_ID= # TOS_SECRET_ACCESS_KEY= # TOS_SESSION_TOKEN= # TOS_ENDPOINT_URL=https://tos-s3-cn-guangzhou.volces.com # TOS_REGION=cn-guangzhou # TOS_BUCKET=tanvas-ai # TOS_PUBLIC_BASE_URL=https://tanvas-ai.tos-cn-guangzhou.volces.com # Manual fallback: Cloudflare R2. All six values are required when provider=r2. # R2_ACCESS_KEY_ID= # R2_SECRET_ACCESS_KEY= # R2_SESSION_TOKEN= # R2_ENDPOINT_URL=https://.r2.cloudflarestorage.com # R2_REGION=auto # R2_BUCKET=canvas-pro # R2_PUBLIC_BASE_URL=https://assets.tapcanvas.uk # Browser-reachable backend proxy prefix for local generated assets. This is # required by background workers when object storage is intentionally disabled. # Direct API development can omit it and derive the prefix from each request. # LOCAL_ASSET_PUBLIC_BASE_URL=http://127.0.0.1:8788/assets/local # Optional: prompt-evolution worker defaults # - Cron at local midnight by default # - Worker uses /internal/prompt-evolution/run with INTERNAL_WORKER_TOKEN # PROMPT_EVOLUTION_CRON=0 0 * * * # PROMPT_EVOLUTION_TZ=America/Los_Angeles # PROMPT_EVOLUTION_SINCE_HOURS=24 # PROMPT_EVOLUTION_MIN_SAMPLES=30 # PROMPT_EVOLUTION_DRY_RUN=0 # PROMPT_EVOLUTION_CONCURRENCY=1 # Optional: DeepSeek Harness HTTP bridge (used by /public/agents/chat) # Docker Compose: keep default `http://agents-bridge:8799` from compose service env # Local host run (non-docker): `http://127.0.0.1:8799` # AGENTS_BRIDGE_BASE_URL=http://127.0.0.1:8799 # AGENTS_BRIDGE_TOKEN= # Optional: agents bridge request timeout (ms, default: 1800000; clamp: 5000~1800000) # AGENTS_BRIDGE_TIMEOUT_MS=1800000 # Trusted administrator-only local workflow JavaScript. This is a bounded Node child process, # not a security sandbox. Keep disabled for untrusted or multi-tenant scripts. # WORKFLOW_LOCAL_JAVASCRIPT_ENABLED=true # Optional default binding referenced by newly created Webhook workflow triggers. # Use a long random value; the flow stores only env://TAPCANVAS_WORKFLOW_WEBHOOK_SECRET. # TAPCANVAS_WORKFLOW_WEBHOOK_SECRET= # AGENTS_API_KEY=sk-... # new-api relay token; also reused by embeddings unless overridden below # Runtime knowledge retrieval is vector-only. The local knowledge directory is an archive # and an explicit incremental-sync source; model-facing tools never read it directly. # Embedding relay is intentionally separate from AGENTS_API_BASE_URL (which may point to Headroom). # Local host: http://127.0.0.1:4455/v1; Docker Compose sets http://new-api:4455/v1. # AGENTS_EMBEDDING_BASE_URL=http://127.0.0.1:4455/v1 # AGENTS_EMBEDDING_MODEL=doubao-embedding-vision-251215 # AGENTS_EMBEDDING_DIMENSIONS=2048 # Optional new-api relay token override; empty means reuse AGENTS_API_KEY. # The upstream Aliyun credential remains configured in new-api's embedding channel. # AGENTS_EMBEDDING_API_KEY= # Complete-film remote tool ceiling; keep below bridge timeout for final agent verification/response. # AGENTS_REMOTE_TOOL_TIMEOUT_MS=1500000 # Complete-film synchronous contracts. `loop` includes authoring and may invoke `start` with its # remaining budget. Success is returned only after deliveryVerification has a real final asset URL. # VIDEO_SYNC_WAIT_TIMEOUT_MS=1200000 # VIDEO_SYNC_POLL_INTERVAL_MS=5000 # Recovery never completes or wakes a chat turn; it only preserves provider-accepted work after # the synchronous request has disconnected/failed and its durable lease is stale. # VIDEO_RUN_RECOVERY=true # VIDEO_RUN_RECOVERY_STALE_MS=1800000 # Specialist authoring ready-queue lease; intentionally independent from paid provider recovery. # VIDEO_AUTHORING_DRIVE_STALE_MS=5000 # Periodic reconciliation interval for provider-accepted image and video assets. # INPROCESS_MEDIA_RECOVERY_EVERY_MS=60000 # Optional: relay all hono-api model/task execution through apps/new-api # Local host run (non-docker): http://127.0.0.1:4455 # Docker Compose network: http://new-api:4455 # NEW_API_INTERNAL_BASE_URL=http://127.0.0.1:4455 # NEW_API_INTERNAL_DOCKER_BASE_URL=http://new-api:4455 # Browser-facing new-api base URL used by the first-run channel setup guide. # NEW_API_PUBLIC_BASE_URL=http://127.0.0.1:4455 # NEW_API_RECOMMENDED_PROVIDER_BASE_URL=https://tt-api.lluban.com # NEW_API_INTERNAL_TOKEN=sk-xxx # Fresh database bootstrap administrators. Existing accounts and passwords are # never overwritten on restart. TAPCANVAS_ADMIN_USERNAME=admin TAPCANVAS_ADMIN_PASSWORD=123456 # Required USD/CNY conversion rate for token-priced and USD-priced models. # apps/new-api no longer publishes this value from /api/status. NEW_API_USD_EXCHANGE_RATE=7.3 # TapCanvas credit denomination. Required production value: 1 CNY = 100 credits. TAP_CREDITS_PER_CNY=100 # Preferred chat reservation target. Any positive available balance may start a turn. # TAP_CHAT_RESERVATION_CREDITS=500 # NEW_API_SQL_DSN=postgresql://tapcanvas:tapcanvas@127.0.0.1:5432/tapcanvas_new_api # NVTOKENS_API_KEY=sk-xxx # MiniMax H3 V2 via metaso.cn. Keep the real credential only in .env. # METASO_MINIMAX_API_KEY=mk-xxx # Klong OpenAI Images-compatible gpt-image-2 fallback. Keep the real credential only in .env. # KLONG_API_KEY=sk-xxx # Dedicated Volcengine Ark DeepSeek safety preflight for every public GPT turn. # ARK_DEEPSEEK_API_KEY=ark-xxx # Google AI Studio API key for the direct google-gemini-official new-api channel. # GOOGLE_GEMINI_API_KEY=AIza-xxx # Megaby asynchronous video channel. Keep the real credential only in .env. # MEGABY_API_KEY=sk-xxx # NewAPI AI 334 image tier. Enable only after /v1/models and all target models # have been verified with this exact key; the patch defaults to disabled. # NEWAPIAI_334_API_KEY=sk-xxx # NEWAPIAI_334_ENABLED=0 # Optional: Yunwu generateContent acceleration guards for /public/chat image tasks # Per-attempt timeout (ms). default: 600000; clamp: 5000~600000 # YUNWU_GENERATE_CONTENT_TIMEOUT_MS=600000 # Maximum fallback attempts. defaults: 3 (text_to_image), 6 (image_edit with refs); clamp: 1~20 # YUNWU_GENERATE_CONTENT_MAX_ATTEMPTS=4 # Maximum retryable-error attempts (timeouts/5xx/429) before early fail. default: 2; clamp: 1~10 # YUNWU_GENERATE_CONTENT_RETRYABLE_BUDGET=2 # Optional: autostart local DeepSeek Harness bridge (dev only) # When enabled and AGENTS_BRIDGE_BASE_URL is empty, the API will spawn `pnpm --filter agents dev serve ...` # and set AGENTS_BRIDGE_BASE_URL automatically. The official `sdk` profile is fixed by the bridge; # legacy AGENTS_PROFILE and agents.config.json are not read. # AGENTS_BRIDGE_AUTOSTART=1 # AGENTS_BRIDGE_HOST=127.0.0.1 # AGENTS_BRIDGE_PORT=8799 # # Optional: bundled Skills directory projected into DeepSeek Harness. # Autostart defaults to apps/agents-cli/skills. # If you start agents from repo root manually, you can set: AGENTS_SKILLS_DIR=apps/agents-cli/skills # Required for platform-owned membership products and account-center settings. COMMERCE_PLATFORM_OWNER_ID=