Repository navigation
Description
Summary
Every new DigitalOcean 1-Click droplet starts on SQLite. SQLite reached end-of-support on 2026-09-01 (#1278), so each new install is born on a backend that no longer receives schema migrations or fixes, and will need a data migration that has no tooling today.
Fresh hosted installs must run on a bundled PostgreSQL by default.
Cause
src/backend/db/engine.pyfalls back to SQLite at/data/trinity.dbwheneverDATABASE_URLis unset.docker-compose.hosted.ymlpassesDATABASE_URL=${DATABASE_URL:-}(empty by default) and has nopostgresservice. Its comment says a Postgres URL must point at an operator-managed database.- Nothing under
packer/digitalocean/(provision, firstboot,.envwriting) and nothing instart.sh --hostedsetsDATABASE_URL.
Scope: the shared hosted path, not the DO image alone
DigitalOcean is where this was found, but every one-click channel converges on the same two pieces:
| Channel | Path |
|---|---|
| DigitalOcean 1-Click | firstboot.sh → start.sh --provision --cloud digitalocean --site-only --hosted --unattended |
| AWS AMI / CloudFormation (#3004) | the same firstboot.sh → start.sh ... --cloud aws ... --hosted |
| Vultr imageless (#2282) | vultr-vendor-data.sh → start.sh --provision |
| Hostinger button / Dokploy (#2283) | docker-compose.hosted.yml directly, no start.sh |
Fix it once in docker-compose.hosted.yml + start.sh --hosted; every channel inherits it. The DO-specific work is the rebuild and resubmission.
Acceptance Criteria
-
docker-compose.hosted.ymlships apostgresservice (postgres:16-alpine), named volume, healthcheck,*default-logging(bug: container logs are unbounded — no json-file max-size anywhere (compose, agent SDK, or daemon); filled the disk and wedged dockerd on 2026-07-27 #1871). Backend and scheduler wait for it healthy. - The
postgresservice is ontrinity-platform-networkonly. Agents cannot route to it (same rule as Redis, Network Topology SEC: Redis has no requirepass — agent containers have unauthenticated full read/write access to platform task queue (AISEC-C1) #589). - A fresh hosted install (no existing database under
/data) gets PostgreSQL:start.shgeneratesPOSTGRES_PASSWORD, writes it andDATABASE_URL=postgresql://trinity:...@postgres:5432/trinityto.env. The backend builds the schema via Alembic on first boot. - An existing hosted install on SQLite (
/data/trinity.dbpresent,DATABASE_URLunset) keeps SQLite acrossstart.sh --hostedupdates and prints a pointer todocs/migrations/SQLITE_TO_POSTGRES.md. Fail closed: the update must never boot an empty PostgreSQL beside a populatedtrinity.db, because the operator would see an empty instance. - Compose-only consumers (feat: community one-click paths — "Deploy on Hostinger" button + Dokploy template (Coolify queued at 1,000 stars) #2283) get PostgreSQL too:
POSTGRES_PASSWORDis a required variable in the hosted compose (fails to render without it), with the requirement documented where the button/template points. - Nightly backups (bug: shipped database backup tooling is never invoked — no scheduled backups, no recovery point #2216) produce
.dumpfiles on a hosted PostgreSQL install. Verified on a booted droplet. -
packer/digitalocean/scripts/01-provision.shpre-pulls the postgres image with the other third-party images, so first boot pulls nothing. - Memory: measure RSS on a 4 GB droplet with PostgreSQL running; the 4 GB / 2 vCPU floor (bug: DigitalOcean 1-Click can be deployed on plans below the 4 GB / 2 vCPU minimum, and runs out of memory on 1 GB #3009) still holds, or the floor moves and the listing says so.
- Boot test: droplet created from the rebuilt snapshot reaches
/health200, backend log shows the Alembic upgrade,/data/trinity.dbdoes not exist. - Rebuilt snapshot submitted to the DO listing via
mp-submit.sh. - Docs:
packer/digitalocean/listing.md,docs/user-docs/guides/deploying/digitalocean.md,SQLITE_TO_POSTGRES.mdand the hosted compose comment state that hosted installs default to PostgreSQL.
Out of scope
- Migrating droplets already deployed on SQLite. No SQLite→PostgreSQL data-copy tool exists; that needs its own ticket.
- Changing the code-level default in
engine.pyor the devdocker-compose.yml.
Related
Parent: #2332. Same decision for the ops provisioning skills: abilityai/trinity-ops-agent#380. Channel tickets: #3004 (AWS), #2282 (Vultr), #2283 (Hostinger/Dokploy), #835 (GCP/Hetzner). Snapshot automation: abilityai/trinity-enterprise#648.
Activity
obasilakis commentedon Oct 1, 2026
/claim
github-actions commentedon Oct 1, 2026
@obasilakis This issue is already assigned to obasilakis. Use
/unclaimfirst if you want to take over.fix(hosting): one-click installs start on a bundled PostgreSQL (#3159)
fix(hosting): bundled PostgreSQL for one-click installs (#3159); vers…