Publish¶
Initiative installs plug-ins from signed registries. A listing names the plug-in, its versions, the container image each runs (pinned by digest) and the most it may ever be granted. It names no keys: each deployment runs its own copy of the image and registers the key that copy signs with. Declare it in the definition:
listing: {
publisher: "acme",
summary: "Your tracker's tickets on a dashboard and in your automations.",
description: "…",
avatar: "assets/avatar.png",
images: [{ path: "assets/board.png", alt: "Open tickets on a dashboard" }],
version: "1.2.0",
minAppVersion: "0.72.0",
releaseNotes: "…",
image: "ghcr.io/acme/tracker@sha256:…",
compose: {
service: `tracker:
image: \${IMAGE}
environment:
INITIATIVE_URL: \${INITIATIVE_URL}
volumes: [tracker-keys:/data]`,
baseUrl: "http://tracker:8080",
},
},
A declarative plug-in's listing names no image, compose or runtime, since
Initiative makes its calls itself, and a tool plug-in's names none of those and
no scopeCeiling either, since it runs no code: its registration is
{"kind": "tool"}.
images is optional: the screenshots on the listing page, in order, at most
12. Each is a PNG, JPEG, WebP, GIF, AVIF or SVG file with alt text of 1 to
300 characters for someone who cannot see it, and a file name of its own (the
avatar sits beside them in the registry source). The registry signs each one
by its digest, as it does the avatar. pack leaves them out: a deployment's
own listing upload takes only the avatar.
compose is optional: the Docker Compose service an operator copies to run
your image beside Initiative, which Initiative shows on the plug-in's settings
page. service is the fragment, YAML text of at most 4096 characters, with two
placeholders Initiative fills: ${IMAGE} (image, pinned by its digest) and
${INITIATIVE_URL} (the deployment's public address). Any other ${…} fails
the build, so a misspelt placeholder cannot ship. baseUrl is where the
service answers on the Compose network, an http or https URL of at most 512
characters; Initiative pre-fills the deployment's base URL with it.
runtime is optional too, and is for a plug-in a deployment runs for its
operator from a reviewed package. It says what the container needs, so the
deployment can run it with no code of its own:
runtime: {
name: "tracker",
port: 8080,
health: { ready: "/readyz", live: "/healthz" },
facts: { INITIATIVE_API_URL: "app_api_internal" },
settings: [{ env: "TRACKER_MODE", required: true }],
signingKey: { env: "TRACKER_PRIVATE_KEY_PEM" },
database: {
roles: [{ id: "owner", login: "tracker_owner", env: "DATABASE_URL" }],
provisionSql: "/app/provision.sql",
},
},
It holds nothing that raises a privilege. Resources, network rules, hostnames and every key and password stay the deployment's:
factscome from a fixed list:app_url,app_origin,app_api_public,app_api_internal,page_origin,portandentitlement_issuer_key(billing's statement key, added for you with anentitlementhook; see Entitlement statements). There is no other channel to Initiative's own services: billing reaches a plug-in only through Initiative.settingsare names the operator fills.secretsare generated by the deployment and kept.
The public registry refuses a listing that carries a runtime.
minAppVersion is the oldest Initiative release a version runs on. Beside it,
the definition's minPluginApi (the manifest's min_plugin_api) is the
oldest plug-in API contract the plug-in calls, as
"MAJOR.MINOR": the SDK version its client.api was written against.
A deployment serving contract 4.3.2 runs it; one serving 4.0.5 or 5.0.0
does not. Leave it out and the plug-in makes no claim: it is offered on any
contract, as listings written before the field were.
availability says which communities may use a version:
"none" |
Every community. The default. |
"beta" |
Only the communities the deployment's owner picks. |
"operations" |
Only the deployment's operations community. |
It is the plug-in's own declaration, in its manifest rather than its listing,
and like every manifest field it is per version: a release that leaves it out
declares "none". While a version is "beta", the deployment's owner picks
which communities may use it.
writes the plug-in's registry source under <publisher>/<uid>/: listing.json,
this version's <version>/manifest.json and the avatar. It is written only
while listing.version is the package's own version: between releases the
package runs ahead of its listing, and a new version is listed at its release,
with its image's digest. The registry's CI checks and signs what is merged.
Before anything is written, listing.json is held to the registry's own
schema, which this package carries as schemas/registry-listing.json. The
build's other listing checks speak in your definition's terms (baseUrl,
scopeCeiling); this one reads the file the registry will read, so a listing
the registry would refuse when a package pins it (a scope it does not
recognise, a field it requires) fails the build instead, with each problem at
its place in the file, such as
listing.json/registration/scope_ceiling/1: must match pattern …, and
nothing is written. It runs between releases too, while the listing is not
written, so the plug-in's own CI finds the problem before its release does.
A plug-in written in another language builds its manifest itself and hands the
SDK a JSON file in place of src/plugin.ts: its publicId, uid and name,
its manifest, and its listing as declared above. The manifest is checked as
a definition's is, and the listing states the version it lists:
npx initiative-plugin build --manifest plugin.json --registry ../registry/sources
npx initiative-plugin pack --manifest plugin.json
A self-hosted deployment can also publish a plug-in that is in no registry, from its listing file: see A private plug-in.