passwd-nsite lets you publish a password-locked nsite.
A locked nsite ships with a small unlock app and an encrypted site.7z.
When someone visits the site:
- The unlock page loads.
- The browser downloads
site.7z. - The visitor enters the password.
- The archive is decrypted locally in the browser.
- The unlocked files are stored locally and served by the site router.
The password-protected content is not visible until the archive is successfully decrypted in the browser.
Demo site:
https://0ygl461f4ecz5thkn8eksa36nepjpij86s83ti8yzokopd3ag5syncabout.nsite.lol/ password is syncing
Install the CLI globally with Deno:
deno install --allow-read --allow-net -f -g -n passwd-nsite jsr:@hzrd149/passwd-nsiteAfter installing, you can run the CLI as passwd-nsite.
Publish a locked nsite directly from JSR with Deno:
deno run --allow-read --allow-net jsr:@hzrd149/passwd-nsite publish ./my-site \
--site-id mysite \
--password YOUR_PASSWORD \
--nsec YOUR_NSEC \
--relay wss://relay.example.com \
--server https://blossom.example.comYou can also read the password from stdin:
printf '%s' YOUR_PASSWORD | deno run --allow-read --allow-net jsr:@hzrd149/passwd-nsite publish ./my-site \
--site-id mysite \
--password-stdin \
--nsec YOUR_NSEC \
--relay wss://relay.example.com \
--server https://blossom.example.comRequired inputs:
<siteDir>--site-id--passwordor--password-stdin--nsec- one or more
--relay - one or more
--server
Optional inputs:
--title--description--dry-run
Permissions:
--allow-readto read the site folder and packaged publish assets--allow-netto upload to Blossom servers and publish to relays
The CLI builds site.7z, uploads the required blobs, signs the named-site manifest, and publishes it to the relays you provide.