Repository navigation
Description
Summary
Package Trinity as a pre-baked VM image that operators can launch on Google Cloud Platform or Hetzner with a single click — no SSH setup, no manual installation, no deployment scripts. The image has Trinity fully installed and starts automatically on first boot after minimal per-instance configuration.
Context
Today, deploying Trinity requires provisioning a VM, installing Docker, cloning the repo, configuring .env, and running ./scripts/deploy/start.sh. This is a reasonable one-time process for technical operators but a significant barrier for new users and makes fleet-scale provisioning slow.
A pre-baked image eliminates all of that. The operator launches the image from their cloud provider's UI or CLI, supplies a few environment variables (admin password, domain, Cloudflare token) via cloud-init user-data, and Trinity is running within minutes.
GCP is the current production hosting environment. Hetzner is a popular choice for self-hosted deployments given its cost/performance ratio.
Acceptance Criteria
- Packer template at
infra/packer/trinity.pkr.hclbuilds a Ubuntu 22.04 base image with Trinity pre-installed - Image includes: Docker Engine, Docker Compose v2, Trinity cloned to
/opt/trinity,cloudflaredbinary - Packer build targets: GCP custom image (via
googlecomputebuilder) and Hetzner snapshot (viahcloudbuilder) - cloud-init first-boot script handles per-instance configuration from user-data: admin password, domain name, Cloudflare Tunnel token, email whitelist seed
- Trinity systemd service starts automatically on boot and restarts on failure
-
.env.examplepre-populated in the image; cloud-init merges user-supplied values and calls./scripts/deploy/start.sh - GCP image published as a public image (or shared image family) so users can launch without building it themselves
-
infra/packer/README.mddocuments: how to build the image, how to launch on GCP and Hetzner, what user-data fields are accepted - Optionally: a minimal Terraform module (
infra/terraform/) for one-command provisioning (VM + firewall rules + Cloudflare DNS)
Technical Notes
Packer builder targets:
- GCP:
googlecomputebuilder → produces a named image in a GCP project; can be made public via IAMallAuthenticatedUsers:roles/compute.imageUser - Hetzner:
hcloudbuilder → produces a snapshot that can be shared or used as a private base
First-boot flow:
- cloud-init writes
/opt/trinity/.envfrom user-data variables - Systemd
trinity.servicecalls/opt/trinity/scripts/deploy/start.shon boot - Cloudflare Tunnel auto-registers if
CF_TUNNEL_TOKENis present in user-data; otherwise Trinity is reachable only via the VM's public IP on port 80
Security: the image must not bake in any credentials. All secrets (admin password, API keys, Cloudflare token) must come from cloud-init user-data at launch time. The image should ship with a randomized placeholder SECRET_KEY that cloud-init overwrites.
Relationship to existing scripts: scripts/deploy/start.sh and scripts/deploy/stop.sh remain the canonical entrypoints — the image just pre-positions everything so those scripts can run without prerequisites.
Cloudflare Tunnel is already wired into the production docker-compose.yml. The image just needs cloudflared pre-installed; the Tunnel token is supplied at launch time.
Activity
feat(hosting): publish prebuilt images and install from them (#2280) (#…
obasilakis commentedon Sep 11, 2026
These ACs are stale — the work shrank a lot (survey, 2026-09-11)
This issue was written before #2280 and #2281. Two of its acceptance criteria now describe a shape we deliberately moved away from, and the rest is mostly already written:
Stale as written
/opt/trinity" plus an on-host build is exactly what feat: prebuilt images + pull-only hosted compose + unattended cloud-init first boot — the gate for every one-click / marketplace channel #2280 replaced. The image should bake the prebuilt GHCR images instead —packer/digitalocean/scripts/01-provision.shpulls all five plus the third-party ones so first boot pulls nothing.infra/packer/trinity.pkr.hcl— the tree that actually exists ispacker/digitalocean/(trinity.pkr.hcl,scripts/,files/). A GCP and a Hetzner builder are additionalsourceblocks over the samefiles/tree, not a second image definition; keeping them inpacker/alongside DO is the cheaper shape.Already done elsewhere, reusable as-is
The first-boot flow this issue specifies — write
.envfrom user-data, start on boot, optional Cloudflare Tunnel, no baked credentials — is implemented inpacker/digitalocean/files/opt/trinity-firstboot/firstboot.sh(230 lines). Provider-coupled points are the metadata endpoint (line 87), the baked-tag read (line 94),TRINITY_INSTALL_SOURCE(line 131) and the cloud-init hook path; everything else carries over. The reuse map on #2282 applies here unchanged.Note that
firstboot.shgoes further than this issue asks: it appliesDOCKER-USERDROP rules (the Docker-past-ufw gap), and it issues and verifies a Let's Encrypt certificate for the bare IP. Do not drop either when porting — the certificate verification exists because the failure is otherwise silent.The one real blocker, and it is on #2280
The GHCR images are amd64 only today — every manifest index carries
amd64plus anunknownattestation entry and no arm64 (check on #2280). Hetzner's CAX line is arm64, so the Hetzner half of this issue needs #2280's multi-arch AC done first, or it ships amd64-only and silently excludes the cheapest Hetzner plans. The GCP half is unaffected.Scope question worth answering before picking this up
Hetzner has no third-party marketplace, so the deliverable there is a shared snapshot plus documentation, not a listing — materially less reach than DigitalOcean (#2281), Vultr (#2282) or the community buttons (#2283). GCP public-image sharing needs the
allAuthenticatedUsers:roles/compute.imageUsergrant and an owning project. Both are fine, but this issue is now the lowest-reach item in epic #2332 rather than a peer of the marketplace lanes; worth re-ranking rather than working in filed order.obasilakis commentedon Oct 1, 2026
Database backend: PostgreSQL. SQLite reached end-of-support on 2026-09-01 (#1278). New installs from any one-click channel must start on PostgreSQL.
Added acceptance criteria:
start.sh --provision --cloud <gcp|hetzner> --hosted, as DigitalOcean and AWS do) and get PostgreSQL from bug: one-click hosted installs (DigitalOcean 1-Click first) create new instances on SQLite after its end-of-support — bundle PostgreSQL in the hosted compose #3159. No per-cloud database setup./health200, no/data/trinity.db.The Packer, Ubuntu-version and cloudflared criteria above predate the shared hosted path (#2280,
packer/digitalocean,packer/aws). They need re-scoping against it before work starts.