javascript-solid-server 0.0.41 → 0.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -136,7 +136,8 @@
136
136
  "Bash(npm cache clean:*)",
137
137
  "Bash(git checkout:*)",
138
138
  "Bash(gh gist edit:*)",
139
- "Bash(gh gist view:*)"
139
+ "Bash(gh gist view:*)",
140
+ "Bash(./bin/git-credential-nostr acl:*)"
140
141
  ]
141
142
  }
142
143
  }
package/README.md CHANGED
@@ -4,7 +4,7 @@ A minimal, fast, JSON-LD native Solid server.
4
4
 
5
5
  ## Features
6
6
 
7
- ### Implemented (v0.0.41)
7
+ ### Implemented (v0.0.42)
8
8
 
9
9
  - **LDP CRUD Operations** - GET, PUT, POST, DELETE, HEAD
10
10
  - **N3 Patch** - Solid's native patch format for RDF updates
@@ -354,38 +354,29 @@ git push
354
354
 
355
355
  Git operations respect WAC permissions - clone requires Read access, push requires Write access.
356
356
 
357
+ **Auto-checkout:** After a successful push to a non-bare repository, JSS automatically updates the working directory - no post-receive hooks needed.
358
+
357
359
  ### Git Push with Nostr Authentication
358
360
 
359
361
  Git push supports NIP-98 authentication via Basic Auth. Install the credential helper:
360
362
 
361
363
  ```bash
362
364
  npm install -g git-credential-nostr
365
+ git-credential-nostr generate
363
366
  git config --global credential.helper nostr
367
+ git config --global nostr.privkey <key-from-generate>
364
368
  ```
365
369
 
366
- Generate or configure your Nostr key:
370
+ Create an ACL for your repo (includes public read for clone + owner write for push):
367
371
 
368
372
  ```bash
369
- # Generate a new keypair
370
- git-credential-nostr generate
371
-
372
- # Or use an existing private key
373
- git config --global nostr.privkey YOUR_64_CHAR_HEX_PRIVKEY
373
+ cd myrepo
374
+ git-credential-nostr acl > .acl
375
+ git add .acl && git commit -m "Add ACL"
374
376
  ```
375
377
 
376
378
  See [git-credential-nostr](https://github.com/JavaScriptSolidServer/git-credential-nostr) for more details.
377
379
 
378
- Add the Nostr identity to your ACL:
379
-
380
- ```turtle
381
- <#nostr-writer>
382
- a acl:Authorization;
383
- acl:agent <did:nostr:YOUR_64_CHAR_HEX_PUBKEY>;
384
- acl:accessTo <./>;
385
- acl:default <./>;
386
- acl:mode acl:Read, acl:Write.
387
- ```
388
-
389
380
  ## Authentication
390
381
 
391
382
  ### Simple Tokens (Development)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "javascript-solid-server",
3
- "version": "0.0.41",
3
+ "version": "0.0.43",
4
4
  "description": "A minimal, fast Solid server",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -201,6 +201,27 @@ export async function handleGit(request, reply) {
201
201
  if (code !== 0 && !headersSent) {
202
202
  reply.code(500).send({ error: 'Git operation failed' });
203
203
  }
204
+
205
+ // Auto-checkout working directory after successful push to non-bare repo
206
+ if (code === 0 && isGitWriteOperation(urlPath) && gitInfo.isRegular) {
207
+ const checkout = spawn('git', ['checkout', '-f'], {
208
+ cwd: repoAbs,
209
+ env: {
210
+ ...process.env,
211
+ GIT_DIR: gitInfo.gitDir,
212
+ GIT_WORK_TREE: repoAbs
213
+ }
214
+ });
215
+ checkout.on('error', (err) => {
216
+ console.error('Auto-checkout failed:', err.message);
217
+ });
218
+ checkout.on('close', (checkoutCode) => {
219
+ if (checkoutCode !== 0) {
220
+ console.error('Auto-checkout exited with code:', checkoutCode);
221
+ }
222
+ });
223
+ }
224
+
204
225
  resolve();
205
226
  });
206
227
  });