diff --git a/README.md b/README.md index 6084919..347e57e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ # Run instantly with npx (no installation required!) npx jspod -# That's it! Your Solid server is running at http://localhost:3000 +# That's it! Your Solid server is running at http://localhost:5444 ``` ## ✨ Features @@ -61,7 +61,7 @@ npx jspod ### Basic Usage ```bash -# Start with defaults (port 3000, single-user) +# Start with defaults (port 5444, single-user) jspod # Custom port @@ -78,7 +78,7 @@ jspod --multiuser ``` Options: - -p, --port Port to listen on (default: 3000) + -p, --port Port to listen on (default: 5444) -h, --host
Host to bind to (default: 0.0.0.0) -r, --root Data directory (default: ./pod-data) --multiuser Enable multi-user mode @@ -125,7 +125,7 @@ jspod 5. **Monitor logs** ```bash - jspod --verbose > jspod.log 2>&1 + jspod > jspod.log 2>&1 ``` ## 🏃 Quickstart Examples @@ -136,7 +136,7 @@ jspod # Start your personal Solid pod jspod -# Visit http://localhost:3000 in your browser +# Visit http://localhost:5444 in your browser # Register with passkey, start storing data! ``` @@ -195,7 +195,7 @@ Under the hood, jspod runs JavaScriptSolidServer with these options: ```javascript { - port: 3000, // Easy to remember + port: 5444, // Memorable, low collision with common dev servers host: '0.0.0.0', // Accept connections from anywhere root: './pod-data', // Local data directory multiuser: false, // Single pod per server @@ -210,7 +210,7 @@ Under the hood, jspod runs JavaScriptSolidServer with these options: npx jspod ``` -**Step 2**: Open your browser to `http://localhost:3000` +**Step 2**: Open your browser to `http://localhost:5444` **Step 3**: Register with a passkey - Click "Register" or "Sign Up" @@ -223,7 +223,7 @@ npx jspod - Your data stays on your server **Troubleshooting**: -- **Port in use?** Run `jspod --port 3001` +- **Port in use?** Run `jspod --port 5445` - **Data location?** Check `./pod-data` directory - **Can't register?** Make sure your browser supports WebAuthn (Chrome, Firefox, Safari, Edge all work) diff --git a/index.js b/index.js index 3eee61d..0187c51 100755 --- a/index.js +++ b/index.js @@ -9,9 +9,10 @@ import { spawn } from 'child_process'; import { fileURLToPath } from 'url'; import { dirname, join, delimiter } from 'path'; import chalk from 'chalk'; -import { existsSync, mkdirSync } from 'fs'; +import { existsSync, mkdirSync, readFileSync } from 'fs'; const __dirname = dirname(fileURLToPath(import.meta.url)); +const pkg = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf8')); // Parse CLI arguments const args = process.argv.slice(2); @@ -36,6 +37,9 @@ for (let i = 0; i < args.length; i++) { options.multiuser = true; } else if (arg === '--no-auth') { options.auth = false; + } else if (arg === '--version' || arg === '-v') { + console.log(`jspod v${pkg.version}`); + process.exit(0); } else if (arg === '--help') { console.log(chalk.cyan(` ╔═══════════════════════════════════════════════════════════════════╗ @@ -43,18 +47,19 @@ for (let i = 0; i < args.length; i++) { ╚═══════════════════════════════════════════════════════════════════╝ `)); console.log(chalk.white('Usage:')); - console.log(chalk.yellow(' jssd') + chalk.dim(' [options]\n')); + console.log(chalk.yellow(' jspod') + chalk.dim(' [options]\n')); console.log(chalk.white('Options:')); console.log(chalk.green(' -p, --port ') + chalk.yellow('') + chalk.dim(' Port to listen on (default: 5444)')); console.log(chalk.green(' -h, --host ') + chalk.yellow('
') + chalk.dim(' Host to bind to (default: 0.0.0.0)')); console.log(chalk.green(' -r, --root ') + chalk.yellow('') + chalk.dim(' Data directory (default: ./pod-data)')); console.log(chalk.green(' --multiuser') + chalk.dim(' Enable multi-user mode')); console.log(chalk.green(' --no-auth') + chalk.dim(' Disable authentication')); + console.log(chalk.green(' -v, --version') + chalk.dim(' Show jspod version')); console.log(chalk.green(' --help') + chalk.dim(' Show this help message\n')); console.log(chalk.white('Examples:')); - console.log(chalk.dim(' jssd')); - console.log(chalk.dim(' jssd --port 8080 --root /var/pods')); - console.log(chalk.dim(' jssd --multiuser\n')); + console.log(chalk.dim(' jspod')); + console.log(chalk.dim(' jspod --port 8080 --root /var/pods')); + console.log(chalk.dim(' jspod --multiuser\n')); console.log(chalk.white('Features:')); console.log(chalk.dim(' • Solid Protocol compliant')); console.log(chalk.dim(' • WebID authentication')); @@ -62,7 +67,7 @@ for (let i = 0; i < args.length; i++) { console.log(chalk.dim(' • WebSocket notifications')); console.log(chalk.dim(' • JSON-LD native\n')); console.log(chalk.white('Resources:')); - console.log(chalk.blue(' https://github.com/JavaScriptSolidServer/jssd')); + console.log(chalk.blue(' https://github.com/JavaScriptSolidServer/jspod')); console.log(chalk.blue(' https://solidproject.org\n')); process.exit(0); } else { @@ -111,7 +116,7 @@ console.log(chalk.cyan(' ├─ ') + chalk.green('Notifications ') + chal console.log(chalk.cyan(' └─ ') + chalk.green('JSON-LD Native ') + chalk.bold.green('✓')); console.log('\n' + chalk.bold.white('📚 Resources:\n')); -console.log(chalk.cyan(' ├─ ') + chalk.white('Server: ') + chalk.blue.underline('https://github.com/JavaScriptSolidServer/jssd')); +console.log(chalk.cyan(' ├─ ') + chalk.white('Server: ') + chalk.blue.underline('https://github.com/JavaScriptSolidServer/jspod')); console.log(chalk.cyan(' ├─ ') + chalk.white('Solid: ') + chalk.blue.underline('https://solidproject.org')); console.log(chalk.cyan(' └─ ') + chalk.white('WebID: ') + chalk.blue.underline('https://www.w3.org/2005/Incubator/webid/spec')); @@ -138,7 +143,7 @@ const jss = spawn('jss', jssArgs, { env: { ...process.env, PATH: `${join(__dirname, 'node_modules', '.bin')}${delimiter}${process.env.PATH}`, - TOKEN_SECRET: process.env.TOKEN_SECRET || 'jssd-default-secret-change-in-production', + TOKEN_SECRET: process.env.TOKEN_SECRET || 'jspod-default-secret-change-in-production', NODE_ENV: process.env.NODE_ENV || 'development' } }); diff --git a/package.json b/package.json index 3d7405f..9b00704 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jspod", - "version": "0.0.7", + "version": "0.0.8", "description": "JavaScript Solid Pod - Just works, batteries included", "type": "module", "main": "index.js", @@ -37,6 +37,6 @@ }, "dependencies": { "chalk": "^5.6.2", - "javascript-solid-server": "^0.0.186" + "javascript-solid-server": "^0.0.194" } }