johnandersen777.bsky.social/atlibs-fedproxy
fedproxy and ingress modules for atlibs: SSH public keys on your PDS, did:key ingress; pages and web tiles
atlibs-fedproxy
Two atlibs wasm modules (knotless://johnandersen777.bsky.social/atlibs) and the pages that run them:
fedproxy: lists and adds the SSH public keys fedproxy.com reads from your PDS to expose your services, as the signed-in user, held torecords/fedproxy.json's scope.ingress: serves HTTP and XRPC from a module athttps://did-key-<key>.xrpc.fedproxy.com, through the fedproxy did:key ingress relay.forward: true: every request is onecom.fedfork.exec.ingress.requestcall to the host with{method, path, params, headers, body, callerDid}; its output{status, body, contentType, headers}is the response.headersmaps a name to a string, or to a list of strings for a repeated header (Set-Cookie); other entries are dropped. The relay drops the headers it owns (Connection and the other hop-by-hop ones, Content-Length, Strict-Transport-Security, Alt-Svc, Proxy-*), a Set-Cookie with a Domain, CR/LF/NUL, and past 64 values or 32 KiB;contentTypewins over a Content-Type header. The relay itself answers CORS preflights and setsAccess-Control-Allow-Origin: *unlessheaderssets it; sendAccess-Control-Expose-Headersfor a header a browser must read.aliases: custom host names (a list, or space/comma separated). After every registration the module sendscom.fedproxy.temp.xrpc.alias {hosts}; the relay serves each host whose_xrpc.<host>TXT holds this did:key (or its did-key host) and answersalias#result {accepted, rejected}, which is the run result'saliases. The TXT alone already routes the host while the module is connected; the frame reports whether the relay sees it. While any host is rejected the module sends the frame again every 60 s (the relay caches TXT answers, negative ones too, for 60 s), so a TXT record added after the connection is reported accepted without a reconnect.routes: NSIDs whose/xrpc/<nsid>requests become calls to that NSID, each served by a composition edge. A composition's instanceinputmay fixroutes,deadlineMs,maxRequests,lifetimeMs,forward,aliasesandrelay(module.jsonconfig), as atlibs-agents'serve.jsondoes.
Layout
modules/fedproxy,modules/ingress: the modules (Rust, against atlibs'abiSDK)web/fedproxy-ssh-public-keys: a page for the keys;web/fedproxy-webtiles: the same as a web tile (tile/);web/ingress: a page that serves through ingressrecords/: the session record, published module snapshots (records/wasm/) and the tile (records/tiles/)
Set up
atlibs is a sibling checkout: Cargo fetches the abi crate from git, and the tests and pages import
its JavaScript from ../atlibs.
git clone https://knotless.dev/johnandersen777.bsky.social/atlibs ../atlibs && git -C ../atlibs checkout -q 88b2ba8
Build
cargo wasm
The wasm lands in target/wasm32-unknown-unknown/release/; each page's modules/ links to it.
Run a page
python3 -m http.server 8000 --bind 127.0.0.1 --directory web/fedproxy-ssh-public-keys
Open http://127.0.0.1:8000/?module=local to run your own build (without ?module=local the page runs
the published module record).
Test
cargo wasm && node --test modules/*/test.mjs web/*/*.test.mjs
Publish
Commit first: the source manifest names the commit it was built from.
atlibs login you.bsky.social
atlibs publish --dir modules --dry-run --as you.bsky.social
atlibs publish --dir modules --as you.bsky.social
atlibs publish tile web/fedproxy-webtiles/tile fedproxy-webtiles --out records/tiles --as you.bsky.social
Today's atlibs builds only its own layout.
atlibs publishrebuilds in a container fromCargo.toml,Cargo.lock,.cargo,rust/srcandexamples/rust, withbash rust/src/build.sh, so it does not yet seemodules/. Until it does,--no-buildpublishes yourcargo wasmbuild, whichatlibs verify(that container rebuild) will not reproduce.