synor/docs/PLAN/PHASE9-SynorHosting/01-Milestone-02-HostingGateway.md
Gulshan Yadav c829362729 feat(cli): add deploy command for Synor Hosting
Add `synor deploy` command group for deploying web applications:
- `synor deploy push` - upload project to Synor Hosting
- `synor deploy init` - create synor.json configuration
- `synor deploy list` - list all deployments
- `synor deploy delete` - remove a deployment

Features:
- synor.json configuration parsing with build/routes/headers
- Framework auto-detection (Next.js, Vite, Astro, Angular, SvelteKit)
- Build command execution with install support
- Multipart file upload to storage gateway
- Deployment name validation with reserved word protection
- Content type detection for 20+ MIME types

Also adds Phase 9 milestone documentation and marks Synor Hosting
as 100% complete in the roadmap.
2026-01-10 12:59:35 +05:30

1.8 KiB

Milestone 02: Hosting Gateway

HTTP gateway server for serving hosted web applications

Status: Complete

Tasks

  • Create HostingGateway server with Axum
  • Implement request handler with host-based routing
  • Implement content fetching from Synor Storage
  • Add content type detection (20+ MIME types)
  • Implement RateLimiter with token bucket algorithm
  • Add CacheControl middleware for immutable assets
  • Create SSL configuration structure
  • Create hosting-gateway binary
  • Create Docker configuration (Dockerfile + Caddy)
  • Create docker-compose.hosting.yml
  • Add comprehensive test coverage (37 tests total)

Files

crates/synor-hosting/src/
├── server/
│   ├── mod.rs      # HostingGateway, GatewayConfig
│   ├── handler.rs  # Request routing, content fetching
│   ├── middleware.rs # RateLimiter, CacheControl
│   └── ssl.rs      # SSL configuration
├── bin/
│   └── hosting-gateway.rs

docker/hosting-gateway/
├── Dockerfile      # Multi-stage Rust build
└── Caddyfile       # Wildcard HTTPS for *.synor.cc

docker-compose.hosting.yml

Key Components

  • HostingGateway: Main HTTP server using Axum
  • GatewayConfig: Configuration (listen addr, domain, storage URL, rate limit)
  • RateLimiter: Token bucket rate limiting per client IP
  • CacheControl: Immutable asset detection for optimal caching
  • Caddy reverse proxy with automatic Let's Encrypt HTTPS

Architecture

Internet → Caddy (HTTPS) → HostingGateway → Storage Gateway → Storage Nodes
                ↓
         *.synor.cc wildcard cert

Validation Commands

cargo test -p synor-hosting
cargo build -p synor-hosting --features server
docker-compose -f docker-compose.hosting.yml build

Completed: January 2026