feat: add Queue-based async server provisioning
- Add Cloudflare Queue for async server provisioning workflow - Implement VPS provider abstraction (Linode, Vultr) - Add provisioning API endpoints with API key authentication - Fix race condition in balance deduction (atomic query) - Remove root_password from Queue for security (fetch from DB) - Add IP assignment wait logic after server creation - Add rollback/refund on all failure cases Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,12 +8,18 @@ workers_dev = true
|
||||
[ai]
|
||||
binding = "AI"
|
||||
|
||||
# D1 Database binding (cloud-instances-db: 1,119 servers)
|
||||
# D1 Database binding (cloud-instances-db: server specs, pricing)
|
||||
[[d1_databases]]
|
||||
binding = "DB"
|
||||
database_name = "cloud-instances-db"
|
||||
database_id = "bbcb472d-b25e-4e48-b6ea-112f9fffb4a8"
|
||||
|
||||
# D1 Database binding (telegram-conversations: users, deposits, orders)
|
||||
[[d1_databases]]
|
||||
binding = "USER_DB"
|
||||
database_name = "telegram-conversations"
|
||||
database_id = "c285bb5b-888b-405d-b36f-475ae5aed20e"
|
||||
|
||||
# KV Cache binding for rate limiting and response caching
|
||||
[[kv_namespaces]]
|
||||
binding = "CACHE"
|
||||
@@ -22,3 +28,14 @@ id = "c68cdb477022424cbe4594f491390c8a"
|
||||
# Observability
|
||||
[observability]
|
||||
enabled = true
|
||||
|
||||
# Queue for async server provisioning
|
||||
[[queues.producers]]
|
||||
queue = "provision-queue"
|
||||
binding = "PROVISION_QUEUE"
|
||||
|
||||
[[queues.consumers]]
|
||||
queue = "provision-queue"
|
||||
max_batch_size = 1
|
||||
max_retries = 3
|
||||
dead_letter_queue = "provision-queue-dlq"
|
||||
|
||||
Reference in New Issue
Block a user