85 lines
2.8 KiB
TOML
85 lines
2.8 KiB
TOML
name = "telegram-summary-bot"
|
|
main = "src/index.ts"
|
|
compatibility_date = "2024-01-01"
|
|
|
|
[ai]
|
|
binding = "AI"
|
|
|
|
[vars]
|
|
ENVIRONMENT = "production"
|
|
SUMMARY_THRESHOLD = "50" # 프로필 업데이트 주기 (메시지 수)
|
|
MAX_SUMMARIES_PER_USER = "1" # 유지할 프로필 버전 수
|
|
N8N_WEBHOOK_URL = "https://n8n.inouter.com" # n8n 연동 (선택)
|
|
# Admin IDs moved to secrets (see bottom of file)
|
|
|
|
# API Endpoints
|
|
OPENAI_API_BASE = "https://gateway.ai.cloudflare.com/v1/d8e5997eb4040f8b489f09095c0f623c/telegram-bot/openai"
|
|
NAMECHEAP_API_URL = "https://namecheap.api.inouter.com"
|
|
WHOIS_API_URL = "https://whois-api-kappa-inoutercoms-projects.vercel.app"
|
|
CONTEXT7_API_BASE = "https://context7.com/api/v2"
|
|
BRAVE_API_BASE = "https://api.search.brave.com/res/v1"
|
|
WTTR_IN_URL = "https://wttr.in"
|
|
HOSTING_SITE_URL = "https://hosting.inouter.com"
|
|
CLOUD_ORCHESTRATOR_URL = "https://cloud-orchestrator.kappa-d8e.workers.dev"
|
|
|
|
|
|
[[d1_databases]]
|
|
binding = "DB"
|
|
database_name = "telegram-conversations"
|
|
database_id = "c285bb5b-888b-405d-b36f-475ae5aed20e"
|
|
|
|
[[kv_namespaces]]
|
|
binding = "RATE_LIMIT_KV"
|
|
id = "15bcdcbde94046fe936c89b2e7d85b64"
|
|
preview_id = "0d3af750739e40d4a0324889564d74a7"
|
|
|
|
[[kv_namespaces]]
|
|
binding = "SESSION_KV"
|
|
id = "24ee962396cc4e9ab1fb47ceacf62c7d"
|
|
preview_id = "302ad556567447cbac49c20bded4eb7e"
|
|
|
|
# Email Worker 설정 (SMS → 메일 수신)
|
|
# Cloudflare Dashboard에서 Email Routing 설정 필요:
|
|
# 1. Email > Email Routing > Routes
|
|
# 2. deposit@your-domain.com → Worker: telegram-summary-bot
|
|
|
|
# Service Binding (Worker-to-Worker 통신)
|
|
[[services]]
|
|
binding = "CLOUD_ORCHESTRATOR"
|
|
service = "cloud-orchestrator"
|
|
|
|
# Cron Triggers:
|
|
# - 매일 자정(KST): 24시간 경과된 입금 대기 자동 취소 + 정합성 검증
|
|
# - 매 5분: pending 상태 서버 주문 자동 삭제 (5분 경과)
|
|
[triggers]
|
|
crons = ["0 15 * * *", "*/5 * * * *"] # UTC 15:00 = KST 00:00, 매 5분
|
|
|
|
# Secrets (wrangler secret put 으로 설정):
|
|
# - BOT_TOKEN: Telegram Bot Token
|
|
# - WEBHOOK_SECRET: Webhook 검증용 시크릿
|
|
# - OPENAI_API_KEY: OpenAI API 키
|
|
# - NAMECHEAP_API_KEY: namecheap-api 래퍼 인증 키 (도메인 추천용)
|
|
# - NAMECHEAP_API_KEY_INTERNAL: Namecheap API 키 (내부용)
|
|
# - BRAVE_API_KEY: Brave Search API 키
|
|
# - DEPOSIT_API_SECRET: Deposit API 인증 키 (namecheap-api 연동)
|
|
# - DOMAIN_OWNER_ID: 도메인 관리 권한 Telegram ID (보안상 secrets 권장)
|
|
# - DEPOSIT_ADMIN_ID: 예치금 관리 권한 Telegram ID (보안상 secrets 권장)
|
|
|
|
# Server Provision Queue
|
|
[[queues.producers]]
|
|
queue = "server-provision-queue"
|
|
binding = "SERVER_PROVISION_QUEUE"
|
|
|
|
[[queues.consumers]]
|
|
queue = "server-provision-queue"
|
|
max_retries = 3
|
|
max_batch_size = 10
|
|
max_batch_timeout = 30
|
|
max_concurrency = 5
|
|
dead_letter_queue = "provision-dlq"
|
|
|
|
# Dead Letter Queue
|
|
[[queues.consumers]]
|
|
queue = "provision-dlq"
|
|
max_retries = 0
|