← Skulk

03 · Web · Next.js 16 + PostgreSQL

A server the app does not have to trust.

Accounts, plans and downloads live on a Next.js server. It tells each install what it may do, and signs the answer so that nobody, the server's own operator included, can fake one.

  • Next.js 16
  • Prisma 7
  • PostgreSQL
  • Better Auth
  • Ed25519
  • Docker
  • Hetzner

The check-in

Four messages, and the last one is offline.

The app

The server

  1. This is install 7f3a. What may I do?
  2. Plan, limits, oldest version allowed, ask again by Friday. Signed.
  3. Signature matches the key I was built with. Saved to disk.
  4. Offline until Friday? Still working, from the saved answer.

Edit the saved answer, or point the app at a different server, and the signature no longer matches.

01

Sign-in

The desktop app never sees a password.

Signing in happens in the browser. The app makes a random secret, opens the site with only the secret's hash, and gets a one-time code back through a skulk:// link.

Code and secret together are traded for a session. The code alone is worthless to anyone who intercepts it.

02

Check-in

What the app may do arrives signed, and works offline.

At each check-in the server answers with the plan's limits, the oldest app version still allowed, and a time by which the app must ask again. The answer is signed with a key whose public half is built into the app.

The app keeps that answer on disk and works offline until it expires. Editing the file, or pointing the app at another server, gives nothing: the signature would not match.

Signature
Ed25519.
Offline
Until the answer's own deadline.

03

Builds

Uploaded by checksum, published only when signed.

Build files are stored under their SHA-256, so a file the server already holds is never uploaded twice. A new engine whose fonts did not change uploads the base alone.

The server refuses a build that is not signed by the release key, and downloads can resume where they broke off.

04

Admin

Behind a role and a phone code.

The admin pages need the admin role and a one-time code from a phone. There is deliberately no page or setting that can make someone an admin: that takes a command run on the server itself.

Tested
38 tests on the server.

Next · 04

The keys

Three signing keys kept in three places, so a break-in at the server installs nothing.