Commit Graph

5 Commits

Author SHA1 Message Date
kappa
1c65c02045 feat: add GET /api/provision/images endpoint
- Add handleGetOsImages handler in provision.ts
- Add getOsImages method in ProvisioningService
- Add route in index.ts
- Returns key, name, family, is_default for each OS image

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 10:35:16 +09:00
kappa
3c420d2841 feat: manage OS images in database instead of hardcoded values
- Add os_images table with linode_image_id and vultr_os_id columns
- Support Ubuntu (24.04, 22.04), Debian (11-13), AlmaLinux (8-9),
  Rocky Linux (8-9), and Fedora 42
- AlmaLinux and Rocky Linux added as CentOS migration alternatives
- Default OS changed from ubuntu_22_04 to ubuntu_24_04
- Fix Vultr OS IDs (1743=22.04, 2284=24.04)
- Remove hardcoded OS validation, validate against DB
- Return available OS list in error message for invalid image

Migration: migrations/003_os_images.sql

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 10:31:14 +09:00
kappa
7d9edc14a3 feat: add configurable VPS provider API URLs for emulator testing
- Add LINODE_API_URL and VULTR_API_URL environment variables
- Update LinodeProvider and VultrProvider to accept optional baseUrl
- Update ProvisioningService to pass API URLs to providers
- Add source_provider and source_region_code to PricingWithProvider type
- Use source_provider (linode/vultr) instead of provider_name (Anvil)
- Improve error handling for non-JSON responses in LinodeProvider

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 10:21:27 +09:00
kappa
006b938ad2 feat: add source_provider mapping for actual VPS provisioning
- Update PricingWithProvider type with source_provider and source_region_code
- Update getPricingWithProvider query to JOIN instance_types for actual plan_id
- Use source_provider (linode/vultr) instead of provider_name (Anvil)
- Use source_region_code for actual provider region (ap-northeast, nrt, icn)

Mapping: anvil_regions.source_provider + anvil_pricing.source_instance_id
         → instance_types.instance_id (actual Linode/Vultr plan)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 00:47:03 +09:00
kappa
9b51b8d427 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>
2026-01-27 17:19:19 +09:00