Skip to content

Plugin API seam: api.serverInfo — a plugin can't learn its own origin at activate time #601

Description

@melvincarvalho

One of four plugin-API seams surfaced by building 33 out-of-tree plugins on the #206 loader (full report + ranking). Ranked by independent demand, this is the broadest and cheapest.

The gap

A plugin cannot learn its own server origin (baseUrl, port) at activate time. Every plugin that mints an absolute URL or calls the host back over loopback must be told its origin via config, and a wrong value fails quietly (e.g. nip05/ serves an empty identity map).

Consumers (~16, uncoordinated)

The whole DAV family (webdav/carddav/caldav), the shims (mastodon/bluesky/matrix/activitypub), rss, sparql, nip05, webfinger, notifications, micropub, backup, metrics, dashboard, oembed, jmap, remotestorage — essentially every plugin that isn't purely realtime. All repeat baseUrl/loopbackUrl in config today. The test harness's probe-port-then-boot dance exists for the same reason.

Sketch

api.serverInfo → { baseUrl, port }, available by activate time, or an onListen-style hook if the origin isn't known until listen.

Cost

Trivial — the server knows its own bind address; this is exposing it on the api object. Best effort-to-value ratio of the four seams; suggested to land first as the reference PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpluginCould be implemented as a plugin (#206); core/plugin line defined in #564priority: highP1 - Do soon, significant improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions