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:
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_cellLaunch with the RDS override:
docker compose \
-f docker-compose.cell.yml \
-f docker-compose.aws-rds.yml \
--env-file .env up -d --no-buildEnsure the EC2 security group can reach RDS port 5432, and keep RDS isolated inside private subnets without public accessibility.
TLS Termination (HTTPS & Mail Protocols) #
- TLS Certificates (
CELL_TLS_CERT_DIR): Mounttls.crt(full certificate chain) andtls.key(private key,0600) intoCELL_TLS_CERT_DIR. Bothhttps-proxy(Nginx) and mail daemons (smtp-in,imapd,pop3d) read/etc/tsubame/certs/tls.crtand/etc/tsubame/certs/tls.key. - 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 WebAuthnRP_IDand mail clients validate cleanly. - Nginx Reverse Proxy (
nginx.aws.conf): - Listens on443 sslwithTLSv1.2 TLSv1.3andserver_tokens off. - ForwardsHost,X-Real-IP,X-Forwarded-For,X-Forwarded-Proto https,X-Forwarded-Host, andX-Forwarded-Port 443. - Keepscontrol-backenddbound only to127.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:
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.