-
Notifications
You must be signed in to change notification settings - Fork 1
Gateway Management
Manage a system-level Caddy reverse proxy across your hosts. Unlike Docker-based stacks, the gateway runs as a systemd service and is managed via Caddyfile deployment.
Since: v0.24.0
The gateway command manages Caddy as a system service (not a container). This is useful when Caddy acts as the front-door reverse proxy for multiple Docker stacks on a host.
strut gateway deploy --host harbor # Deploy Caddyfile and reload
strut gateway status --host harbor # Check Caddy service status
strut gateway reload --host harbor # Reload without deploying new config
strut gateway validate # Validate local Caddyfile syntaxPlace Caddyfile configs in your project at:
stacks/gateway/
├── Caddyfile.harbor # Host-specific config for "harbor"
├── Caddyfile.compass # Host-specific config for "compass"
└── Caddyfile # Shared fallback (used if no host-specific file exists)
Resolution order:
-
stacks/gateway/Caddyfile.<host-alias>(host-specific) -
stacks/gateway/Caddyfile(shared fallback)
Deploys the Caddyfile to the remote host:
- Backs up the current remote Caddyfile
- Uploads the new config via SCP
- Validates syntax on the remote (
caddy validate) - Reloads Caddy service
- Automatic rollback if validation fails
strut gateway deploy --host harbor
strut gateway deploy --host harbor --dry-runShows systemctl status caddy on the remote host:
strut gateway status --host harborReloads Caddy without deploying a new config (useful after manual remote edits):
strut gateway reload --host compassValidates all local Caddyfile syntax without deploying. Requires caddy installed locally:
strut gateway validate| Variable | Default | Description |
|---|---|---|
GATEWAY_CADDY_PATH |
/etc/caddy/Caddyfile |
Remote path for active Caddyfile |
GATEWAY_STACK_DIR |
stacks/gateway |
Local directory for Caddyfile configs |
Set these in strut.conf to override defaults.
The --host alias resolves via the [hosts] section in strut.conf (see Multi-Host Topology). Falls back to VPS_HOST / VPS_USER env vars if no topology entry exists.
- Remote config is always backed up before overwrite (
.baksuffix) - New config is validated remotely before reload
- If validation fails, the previous config is automatically restored
- Supports
--dry-runfor previewing the operation
strut · v0.28.0 · Report an Issue
Getting Started
Core Concepts
Operations
- Deployment
- Ship and Rebuild
- GitHub Actions
- Remote Host Setup
- Provisioning
- Blue-Green Deploy
- Deploy Rollback
- Database Backups
- Secrets Management
- Stack Groups
- Lifecycle Hooks
- Notifications
- Key Rotation
- Drift Detection
- Domain and SSL
- Certificate Management
- Gateway Management
- Monitoring
- Volume Management
Advanced
- Security Posture
- VPS Audit and Migration
- Stack Validation
- Data Anonymization
- Debugging
- Local Development
Extending
Contributing