Skip to content

Commit 3b00cf6

Browse files
feat: --provision-keys passthrough (default off) (#45)
Expose JSS's existing owner-key provisioning (Schnorr secp256k1 keypair → <pod>/private/privkey.jsonld + WebID Multikey VM + /.well-known/did/nostr/<pubkey> resolution) through jspod as an opt-in flag. Default off — keeps jspod Solid-pure. The planned nosdav-server wrapper will flip this on as part of its Nostr-default positioning. jspod --provision-keys # turn it on for this run jspod --no-provision-keys # explicit off (already the default) Adds the flag to parsing, --help text, and README. Fixes #44
1 parent 6af6765 commit 3b00cf6

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ That's it. You have a working Solid pod with a passkey-capable identity provider
3232
--no-open Don't auto-open the browser on start
3333
--no-git Disable JSS's git HTTP backend
3434
--browser <style> Data browser: folder (default) or json
35+
--provision-keys Generate a Nostr-compatible owner keypair on first start
3536
-v, --version Print jspod version
3637
--help Show help
3738
```

index.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,13 @@ const options = {
255255
// 'folder' (default) = friendlier container listing (table + breadcrumb)
256256
// that falls back to JSON-LD when the resource isn't a container.
257257
// 'json' = minimal JSON-LD pretty-print (the developer view).
258-
browser: 'folder'
258+
browser: 'folder',
259+
// Off by default — keeps jspod Solid-pure. Opt in here when you want
260+
// a Nostr identity on the pod (JSS generates a Schnorr secp256k1
261+
// keypair on first start, stores it at <pod>/private/privkey.jsonld,
262+
// and publishes the pubkey in the WebID profile). The nosdav-server
263+
// wrapper will flip this on by default.
264+
provisionKeys: false
259265
};
260266

261267
// Auth-ladder rung-1 credentials. See issue #6: jspod ships a deliberately
@@ -332,6 +338,10 @@ for (let i = 0; i < args.length; i++) {
332338
options.open = false;
333339
} else if (arg === '--no-git') {
334340
options.git = false;
341+
} else if (arg === '--provision-keys') {
342+
options.provisionKeys = true;
343+
} else if (arg === '--no-provision-keys') {
344+
options.provisionKeys = false;
335345
} else if (arg === '--browser') {
336346
const raw = requireValue(arg, args[++i]);
337347
if (raw !== 'json' && raw !== 'folder') {
@@ -362,6 +372,7 @@ for (let i = 0; i < args.length; i++) {
362372
console.log(chalk.green(' --no-open') + chalk.dim(' Do not open the browser automatically'));
363373
console.log(chalk.green(' --no-git') + chalk.dim(' Disable JSS\'s git HTTP backend (it is on by default)'));
364374
console.log(chalk.green(' --browser ') + chalk.yellow('<folder|json>') + chalk.dim(' Data browser style (default: folder)'));
375+
console.log(chalk.green(' --provision-keys') + chalk.dim(' Generate a Nostr-compatible owner keypair on first start'));
365376
console.log(chalk.green(' -v, --version') + chalk.dim(' Show jspod version'));
366377
console.log(chalk.green(' --help') + chalk.dim(' Show this help message\n'));
367378
console.log(chalk.white('Examples:'));
@@ -621,6 +632,13 @@ if (!options.auth) {
621632
// don't want this surface can pass --no-git.
622633
jssArgs.push(options.git ? '--git' : '--no-git');
623634

635+
// Off by default. JSS generates a Schnorr secp256k1 keypair on first
636+
// start, writes it to <pod>/private/privkey.jsonld (mode 0600), and
637+
// publishes the pubkey in the WebID profile as a Multikey
638+
// verificationMethod. Pairs with the existing /.well-known/did/nostr/
639+
// resolution endpoint so the pod becomes its own DID resolver.
640+
if (options.provisionKeys) jssArgs.push('--provision-keys');
641+
624642
// Start JSS with enhanced PATH to find the binary
625643
const jss = spawn('jss', jssArgs, {
626644
stdio: 'inherit',

0 commit comments

Comments
 (0)