Repository navigation
Description
Problem
JSS persists internal server state under `DATA_ROOT/.well-known/`:
- `src/token.js:190-207` — token store
- `src/handlers/pay.js:92-130` — pay/webledger state
But `.well-known/` is public-by-convention (RFC 8615) — apps and tools expect resources there to be discoverable. JSS itself serves legitimate public resources from the same namespace (e.g. webledger registry).
This conflation forces a bad trade in #350 / #357: either hide `.well-known/` from container listings (breaking webledger discovery) or show it (potentially fingerprinting internal sidecars).
Why this should change
- Public namespace contract: `.well-known/` was reserved for publicly-known metadata. Storing private state there is at odds with the convention.
- Operational hygiene: tools that audit pods / inventory `.well-known/` (e.g. for security headers, OIDC discovery probes) shouldn't accidentally surface server internals.
- ACL fragility: if anyone ever loosens an ACL on `.well-known/` thinking "it's just metadata," internal state silently leaks.
Proposed shape
Move internal persistence to a clearly-internal namespace — `.server/` already exists on solid.social and could be the home, or a fresh `.state/`. Both are server-internal-only by convention (not part of any public spec).
Files to migrate
- Token store paths in `src/token.js` — currently writes to `<DATA_ROOT>/.well-known/...`. Switch to `<DATA_ROOT>/.server/tokens/...` (or similar).
- Pay/webledger internal state in `src/handlers/pay.js` — same. The webledger registry (the public part) stays where consumers expect it, only the internal bookkeeping moves.
Migration
Server start-up: if the new paths don't exist but the old ones do, copy/move on first boot. Alternatively keep dual-read for one release cycle, then drop.
Acceptance
- Token store no longer writes anywhere under `.well-known/`
- Pay state moved out of `.well-known/`
- Webledger public registry resources stay at the published `.well-known/` URL
- Migration path for existing deployments (boot-time move or dual-read)
- After landing, the listing allowlist in `src/ldp/container.js` can drop the apologetic comment about `.well-known` and just be 'Solid Linked Data resources only'
- Tests cover: fresh install uses new paths; existing deployment migrates without losing state
Out of scope
- Changing the listing allowlist (ldp: hide server-internal sidecars from container listings (#350) #357 already includes `.well-known` for now — pick this up after migration)
- The structure of webledger / OIDC discovery URLs (those stay at `.well-known/` per the relevant specs)
Context
Surfaced during #357 (PR for #350). Copilot noted that hiding `.well-known` from listings would break legitimate public-resource discovery, while showing it leaks internal sidecars. Both observations are correct — the fix is upstream of the listing layer.
Activity
ldp: restore .well-known to listing allowlist (PR #357 round 2)
ldp: hide server-internal sidecars from container listings (#350) (#357)