After bringing up the stack, follow Initial setup for the first account, installation administrator and workspace.
The standalone digitalocean/ directory in the deployment repository provisions an Ubuntu 24.04 x64 Droplet, a restricted SSH firewall and a private DigitalOcean Container Registry. Docker Compose runs PostgreSQL, Java 25/Spring Boot 4, Flutter web, LiveKit and Caddy HTTPS. The full operator guide is included in that directory's README. No resources, image pushes, DNS changes or remote deployment have been executed to prepare these files.
One command for build, push and installation#
For future deployments, the examples use sintonia.one for the app, api.sintonia.one for the backend and rtc.sintonia.one for calls. Point all three A records to the Droplet. After Terraform apply, prepare the private config and run locally:
cp .env.example .env.deploy
chmod 600 .env.deploy
bash scripts/release.sh .env.deploy 1.0.0-do.2 \
/path/sintonia-backend /path/sintonia-app /path/sintonia-documentationThe command reads the registry from Terraform outputs, builds Flutter with the API origin, builds/pushes all three linux/amd64 images and invokes the installer. It updates the private config's release image references only after successful installation. A build/push failure prevents installation. Add --repair-docker if cloud-init failed to install Docker. This command does not apply Terraform, change DNS or expose documentation. If images are already available, use the installation-only command below.
Mailpit is included with persistent storage, internal SMTP mailpit:1025, authentication/STARTTLS disabled, and a loopback-only web interface on port 18025. It captures mail instead of delivering it to real user inboxes. Invitation/recovery/confirmation messages are viewed through a private SSH tunnel:
ssh -N -L 18026:127.0.0.1:18025 root@DROPLET_IPOpen http://localhost:18026. The separate local port avoids conflicts with the development Mailpit. Keep this UI private because it contains account recovery links. The initial capture limit is 5,000 messages. External SMTP is optional for a future switch to real delivery; check DigitalOcean SMTP restrictions at that time. Back up the sintonia-do_mailpit-data volume if captured mail must be preserved.
Integrated installation after Terraform#
Terraform creates infrastructure; cloud-init installs Docker without private registry credentials or application settings. After apply, DNS setup and publishing release images, configure a private file and run the installer:
cp .env.example .env.deploy
chmod 600 .env.deploy
# Configure real domains, DOCR image references, SMTP and ACME email.
# Leave initial generated credentials blank; the server generates them.
# Verify the SSH host fingerprint in the provider console before accepting it.
bash scripts/install.sh .env.deployThe installer reads Terraform IP/registry outputs, waits for SSH/cloud-init, checks Docker/Compose, transfers runtime files, merges configuration while preserving established credentials, prepares secrets, streams one-hour read-only registry auth, pulls images and starts containers. It does not run Terraform apply, build/push images, change DNS or publish documentation. Use the image publishing script below first.
If cloud-init failed to install Docker, inspect cloud-init status --long, systemctl status docker --no-pager and /var/log/cloud-init-output.log via SSH. Then explicitly repair the same Droplet:
bash scripts/install.sh .env.deploy --repair-dockerThe repair installs/checks Docker and Compose with retries and enables the service, without destroying the VM/volumes or changing Terraform user_data. Errors remain visible if package/network setup still fails. Repeating installation preserves existing database/encryption/media credentials when incoming fields are blank, and rejects replacing established values. A blank admin setup token disables completed bootstrap without regenerating it. The existing Caddyfile is retained; review the incoming reference under .incoming/Caddyfile manually. Back up before upgrades. Containers restart after reboot through Docker and unless-stopped; manually stopped containers remain stopped.
Provision#
Install Terraform >=1.9/<2, doctl, Docker/Buildx, Python 3 and the app's Flutter SDK. Register a public SSH key with DigitalOcean. Supply DIGITALOCEAN_TOKEN through a secret manager/environment, never Terraform variables, Git, cloud-init or the Droplet. From digitalocean/:
cp terraform.tfvars.example terraform.tfvars
# Set your unique registry name, region, size, SSH key fingerprint and admin IP CIDRs.
terraform init
terraform fmt -check
terraform validate
terraform plan -out=deploy.tfplan
terraform apply deploy.tfplan
terraform output droplet_ipv4
terraform output registry_endpointReview the plan and charges first. The 4 vCPU/8 GB default is a pilot estimate, not a capacity guarantee. Droplet backups are enabled and billable; registry uses basic/professional for three image repositories. Check current regional availability/pricing and media traffic costs. A single Droplet has no HA. Droplet and registry have prevent_destroy; replacement of the VM requires a deliberate backup/restoration plan. Keep state/plans private and commit .terraform.lock.hcl. Configure secure remote state/locking for teamwork. If managing an existing registry, configure matching properties and import it before planning:
terraform import digitalocean_container_registry.sintonia EXISTING_REGISTRYPoint app/API/RTC A records at the Droplet's IPv4, without AAAA in this example. RTC/API should use direct DNS, without an HTTP CDN proxy. Verify the SSH host fingerprint through the provider console, then wait for bootstrap:
ssh root@DROPLET_IP 'cloud-init status --wait'Cloud-init installs Docker/Compose, limits logs and disables password SSH. It does not contain runtime credentials or start the stack. Mailpit captures recovery/invitation emails locally by default. External SMTP is needed only when you choose real inbox delivery.
Build and push to DigitalOcean Registry#
Run locally/CI, supplying explicit independent source directories:
bash scripts/push-images.sh YOUR_REGISTRY 1.0.0-do.1 https://api.yourdomain.com \
/path/sintonia-backend /path/sintonia-app /path/sintonia-documentationWeb sign-in uses the current page origin, with no server selector. Proxy /api/*, /events (WebSocket) and authentication callbacks to the backend on that origin. Mobile and desktop require a server address, remembered after validation. No cloud address is compiled into the client.
Install and configure#
Transfer only the runtime files, not Terraform state/plans or workstation credentials:
scp compose.yaml Caddyfile Caddyfile.documentation .env.example root@DROPLET_IP:/opt/sintonia/
ssh root@DROPLET_IP 'mkdir -p /opt/sintonia/scripts'
scp scripts/prepare-secrets.py scripts/validate-config.py scripts/deploy.sh root@DROPLET_IP:/opt/sintonia/scripts/
ssh root@DROPLET_IPOn the Droplet:
cd /opt/sintonia
python3 scripts/prepare-secrets.py --public-ip DROPLET_IP
# Edit .env: real domains, ACME_EMAIL, versioned DOCR images, SMTP and MAIL_FROM.The script creates private .env/LiveKit files and generates blank database/admin-setup/LiveKit credentials without replacing existing values on repeat. Never print/commit them. The public IP is advertised to media clients; update the generated LiveKit configuration after IP changes. Keep the backend's generated operational key in the persistent instance volume.
For the first account on an empty database, set REGISTRATION_MODE=ip_restricted and REGISTRATION_ALLOWED_CIDRS=YOUR_PUBLIC_IP/32 before temporarily enabling REGISTRATION_ENABLED=true. The backend denies uninvited registration from other addresses; use direct API DNS so the client address is accurate. Deploy, register your account and activate installation administration using ADMIN_SETUP_TOKEN. Then choose the ongoing registration policy in the portal: public, invitation-only or authorized IPs. Saved policy takes precedence over environment defaults. Remove the setup token after activation and recreate only the backend to apply that environment change. Replace the temporary operator-only window with the organization's chosen policy; public registration is supported when explicitly enabled in the portal.
On the workstation, send a one-hour read-only registry credential directly to the dedicated Droplet, without printing the auth JSON or copying the primary account token:
bash scripts/registry-auth.sh YOUR_REGISTRY root@DROPLET_IPThis replaces /root/.docker/config.json on this dedicated host. Renew before each pull/update; existing containers do not need permanent credentials. On the Droplet:
cd /opt/sintonia
bash scripts/deploy.shCaddy obtains certificates for the real DNS names. App/API use HTTPS and events use WSS. Never run expanded docker compose config to the terminal: it contains credentials; use --quiet.
Media, documentation and persistence#
Public inbound ports are 80/443 TCP for HTTPS/ACME, 7881 TCP for ICE, 7882 UDP for media mux and 3478 UDP for authenticated LiveKit TURN. SSH 22 is restricted to admin CIDRs. LiveKit uses host networking; signaling 7880 is reached by Caddy through the Docker gateway and is not allowed in the cloud firewall. Database/backend/web have no direct published ports. Local development loopback bindings are unchanged.
The example supports ICE/TCP and TURN/UDP, not TURN/TLS on port 443. Strict corporate networks may require a separate TLS TURN service/domain/certificate; configure TURN_URLS, TURN_SHARED_SECRET and optionally TURN_FORCE_RELAY in the backend. HTTP reverse proxying does not provide TURN/TLS. Validate encrypted Chrome/Firefox/mobile calls across external networks before release. Calls are not recorded.
Documentation has no public route and its Compose profile is disabled. Only if you choose to publish it, configure docs DNS/domain, append Caddyfile.documentation to Caddyfile, start docker compose --profile documentation up -d documentation, then validate/reload Caddy. Nothing publishes the former external documentation site.
Docker volumes live on the Droplet disk and survive container replacement, but not disk/Droplet destruction. Back up PostgreSQL consistently, RustFS objects, legacy instance uploads/recordings, operational keys and private configuration to an independent encrypted destination. For a coherent backup, stop backend writes during the dump and instance-file copy, then restart and test isolated restoration. Droplet snapshots/backups do not replace database-consistent off-host backups. Do not put data/keys/backups in image layers. Plan retention/RPO/RTO and storage/media bandwidth growth using the sizing guide.
For upgrades, back up and rehearse on an isolated copy, publish new release tags/digests, renew registry pull auth, update image references and run deploy. Preserve volumes and passwords. Flyway applies migrations before backend startup; never edit applied SQL, bypass errors with clean/repair or assume reverting the image reverts the database. Do not run down -v or volume prune. Check HTTPS, API health, login/2FA, SMTP/recovery, files, events, encrypted calls and full restoration. up --wait is not an end-to-end acceptance test. Monitor CPU/RAM, disk, database, certificates, SMTP and media bandwidth. Backend replicas/backplane are not implemented.
Official references#
- DigitalOcean Terraform resources
- doctl registry docker-config
- LiveKit production deployment
- DigitalOcean SMTP restrictions
Registry login 403#
registry:update permission is required with read_write true means the operator token cannot issue push credentials. Configure a token with registry:update in the doctl context (doctl auth init --context sintonia) and/or update DIGITALOCEAN_TOKEN if used. Keep tokens out of logs. Test doctl registry login --expiry-seconds 3600; the release script now checks this before compiling Flutter. The Droplet still receives only short-lived pull auth, never the primary operator token.
SSH key passphrases#
The installer allows OpenSSH to request an encrypted private key's passphrase in the terminal. Server password login remains disabled, host keys are strictly verified and a private multiplexed connection is reused for SCP/commands and closed on exit. The script does not store the passphrase. Set SINTONIA_SSH_KEY to a nondefault private-key path if needed; release.sh passes this environment setting to the installer. A key already unlocked in ssh-agent/Keychain may connect without another prompt. Never put the passphrase in environment files or command arguments.
Runtime registration settings and calls#
Installation administrators can change signup policy under Administration → System settings without rebuilding images. The database policy overrides initial environment defaults once saved. The backend enforces public, invitation-only or IP-restricted signup; the proxy must not retain the obsolete registration IP rule. The installer safely upgrades known shipped proxies and requires manual review for relevant custom rules. Release 1.0.0-do.11 includes optional registration approval (off by default), email OTP, channel visibility/administrator management, signup password confirmation, persistent minimized calls, camera/microphone/resolution selection connection-quality charts, active-speaker highlighting, screen sharing docked feedback and keyboard-safe mobile people selection. Input selection preserves disabled sources.
Diagnose people search in production#
From this deployment directory, run bash scripts/diagnose-people-search.sh --compare in your terminal and enter the two account emails. OpenSSH unlocks the private key locally; never send its passphrase to support. Set SINTONIA_SSH_KEY for a non-default key and keep strict server host-key verification.
The read-only report includes container/migration versions, deployment mode, whether the two accounts exist/are enabled/approved, shared workspace counts and selected search-error identifiers. It omits the supplied emails and never selects passwords, session tokens, keys or message contents. It performs no deployment, account changes or automatic repair. Share the JSON report to diagnose before modifying workspace membership or isolation.
For an empty search, add the exact term: bash scripts/diagnose-people-search.sh --compare --query Gab. Enter your account as A and the other as B. queryComparison reports whether the term matches each saved name/email and whether A should appear in B's first page (accountAExpectedInBFirstPage). It reproduces the scoped filter/pagination in the first shared active workspace, explicitly noting that limit if multiple exist. It omits the query and stored personal fields. legacy only means the registration-approval migration is absent, not that an account is blocked. If SQL eligibility is positive, the actual browser request still needs checking.
Release do.8 adds browser Web Push, compact mobile chat and local noise suppression. V8 applies automatically; preserve the database and operational encryption key.
Release do.9 removes Cloud selection: web uses its own origin; mobile/desktop require a server address. It adds visibility-aware video reception and explicit Simulcast. Preserve INSTANCE_IDENTITY_ORIGIN and review custom proxy routes before deployment.
Release do.10 adds presentation fullscreen, camera focus, participant scrolling, on-demand connection charts and profile cards; screen-share controls use vector artwork independent of icon fonts.
Meetings and account blocking — do.11#
Release do.11 adds the calendar, approved accountless guests, delegated meeting administrators, SMTP invitations with ICS, email OTP policy disabled by default, and installation account block/unblock controls. Flyway applies V9–V10 without deleting data. Signaling proxies must use /api/meeting-sfu-authorize; do not expose port 7880. Internal LIVEKIT_CONTROL_URL enables durable media removal. Custom proxies require review. Mailpit does not deliver external invitations: configure real SMTP. Back up before upgrading.
Release do.12 adds the monthly calendar/day agenda, admission chime and separate actions for Google Calendar, Outlook.com, Microsoft 365 and ICS download. Online forms require user confirmation, without OAuth synchronization. Client/docs changes require no migrations beyond V10.
Release do.13: time grid, conversations and duplicate cleanup#
Release do.13 adds draggable/resizable Week/Day views, one canonical DM per unordered pair/workspace, personal sidebar hiding, faster opening with progress, and continuous background call audio. Flyway automatically applies V11 while preserving earlier conversations. Upgrade the application before cleanup to prevent new duplicates.
From digitalocean/ on your workstation, generate a read-only remote plan:
bash scripts/cleanup-direct-conversations.shSSH keeps strict host verification and prompts for the key passphrase locally when needed. SINTONIA_SSH_KEY supports a custom private key path. Output contains counts only. The private plan is stored at /opt/sintonia/backups/direct-cleanup-plan.json. No data is removed at this stage.
Review the counts, then apply the frozen plan:
bash scripts/cleanup-direct-conversations.sh --applyApply first creates a private (0600) pg_dump under /opt/sintonia/backups/, rechecks candidates in a locked transaction, and removes only planned empty duplicates. Any messages (including soft-deleted rows), files, calls, integrations, custody or unknown references protect a conversation. Canonical conversations are also protected. Contacts, tokens, keys and message content are not printed. The tool never merges E2EE ciphertext across channel IDs or removes user recovery backups. With no eligible candidates, no changes or backup are necessary.
PostgreSQL must already be running. The scripts do not start containers or change images. Backup/lock/SQL failure prevents removal; generate another plan if installation/data changed. Python/Bash tools are included in the deployment package and run independently of the app/docs repositories.
Release do.14: answering incoming calls#
Acknowledges an invitation before loading its conversation and keys, shows joining progress, and prevents repeated ringing during preparation. Hidden DMs can receive calls. Failures offer an explicit retry; accepted responses are idempotent and reveal the DM only for the recipient. New member/workspace-authorized GET /api/channels/{id}. No new migration (V11).
bash scripts/release.sh .env.deploy 1.0.0-do.14 /caminho/sintonia-backend /caminho/sintonia-app /caminho/sintonia-documentation /caminho/sintonia-recorderRun this as the operator; local preparation does not publish or deploy externally.
Release do.15: meeting participants#
Preserves invitee names across editing and reopening the picker. Adds bounded scrollable/searchable rosters, @Display name and lazy profile previews on hover or click. Meeting details now include invitees' email; update backend and app together. No new migration (V11).
bash scripts/release.sh .env.deploy 1.0.0-do.15 /caminho/sintonia-backend /caminho/sintonia-app /caminho/sintonia-documentation /caminho/sintonia-recorderPreparation is local; the operator decides when to deploy.
Release do.16: optional meeting recording#
Adds the independent recorder image and Flyway V12. Release scripts build four linux/amd64 images. The Compose recording profile and database policy remain off by default; prepare private storage/backups, add the recording profile and enable the portal policy explicitly. See Recording. No automatic Spaces upload or remote disk provisioning.
bash scripts/release.sh .env.deploy 1.0.0-do.16 /caminho/sintonia-backend /caminho/sintonia-app /caminho/sintonia-documentation /caminho/sintonia-recorderArchive/worker credentials are generated only if missing and retained on upgrade. No remote deployment is performed as part of implementation.
Release do.17: joining public channels#
Fixes Bad state: No element in public-channel discovery. Joining returns authorized metadata, opens the selected channel directly and discards older catalogue snapshots. Empty replies from older servers use a direct authorized lookup. Update backend and client together. No new migration, database cleanup or key changes (V12).
bash scripts/release.sh .env.deploy 1.0.0-do.18 /caminho/sintonia-backend /caminho/sintonia-app /caminho/sintonia-documentation /caminho/sintonia-recorderPrepared locally; deployment is an operator action.
Off-host recording workers#
The deployment bundle includes recording-workers/ for independent hosts and an optional private TLS control ingress. Terraform recording_worker_cidrs defaults empty, keeping 8443 closed. Portal registration does not provision Droplets. Use one identity per process and the recorder image from the same release, without copying the central master. Worker installation and reviewed infrastructure changes are separate from publishing images. See Recording worker pools.
Administration without an initial token#
If ADMIN_SETUP_TOKEN is empty, the server owner with SSH can grant the installation role to their own active/approved local account. From the DigitalOcean deployment repository:
ssh root@DROPLET_IP 'cd /opt/sintonia && bash -s -- --email YOUR_EMAIL' \
< scripts/grant-instance-admin.shReplace IP/email. No new deployment is required. The operation is transactional, idempotent and audited. Disabled, pending and federated accounts are rejected. Passwords, messages, devices and custody roles are unchanged. Refresh the portal afterwards. This requires server control and exposes no public login-based promotion.
Documentation HTTPS: explicit operator action#
After updating deployment files, run on your own server from /opt/sintonia, only when you want to expose the documentation:
bash scripts/documentation.sh enable
bash scripts/documentation.sh checkThe command checks the real DOCS_DOMAIN, prepares the site without overwriting custom routes, validates the Caddyfile inside the proxy, starts the documentation profile, saves the previous configuration and recreates only the proxy. This also avoids stale file bind mounts after atomic configuration replacement. The command is never invoked by release/install/deploy: documentation stays disabled by default.
SSL_ERROR_INTERNAL_ERROR_ALERT happens during TLS before HTML is served. Check DNS A and AAAA, public ports 80/443, the configured site and certificate issuance. An HTTPS response from the application domain does not validate the documentation subdomain. Caddy may take a few minutes to issue its certificate; rerun check. Inspect docker compose logs --tail=100 proxy locally when needed. Do not erase certificate volumes, database or uploads. See automatic HTTPS.
RustFS storage update#
The stack now includes private RustFS 1.0.6 with persistent volumes and loopback-only console. Release/install prepares missing credentials without replacing established values. Flyway V28 adds object references; legacy data remains readable and can be copied/verified without source deletion. See object storage for migration, backup, external endpoint override and future cluster templates. Preserve bucket/prefix/credentials across releases; this change provisions no remote resources.