loon-plugins

module
v0.0.0-...-3e622d4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2026 License: MIT

README

loon

loon-plugins

A collection of plugins for the loon framework.


New or changed plugins are held to CHECKLIST.md — contract, security, i18n-readiness, admin surface, jobs, docs, tests, and how each item is verified.

Before writing one, read SEAMS.md — every shared system a plugin can reach for (41 declared contracts, grouped by what they are for), the rules they live by, and what is still duplicated across the 49 plugins because nothing was there to reach for. It answers the question an author asks first and currently answers by grepping: does this already exist?

Each plugin is a self-describing module a loon host imports and boots. The job machinery (RegisterJob, RunLoop, off-peak gating, the /admin/jobs view) lives in loon's schedule package, so a plugin inherits the scheduler for free — what a plugin declares is its data surface: its own Postgres schema, or a set of narrow ports the host injects.

Plugins

Plugin What it is
usenet A full Usenet indexer — multi-provider fleet with per-backbone crawl state, multi-host coordination (leases + term assignment), pluggable staging (Postgres or Redis), a data-driven 24-rule junk engine + operator blacklist, NZB assembly, and health checking. Runs standalone or, in host-sink mode, hands assembled releases to a host's NZB domain (the ReleaseSink/ReleaseHealthStore seams). Owns its usenet schema; NNTP via loon/nntp.
scraper Generic metadata scraper — shared jobs over a registry of pluggable catalog.MetadataSource modules (anidb, tmdb, mangadex, …).
catalog Newznab category-tree taxonomy — the content classification a host and the usenet plugin categorise releases against.
backup Single-job site backup: pg_dump + static dirs into one archive, with a free-disk pre-flight.
backups Capability-hook backup — runs every plugin's Backupable hook into one archive.
dbmaint Database maintenance jobs — pg_repack, reindex, and vacuum, off-peak-gated.
stats Collects every plugin's StatContributor hook into a cached site-stats snapshot.
dailyreward A home-page daily-points card (points sink demo).
pointstore A points sink / profile-flair store.
anidbscraper Mechanics demo — AniDB as a standalone host-data worker plugin (injected ports + SetDeps).
trackerdir The external-tracker directory: facts (domains, categories, search precision, auth, politeness) for ~600 trackers, extracted by scripts/gen_trackerdir.py from both Prowlarr corpora — the community Cardigann YAML and the native C# majors (BTN, AnimeBytes, HDBits…). A data library, not a plugin — see the package comment for what is deliberately NOT taken.
pluginapi Neutral capability contracts both sides import (never each other): UsenetIndex/UsenetAdmin, the ReleaseSink/ReleaseHealthStore seams, CatalogSink/Fillable, Backupable/StatContributor, host-data ports.

Plugin archetypes

Archetype Owns a schema? Data access Example
Self-contained Yes (Metadata.Migrations) core.Storage.SchemaDB usenet
Host-data worker No narrow ports injected via SetDeps anidbscraper
Capability hook No reads peers off the extension registry backups, stats

How a host consumes a plugin

  1. In the host's go.mod (sibling-checkout replace until loon tags releases):

    require github.com/the-loon-clan/loon-plugins v0.0.0-...
    replace github.com/the-loon-clan/loon-plugins => ../loon-plugins
    
  2. Import the plugin — its init() self-registers. Self-contained plugins need only a blank import; host-data plugins also call SetDeps(...) before core.Boot:

    import _ "github.com/the-loon-clan/loon-plugins/usenet"   // self-contained
    
  3. Docker: a replace pointing outside the build context needs a BuildKit build-context (--build-context loonplugins=../loon-plugins + COPY --from=loonplugins) — the same three-way contract loon uses.

See loon-demo-site for a working host that wires usenet, scraper, catalog, backups, stats, dailyreward, and pointstore.

Development

make help      # the targets
make check     # what CI runs: vet, sqllint, sentinels, test
make itest     # the tests that need a real Postgres, against a disposable one

