Skip to content

dev2 deploys: IMAGE_REPO prebuilt-image mode (dev2 pulls, never builds) - #275

Merged
ralyodio merged 1 commit into
masterfrom
dev2/prebuilt-image-deploys
Nov 22, 2026
Merged

ralyodio merged 1 commit into
masterfrom
dev2/prebuilt-image-deploys

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

dev2 (about 2 GB free RAM, swap full, load 50-80) compiled the Rust c0mpute binary and the Next.js site in every c0mpute.com deploy. This adds an opt-in mode where CI builds and dev2 only pulls.

  • deploy-app.sh: IMAGE_REPO in deploy.env means pull <IMAGE_REPO>:<full sha>, export APP_IMAGE, then compose up --no-build. If the tag is missing, the deploy stops with an error and the running stack is not touched. It never falls back to a local build. Deploy-gate, vault sync, standby, health check and rollback stay as they were. On rollback, APP_IMAGE is pointed back at the snapshotted image.
  • Registry auth: the workflow sends its short-lived GITHUB_TOKEN as one line on ssh stdin. The script reads it before deploy-gate, because the gate runs its job with stdin on /dev/null. The token goes to docker login in a throwaway DOCKER_CONFIG and is never written to the box. ci-deploy needs no change, since stdin passes through its exec.
  • After a healthy deploy, old pulled tags are pruned. The current tag, the previous one and :rollback are kept.
  • dev2-site: sites.d image_repo renders IMAGE_REPO= and image: ${APP_IMAGE:-<site>-app:latest}.
  • c0mpute.com: remote_build (dev2: REMOTE_BUILD=c0mpute builds site images on a c0mpute builder #263, never applied on the box) is replaced by image_repo: ghcr.io/profullstack/c0mpute-web. The image comes from profullstack/c0mpute's deploy-dev2 workflow.

🤖 Generated with Claude Code

…build on dev2)

deploy-app.sh: with IMAGE_REPO in deploy.env (sites.d "image_repo") the
script pulls <IMAGE_REPO>:<full sha>, exports APP_IMAGE for compose and
runs compose up --no-build. A missing tag stops the deploy before the
running stack is touched; there is no local-build fallback. Registry
auth is one line on stdin (the workflow's GITHUB_TOKEN), read before the
deploy gate and used with a throwaway DOCKER_CONFIG, never stored.
Rollback re-points APP_IMAGE at the snapshotted image; old pulled tags
are pruned after a healthy deploy (current, previous, :rollback kept).

dev2-site renders IMAGE_REPO and image: ${APP_IMAGE:-<site>-app:latest}.
c0mpute.com moves from remote_build (never rolled out) to image_repo
ghcr.io/profullstack/c0mpute-web.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

42 finding(s)

HIGH/CRITICAL: 15 | MEDIUM: 13 | LOW: 14

Severity Rule Location
HIGH py-ssrf-outbound-request dev2/dev2-site:152
HIGH py-ssrf-outbound-request dev2/dev2-site:1103
HIGH py-ssrf-outbound-request dev2/dev2-site:1916
HIGH sh-remote-script-execution root-ubuntu.sh:3262
HIGH sh-remote-script-execution root-ubuntu.sh:3263
HIGH sh-remote-script-execution root-ubuntu.sh:5176
HIGH sh-remote-script-execution root-ubuntu.sh:5180
HIGH sh-remote-script-execution root-w3bs-os.sh:3639
HIGH sh-remote-script-execution root-w3bs-os.sh:3640
HIGH sh-remote-script-execution root-w3bs-os.sh:5569
HIGH sh-remote-script-execution root-w3bs-os.sh:5579
HIGH sh-remote-script-execution root-w3bs-os.sh:5586
HIGH sh-remote-script-execution root-w3bs-os.sh:5602
HIGH sh-remote-script-execution root-w3bs-os.sh:5607
HIGH sh-plaintext-download root-w3bs-os.sh:6289
MEDIUM sql-template-interpolation dev2/dev2-site:1347
MEDIUM sql-template-interpolation dev2/dev2-site:1424
MEDIUM gha-ssh-key-secret dev2/templates/deploy-dev2.yml:40
MEDIUM sh-remote-script-execution root-ubuntu.sh:5384
MEDIUM redos-nested-quantifier src/domain-free.ts:56
MEDIUM redos-nested-quantifier src/emoji.ts:167
MEDIUM redos-nested-quantifier src/icon.ts:166
MEDIUM redos-nested-quantifier src/mail.ts:1060
MEDIUM sql-template-interpolation src/users-dump.ts:487
MEDIUM sql-string-concatenation src/users-dump.ts:507
MEDIUM sql-template-interpolation src/users-dump.ts:540
MEDIUM sql-string-concatenation src/users-dump.ts:574
MEDIUM redos-nested-quantifier src/wcag.ts:556
LOW secret-generic-credential src/credentials.ts:41
LOW secret-generic-credential src/credentials.ts:58
LOW secret-generic-credential src/credentials.ts:61
LOW secret-generic-credential src/credentials.ts:66
LOW secret-generic-credential src/user-export.ts:689
LOW secret-generic-credential src/user-export.ts:695
LOW secret-generic-api-key test/credentials.test.ts:208
LOW secret-generic-credential test/mail.test.ts:141
LOW secret-generic-credential test/proxy.test.ts:69
LOW secret-generic-credential test/proxy.test.ts:85
LOW secret-generic-credential test/shorten.test.ts:36
LOW secret-database-url test/users-dump.test.ts:108
LOW secret-database-url test/users-dump.test.ts:119
LOW secret-database-url test/users-dump.test.ts:120

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit fda24a0 into master Nov 22, 2026
2 checks passed
@ralyodio
ralyodio deleted the dev2/prebuilt-image-deploys branch November 22, 2026 23:55
ralyodio added a commit that referenced this pull request Nov 23, 2026
…aller), coinpayportal, bittorrented (#278)

The heaviest dev2 deploys stop building on the box (STANDING: never build on
dev2). Each repo is public, so its deploy workflow builds the image on GitHub
Actions (free minutes) and pushes ghcr.io/profullstack/<pkg>:<sha>; dev2's
deploy-app.sh pulls it in IMAGE_REPO mode (#275).

- sites.d: image_repo for threatcrush.com (threatcrush-web, replaces the unused
  remote_build), crawlproof.com (crawlproof-web, bespoke deploy script),
  pairux.com (pairux-web), installer.pairux.com (pairux-installer),
  coinpayportal.com (coinpayportal-web), bittorrented.com (bittorrented-web;
  app_host corrected: it runs on dev2, the droplet is retired)
- templates/deploy-app.sh: the operator vault handoff coinpayportal.com's copy
  carried by hand (export the old container's unlock before the swap, import it
  once healthy or after a rollback) is now in the template, a no-op wherever
  scripts/operator-vault-handoff.sh is absent, so coinpayportal can run the
  shared template with prebuilt mode

Co-authored-by: riotcoder <riotcoder@profullstack.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant