# ============================================================ # Cat Cafe / Clowder AI — Environment Configuration # 猫猫咖啡环境配置 # # Copy this file to .env and fill in your values: # cp .env.example .env # # All fields are optional — fill in what you need. # 所有字段均为可选,按需填写。 # ============================================================ # ── Core Ports 核心端口 ────────────────────────────────────── # These ports must not conflict with other local services. # Default: Frontend 3003, API 3004, Redis 6399 # Convention: API port = Frontend port + 1 (same as internal 3001→3002) FRONTEND_PORT=3003 API_SERVER_PORT=3004 # API bind host (default: localhost only). Set to 0.0.0.0 for LAN / Tailscale / Docker access. # API 监听地址(默认仅本机访问)。如需局域网 / Tailscale / Docker 访问,改为 0.0.0.0。 API_SERVER_HOST=127.0.0.1 # Allow phones / tablets on RFC 1918 LANs or Tailscale to call the API when API_SERVER_HOST=0.0.0.0. # Warning: this trusts the entire private network. Restart required after changing. # 允许 RFC 1918 局域网 / Tailscale 上的手机平板访问;需要同时设置 API_SERVER_HOST=0.0.0.0。 # 注意:会信任整个私网内的所有设备。修改后需重启服务。 # CORS_ALLOW_PRIVATE_NETWORK=true # ── Owner Identity 所有者身份 ─────────────────────────────── # Owner identity for privileged operations. # - Default cat selection: works without this (falls back to 'default-user') # - Sensitive env writes: REQUIRES this to be explicitly set (403 otherwise) # For multi-user deployments, set this to your actual user ID. # 所有者身份,用于特权操作。 # - 默认猫选择:无需配置(回落到 'default-user',开箱即用) # - 敏感环境变量写入:必须显式配置(否则 403) # 多用户部署时,请设置为你的实际用户 ID。 # DEFAULT_OWNER_USER_ID=default-user MCP_SERVER_PORT=3011 NEXT_PUBLIC_API_URL=http://localhost:3004 NEXT_PUBLIC_BRAND_NAME="Clowder AI" # CLI inactivity timeout in milliseconds. # Default is 1800000 = 30 minutes; set to 0 to disable the CLI-layer timeout. # CLI_TIMEOUT_MS=1800000 # ── Workspace Access 工作目录 ─────────────────────────────── # Comma-separated list of directories the MCP server is allowed to access. # 逗号分隔的 MCP Server 允许访问的工作目录列表。 # ALLOWED_WORKSPACE_DIRS=/Users/you/projects # ── Redis 数据存储 ────────────────────────────────────────── # Use --memory flag with pnpm start to skip Redis entirely. # 启动时加 --memory 可跳过 Redis(数据仅存内存,重启丢失)。 REDIS_PORT=6399 REDIS_URL=redis://localhost:6399 # ── Redis Data TTL(数据保留期限)────────────────────────────── # Default 0 = persistent (recommended). Set >0 to auto-delete data after N seconds. # 默认 0 = 永久保存(推荐)。设为 >0 会在到期后自动删除数据! # MESSAGE_TTL_SECONDS=0 # THREAD_TTL_SECONDS=0 # TASK_TTL_SECONDS=0 # ── Model API Keys 模型密钥(推荐通过 UI 配置)─────────────── # RECOMMENDED: Add API keys via the web UI after launch: # Hub → System Settings → Account Configuration # 推荐方式:启动后在前端 UI 添加 API key: # Hub → 系统配置 → 账号配置 # # The env vars below are a legacy fallback. Leave them commented out # unless you have a specific reason to use them. # 以下环境变量仅作兼容兜底,通常不需要填写。 # ANTHROPIC_API_KEY= # Claude — https://console.anthropic.com/ # OPENAI_API_KEY= # GPT / Codex — https://platform.openai.com/ # GOOGLE_API_KEY= # Gemini — https://aistudio.google.com/ # ── Optional: API Gateway Proxy 反向代理(可选)────────────── # Route API calls through a custom gateway (e.g. load balancer). # 通过自定义网关路由 API 调用(如负载均衡器)。 # Set to 1 and configure .cat-cafe/proxy-upstreams.json to enable. ANTHROPIC_PROXY_ENABLED=0 # ANTHROPIC_PROXY_PORT=9877 # ── Optional: Local Services 本地服务(可选)─────────────── # Voice, embedding, and LLM services are managed by Service Manifest. # Install/configure via the UI: System Settings → 本地服务. # 语音、嵌入、LLM 等本地服务由 Service Manifest 管理。 # 通过 UI 安装和配置:系统配置 → 本地服务。 # Runtime config stored in .cat-cafe/services.json (gitignored). # TTS_CACHE_DIR=./data/tts-cache EMBED_MODE=off # ── Optional: Feishu 飞书(可选)──────────────────────────── # Chat with cats from Feishu/Lark. Requires a Feishu app. # 在飞书里和猫猫聊天,需要创建飞书应用。 # FEISHU_APP_ID=cli_xxx # FEISHU_APP_SECRET=xxx # FEISHU_VERIFICATION_TOKEN=xxx # ── Optional: Telegram(可选)─────────────────────────────── # Chat with cats from Telegram. Create a bot via @BotFather. # 在 Telegram 里和猫猫聊天,通过 @BotFather 创建 bot。 # TELEGRAM_BOT_TOKEN=123456:ABC-DEF... # ── Optional: GitHub PR Review Notifications(可选)───────── # Polls IMAP for GitHub review emails and routes to chat. # 轮询 IMAP 邮箱获取 GitHub review 邮件通知。 # GITHUB_REVIEW_IMAP_USER=xxx@qq.com # GITHUB_REVIEW_IMAP_PASS= # GITHUB_REVIEW_IMAP_HOST=imap.qq.com # GITHUB_REVIEW_IMAP_PORT=993 # GITHUB_MCP_PAT=ghp_... # ── Optional: WeCom 企业微信(可选)───────────────────────── # Chat with cats from WeCom/WeChat Work. # 在企业微信里和猫猫聊天。 # WECOM_BOT_ID=xxx # WECOM_BOT_SECRET=xxx # WECOM_CORP_ID=xxx # WECOM_AGENT_ID=xxx # WECOM_AGENT_SECRET=xxx # WECOM_TOKEN=xxx # WECOM_ENCODING_AES_KEY=xxx # ── Logging 日志(可选)───────────────────────────────────── # Log level: debug, info, warn, error LOG_LEVEL=info LOG_DIR=./data/logs/api # ── Optional: Web Push Notifications(可选)───────────────── # Browser push notifications when cats need your attention. # 浏览器推送通知,猫猫需要你关注时提醒。 # Generate keys: npx web-push generate-vapid-keys # VAPID_PUBLIC_KEY=... # VAPID_PRIVATE_KEY=... # VAPID_SUBJECT=mailto:you@example.com