Title: Feature: --public flag to skip WAC and allow open access · Issue #107 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: Feature: --public flag to skip WAC and allow open access · Issue #107 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: Feature: --public flag to skip WAC and allow open access · Issue #107 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Summary Add a --public flag that disables WAC (Web Access Control) checks, allowing unauthenticated read/write access to all resources. This enables JSS to be used as a simple file server similar to npx serve, but with REST write capabil...
Open Graph Description: Summary Add a --public flag that disables WAC (Web Access Control) checks, allowing unauthenticated read/write access to all resources. This enables JSS to be used as a simple file server similar t...
X Description: Summary Add a --public flag that disables WAC (Web Access Control) checks, allowing unauthenticated read/write access to all resources. This enables JSS to be used as a simple file server similar t...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/107
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Feature: --public flag to skip WAC and allow open access","articleBody":"## Summary\n\nAdd a `--public` flag that disables WAC (Web Access Control) checks, allowing unauthenticated read/write access to all resources. This enables JSS to be used as a simple file server similar to `npx serve`, but with REST write capabilities.\n\n**Difficulty**: 15/100 \n**Estimated Effort**: 2-4 hours \n**Dependencies**: None\n\n---\n\n## Motivation\n\nCurrently, JSS requires either:\n1. ACL files to grant access, or\n2. Authentication via Solid-OIDC\n\nThis makes it impossible to use JSS as a simple \"just serve this folder\" tool like `npx serve`. The `--public` flag would enable:\n\n1. **Quick local development** - No auth setup needed\n2. **Simple file sharing** - LAN file server with write support\n3. **jsserve wrapper** - Foundation for `npx jsserve` (see future issue)\n4. **WebDAV alternative** - Simple REST-based file server\n5. **Testing/demos** - Quick Solid server without auth complexity\n\n---\n\n## Proposed Implementation\n\n### CLI Flag\n\n```bash\njss start --public # Open read/write, no auth\njss start --public --read-only # Open read, no writes (like npx serve)\n```\n\n### Environment Variable\n\n```bash\nJSS_PUBLIC=true jss start\n```\n\n### Config File\n\n```json\n{\n \"public\": true\n}\n```\n\n---\n\n## Implementation Details\n\n### 1. Add flag to CLI (`bin/jss.js`)\n\n```javascript\n.option('--public', 'Allow unauthenticated access to all resources (disables WAC)')\n.option('--read-only', 'Disable PUT/DELETE methods (read-only mode)')\n```\n\n### 2. Add to config (`src/config.js`)\n\n```javascript\nconst DEFAULTS = {\n // ... existing ...\n public: false,\n readOnly: false,\n};\n\n// Environment variable mapping\nif (process.env.JSS_PUBLIC) {\n config.public = process.env.JSS_PUBLIC === 'true';\n}\nif (process.env.JSS_READ_ONLY) {\n config.readOnly = process.env.JSS_READ_ONLY === 'true';\n}\n```\n\n### 3. Skip WAC when public (`src/auth/middleware.js`)\n\n```javascript\nexport async function authorize(request, reply) {\n // Public mode - skip all auth/WAC checks\n if (request.config?.public) {\n return; // Allow request to proceed\n }\n \n // ... existing WAC logic ...\n}\n```\n\n### 4. Block writes when read-only (`src/handlers/resource.js`, `src/handlers/container.js`)\n\n```javascript\n// At start of PUT/DELETE handlers\nif (request.config?.readOnly) {\n return reply.code(405).send({ \n error: 'Method Not Allowed',\n message: 'Server is in read-only mode'\n });\n}\n```\n\n---\n\n## Behavior Matrix\n\n| Flag Combination | GET | PUT/DELETE | Auth Required |\n|------------------|-----|------------|---------------|\n| (default) | ACL | ACL | Yes (if ACL requires) |\n| `--public` | ✅ Allow | ✅ Allow | No |\n| `--public --read-only` | ✅ Allow | ❌ Block | No |\n| `--read-only` (no public) | ACL | ❌ Block | Yes |\n\n---\n\n## Security Considerations\n\n### Warning on Startup\n\nWhen `--public` is enabled, show a clear warning:\n\n```\n⚠️ WARNING: Server running in PUBLIC mode\n All files are readable and writable without authentication.\n Do not use in production or expose to the internet.\n```\n\n### Binding to localhost by default?\n\nConsider: When `--public` is set, should the default host be `localhost` instead of `0.0.0.0`?\n\n```javascript\nif (config.public && !explicitHostSet) {\n config.host = 'localhost'; // Safer default for public mode\n}\n```\n\nUser can override with `--public --host 0.0.0.0` if they explicitly want network access.\n\n---\n\n## Examples\n\n### Local Development\n```bash\n# Quick Solid-compatible file server for development\njss start --public --port 3000 --root ./test-data\n```\n\n### Read-Only File Sharing\n```bash\n# Share files on LAN, no writes allowed\njss start --public --read-only --host 0.0.0.0 --root ~/shared\n```\n\n### Testing Solid Apps\n```bash\n# Test app without auth complexity\njss start --public --root ./fixtures\nnpm test\n```\n\n---\n\n## Files to Modify\n\n| File | Changes |\n|------|---------|\n| `bin/jss.js` | Add `--public` and `--read-only` options (~5 LOC) |\n| `src/config.js` | Add defaults and env var mapping (~10 LOC) |\n| `src/auth/middleware.js` | Skip WAC when public (~5 LOC) |\n| `src/handlers/resource.js` | Block writes when read-only (~5 LOC) |\n| `src/handlers/container.js` | Block writes when read-only (~5 LOC) |\n| **Total** | **~30 LOC** |\n\n---\n\n## Testing\n\n```javascript\ndescribe('--public flag', () => {\n it('should allow unauthenticated GET', async () => {\n const server = await createServer({ public: true, root: tmpDir });\n const res = await request(server).get('/file.txt');\n expect(res.status).toBe(200);\n });\n\n it('should allow unauthenticated PUT', async () => {\n const server = await createServer({ public: true, root: tmpDir });\n const res = await request(server)\n .put('/new-file.txt')\n .send('content');\n expect(res.status).toBe(201);\n });\n\n it('should block PUT when read-only', async () => {\n const server = await createServer({ public: true, readOnly: true, root: tmpDir });\n const res = await request(server)\n .put('/new-file.txt')\n .send('content');\n expect(res.status).toBe(405);\n });\n});\n```\n\n---\n\n## Related Issues\n\n- Future: `jsserve` package (thin wrapper using this flag)\n- #100 - Production Readiness (this is a dev/convenience feature)\n\n---\n\n## Open Questions\n\n1. Should `--public` default to `localhost` binding for safety?\n2. Should there be a `--public-read` (read-only public) shorthand?\n3. Should `--public` disable IdP/login UI entirely, or just make it optional?","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-01-28T09:54:26Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/107"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e2706208-8d14-388a-d117-9a978e2be8ba |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB3C:3C1C49:2DFEDEF:3C5BBB7:6B0390EC |
| html-safe-nonce | 52f74c1b7cfea75b55f10d7fe02898e486550a1421eaa7c05eb36340398d575a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjNDOjNDMUM0OToyREZFREVGOjNDNUJCQjc6NkIwMzkwRUMiLCJ2aXNpdG9yX2lkIjoiMzcxOTM0ODQxOTIxMTUzMDQ3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4c31108673109bdbdbdcf3b1bbc06ea86ad20248c579485a6be2a41b2db3245d |
| hovercard-subject-tag | issue:3864569336 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/107/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8f96a5bff090354a7dafa3cc328ff5c8fd5e5604f6e63c96a4381b4dcb8466eb/JavaScriptSolidServer/JavaScriptSolidServer/issues/107 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8f96a5bff090354a7dafa3cc328ff5c8fd5e5604f6e63c96a4381b4dcb8466eb/JavaScriptSolidServer/JavaScriptSolidServer/issues/107 |
| og:image:alt | Summary Add a --public flag that disables WAC (Web Access Control) checks, allowing unauthenticated read/write access to all resources. This enables JSS to be used as a simple file server similar t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width