Skip to content

Move internal server state out of .well-known/ namespace #358

Open

Description

@melvincarvalho

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions