Skip to content

Commit 822e468

Browse files
chore: default --host from 127.0.0.1 to localhost (#22)
Browsers treat 127.0.0.1 and localhost as separate origins for storage, but for first-run UX localhost is the friendlier and more familiar default — matches Vite, Next.js dev, etc. — and WebAuthn (passkeys) explicitly requires the Relying Party ID to be 'localhost' or a real domain, so this also unlocks the eventual rung-3 climb. Server-side reachability is unchanged: Node's localhost bind covers both 127.0.0.1 and ::1 loopback. Existing users with browser data keyed to the old 127.0.0.1 origin will need to sign in again (IndexedDB is per-origin). - options.host default: '127.0.0.1' → 'localhost' - Banner / auto-open URL / IDP issuer follow automatically via formatUrl - Help text + README + inline LAN-warning copy updated - Loopback-check still accepts both names (no behaviour change there) Bumps jspod to 0.0.24.
1 parent cb66dd3 commit 822e468

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ Your browser opens to `http://localhost:5444`. Click **Sign in** and use:
1919

2020
That's it. You have a working Solid pod with a passkey-capable identity provider, a tiny built-in data browser, and a [WebID](https://www.w3.org/2005/Incubator/webid/spec) you can point any Solid app at.
2121

22-
> jspod binds to `127.0.0.1` by default so the placeholder `me` / `me` credentials are reachable only from your local machine.
22+
> jspod binds to `localhost` by default so the placeholder `me` / `me` credentials are reachable only from your local machine.
2323
2424
## CLI options
2525

2626
```
2727
-p, --port <number> Port to listen on (default: 5444)
28-
-h, --host <address> Host to bind to (default: 127.0.0.1)
28+
-h, --host <address> Host to bind to (default: localhost)
2929
-r, --root <path> Data directory (default: ./pod-data)
3030
--multiuser Enable multi-user mode (registration enabled)
3131
--no-auth Open pod, no IDP, no ACL (demos / dev only)

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function formatUrl(host, port) {
3737
const args = process.argv.slice(2);
3838
const options = {
3939
port: 5444,
40-
host: '127.0.0.1',
40+
host: 'localhost',
4141
root: './pod-data',
4242
multiuser: false,
4343
auth: true,
@@ -47,7 +47,7 @@ const options = {
4747
// Auth-ladder rung-1 credentials. See issue #6: jspod ships a deliberately
4848
// weak default sign-in so the new user is on a working pod within seconds,
4949
// with a clearly-marked path to climb (change password / add a passkey).
50-
// Safe because the default host is localhost-only (127.0.0.1).
50+
// Safe because the default host is localhost-only.
5151
// Username is fixed by JSS for root pods (server.js:970). Password defaults
5252
// to 'me' but can be overridden via JSS_SINGLE_USER_PASSWORD so the env
5353
// override documented in the README actually takes effect (and the banner
@@ -129,7 +129,7 @@ for (let i = 0; i < args.length; i++) {
129129
console.log(chalk.yellow(' jspod') + chalk.dim(' [options]\n'));
130130
console.log(chalk.white('Options:'));
131131
console.log(chalk.green(' -p, --port ') + chalk.yellow('<number>') + chalk.dim(' Port to listen on (default: 5444)'));
132-
console.log(chalk.green(' -h, --host ') + chalk.yellow('<address>') + chalk.dim(' Host to bind to (default: 127.0.0.1)'));
132+
console.log(chalk.green(' -h, --host ') + chalk.yellow('<address>') + chalk.dim(' Host to bind to (default: localhost)'));
133133
console.log(chalk.green(' -r, --root ') + chalk.yellow('<path>') + chalk.dim(' Data directory (default: ./pod-data)'));
134134
console.log(chalk.green(' --multiuser') + chalk.dim(' Enable multi-user mode'));
135135
console.log(chalk.green(' --no-auth') + chalk.dim(' Disable authentication'));
@@ -316,7 +316,7 @@ if (options.auth && !options.multiuser) {
316316
console.log('\n' + chalk.bold.red('⚠ Warning: ') + chalk.yellow(
317317
`--host ${options.host} exposes the well-known me/me credentials beyond localhost.`
318318
));
319-
console.log(chalk.dim(' Set JSS_SINGLE_USER_PASSWORD=... before running, or bind to 127.0.0.1.'));
319+
console.log(chalk.dim(' Set JSS_SINGLE_USER_PASSWORD=... before running, or bind to localhost.'));
320320
}
321321
}
322322
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jspod",
3-
"version": "0.0.23",
3+
"version": "0.0.24",
44
"description": "JavaScript Solid Pod - Just works, batteries included",
55
"type": "module",
66
"main": "index.js",

0 commit comments

Comments
 (0)