Plugins
Plugins add service kinds, pages, settings and timers without the core knowing about them. Lanternly ships with one, Amazon Web Services, and you can write your own.
Turning plugins on and off
Owners open Settings → Plugins → Manage plugins. Each plugin says what it adds and what turning it off does. A fresh install starts with every plugin off.
Turning a plugin off hides its pages, menu items and buttons, but never stops what it created: services keep running, backed up and monitored, and servers it made stay listed so they can still be followed and deleted.
Included plugins
Write a plugin
A plugin lives in src/plugins/<id>/. The AWS plugin (src/plugins/aws/) is a complete example.
- Describe it. Create
src/plugins/<id>/plugin.tsexporting aDeployerPlugin(typed insrc/plugins/types.ts): id, name, description, icon, the pages it owns, optional side-menu items ({ href, label, icon, group }) and service kinds. - Register it. Add one line to
src/plugins/installed.ts. If it has server code (timers, service kind steps, alatestVersioncheck), add a line toinstalled-hooks.ts; if it has React parts (a settings card, Servers or Services page parts, a service's page), toinstalled-parts.ts. - Guard its pages. Pages under
src/app/admin/(console)/that belong to the plugin callrequirePlugin('<id>'); its server actions returnpluginOffError('<id>')while it's off. - Server steps. A service kind's own steps on the server go in
agent/kinds/<id>.sh, whichclubctlloads when present. - Test it. Tests go in
tests/plugins/<id>/. Nothing the plugin adds should show while it's off.
How the core reaches plugins
The core never imports a plugin directly. It goes through two files:
src/plugins/server.ts: server-side hooks, such asstartPlugins()(timers, called at start-up),projectCosts(),serverBusy()andserviceKind()for create, configure and upgrade steps of a plugin's service kind.src/plugins/parts.ts: React parts, such asserversPageParts()(toolbar, notices, footer), parts for the Services page, a service kind's page and its list cells.
Tagging plugin lines
Every line in a shared file that mentions a plugin ends with a comment plugin:<id>, and longer stretches sit between plugin:<id>:start and plugin:<id>:end. A file whose first line carries the tag belongs to the plugin. This lets scripts/export-core.mjs produce a copy without a given plugin (useful for keeping a plugin private), so keep the tags when you edit those lines.
import { awsPlugin } from './aws/plugin' // plugin:aws