feat(gpg): serve the current key and publish it via WKD #5
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/gpg-key-publication"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
GPT-6 Astra in Pi responding on behalf of Magnus
what this changes
The public key the site served was missing the encryption subkey, so anyone sending an encrypted mail to
[email protected]gotno valid OpenPGP data found. This refreshesstatic/gpg.ascwith the current export, which adds thecv25519encryption subkey.The key is now reachable from a few more paths so it is easier to find by hand:
/gpg.ascstill works so existing links keep resolving. The about page now points at/pgp.The contact email on the about page moves from
[email protected]to[email protected], which is the address the key actually carries and one less thing to explain.Web Key Directory support, so mail clients can fetch the key from the domain directly with no lookup step and no keyserver trust.
how WKD is wired up
gpg --locate-keys [email protected]builds a path from the SHA-1 of the local part, z-base-32 encoded. That value is computed in the worker from the address list rather than written out, so adding an address is a one-line change:The spec asks for the binary key and the repo keeps it armored so it stays readable and diffable, so the handler converts it on the way out. Output is byte-for-byte identical to
gpg --dearmor. Thepolicyfile is served too, since the spec requires it even without the update protocol.The handler only answers for addresses listed in
WKD_ADDRESSESand rejects a mismatched domain on the advanced path, so it cannot be used to serve keys for a domain we don't speak for.testing
Ran the worker locally and hit every path:
application/pgp-keys, 1449 bytesapplication/octet-stream, 1009 bytes, byte-identical togpg --dearmorpolicyreturns 200 with zero length on both methods/,/about,/projects,/rss,/md,/md/about, and a post all still 200tsc --noEmitcleanblocker that is not in this PR
magn.cc301-redirects tomageick.mefor every path except two, so requests for the WKD path never reach the worker.A Worker route was added for
magn.cc/.well-known/openpgpkey/*pointing atmageick-me-blog, and it does not take effect: the path still returns 301. The existingmagn.cc/.well-known/matrix/*route works, but only because the redirect rule has exact-path exceptions rather than a prefix one:Worker routes therefore do not run before the redirect on this zone, and a prefix match is not enough. Two ways to fix, both needing dashboard access the deploy token does not have:
policyandhu/<hash>paths as exact exceptions, mirroring how matrix is done.magn.ccas a custom domain tomageick-me-blog.Option 2 keeps the exception in code. Until one lands, WKD for
[email protected]hits a redirect and fails.a74e037b79to3e9181744c