|
1 | | -# jspod - JavaScript Solid Pod |
| 1 | +# jspod |
2 | 2 |
|
3 | | -> **Just works**. Batteries included. Zero configuration. |
| 3 | +> Your personal [Solid](https://solidproject.org) pod, in one command. |
4 | 4 |
|
5 | 5 | [](https://www.npmjs.com/package/jspod) |
6 | 6 | [](LICENSE) |
7 | 7 |
|
8 | | -**jspod** is the easiest way to run a [Solid](https://solidproject.org) server. It's a thin wrapper around [JavaScriptSolidServer](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer) with sensible defaults and a beautiful CLI. |
9 | | - |
10 | | -## 🚀 Quick Start |
| 8 | +## Try in 60 seconds |
11 | 9 |
|
12 | 10 | ```bash |
13 | | -# Run instantly with npx (no installation required!) |
14 | 11 | npx jspod |
15 | | - |
16 | | -# That's it! Your Solid server is running at http://localhost:5444 |
17 | 12 | ``` |
18 | 13 |
|
19 | | -## ✨ Features |
20 | | - |
21 | | -### 🎯 Just Works |
22 | | -- **Zero configuration** - Smart defaults for everything |
23 | | -- **One command** - `npx jspod` and you're running |
24 | | -- **Beautiful CLI** - Gorgeous terminal output that makes you smile |
25 | | - |
26 | | -### 🔋 Batteries Included |
27 | | - |
28 | | -Built on [JavaScriptSolidServer](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer) with all features enabled: |
29 | | - |
30 | | -- ✅ **Solid Protocol** - Full Solid spec compliance |
31 | | -- ✅ **WebID Authentication** - Identity and access control |
32 | | -- ✅ **Passkey Support** - Modern passwordless authentication |
33 | | -- ✅ **WebSocket Notifications** - Real-time updates |
34 | | -- ✅ **JSON-LD Native** - First-class JSON-LD support |
35 | | -- ✅ **Content Negotiation** - Turtle, JSON-LD, and more |
36 | | - |
37 | | -## 📦 Installation |
38 | | - |
39 | | -### No Installation (Recommended) |
40 | | - |
41 | | -```bash |
42 | | -npx jspod |
43 | | -``` |
| 14 | +Your browser opens to `http://localhost:5444`. Click **Sign in** and use: |
44 | 15 |
|
45 | | -### Global Installation |
| 16 | +| Username | Password | |
| 17 | +| -------- | -------- | |
| 18 | +| `me` | `me` | |
46 | 19 |
|
47 | | -```bash |
48 | | -npm install -g jspod |
49 | | -jspod |
50 | | -``` |
51 | | - |
52 | | -### Local Installation |
53 | | - |
54 | | -```bash |
55 | | -npm install jspod |
56 | | -npx jspod |
57 | | -``` |
58 | | - |
59 | | -## 🎮 Usage |
60 | | - |
61 | | -### Basic Usage |
62 | | - |
63 | | -```bash |
64 | | -# Start with defaults (port 5444, single-user) |
65 | | -jspod |
| 20 | +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. |
66 | 21 |
|
67 | | -# Custom port |
68 | | -jspod --port 8080 |
| 22 | +> jspod binds to `127.0.0.1` by default so the placeholder `me` / `me` credentials are reachable only from your local machine. |
69 | 23 |
|
70 | | -# Custom data directory |
71 | | -jspod --root /var/pods |
| 24 | +## CLI options |
72 | 25 |
|
73 | | -# Multi-user mode |
74 | | -jspod --multiuser |
75 | 26 | ``` |
76 | | - |
77 | | -### CLI Options |
78 | | - |
79 | | -``` |
80 | | -Options: |
81 | 27 | -p, --port <number> Port to listen on (default: 5444) |
82 | 28 | -h, --host <address> Host to bind to (default: 127.0.0.1) |
83 | 29 | -r, --root <path> Data directory (default: ./pod-data) |
84 | | - --multiuser Enable multi-user mode |
85 | | - --no-auth Disable authentication |
86 | | - --no-open Do not open the browser automatically |
87 | | - -v, --version Show jspod version |
88 | | - --help Show help message |
89 | | -``` |
90 | | - |
91 | | -### Environment Variables |
92 | | - |
93 | | -```bash |
94 | | -# JWT secret — auto-generated and persisted at <root>/.token-secret on |
95 | | -# first run. Override here only for operator-managed deployments. |
96 | | -export TOKEN_SECRET="$(openssl rand -base64 32)" |
97 | | - |
98 | | -# Set environment |
99 | | -export NODE_ENV="production" |
100 | | - |
101 | | -# Run server |
102 | | -jspod |
103 | | -``` |
104 | | - |
105 | | -### Production Deployment |
106 | | - |
107 | | -**⚠️ Important**: Before deploying to production: |
108 | | - |
109 | | -1. **TOKEN_SECRET** is auto-generated on first run and persisted at `<root>/.token-secret` (mode 0600). For operator-managed deployments — secret rotation, distributed setups, secret managers — set it explicitly via env: |
110 | | - ```bash |
111 | | - export TOKEN_SECRET="$(openssl rand -base64 32)" |
112 | | - ``` |
113 | | - |
114 | | -2. **Use a proper domain** (not localhost) |
115 | | - - Passkeys require HTTPS in production |
116 | | - - Get SSL cert (Let's Encrypt recommended) |
117 | | - |
118 | | -3. **Run as a service** |
119 | | - ```bash |
120 | | - # Example systemd service |
121 | | - sudo systemctl enable jspod |
122 | | - sudo systemctl start jspod |
123 | | - ``` |
124 | | - |
125 | | -4. **Set up backups** |
126 | | - - Back up `./pod-data` directory |
127 | | - - Contains all user data and credentials |
128 | | - |
129 | | -5. **Monitor logs** |
130 | | - ```bash |
131 | | - jspod > jspod.log 2>&1 |
132 | | - ``` |
133 | | - |
134 | | -## 🏃 Quickstart Examples |
135 | | - |
136 | | -### Personal Pod |
137 | | - |
138 | | -```bash |
139 | | -# Start your personal Solid pod |
140 | | -jspod |
141 | | - |
142 | | -# Visit http://localhost:5444 in your browser |
143 | | -# Register with passkey, start storing data! |
| 30 | + --multiuser Enable multi-user mode (registration enabled) |
| 31 | + --no-auth Open pod, no IDP, no ACL (demos / dev only) |
| 32 | + --no-open Don't auto-open the browser on start |
| 33 | + -v, --version Print jspod version |
| 34 | + --help Show help |
144 | 35 | ``` |
145 | 36 |
|
146 | | -### Multi-User Server |
| 37 | +## The auth ladder |
147 | 38 |
|
148 | | -```bash |
149 | | -# Run a server for multiple users |
150 | | -jspod --multiuser --port 443 --root /var/solid-pods |
| 39 | +jspod ships you onto the lowest rung that's safe, and the climb is visible: |
151 | 40 |
|
152 | | -# Users can register and get their own pod space |
153 | | -``` |
| 41 | +| Rung | Auth | How to get there | |
| 42 | +| ---: | ------------------- | -------------------------------------------------- | |
| 43 | +| 0 | None | `jspod --no-auth` (demos / dev only) | |
| 44 | +| 1 | `me` / `me` | Default. Localhost-only. | |
| 45 | +| 2 | Your password | Change it in your pod's account settings | |
| 46 | +| 3 | Passkey | Add a passkey from account settings | |
| 47 | +| 4 | Hardware key / MFA | Power-user setup | |
154 | 48 |
|
155 | | -### Development Server |
156 | | - |
157 | | -```bash |
158 | | -# Run on custom port for development |
159 | | -jspod --port 8080 --root ./dev-data |
160 | | -``` |
161 | | - |
162 | | -## 🆚 jspod vs JavaScriptSolidServer |
163 | | - |
164 | | -| Feature | JavaScriptSolidServer | jspod | |
165 | | -|---------|----------------------|------| |
166 | | -| Installation | `npm install -g javascript-solid-server` | `npx jspod` | |
167 | | -| Configuration | Config file required | Smart defaults | |
168 | | -| Commands | `jss start [options]` | `jspod` | |
169 | | -| First run | 5+ steps | 1 command | |
170 | | -| Use case | Power users, customization | Quick start, demos | |
171 | | - |
172 | | -**When to use JavaScriptSolidServer**: Production deployments, custom configuration, advanced features |
173 | | - |
174 | | -**When to use jspod**: Quick demos, local development, "just want it to work" |
175 | | - |
176 | | -## 🛠️ How It Works |
177 | | - |
178 | | -jspod is a thin wrapper that: |
179 | | - |
180 | | -1. Provides sensible defaults |
181 | | -2. Creates beautiful CLI output |
182 | | -3. Manages the lifecycle of JavaScriptSolidServer |
183 | | -4. Handles graceful shutdown |
184 | | - |
185 | | -### Enabled Features |
186 | | - |
187 | | -Under the hood, jspod runs JavaScriptSolidServer with these options: |
188 | | - |
189 | | -| Feature | JSS Flag | Description | |
190 | | -|---------|----------|-------------| |
191 | | -| **WebSocket Notifications** | `--notifications` | Real-time updates via WebSockets | |
192 | | -| **Content Negotiation** | `--conneg` | Turtle, JSON-LD, and more | |
193 | | -| **Single-user Mode** | `--no-multiuser --single-user` | One pod per server (use `--multiuser` flag to change) | |
194 | | -| **Identity Provider** | `--idp` | Built-in IDP so the rung-1 sign-in works out of the box | |
195 | | -| **Tiny Data Browser** | `--mashlib-module` | ~200 bytes of JS + CSS shipped in this npm package, served from jsdelivr. Replaces the full mashlib bundle by default. | |
196 | | -| **Passkey Auth** | (built-in) | Automatic in JSS - no flag needed | |
197 | | -| **WebID** | (built-in) | Core Solid protocol feature | |
198 | | - |
199 | | -### The page is the data |
200 | | - |
201 | | -By default jspod uses a deliberately minimal data browser — a ~200-byte ES module that renders the JSON-LD data island JSS already embeds in each HTML response, with every URI turned into a clickable link. No SPA, no CDN bundle, no parsing — *the page is the data, and the URIs are the navigation*. |
202 | | - |
203 | | -The browser source is two files in this npm package: |
204 | | - |
205 | | -- [`data-browser.js`](./data-browser.js) — finds `#dataisland`, renders to `#mashlib`, makes URIs clickable |
206 | | -- [`data-browser.css`](./data-browser.css) — system font, cream background, soft card |
207 | | - |
208 | | -JSS loads them from a version-pinned jsdelivr URL: `https://cdn.jsdelivr.net/npm/jspod@<version>/data-browser.js`. Override with `--mashlib-cdn` (full mashlib from CDN) or `--no-mashlib` (raw RDF responses) via your own JSS invocation if you want something else. |
209 | | - |
210 | | -### Default Configuration |
211 | | - |
212 | | -```javascript |
213 | | -{ |
214 | | - port: 5444, // Memorable, low collision with common dev servers |
215 | | - host: '127.0.0.1', // Localhost-only by default (rung-1 credentials) |
216 | | - root: './pod-data', // Local data directory |
217 | | - multiuser: false, // Single pod per server |
218 | | - TOKEN_SECRET: (per-pod) // Auto-generated on first run and persisted at |
219 | | - // <root>/.token-secret (mode 0600). Override via |
220 | | - // the TOKEN_SECRET env var for operator control. |
221 | | -} |
222 | | -``` |
223 | | - |
224 | | -## 🎯 First Run Guide |
225 | | - |
226 | | -**Step 1**: Start the server |
227 | | -```bash |
228 | | -npx jspod |
229 | | -``` |
230 | | - |
231 | | -**Step 2**: Your browser opens automatically to `http://localhost:5444` |
232 | | - |
233 | | -> Running over SSH, in CI, or in a non-interactive terminal? jspod skips auto-open and prints the URL instead. You can also pass `--no-open` to disable it explicitly. |
234 | | -
|
235 | | -**Step 3**: Sign in (rung 1 of the auth ladder) |
236 | | - |
237 | | -The first time you start jspod, an IDP account is seeded with deliberately weak default credentials: |
238 | | - |
239 | | -| Field | Value | |
240 | | -| -------- | ----- | |
241 | | -| Username | `me` | |
242 | | -| Password | `me` | |
243 | | - |
244 | | -Click **Sign in** on the welcome page, then point a Solid app (like [Pilot](https://solid-apps.github.io/pilot/)) at `http://localhost:5444` and sign in with `me` / `me`. |
245 | | - |
246 | | -> **Why are the defaults so weak?** jspod ships you onto the first rung of the auth ladder in under a minute, then guides you up. Rung 1 is **only safe on localhost** — jspod binds to `127.0.0.1` by default for exactly this reason. Once you're in, change the password (rung 2) or add a passkey (rung 3) from your pod's account settings. See [issue #6](https://github.com/JavaScriptSolidServer/jspod/issues/6) for the ladder rationale. |
247 | | -
|
248 | | -**Step 4**: Climb the ladder |
249 | | - |
250 | | -| Rung | Auth | How | |
251 | | -| ---- | --------------------- | -------------------------------------------- | |
252 | | -| 0 | None | `npx jspod --no-auth` (demos / dev only) | |
253 | | -| 1 | `me` / `me` | **Default.** Localhost-only. | |
254 | | -| 2 | Your password | Change it from your pod's account settings | |
255 | | -| 3 | Passkey | Add a passkey from account settings | |
256 | | -| 4 | Hardware key / MFA | Power-user setup | |
257 | | - |
258 | | -Override the default password without going through the UI: |
| 49 | +Override the initial password without going through the UI: |
259 | 50 |
|
260 | 51 | ```bash |
261 | 52 | JSS_SINGLE_USER_PASSWORD='your-password' npx jspod |
262 | 53 | ``` |
263 | 54 |
|
264 | | -**Step 5**: Start using your pod |
265 | | -- Upload files, create resources from a Solid app |
266 | | -- Your data stays on your server |
267 | | -- Connect more apps — they all authenticate against your IDP |
268 | | - |
269 | | -**Troubleshooting**: |
270 | | -- **Port in use?** Run `jspod --port 5445` |
271 | | -- **Data location?** Check `./pod-data` directory |
272 | | -- **Can't register?** Make sure your browser supports WebAuthn (Chrome, Firefox, Safari, Edge all work) |
273 | | - |
274 | | -## 📖 Learn More |
275 | | - |
276 | | -### What is Solid? |
277 | | - |
278 | | -[Solid](https://solidproject.org) is a web specification that lets people store their data securely in decentralized data stores called Pods. This gives users control over their own data. |
279 | | - |
280 | | -### Resources |
281 | | - |
282 | | -- **jspod**: https://github.com/JavaScriptSolidServer/jspod |
283 | | -- **JavaScriptSolidServer**: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer |
284 | | -- **Solid Project**: https://solidproject.org |
285 | | -- **Solid Spec**: https://solidproject.org/TR/protocol |
286 | | -- **WebID**: https://www.w3.org/2005/Incubator/webid/spec |
287 | | - |
288 | | -## 🤝 Contributing |
| 55 | +## Configuration |
289 | 56 |
|
290 | | -Contributions welcome! jspod is intentionally simple - we want to keep it that way. |
| 57 | +| Variable | Effect | |
| 58 | +| --------------------------- | ------------------------------------------------------------------- | |
| 59 | +| `JSS_SINGLE_USER_PASSWORD` | Seed password instead of `me` (kept out of `ps` / banner output). | |
| 60 | +| `TOKEN_SECRET` | JWT signing secret. Auto-generated at `<root>/.token-secret` (mode 0600) on first run if unset. Override for operator-managed deployments. | |
| 61 | +| `NODE_ENV` | Standard Node env. Defaults to `development`. | |
291 | 62 |
|
292 | | -**Philosophy**: |
293 | | -- Simple over complex |
294 | | -- Defaults over configuration |
295 | | -- Works over features |
| 63 | +For LAN-reachable deployments, pass `--host 0.0.0.0` (jspod prints a warning to remind you that the rung-1 credentials are now exposed) and either set `JSS_SINGLE_USER_PASSWORD` or change the password from the pod UI immediately after first sign-in. |
296 | 64 |
|
297 | | -See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines. |
| 65 | +## The data browser |
298 | 66 |
|
299 | | -## 📄 License |
| 67 | +jspod ships a deliberately minimal data browser — about 800 bytes of JS that JSS loads from a version-pinned jsdelivr URL. It parses the JSON-LD island JSS already embeds in each HTML response, pretty-prints it, and renders every URI as a clickable link. |
300 | 68 |
|
301 | | -MIT - see [LICENSE](./LICENSE) |
| 69 | +The source: [`data-browser.js`](./data-browser.js). The page is the data; the URIs are the navigation. No SPA, no mashlib CDN bundle. |
302 | 70 |
|
303 | | -## 🙏 Credits |
| 71 | +If you want the full mashlib data browser instead, skip jspod and run JSS directly with `jss start --mashlib-cdn`. |
304 | 72 |
|
305 | | -jspod is built on top of the excellent [JavaScriptSolidServer](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer) by Melvin Carvalho and contributors. |
| 73 | +## When to use jspod |
306 | 74 |
|
307 | | -## 💬 Support |
| 75 | +- ✅ A working personal pod in 60 seconds on your laptop |
| 76 | +- ✅ Trying Solid for the first time |
| 77 | +- ✅ Local development against a Solid app |
| 78 | +- ❌ Hosting pods for multiple users → use [JSS](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer) directly with `--multiuser` |
| 79 | +- ❌ Production deployments → JSS with operator-managed config |
308 | 80 |
|
309 | | -- **Issues**: https://github.com/JavaScriptSolidServer/jspod/issues |
310 | | -- **Discussions**: https://github.com/JavaScriptSolidServer/jspod/discussions |
311 | | -- **Solid Forum**: https://forum.solidproject.org |
| 81 | +## Links |
312 | 82 |
|
313 | | ---- |
| 83 | +- [JavaScriptSolidServer (the substrate)](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer) |
| 84 | +- [Solid project](https://solidproject.org) |
| 85 | +- [Solid spec](https://solidproject.org/TR/protocol) |
314 | 86 |
|
315 | | -**Made with ❤️ for the Solid community** |
| 87 | +## License & credits |
316 | 88 |
|
317 | | -*"Solid made simple"* |
| 89 | +MIT. Built on [JavaScriptSolidServer](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer) by Melvin Carvalho and contributors. Issues: [GitHub](https://github.com/JavaScriptSolidServer/jspod/issues). |
0 commit comments