Skip to content

well-known did:nostr index doesn't find subdomain-mode pods #411

Description

@melvincarvalho

Symptom

On solid.social (subdomain-mode deployment), the local pubkey index in src/idp/well-known-did-nostr.js silently skips subdomain pods. The Sign in with Schnorr flow falls through to the typed-username fallback (#403/#405) instead of resolving via the local index.

Live log on solid.social:

well-known-did-nostr: skipping account b0b1707f-512a-49c6-8aac-635f2cb64582
  (profile=/home/ubuntu/solid-server/data/profile/card.jsonld):
  ENOENT no such file or directory, stat '/home/ubuntu/solid-server/data/profile/card.jsonld'

The account's WebID is https://test.solid.social/profile/card.jsonld#me and the profile actually lives at /home/ubuntu/solid-server/data/test/profile/card.jsonld. The indexer derives the on-disk path from new URL(webId).pathname only — /profile/card.jsonld — and joins it under dataRoot, which strips the subdomain.

Cause

profilePathFromWebId(dataRoot, webId) (added in #408) uses webIdUrl.pathname exclusively. Two correct shapes:

  • Path mode (e.g. https://example.com/alice/profile/card.jsonld#me) → pathname /alice/profile/card.jsonld → joins correctly under dataRoot.
  • Subdomain mode (e.g. https://alice.example.com/profile/card.jsonld#me) → pathname /profile/card.jsonld → SHOULD join under <dataRoot>/alice/profile/card.jsonld, but currently joins as <dataRoot>/profile/card.jsonld.

Pre-existing bourgeoa case (/home/ubuntu/solid-server/data/bourgeoa/profile/card, no .jsonld) is a separate legacy shape — the on-disk file has no extension while the WebID requests .jsonld. Same root cause though: path-from-webId derivation needs to be smarter about the deployment's pod-host strategy.

Fix sketch

profilePathFromWebId needs to know:

  1. The deployment's subdomain pattern (pod = first label of host vs. first segment of path).
  2. The legacy extensionless card fallback when card.jsonld is missing (mirror what src/server.js's root-pod seeding does at lines ~734-738).

Either pass the relevant config (subdomainsEnabled, baseDomain) into the indexer and branch on it, or derive the on-disk path from the account record (which has podName) rather than the WebID — and use webId only for the containment check.

Workaround

Typed-username fallback (#403/#405) compensates today; users get logged in but the local index is dead weight on subdomain-mode deployments.

Refs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions