~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0
README.md

atlibs-examples-spa-networking

examples/marque-fedproxy-ingress: serve from a browser tab through the fedproxy ingress, at the tab's did:key host; signed in, on a Marque domain too.

cargo install --locked --git https://knotless.dev/johnandersen777.bsky.social/atlibs --rev 88b2ba8 atlibs
git clone https://knotless.dev/johnandersen777.bsky.social/atlibs-examples-spa-networking
cd atlibs-examples-spa-networking
scripts/stage.sh
python3 -m http.server 8780 --bind 127.0.0.1 -d examples/marque-fedproxy-ingress/dist   # http://127.0.0.1:8780/

Signed out, http://127.0.0.1:8780/ serves at once at the URL it shows (its did:key stays in the browser's site data, so reloads keep it):

curl https://did-key-<key>.xrpc.fedproxy.com/   # hello world, from the tab

Signed in, pick a domain you registered at Marque, a name, Serve: it writes <name> CNAME did-key-<key>.xrpc.fedproxy.com and _xrpc.<name> TXT did:key:<key>, and the tab answers there too:

dig +short TXT _xrpc.<name>.<domain>   # did:key:<key>
curl https://<name>.<domain>/          # hello world, from the tab
whatfrom
@publicdomainrelay/atlibs 0.3.0, -code-mode 0.3.0jsdelivr (index.html import map)
assemblyscript 0.28.20, binaryen 131.0.0-nightly.20260721, long 5.3.2jsdelivr
@atproto/oauth-client-browser 0.5.14, codemirror 6.0.2, @codemirror/lang-javascript 6.2.5esm.sh
marque module + sessionbafyreigtk2moowpnarynnlhle6seiod547wufbivliavdutljs3bydkhli (bobvmbuilder.bsky.social, atlibs.lock.json)
ingress modulebafyreidhsbptjjb4kbzdom2s6fgj47urcne56gcgl4hks254qertg7e3ja

Deploy (any static host):

scripts/stage.sh --origin https://you.example/serve/ && rsync -a examples/marque-fedproxy-ingress/dist/ you.example:/srv/serve/

Deploy https://atlibs-networking.socialweb.computer/ (scripts/deploy.sh: stage for that origin, back up the live dir, tar over ssh to the socialweb.computer gateway, a Caddy file_server site):

scripts/deploy.sh

Update a module: (cd examples/marque-fedproxy-ingress && atlibs add bobvmbuilder.bsky.social/<module>), then scripts/stage.sh.

Test:

node --test examples/*/*.test.mjs