# Bellona Remote — Production Deployments

Production-ready deployment artifacts for the Bellona Remote Gateway data plane
(`apps/bellona/remote-gateway`).

| Directory              | Item          | Target                      | Stack                                                                                                                          |
| ---------------------- | ------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| [`hetzner/`](hetzner/) | `180.C.25.08` | Hetzner Cloud (single node) | `docker-compose.prod.yml` + Caddy (TLS/ACME) + coturn + Postgres + MinIO + Prometheus/Grafana + Loki/Promtail + pg-backup cron |
| [`aws/`](aws/)         | `180.C.25.09` | AWS                         | Terraform: ALB + ECS Fargate + RDS Postgres + ElastiCache Redis + S3 + CloudWatch + coturn EC2 + RDS/S3 backups                |
| [`smoke/`](smoke/)     | both          | —                           | `smoke-test.sh` — post-deploy validation hook (fails loud without a deployed URL; never fabricates a pass)                     |

## What is and is not run here

These artifacts ARE the deliverable. They are validated for **syntax and
internal consistency**:

- Hetzner compose: `docker compose -f hetzner/docker-compose.prod.yml config` ✔
- AWS Terraform: `terraform validate` + `terraform fmt -check` (provider
  `aws ~> 5.0`) ✔
- Shell scripts: `bash -n` ✔, and `smoke/smoke-test.sh` exits non-zero without
  `BELLONA_SMOKE_BASE_URL` ✔

The live `docker compose up` (real Hetzner VM) and `terraform apply` (real,
billable AWS resources) are **account/credential-gated and are NOT run here**.
The smoke test is the validation hook for when a deployment IS live. See each
directory's README for the full runbook and an honest limitations section.

## Common design

- The gateway is never publicly reachable on its app port (`4070`); a TLS edge
  (Caddy / ALB) is the only public HTTP entry. coturn's STUN/TURN/relay ports
  are the only other public ports (WebRTC requires reachable relay candidates).
- Gateway env in both stacks mirrors
  `apps/bellona/remote-gateway/src/config.ts`; secrets come from compose `.env`
  (`:?` required) or AWS Secrets Manager, never hard-coded.
- coturn is the TURN relay for the `180.C.25.04` WebRTC direct-vs-relay
  fallback; the gateway derives short-lived TURN credentials from the shared
  static-auth-secret, and the connection metric records the relay server when a
  session falls back to it.
