Repository navigation
Description
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:
- The deployment's subdomain pattern (pod = first label of host vs. first segment of path).
- The legacy extensionless
cardfallback whencard.jsonldis missing (mirror whatsrc/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
- Surfaced during live testing of auth: serve /.well-known/did/nostr/<pubkey>.json (#407) #408 on solid.social
- Indexer code:
src/idp/well-known-did-nostr.js - Subdomain config plumbing:
src/server.js(subdomainsEnabled,baseDomain)
Activity
Address copilot pass 2 on #413 — precise per-candidate diagnostics
Index subdomain-mode pods (#411) (#413)
fix(well-known-did-nostr): probe profile/card.jsonld for root-path We…