SectionDevelopment
Development
make build # dist/monopanel
make check # gofmt + go vet + golangci-lint + tests (about 2 s)
make web # the web UI into web/build (needs node and pnpm)
make help # every target| Command | What it does |
|---|---|
make test | unit tests; the panel's logic is exercised through a fake agent, without root or systemd |
make check | the above plus gofmt, go vet and golangci-lint — what CI runs |
make test-race | the race detector (about a minute): job queue, SSE broker, certificate cache |
make cover | coverage per package; make cover-html opens the report |
make web-check | types and markup of the web UI (svelte-check) |
scripts/check-templates.sh | feeds the generated configuration to a real nginx -t and apachectl -t |
make e2e | a scenario against a live panel: account → site with a preset → database → removal |
make testbed-matrix | the same scenario on the eleven testbed VMs (one per OS of the matrix) in parallel, each rolled back to a clean snapshot first; make testbed-migrate SRC= DST= moves a real account between two of them and checks what arrived |
The fake agent (internal/agent/agenttest) listens on a unix socket and answers
the privileged operations while recording everything the panel tried to do. A test
can therefore read the generated nginx server block and php-fpm pool and check
behaviour end to end: CMS presets, IP allow-lists, suspending a site, cascading
account removal, update signature verification.
End-to-end runs against a real panel and removes everything it created:
make e2e HOST=<ssh alias> # mints a token over ssh and revokes it afterwards
# or explicitly:
MONOPANEL_URL=https://panel:8443 MONOPANEL_TOKEN='…' make e2eCI on every push: tests with the race detector and coverage, the linter, template
validation against real nginx and Apache, the web UI build with type checking, and
binaries for amd64 and arm64. E2E runs on demand (workflow_dispatch) because it
needs a live host. The OS matrix runs from a workstation against a Proxmox testbed
(docs/en/08-testbed.md): the scripts live in scripts/testbed/, the
host and network in the git-ignored .dev/testbed.env.
Layout
cmd/monopanel/ entry point
internal/api/ HTTP API (huma + chi), SSE, UI, TLS, job handlers
internal/agent/ the privileged agent: ApplyConfigSet, EnsureUnixUser, Service, Pkg
internal/jobs/ job queue, workers, event broker
internal/store/ SQLite, migrations, models
internal/osprofile/ Debian/RHEL differences
internal/render/ template rendering with golden tests
internal/updater/ finding a release, verifying it, installing with rollback
internal/cli/ tui/ the mp commands and the terminal menu
internal/client/ Go client for the API (CLI, menu, setup)
templates/ nginx/, apache/, php-fpm/, systemd/
web/ SvelteKit application (build/ is embedded in the binary)
web/static/monaco/ the VS Code editor (Monaco), trimmed build — see its README
packaging/ nfpm.yaml, units, sysusers/tmpfiles, install.sh
scripts/release/ key generation and SHA256SUMS signing for a release
scripts/testbed/ the testbed: VMs on Proxmox, panel bootstrap, matrix and migration runs