Skip to content

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

Closed

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.

Activity

  1. added
    enhancement
    priority: high
    plugin
    on Jul 11, 2026
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

    enhancementpluginpriority: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions