Ad blocking: For developers
How Ad blocking is built, for anyone who wants to change it or make one like it. It is MIT, by TheMightyTRexUK, and works with plug-in API >=1.14 <2.0.
Its files
Containers
| Container | Network | Folders | Runs as | Starts | Limits |
|---|---|---|---|---|---|
main |
lan |
None | 10001:10001 |
always |
48 MB, 0.1 core |
Each image is pinned by digest in the manifest:
main:ghcr.io/themightytrex/starboard-plugin-examples@sha256:83b980f1828cdee537bcdf03702ddf6458710cba53f9009938225df430d34d9e
What Starboard calls
| Path | What it is |
|---|---|
GET /health |
Health: 200 while it can work |
GET /card |
The Blocked today card (stat) |
How it works
app.pyuses only Python's standard library and the shared helpersbplugin.py. It keeps nothing on disk and runs no background job: it asks only when Starboard asks for the card.- Pi-hole 6: it signs in at
/api/authwith the password, reads/api/stats/summaryand signs out again withDELETE /api/auth, so no session is left open. - AdGuard Home: it reads
/control/statswith the user name and password (basic sign-in). - The card answer uses
band():protectedwith the time it asked, orneeds_setupwhen there is no address. If Pi-hole or AdGuard Home fails,/cardanswers 502 and Starboard shows "No answer from Ad blocking".
Find out more
This page on GitHub, where the help is written.