The toolchain runs in a container (scripts/go.sh says why), and that script mounts the PARENT directory: go.mod carries replace github.com/the-loon-clan/loon => ../loon, so keep loon checked out beside this repo or the module graph will not resolve.

CONTRIBUTING.md covers what each check exists for and where member-facing words belong. SECURITY.md covers reporting, and what the shared guards do and do not promise.

License

MIT — see LICENSE.

Directories

Path Synopsis
Package achievements is a loon plugin: earnable badges, described as DATA.
Package achievements is a loon plugin: earnable badges, described as DATA.
Package agent owns the fleet agent's read-only surfaces: the profile fleet card a member sees on their own page, and the dispatch overview on admin settings.
Package agent owns the fleet agent's read-only surfaces: the profile fleet card a member sees on their own page, and the dispatch overview on admin settings.
Package anidbscraper is the worked example for this repo: a real ameNZB background job (the AniDB scraper) extracted into a loon plugin.
Package anidbscraper is the worked example for this repo: a real ameNZB background job (the AniDB scraper) extracted into a loon plugin.
Package applications is a front door for a closed site: somebody who cannot get an invite from a member asks the site directly, staff read the answer, and an approval issues a real invite.
Package applications is a front door for a closed site: somebody who cannot get an invite from a member asks the site directly, staff read the answer, and an approval issues a real invite.
Package backup is PRODUCTION's backup pipeline: it indexes every asset directory, packs the files content-addressed, serves them over HTTP with Range, and a puller on separate hardware fetches and verifies them.
Package backup is PRODUCTION's backup pipeline: it indexes every asset directory, packs the files content-addressed, serves them over HTTP with Range, and a puller on separate hardware fetches and verifies them.
Package backups is the site-backup plugin: on a weekly (and admin-triggered) job it dumps the database and then runs EVERY plugin's Backupable hook, writing each into one archive.
Package backups is the site-backup plugin: on a weekly (and admin-triggered) job it dumps the database and then runs EVERY plugin's Backupable hook, writing each into one archive.
Package catalog is the content-taxonomy plugin: it owns the standard Newznab category tree (Console/Movies/Audio/PC/TV/XXX/Books/Other) and which top-level categories an admin has enabled ("list everything, pick what to index").
Package catalog is the content-taxonomy plugin: it owns the standard Newznab category tree (Console/Movies/Audio/PC/TV/XXX/Books/Other) and which top-level categories an admin has enabled ("list everything, pick what to index").
Package chat is the site shoutbox — the Discord/IRC chat bridge page with SSE live updates and webhook send-back.
Package chat is the site shoutbox — the Discord/IRC chat bridge page with SSE live updates and webhook send-back.
Package comments puts a conversation under whatever a page is about.
Package comments puts a conversation under whatever a page is about.
Package communities is the Reddit-style user-owned sub-forum surface (/c/*, migrations 252-253): communities with join gating (open / request+escrow / invite-only), per-community mods and rules, threads + replies, and banner/icon customisation.
Package communities is the Reddit-style user-owned sub-forum surface (/c/*, migrations 252-253): communities with join gating (open / request+escrow / invite-only), per-community mods and rules, threads + replies, and banner/icon customisation.
Package cosmetics sells what a member looks like.
Package cosmetics sells what a member looks like.
Package curation fills the season/episode columns crawled releases arrive without, and surfaces what it cannot infer.
Package curation fills the season/episode columns crawled releases arrive without, and surfaces what it cannot infer.
Package dailyreward is a loon plugin: a home-page card where a signed-in user claims a daily reward — once per day, behind a captcha — for points and a growing streak.
Package dailyreward is a loon plugin: a home-page card where a signed-in user claims a daily reward — once per day, behind a captcha — for points and a growing streak.
Package dbmaint is the database-maintenance plugin: worker jobs that keep Postgres lean — "Repack NZBs (online)" via the pg_repack CLI, "Reindex (online)" via REINDEX INDEX CONCURRENTLY, and the legacy "Vacuum NZBs" (VACUUM FULL, gated behind maintenance mode; paused by default since pg_repack replaced it).
Package dbmaint is the database-maintenance plugin: worker jobs that keep Postgres lean — "Repack NZBs (online)" via the pg_repack CLI, "Reindex (online)" via REINDEX INDEX CONCURRENTLY, and the legacy "Vacuum NZBs" (VACUUM FULL, gated behind maintenance mode; paused by default since pg_repack replaced it).
Package discord is the Discord bridge: the bot, the account-link card users see on /profile, and the bot's own section of /admin/settings.
Package discord is the Discord bridge: the bot, the account-link card users see on /profile, and the bot's own section of /admin/settings.
Package donations is the donation system — the public donate page, BTCPay invoice creation + webhook, points-package claims, and the admin cost/points/log/wallet/package management.
Package donations is the donation system — the public donate page, BTCPay invoice creation + webhook, points-package claims, and the admin cost/points/log/wallet/package management.
Package downloads closes the loop the other way: the member's download client telling the SITE what happened.
Package downloads closes the loop the other way: the member's download client telling the SITE what happened.
Package economy is a worker-only plugin hosting the per-grab "Points Grab Bonus", extracted from pkg/services.
Package economy is a worker-only plugin hosting the per-grab "Points Grab Bonus", extracted from pkg/services.
Package events owns scheduled events: named spans of time other plugins hang behaviour on.
Package events owns scheduled events: named spans of time other plugins hang behaviour on.
Package feeds discovers releases on public torrent feeds and files community requests for them.
Package feeds discovers releases on public torrent feeds and files community requests for them.
Package forum is the site-wide discussion board — admin-curated categories → threads → replies with Discord-style reaction bars, plus the recruitment-thread visibility mode (mig 251).
Package forum is the site-wide discussion board — admin-curated categories → threads → replies with Discord-style reaction bars, plus the recruitment-thread visibility mode (mig 251).
Package games is a loon plugin: community point games.
Package games is a loon plugin: community point games.
Package hitrun is the hit-and-run framework: the rules that decide whether a member who stopped seeding is warned, and what a site does about it.
Package hitrun is the hit-and-run framework: the rules that decide whether a member who stopped seeding is warned, and what a site does about it.
Package irc is the IRC bridge: the bot, and the account-link card users see on /profile.
Package irc is the IRC bridge: the bot, and the account-link card users see on /profile.
Package lists is the watchlist/collection system — personal NZB lists with public sharing, follows, copies, bulk download as a ZIP, and the /community/watchlists discovery grid.
Package lists is the watchlist/collection system — personal NZB lists with public sharing, follows, copies, bulk download as a ZIP, and the /community/watchlists discovery grid.
Package logs is the error-log search + retention plugin.
Package logs is the error-log search + retention plugin.
Package magic is a loon plugin: torrent promotions, the NexusPHP "magic" tradition.
Package magic is a loon plugin: torrent promotions, the NexusPHP "magic" tradition.
Package medals is a loon plugin: the display cabinet.
Package medals is a loon plugin: the display cabinet.
Package mediainfo carries what somebody who actually downloaded a release can tell everybody who has not: MediaInfo, screenshots, chapters.
Package mediainfo carries what somebody who actually downloaded a release can tell everybody who has not: MediaInfo, screenshots, chapters.
Package messages is the messaging surface: the unified /inbox (direct-message threads and system announcements in one list), the DM send/read/block flows, and the /admin/messages broadcast composer.
Package messages is the messaging surface: the unified /inbox (direct-message threads and system announcements in one list), the DM send/read/block flows, and the /admin/messages broadcast composer.
Package news is the site-news system — the public /news feed + per-post pages and the admin editor.
Package news is the site-news system — the public /news feed + per-post pages and the admin editor.
Package offers is the offer system: members register what they can deliver (a private tracker, a personal collection), other members file "request this" against a bucket, and an external Python offer-agent claims and delivers through /api/offers/*.
Package offers is the offer system: members register what they can deliver (a private tracker, a personal collection), other members file "request this" against a bucket, and an external Python offer-agent claims and delivers through /api/offers/*.
Package perks is the tracker economy: freeleech and double-upload tokens, bought with points and spent on one torrent at a time.
Package perks is the tracker economy: freeleech and double-upload tokens, bought with points and spent on one torrent at a time.
Package playlists is user-curated collections of indexed releases — UNIT3D's playlist area.
Package playlists is user-curated collections of indexed releases — UNIT3D's playlist area.
adminnav.go lets a plugin put its own admin surface in the host's admin nav.
adminnav.go lets a plugin put its own admin surface in the host's admin nav.
pgtest
Package pgtest gives a plugin's store a real Postgres to be tested against.
Package pgtest gives a plugin's store a real Postgres to be tested against.
Package pointstore is a loon plugin: a small points sink that closes the economy loop.
Package pointstore is a loon plugin: a small points sink that closes the economy loop.
Package polls asks the members a question and counts the answers.
Package polls asks the members a question and counts the answers.
Package ranks owns the groups model behind the paid-rank system — the catalog, memberships, the grant capability, and the expiry job (ENTITLEMENTS.md Stage 2).
Package ranks owns the groups model behind the paid-rank system — the catalog, memberships, the grant capability, and the expiry job (ENTITLEMENTS.md Stage 2).
Package releasegroups is the release-group directory — group pages, ownership claims with token-scrape verification, news posts with follower fan-out, bios, and the external-archive mirror.
Package releasegroups is the release-group directory — group pages, ownership claims with token-scrape verification, news posts with follower fan-out, bios, and the external-archive mirror.
Package reports is the member-report queue: the admin surface over releases members have flagged as broken, mislabeled, or malware.
Package reports is the member-report queue: the admin surface over releases members have flagged as broken, mislabeled, or malware.
Package requests is the community request board — filing, voting, points boosts, torrent scraping (nyaa / nekobt / tosho), Prowlarr search, and the fulfil/retry/unpark lifecycle.
Package requests is the community request board — filing, voting, points boosts, torrent scraping (nyaa / nekobt / tosho), Prowlarr search, and the fulfil/retry/unpark lifecycle.
Package rewards is a loon plugin: earning described as DATA rather than as one Go job per rule.
Package rewards is a loon plugin: earning described as DATA rather than as one Go job per rule.
The /flow collaborative node-graph editor.
The /flow collaborative node-graph editor.
Package scraper is the generic metadata scraper: one plugin that owns a registry of pluggable catalog.MetadataSource modules (anidb, tmdb, mangadex, …) and runs a small set of SHARED jobs over all of them — instead of ~12 per-domain scraper jobs.
Package scraper is the generic metadata scraper: one plugin that owns a registry of pluggable catalog.MetadataSource modules (anidb, tmdb, mangadex, …) and runs a small set of SHARED jobs over all of them — instead of ~12 per-domain scraper jobs.
sources/anidb
Package anidb is a local-index catalog.MetadataSource for anime, backed by AniDB's HTTP API (http://api.anidb.net:9001/httpapi).
Package anidb is a local-index catalog.MetadataSource for anime, backed by AniDB's HTTP API (http://api.anidb.net:9001/httpapi).
sources/anilist
Package anilist is a GraphQL catalog.MetadataSource for the anime domain, with NO credential.
Package anilist is a GraphQL catalog.MetadataSource for the anime domain, with NO credential.
sources/openlibrary
Package openlibrary is an API-search catalog.MetadataSource backed by Open Library (https://openlibrary.org) — the book domain.
Package openlibrary is an API-search catalog.MetadataSource backed by Open Library (https://openlibrary.org) — the book domain.
sources/theporndb
Package theporndb is an API-search catalog.MetadataSource backed by https://api.theporndb.net — for the XXX category.
Package theporndb is an API-search catalog.MetadataSource backed by https://api.theporndb.net — for the XXX category.
sources/tmdb
Package tmdb is an API-search catalog.MetadataSource backed by The Movie Database (https://api.themoviedb.org/3) — the movie and tv domains.
Package tmdb is an API-search catalog.MetadataSource backed by The Movie Database (https://api.themoviedb.org/3) — the movie and tv domains.
sources/tvmaze
Package tvmaze is an API-search catalog.MetadataSource backed by TVmaze (https://api.tvmaze.com) — the tv domain, with NO credential.
Package tvmaze is an API-search catalog.MetadataSource backed by TVmaze (https://api.tvmaze.com) — the tv domain, with NO credential.
sources/wikipedia
Package wikipedia is an API-search catalog.MetadataSource backed by Wikipedia's REST API — the movie domain, with NO credential.
Package wikipedia is an API-search catalog.MetadataSource backed by Wikipedia's REST API — the movie domain, with NO credential.
scripts
audit-sentinels command
audit-sentinels finds ownership checks that a zero or empty sentinel could satisfy.
audit-sentinels finds ownership checks that a zero or empty sentinel could satisfy.
lint-sql command
lint-sql walks the Go source under this module and flags any SQL query whose first argument (the SQL string) is built via string concatenation or fmt.Sprintf with non-literal substitution.
lint-sql walks the Go source under this module and flags any SQL query whose first argument (the SQL string) is built via string concatenation or fmt.Sprintf with non-literal substitution.
Package seedlock keeps one member's torrent on one host at a time.
Package seedlock keeps one member's torrent on one host at a time.
Package stats is the site-stats collector + presenter: on a cache job it gathers every plugin's StatContributor hook into one snapshot, caches it via the host sink, and serves it back through two loon views — a role-gated "Site stats" page and a small home-page widget.
Package stats is the site-stats collector + presenter: on a cache job it gathers every plugin's StatContributor hook into one snapshot, caches it via the host sink, and serves it back through two loon views — a role-gated "Site stats" page and a small home-page widget.
Package store is the points store — users spend points on catalog items.
Package store is the points store — users spend points on catalog items.
Package tickets is the support-ticket system — user submission, replies, and admin triage.
Package tickets is the support-ticket system — user submission, replies, and admin triage.
Package tracker is a private BitTorrent tracker: the HTTP announce/scrape endpoints a client talks to, the .torrent download that bakes in a member's passkey, and the member and admin pages around them.
Package tracker is a private BitTorrent tracker: the HTTP announce/scrape endpoints a client talks to, the .torrent download that bakes in a member's passkey, and the member and admin pages around them.
Package trackerdir is the directory of external torrent trackers: who exists, what they carry, how precisely they can be asked, and what they demand before answering.
Package trackerdir is the directory of external torrent trackers: who exists, what they carry, how precisely they can be asked, and what they demand before answering.
Package trackersearch asks external trackers what they have.
Package trackersearch asks external trackers what they have.
Package uploads owns the member-facing upload domain: getting bytes in, and managing the rows that come out.
Package uploads owns the member-facing upload domain: getting bytes in, and managing the rows that come out.
Package usenet is the delivery-axis plugin: a basic Usenet indexer that crawls the last few days of a set of newsgroups, assembles complete article sets into downloadable NZB files, and serves search / group-list / download through a capability the host's pages consume.
Package usenet is the delivery-axis plugin: a basic Usenet indexer that crawls the last few days of a set of newsgroups, assembles complete article sets into downloadable NZB files, and serves search / group-list / download through a capability the host's pages consume.
Package wiki is the site's knowledge base — topics containing long-form markdown posts (Help, FAQ, contributor guides).
Package wiki is the site's knowledge base — topics containing long-form markdown posts (Help, FAQ, contributor guides).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL