Skip to content

Trim the Railway deployment and bring Go, Node and dependencies up to date - #34

Merged
cldixon merged 3 commits into
mainfrom
claude/codebase-deployment-review-jrk38r
Nov 5, 2026
Merged

cldixon merged 3 commits into
mainfrom
claude/codebase-deployment-review-jrk38r

Conversation

@cldixon

@cldixon cldixon commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Warning

Merging will probably redeploy part of the site. offwing-web and ingest follow main and deployed automatically on the last merge (#33). The PDS is not running, so the result would be a read-only website plus an ingest that fails to connect and restarts up to 10 times. If the site should stay down, turn off automatic deploys on those two services before merging, or remove the new deployments afterwards.

Why

  1. Cost. The demo was costing ~$10/month on Railway. Railway charges for memory held, not traffic served, and the deployment had eight containers that were mostly idle and always on.
  2. Security. In October 2026, Go shipped a crypto/x509 fix that distrusts eight eMudhra intermediate CA keys (GO-2026-6809, in Go 1.26.10 and 1.27.3). ingest was last built on Sep 15 from golang:1.26, so it predates the fix. Several dependencies were also well behind.

What changed

In Railway (already done, outside this diff)

  • Deleted watchdog, watchdog-ingest and Postgres-8BEk (plus its volume). The deleted index can be rebuilt from the firehose.
  • Turned on app sleeping for offwing-web.
  • Staged (not yet deployed) the pds image change from ghcr.io/bluesky-social/pds:latest to :0.4.5051. That's the same image latest points to today.

Deployment

  • web/railway.json: adds "sleepApplication": true. This file overrides dashboard settings, so without it a deploy would turn sleeping back off.
  • DEPLOYMENT.md, three new sections:
    • Optional: AppView B: how to bring the watchdog back. It must keep its own database to stay an independent observer.
    • Keeping the bill small: why web can sleep, why the PDS, ingest and Postgres can't, and how to upgrade the pinned PDS safely (back up pds-volume first).
    • Staying patched: base images follow a release line, so each rebuild picks up the latest patches. After a security release, redeploy.
  • README.md / DEVELOPMENT.md: mark the watchdog as optional. Its code is unchanged and CI still tests it.

Go

  • Go 1.27 for the ingest build (golang:1.27) and CI. go.mod keeps go 1.26.0 as the minimum and adds toolchain go1.27.3.
  • pgx 5.5.0 → 5.12.0. 5.5.0 has a known SQL-injection advisory, fixed in 5.5.4.
  • x/crypto 0.21 → 0.58, x/net 0.23 → 0.62, gorilla/websocket 1.5.3, latest indigo.
  • CI now runs govulncheck. It couldn't be run during this work because the container can't reach vuln.go.dev, so this PR's CI run is the first real scan.

Node

  • Node 24 (current LTS) for all images and CI. Node 22 is in maintenance until April 2027.
  • hono 4.13.16 and @hono/node-server 2.1.6 clear their advisories. Neither affected path was in use (no serveStatic, no dot-notation parseBody), but there's no reason to keep them.
  • Everything else updated within its existing version range.
  • Remaining: zod 3.x, pulled in by every @atproto/* package, has a high-severity memory-exhaustion advisory with no fix on the 3.x line. It goes away when @atproto moves to zod 4. Low risk here, because the only inputs it validates come from our own PDS.
  • Not done, on purpose: @atproto/api 0.20 → 0.30, @atproto/repo 0.10 → 0.11 and @anthropic-ai/sdk 0.120 → 1.x. These may include breaking changes and none fixes a security issue.

Verification

  • go build, go vet, gofmt clean; go test ./... passes, including the database tests against a real Postgres 16 (none skipped).
  • npm run typecheck clean in every workspace.
  • npm test passes: 439 tests against a real Postgres, none skipped, on both Node 22 and Node 24.
  • npm run vectors leaves testdata/vectors.json unchanged, so the commitment scheme is untouched.
  • Booted web (demo mode) and watchdog locally. Health checks and home pages return 200 on @hono/node-server 2.

Expected result

PDS, ingest and Postgres always on, with web running only while someone visits. That's roughly 0.3–0.4 GB held around the clock, which should fit inside Hobby's $5 usage credit, so about $5/month in total.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WkPSygdRZ4dKwsasb7dzVQ

The hosted deployment now runs one AppView to cut idle cost: the watchdog,
its firehose consumer and its own Postgres are removed from Railway. The code
stays and is still tested in CI; DEPLOYMENT.md says how to bring it back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WkPSygdRZ4dKwsasb7dzVQ
web/railway.json turns on Railway's app sleeping, so the website stops
holding memory between visits. The PDS image is pinned to 0.4.5051 (what
latest resolved to) in Railway; DEPLOYMENT.md explains both and how to
upgrade the PDS safely.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WkPSygdRZ4dKwsasb7dzVQ
@railway-app

railway-app Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the offwing-pr-34 environment in Offwing

Service Status Web Updated
offwing-web 😴 Sleeping (View Logs) Web Nov 5, 2026 at 4:42 pm UTC
seed 🚨 Crashed (View Logs) Nov 5, 2026 at 4:35 pm UTC
ingest ✅ Success (View Logs) Nov 5, 2026 at 4:35 pm UTC
1 service not affected by this PR
  • pds

@railway-app
railway-app Bot temporarily deployed to Offwing / offwing-pr-34 November 5, 2026 16:28 Destroyed
- Go 1.27 for the ingest build and CI (toolchain go1.27.3), which carries
  the October crypto/x509 distrust fix (GO-2026-6809). The Dockerfile tracks
  golang:1.27 so each build takes the newest patch.
- Go modules: pgx 5.5.0 -> 5.12.0, x/crypto 0.21 -> 0.58, x/net 0.23 -> 0.62,
  gorilla/websocket 1.5.3, latest indigo.
- Node 24 for the images and CI; Node 22 is in maintenance.
- npm: hono 4.13.16 and @hono/node-server 2.1.6 clear their advisories;
  everything else updated within its range. zod 3 (pulled in by @atproto/*)
  still has an advisory with no fix on the 3.x line.
- CI runs govulncheck.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WkPSygdRZ4dKwsasb7dzVQ
@railway-app
railway-app Bot temporarily deployed to Offwing / offwing-pr-34 November 5, 2026 16:34 Destroyed
@cldixon cldixon changed the title Trim the Railway deployment: optional watchdog, sleeping web, pinned PDS Trim the Railway deployment and bring Go, Node and dependencies up to date Nov 5, 2026

cldixon commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

About the red Offwing - seed status: this is expected in the preview environment and isn't caused by this PR's code.

Preview environments are cloned without the pds service (see DEPLOYMENT.md). The seed waits 60 s for http://pds.railway.internal:3000, then exits with PDS never became reachable, without writing anything. That's its intended behaviour. It only deployed this time because the PR touches seed/Dockerfile (Node 24), and its watch patterns are limited to seed/**.

The preview is still useful as a check of the new images:

  • offwing-web (Node 24) built and passed /api/health, and is now sleeping, so sleepApplication works.
  • ingest (Go 1.27) built and runs. It retries the missing PDS every 30 s, as designed.
  • seed (Node 24) started and ran its code up to the PDS check.

GitHub Actions (go, including the first govulncheck scan, typescript and cross-language) is all green. govulncheck reports no vulnerabilities the code can reach.


Generated by Claude Code

@cldixon
cldixon merged commit ecffa05 into main Nov 5, 2026
9 of 10 checks passed

This branch was successfully deployed

No deployments
Offwing / offwing-pr-34 — e432cc1e Deployed Nov 5, 2026 by railway-app[bot]
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.

2 participants