Skip to content

Commit c10ec2f

Browse files
feat: bump jss to 0.0.195 and enable --git by default (#27)
JSS 0.0.195 (JavaScriptSolidServer/JavaScriptSolidServer#466) adds auto-init on first push, which closes the last gap that prevented the git HTTP backend from being useful out of the box. This PR turns on JSS's git backend by default in jspod, so every fresh `npx jspod` produces a pod that is also a real git remote: - `git clone http://localhost:5444/public/apps/<name>` for any public-read path - `git push http://localhost:5444/public/apps/<name>` for any owner-write path (auto-creates the bare repo on first push) - `git pull` to stay current Implementation: - package.json: bump javascript-solid-server from ^0.0.194 to ^0.0.195 - options.git defaults true; new --no-git CLI flag for opt-out (matches existing --no-auth / --no-open shape) - --git or --no-git is always passed explicitly to JSS so the spawn intent is unambiguous regardless of JSS's own default - docs.html grows a "Git remote" section explaining clone / push / auth ergonomics with a link to the upstream Known follow-up (out of scope here): git CLI doesn't speak DPoP natively, so push from the CLI today needs `git -c http.extraHeader="Authorization: DPoP <token>"`. Worth a dedicated jspod helper script + dedicated doc; tracked separately. Refs #1 #26
1 parent c62d3c8 commit c10ec2f

3 files changed

Lines changed: 28 additions & 2 deletions

File tree

docs.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ <h1>jspod docs</h1>
4040
<a href="#auth-ladder">Auth ladder</a>
4141
<a href="#backup">Backup &amp; reset</a>
4242
<a href="#apps">Bundled apps</a>
43+
<a href="#git">Git remote</a>
4344
<a href="#links">Links</a>
4445
</nav>
4546

@@ -119,6 +120,21 @@ <h2 id="apps">Bundled Solid apps</h2>
119120
<p>jspod bundles <a href="https://github.com/solid-apps/pilot">Pilot</a> at <code>/public/apps/pilot/</code>. It's served from your own pod, so same-origin sign-in works even on strict browsers (Brave with shields up).</p>
120121
<p>The bundle is copied skip-if-exists, so you can pin a specific Pilot version by editing the files locally and they'll survive jspod upgrades. Delete <code>pod-data/public/apps/pilot/</code> and restart to re-seed from the current jspod's bundled copy.</p>
121122

123+
<h2 id="git">Git remote (your pod is a git server)</h2>
124+
<p>jspod enables <a href="https://github.com/JavaScriptSolidServer/JavaScriptSolidServer">JSS</a>'s git HTTP backend by default. Any pod path you have ACL Read on is git-cloneable; any path you have ACL Write on is git-pushable. Fresh paths auto-initialize on first push (JSS 0.0.195+).</p>
125+
126+
<h3>Clone a public path</h3>
127+
<pre>git clone http://localhost:5444/public/apps/pilot ./pilot</pre>
128+
129+
<h3>Push to a new path (auto-creates the bare repo)</h3>
130+
<pre>git clone https://github.com/solid-apps/penny.git
131+
cd penny
132+
git remote add pod http://localhost:5444/public/apps/penny
133+
git push pod main</pre>
134+
<p>Note: <code>git push</code> against a Solid pod needs the same DPoP-bound auth as any other Solid write. Easiest workaround today is to set an <code>Authorization</code> header via <code>git -c http.extraHeader=...</code> with a token obtained from <code>/signin.html</code>. Cleaner ergonomics are a known gap.</p>
135+
136+
<p>To opt out: <code>npx jspod --no-git</code>.</p>
137+
122138
<h2 id="links">Links</h2>
123139
<ul>
124140
<li><a href="https://github.com/JavaScriptSolidServer/jspod">jspod source</a> — issues, PRs, releases</li>

index.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ const options = {
4141
root: './pod-data',
4242
multiuser: false,
4343
auth: true,
44-
open: true
44+
open: true,
45+
git: true
4546
};
4647

4748
// Auth-ladder rung-1 credentials. See issue #6: jspod ships a deliberately
@@ -116,6 +117,8 @@ for (let i = 0; i < args.length; i++) {
116117
options.auth = false;
117118
} else if (arg === '--no-open') {
118119
options.open = false;
120+
} else if (arg === '--no-git') {
121+
options.git = false;
119122
} else if (arg === '--version' || arg === '-v') {
120123
console.log(`jspod v${pkg.version}`);
121124
process.exit(0);
@@ -134,6 +137,7 @@ for (let i = 0; i < args.length; i++) {
134137
console.log(chalk.green(' --multiuser') + chalk.dim(' Enable multi-user mode'));
135138
console.log(chalk.green(' --no-auth') + chalk.dim(' Disable authentication'));
136139
console.log(chalk.green(' --no-open') + chalk.dim(' Do not open the browser automatically'));
140+
console.log(chalk.green(' --no-git') + chalk.dim(' Disable JSS\'s git HTTP backend (it is on by default)'));
137141
console.log(chalk.green(' -v, --version') + chalk.dim(' Show jspod version'));
138142
console.log(chalk.green(' --help') + chalk.dim(' Show this help message\n'));
139143
console.log(chalk.white('Examples:'));
@@ -386,6 +390,12 @@ if (!options.auth) {
386390
jssArgs.push('--public');
387391
}
388392

393+
// Enable JSS's git HTTP backend by default so the pod is a real
394+
// git remote (clone for public-read paths, push for owner-write
395+
// paths, auto-init on first push since JSS 0.0.195). Users who
396+
// don't want this surface can pass --no-git.
397+
jssArgs.push(options.git ? '--git' : '--no-git');
398+
389399
// Start JSS with enhanced PATH to find the binary
390400
const jss = spawn('jss', jssArgs, {
391401
stdio: 'inherit',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@
5151
},
5252
"dependencies": {
5353
"chalk": "^5.6.2",
54-
"javascript-solid-server": "^0.0.194"
54+
"javascript-solid-server": "^0.0.195"
5555
}
5656
}

0 commit comments

Comments
 (0)