Update
Update a pinned native binary, NixOS package, or container image, and understand rollback limits.
Use with AI
Take the context you need.
An update replaces the executable and restarts the service on the existing data. Record the current build, keep its configuration and secrets, and take a tested backup first. Build or download the replacement before stopping the server. Review changes between the two source commits.
This release adds a credential recovery table to the account database and an index to actor databases on writable open. The first index build takes a SQLite write lock and extra disk space. Allow for that work in your maintenance window.
Native binary
Section titled “Native binary”Download and verify a new archive,
or build the selected source revision. Keep the old executable in its versioned
/opt/linkjar-pds/<commit> directory. Install the new executable under a new
commit directory before changing the symlink.
Stop the service, then select the new executable. Set PDS_REV to the full
reviewed commit whose binary you installed:
sudo systemctl stop linkjar-pdssudo ln -sfn "/opt/linkjar-pds/$PDS_REV/linkjar-pds" /usr/local/bin/linkjar-pdsUse the native command helper, with
PDS_BIN=/usr/local/bin/linkjar-pds, to check configuration and data before startup:
pds check-configpds verifysudo systemctl start linkjar-pdsA failed check leaves the server stopped. Fix the problem before reopening it. A Cargo build needs its compatible host libraries. A normal Nix package needs its store closure and a retained garbage-collection root. The static Linux binary needs the host’s CA bundle. Keep the build type consistent unless you have tested a change, including throughput on your workload.
Change the linkjar-pds input URL in your host flake to the full reviewed commit.
Update only that input in the host’s lockfile:
nix flake update linkjar-pdsReview the host flake and lockfile diff, then build the host configuration
with your usual nixos-rebuild build --flake ... command. Take the backup and
activate the reviewed configuration with nixos-rebuild switch --flake ....
Use your actual host flake target in place of ....
The module validates configuration before starting the service. Keep the runtime environment file available through activation. NixOS generations record the package; they do not snapshot the PDS data or runtime secrets. See the Nix input update reference for updating a single input.
Docker Compose
Section titled “Docker Compose”Resolve the image tag to its immutable digest:
docker buildx imagetools inspect ghcr.io/linkjar/pds-server:main --format '{{.Manifest.Digest}}'Or build it yourself.
Set PDS_IMAGE in .env to the new digest, then:
docker compose pulldocker compose up -dCompose replaces the server container and leaves Caddy running. Pin a digest;
:main moves with every merge and cannot identify an exact rollback build.
Verify the update
Section titled “Verify the update”For NixOS or a native systemd service:
sudo systemctl status linkjar-pdssudo journalctl -u linkjar-pds --since '2 minutes ago' --no-pagerFor Docker:
docker compose psdocker compose logs --since 2m pdsFrom outside the host, check HTTPS and the server metadata as in setup verification. Also test sign-in and a representative read:
curl --fail https://pds.example.com/xrpc/_healthOn SIGTERM, the server stops taking connections, finishes writes in flight,
closes the firehose so the relay can resume at its cursor, and exits.
The supplied native services allow 30 seconds; Compose allows 60 seconds.
Roll back
Section titled “Roll back”For a native binary, stop the service, point /usr/local/bin/linkjar-pds back to
the retained executable, check it, and start. For NixOS, activate the previous
reviewed host configuration or generation. For Docker, restore the old digest
in .env and run docker compose up -d.
Check schema compatibility for the selected older build before serving data. An executable rollback does not restore the databases. The additive recovery table and actor index remain readable by older servers, but authentication protection can differ.
The reference server and older Candidate builds do not enforce credential epochs or the member host’s live session check. They can accept revoked, unexpired legacy tokens after a password recovery. If recovery must remain effective, rotate the token-signing secrets and keys and require sign-in again before serving with such a build. Keep the account database and its recovery table in every backup.
