Title: ACL generators emit absolute URIs, host-locking pods (supersedes #303) · Issue #427 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: ACL generators emit absolute URIs, host-locking pods (supersedes #303) · Issue #427 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: ACL generators emit absolute URIs, host-locking pods (supersedes #303) · Issue #427 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Problem createRootPodStructure (and createPodStructure) bake the request-time host into every .acl file via absolute acl:accessTo / acl:default / acl:agent URIs. The pod is then locked to the hostname captured at pod-creation time — acce...
Open Graph Description: Problem createRootPodStructure (and createPodStructure) bake the request-time host into every .acl file via absolute acl:accessTo / acl:default / acl:agent URIs. The pod is then locked to the hostn...
X Description: Problem createRootPodStructure (and createPodStructure) bake the request-time host into every .acl file via absolute acl:accessTo / acl:default / acl:agent URIs. The pod is then locked to the hostn...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/427
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ACL generators emit absolute URIs, host-locking pods (supersedes #303)","articleBody":"## Problem\n\n`createRootPodStructure` (and `createPodStructure`) bake the request-time host into every `.acl` file via absolute `acl:accessTo` / `acl:default` / `acl:agent` URIs. The pod is then locked to the hostname captured at pod-creation time — accessing the same server via any other host returns 401/403, even for `foaf:Agent` public-read ACLs.\n\nThe read side has supported relative URIs since `a736338` (Jan 2026). The write side never got the symmetric treatment. This issue tracks bringing the two sides into alignment, in phases, and supersedes #303.\n\n## Phase tracker\n\n- [x] Phase 1 — relative `acl:accessTo` / `acl:default` in generators — #428 (PR #429, merged)\n- [x] Phase 2 — relative `acl:agent` in generators — #430 (PR #431, merged)\n- [x] Phase 3 — fold in #303 landing page seeding — #433 (PR #434, merged; #303 closed as superseded)\n - [x] Phase 3 refinement — mode-agnostic landing copy + HEAD-adaptive Sign up/Sign in — #435 (PR #436, merged)\n- [ ] Phase 4 — cross-host auth normalization — *(separate design issue, not yet filed)*\n\n## Reproduction\n\n```bash\njss start --single-user --no-idp --port 4444\n# (or: npx fonstr 4444)\ncurl -s -o /dev/null -w \"%{http_code}\\n\" http://localhost:4444/ # 200\ncurl -s -o /dev/null -w \"%{http_code}\\n\" http://0.0.0.0:4444/ # 401\ncurl -s -o /dev/null -w \"%{http_code}\\n\" http://127.0.0.1:4444/ # 401\ncurl -s -o /dev/null -w \"%{http_code}\\n\" http://\u003clan-ip>:4444/ # 401\n```\n\nThe seeded `/.acl` contains `acl:accessTo: { '@id': 'http://localhost:4444/' }`. The WAC checker does string equality on the resolved `accessTo` vs. the request URL (`src/wac/checker.js:203`), so any other host fails to match — even though the rule is `foaf:Agent` and identity isn't involved.\n\n## Root cause\n\nTwo pieces, introduced together in v0.0.79 (PR #77 / commit `8adacaa`, \"feat: Add single-user mode\"):\n\n1. **`src/server.js:556`** explicitly remaps `0.0.0.0` → `localhost` when computing the pod's `baseUrl`, freezing one host into the pod identity.\n2. **`src/handlers/container.js:188`** and **`src/server.js`'s `createRootPodStructure`** call `generateOwnerAcl(podUri, …)` (and siblings) with absolute `podUri`, which `src/wac/parser.js:226` writes verbatim into JSON-LD `acl:accessTo` / `acl:default`.\n\nBoth ends could be relative. The parser at `src/wac/parser.js:141` already calls `resolveUri(uri, baseUrl)` against the ACL's own request URL, so a relative `./` would always match the requesting host.\n\n## Prior art\n\nThis is a recurring class of bug. All previously closed:\n\n- **#24** — *ACL relative URIs not resolving correctly* (closed: relative `./` reads work since `a736338`)\n- **#64 / PR #65** — *ACL relative URI resolution: ./#me not matching authenticated WebID* (closed: `acl:agent` also resolved against ACL URL since `bdbbbb7`)\n- **#107** — *Feature: --public flag to skip WAC* (closed: the workaround)\n- **#144** — *WAC returns 403 for path-based pod access when subdomains enabled* (closed)\n- **#250** — *buildResourceUrl strips port — ACL matching fails on non-standard ports* (closed)\n- **#276 / PR #303** — *Default index.html for server root* (open, conflicting): adds `seedServerRoot` that does emit relative `accessTo: '/'`, but only for the multi-user landing-page path, and was never merged. **This issue supersedes #303.**\n\n## Design\n\n### What can be relative\n- `acl:accessTo` and `acl:default` — pure URL matching, no identity. Resolves against ACL URL ⇒ portable across hosts.\n- `acl:agent` — also resolves against ACL URL (PR #65). Makes the on-disk pod portable; pod can be moved to another domain without rewriting ACLs.\n\n### What stays absolute\n- The WebID exposed in the user's profile document (`/profile/card.jsonld#me`) — this is the global identifier dereferenced by other servers, OIDC `webid` claim, etc.\n- The `solid:oidcIssuer` predicate in the profile.\n\n### What this *doesn't* fix\n- **Owner write across different hosts** (auth on host A, request on host B). The token's `webid` claim is frozen at auth time; relative `acl:agent` resolves against the request host. They'll mismatch. Needs a separate normalization pass in the auth layer (e.g. `--canonical-host` flag, or treat localhost ≡ 127.0.0.1 ≡ 0.0.0.0 ≡ configured-host as equivalent identities). Tracked as Phase 4 below; will likely spin off into its own design issue.\n\n## Phases\n\nEach phase is independently shippable.\n\n### Phase 1 — Relative `accessTo` / `default` in generators\n\n**Scope.** Update `generateOwnerAcl`, `generatePrivateAcl`, `generateInboxAcl`, `generatePublicFolderAcl`, `generatePublicReadAcl` in `src/wac/parser.js` so `acl:accessTo` and `acl:default` are emitted as relative URIs (`./`, `./private/`, etc.) rather than absolute. Update callers in `src/handlers/container.js` and `src/server.js` (`createRootPodStructure`) to pass the relative path string instead of `${podUri}…`.\n\n**Unblocks.** Public read across hosts. The fonstr-style welcome-page case works on localhost / 0.0.0.0 / 127.0.0.1 / LAN IP / public domain without further change.\n\n**Tests.**\n- Unit: each generator emits the relative form.\n- Integration: `--single-user --no-idp` server, `GET /` from each of 4+ hosts → 200.\n- Regression: existing absolute-URI ACLs on disk still parse and authorize correctly (parser handles both).\n\n**Risk.** Low. Read side already resolves both forms; this is a write-side change only.\n\n### Phase 2 — Relative `acl:agent` in generators\n\n**Scope.** Same generators emit `acl:agent: { '@id': './profile/card.jsonld#me' }` (or whatever the relative form is) when the WebID is hosted under the same pod. PR #65 already proved the parser handles this.\n\n**Unblocks.** Owner read/write when authed and hitting via the same host (the common single-machine case). Pod becomes portable on disk — operators can `mv` a pod to a new domain without rewriting ACLs.\n\n**Tests.**\n- Unit: each generator emits relative agent for in-pod WebIDs.\n- Integration: owner authenticates via canonical host, performs reads/writes — same ACL file, no host baked in.\n- Move test: serialize a pod, point a new server at it on a different host, owner login still works.\n\n**Risk.** Low. Doesn't change the absolute WebID in the profile document.\n\n### Phase 3 — Fold in #303 (landing page seeding)\n\n**Scope.** Bring `seedServerRoot` from PR #303 onto the new generators. Now portable by construction. Multi-user deployments get a default landing page at `/` instead of a raw container listing. Operator-provided `/index.html` preserved (skip-if-exists). Close #303 once this lands.\n\n**Tests.** Carry forward the four tests from PR #303.\n\n**Risk.** Low — UX-only at this point. The ACL machinery is already proven by Phases 1–2.\n\n### Phase 4 — Cross-host auth normalization (separate sub-issue)\n\n**Scope.** Reconcile token `webid` (from auth time) against ACL `acl:agent` (resolved at request time) when they refer to the same identity but different hosts. Likely shape: a `--canonical-host` flag (or auto-derived from the OIDC issuer) that the WAC checker uses to normalize both sides before comparison. Touches OIDC, Nostr auth, Schnorr SSO.\n\n**Unblocks.** Owner write when authed on host A and hitting host B (mobile/LAN/tunnel scenarios — the \"fonstr just works everywhere\" promise).\n\n**Risk.** Medium-high. Worth its own design issue before implementation. Will reference back here.\n\n## Acceptance criteria\n\n- [ ] Phase 1: public read works on every interface the server binds, on a fresh single-user pod.\n- [ ] Phase 2: owner read/write works from the canonical host; pod directory can be moved between hostnames without ACL rewrites.\n- [ ] Phase 3: default landing page seeded for multi-user deployments, portable by construction. PR #303 closed.\n- [ ] Phase 4: separate issue filed with design proposal.\n- [ ] No regression for existing absolute-URI ACL files on disk.\n\n## Out of scope\n\n- Hostless (DID-based) WebIDs — interesting but a much bigger conversation.\n- Auto-detecting and rewriting old absolute-URI ACLs in existing pods (operators can leave them; the parser handles both).\n\n\n\n\n\n\n\n","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-05-14T03:45:08Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/427"}
| 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:c612c4ce-57fa-64ab-62c2-60c61db5e5ce |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B438:36D701:18764:1F41F:6B039152 |
| html-safe-nonce | e3bb6b7a368c86e57875051eba5ac9ac30150e235da38d0709357f8295a2badc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDM4OjM2RDcwMToxODc2NDoxRjQxRjo2QjAzOTE1MiIsInZpc2l0b3JfaWQiOiIyMzEyODQ2OTg1OTc3MzY4OTE0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0d7b8f98961ac15b67e68e68636f470b4f8787e068ace11ffec9a36d8f82194e |
| hovercard-subject-tag | issue:4442955380 |
| 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/427/issue_layout |
| twitter:image | https://opengraph.githubassets.com/21634bf7e6497e804b4df5239199a7a952f9f81ad5ac415309408b2da8d2cd17/JavaScriptSolidServer/JavaScriptSolidServer/issues/427 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/21634bf7e6497e804b4df5239199a7a952f9f81ad5ac415309408b2da8d2cd17/JavaScriptSolidServer/JavaScriptSolidServer/issues/427 |
| og:image:alt | Problem createRootPodStructure (and createPodStructure) bake the request-time host into every .acl file via absolute acl:accessTo / acl:default / acl:agent URIs. The pod is then locked to the hostn... |
| 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