asxpio-services runs the site and the monitor worker from this flake
(services.asxpio) and the containers are gone. The Dockerfile,
.dockerignore, docker-compose.yml and the Kaniko and deploy jobs go; CI
runs the tests and builds the package on every push, main included.
CLAUDE.md describes the new setup: storage on ops over the private
network, settings and secrets in iac's sops, no deploy secrets here.
Assisted-by: Claude:opus-5-5
packages.default is the app with its gems (bundlerEnv from Gemfile.lock
and gemset.nix, generated by bundix): bin/asxpio is Puma serving
config.ru, bin/asxpio-monitor the reachability worker. Photos are
resized with ImageMagick 7's magick. nixosModules.default
(services.asxpio) runs both as hardened systemd services with a dynamic
user, the web one with readiness from Puma (Type=notify); settings and
secrets come from one environment file. CI checks that gemset.nix
matches Gemfile.lock (bin/check-gemset) and builds the package.
Checked locally: migrations on an empty database, /healthz and /, an
invoice PDF with the Noto fonts, a photo resized to WebP and cropped.
The container deploy stays until the NixOS service has taken over.
Assisted-by: Claude:opus-5-5
asxpio-ops moves to NixOS, where containers run under Podman. Podman
ignores the HEALTHCHECK of OCI-format images, which is what kaniko
pushes, so the container would never report "healthy" and the deploy,
which waits for exactly that, would time out.
Copy the image's healthcheck into the compose file. Under Docker,
which reads it from the image today, nothing changes.
Assisted-by: Claude:opus-5-5
Superuser accounts can do everything, so their login should not be
exposed on the public site. With SUPERUSER_HOST set, a superuser's
correct password on any other host fails exactly like a wrong one, an
existing superuser session there counts as none, a password reset sends
nothing, and the env recovery login only works on that host.
admin.asxp.io is a second Traefik router to the same container, allowed
only from WireGuard and the VPC. The host comes from HTTP_HOST, since
Rack's request.host would trust a client-sent X-Forwarded-Host.
Invite and reset links for regular users use SITE_URL, so an invite
created on admin.asxp.io still opens for someone off WireGuard.
Assisted-by: Claude:opus-5-5
storage moved to Postgres 18.7 (2026-11-13); the CI database service
follows, so tests run on the server version that ships.
Assisted-by: Claude:opus-5-5
The plain puma binstub runs without Bundler, so RubyGems activates
gems as they are required and picks Ruby's default bigdecimal. Under
Ruby 4 that is 4.0.1, which ttfunk 1.8.0 (prawn, invoice PDFs) refuses:
the deploy of 7b34454 crash-looped on Gem::ConflictError. With bundle
exec the lockfile decides (bigdecimal 3.3.1).
Checked on ops with the production env, as a separate container: the
Ruby 4 image boots to Listening and renders the latest invoice to PDF.
Assisted-by: Claude:opus-5-5
The deploy (run 458) crash-looped: under Ruby 4 the default bigdecimal
is 4.0.1, and ttfunk 1.8.0 (prawn, invoice PDFs) requires bigdecimal
~> 3.1, so the app fails to load (Gem::ConflictError). The pre-merge
boot test stopped at the database connection, before prawn was
loaded, so it missed this. Production was rolled back by hand to
768b10e1; this puts main back in step.
Assisted-by: Claude:opus-5-5
Move the production image to ruby:4.0.9-slim-bookworm (same distro, so
native gems build against the same libraries) and the dev shell to
nixpkgs' ruby_4_0, also 4.0.9, so the tests run on the Ruby that ships.
Ruby 4's Bundler 4 dropped `bundle install --without`; set
BUNDLE_WITHOUT instead, which Bundler 2 reads too. The lockfile stays
BUNDLED WITH 2.7.2 (nixpkgs' bundler; Bundler 4 switches to it).
Checked before merging: the image builds, keeps the test gems out, and
boots Puma 8.0.2 on Ruby 4.0.9 through to opening the database.
Rollback: revert this commit and redeploy (or re-tag the previous image).
Assisted-by: Claude:opus-5-5
minitest 6 moved Minitest::Mock into the separate minitest-mock gem;
the tests require minitest/mock, so the Renovate bump alone failed with
a LoadError. Take both. Test-only: the production image installs
without the test group.
Assisted-by: Claude:opus-5-5
Floating tags (17-alpine, 3.4-slim, nginx:alpine, :latest, :debug, @v7)
change under a deploy without anyone deciding it: the storage deploy
moved Postgres to 17.12 on its own because of postgres:17-alpine. Pin
every image and action to its exact current version, so each change
arrives as a reviewed Renovate PR and a rollback is a revert.
Assisted-by: Claude:opus-5-5
The previous run failed to push its image: the token behind FJ_TOKEN
had been regenerated, and the secret now holds the new one.
Assisted-by: Claude:opus-5-5
Forgejo reserves names starting with FORGEJO_, and since runner v13
secrets.FORGEJO_TOKEN, _USER and _REGISTRY no longer reach the job as
the values set on the repository: Kaniko logged in with the wrong
credentials and every image push failed with UNAUTHORIZED.
The registry host and user are not secret (they are in every image
name), so write them in the workflow; the token comes from FJ_TOKEN,
as in datacenterbingo.
Assisted-by: Claude:opus-5-5
rack 3.2.6 has a denial of service in the multipart parser
(CVE-2026-125111, GHSA-5v64-555j-wjxm): parsed data stays in the scan
buffer, so a crafted upload makes memory grow without bound. The app
is reachable from the internet and accepts multipart forms.
Only the lock changes; the Gemfile already allows ~> 3.2.
Assisted-by: Claude:fable-5-2
There was no way to put a file up for public use short of running an
S3 client with the uploader key. Add a "files" area to the admin:
upload one or more files, copy the link, edit the note, replace the
contents under the same link, delete. It has its own read/write/delete
permission flags like the other areas, and every action is audited.
The objects go to the storage stack's public bucket and are served by
Garage at s3.asxp.io/public/<key>, not by this app. The app's key can
only put and delete there, so a public_files table is the record of
what was published. Keys get a random prefix: links are not guessable
and names never collide.
That host is same-site with the admin, so a file that can carry script
must not render there. Only a fixed list of types (images, PDF, plain
text, audio, video) is served inline; the rest, HTML and SVG included,
is stored as an attachment. Image metadata is stripped by default, as
for the bingo photos, because of GPS tags.
A per-file limit and a total quota keep the small disk on asxpio-ops
from filling up.
Assisted-by: Claude:fable-5-2
CLAUDE.md and SECRETS.md still described MinIO: the endpoint, the
bootstrap script and the kind of key. Describe Garage, and say how the
deploy turns the ASXPIO_S3_* secrets into a Garage key.
Assisted-by: Claude:fable-5-2
The storage stack replaces MinIO, abandoned upstream, with Garage. Point
the app at garage:3900.
Garage only accepts keys in its own format, so hash the existing
ASXPIO_S3_* secrets into it the way storage's bootstrap does. The
secrets stay as they are; a pair already in Garage's format is used
unchanged.
Assisted-by: Claude:fable-5-2
Payments often arrive before they are recorded, so stamping paid_at
with the click time skews received-per-month and days-to-pay stats.
Mark paid now takes an optional date, and a paid invoice gets a form
to correct it. Past days are stored at 12:00 UTC so the date holds in
any timezone; future and malformed dates are refused. The PDF does not
print the date, so nothing is re-rendered.
Assisted-by: Claude:opus-5-5
Claude-Session: https://claude.ai/code/session_01TCc5TvWnAs5xPvGMQXTJw3
Opening /admin/ logged out stored next=/admin/ in the login form, and a
successful login then redirected to /admin/, which has no route (404).
Redirect trailing-slash admin URLs to the slashless route with a 301,
and drop trailing slashes from the post-login target too.
Assisted-by: Claude:opus-5-5
.dockerignore left out all of bin/, which only held bin/test until now.
The asxpio-monitor container runs bin/monitor from the image and
crash-looped with "No such file or directory -- bin/monitor". Exclude
just bin/test.
Assisted-by: Claude:opus-5-5
datacenterbingo gets a public page showing whether each datacenter's
network answers. The probing lives here, next to the schema and the
admin, since the public site only has a read-only role.
bin/monitor runs as a second container from the same image. Once a
minute it opens one TCP connection to every active target (a handshake
or a refusal both count as answered) and folds the results into
5-minute rows per datacenter, plus a per-bucket row for control hosts in
Russia, so a lost vantage point isn't mistaken for dark sites. Rows are
kept 30 days. Targets are managed at /admin/bingo/monitor; only hosts a
public source ties to that one site belong there.
Migration 017 also grants the new tables to the bingo role, so the
public site can read them without a storage redeploy.
Assisted-by: Claude:opus-5-5