RDS & TLS Setup #

For managed persistence and encrypted ingress on cloud VMs (such as AWS EC2 + RDS), use the docker-compose.aws-rds.yml override and nginx.aws.conf.example in infra/deploy/cell/.

AWS RDS PostgreSQL Override #

The RDS override disables the bundled postgres container (profiles: ["disabled"]), resets service depends_on dependencies, and points every daemon to your RDS endpoint with sslmode=require:

  • IDENTITY_PG_DSN (identityd)
  • TENANT_PG_DSN (tenant-configd)
  • TSUBAME_PG_DSN (control-backendd)
  • MB_DSN (mail-worker, smtp-in)
  • DATABASE_URL (imapd, pop3d)

Configure .env from .env.aws-rds.example:

bash
CELL_TENANT_ID=tenant-prod-cell
CELL_PRIMARY_DOMAIN=mail.<your-domain>
RDS_ENDPOINT=<your-rds-instance>.<region>.rds.amazonaws.com
POSTGRES_USER=tsubame
POSTGRES_PASSWORD=GENERATE_ME
POSTGRES_DB=tsubame_cell

Launch with the RDS override:

bash
docker compose \
  -f docker-compose.cell.yml \
  -f docker-compose.aws-rds.yml \
  --env-file .env up -d --no-build
TIP

Ensure the EC2 security group can reach RDS port 5432, and keep RDS isolated inside private subnets without public accessibility.

TLS Termination (HTTPS & Mail Protocols) #

  1. TLS Certificates (CELL_TLS_CERT_DIR): Mount tls.crt (full certificate chain) and tls.key (private key, 0600) into CELL_TLS_CERT_DIR. Both https-proxy (Nginx) and mail daemons (smtp-in, imapd, pop3d) read /etc/tsubame/certs/tls.crt and /etc/tsubame/certs/tls.key.
  2. Wildcard / Multi-SAN Coverage: Include SANs for admin.<your-domain>, console.<your-domain>, mail.<your-domain>, docs.<your-domain>, and *.<your-domain> (or automated ACME certs) so WebAuthn RP_ID and mail clients validate cleanly.
  3. Nginx Reverse Proxy (nginx.aws.conf): - Listens on 443 ssl with TLSv1.2 TLSv1.3 and server_tokens off. - Forwards Host, X-Real-IP, X-Forwarded-For, X-Forwarded-Proto https, X-Forwarded-Host, and X-Forwarded-Port 443. - Keeps control-backendd bound only to 127.0.0.1:8080 (CONTROL_HTTP_PORT=127.0.0.1:8080).

Platform WebAuthn Origin Alignment #

Set TSUBAME_PLATFORM_RP_ID and TSUBAME_PLATFORM_ORIGIN to match the exact HTTPS hostname used to access the Platform Admin portal:

bash
TSUBAME_PLATFORM_RP_ID=admin.<your-domain>
TSUBAME_PLATFORM_ORIGIN=https://admin.<your-domain>

Mismatched RP_ID or non-HTTPS origins will cause browser WebAuthn Passkey registration and assertion ceremonies to fail closed.