Repository navigation
Development
-
Go: the version in
go.mod(currentlygo 1.26.0). -
Node.js and npm for the web app. The Makefile loads nvm if
~/.nvm/nvm.shexists and then runsnpm ci(only ifweb/node_modulesis missing) andnpm run build. The project does not pin a Node version; use a current release. -
Caddy for running the whole thing locally:
scripts/dev.shinstalls it intobin/withgo installif it is missing.
| Target | What it does |
|---|---|
make web |
Builds the web app into internal/webui/dist (installs dependencies if needed) |
make build |
make web, then go build -tags webui -o bin/ownpaneld ./cmd/ownpaneld: a binary with the web interface embedded |
make build-linux |
make web, then the same for Linux, amd64, CGO_ENABLED=0: bin/linux-amd64/ownpaneld
|
make package VERSION=v1.2.3 |
scripts/package.sh: release archives for linux/amd64 and linux/arm64 plus checksums.txt in dist/, exactly as the release workflow builds them (Caddy is downloaded from its official release and checked against a pinned SHA-512) |
make test |
go vet ./... && go test ./... |
make dev |
scripts/dev.sh: Caddy and ownpaneld locally on ports 8080/8443 with self-signed certificates |
A plain go build ./cmd/ownpaneld works without the web build and serves only the API (/ answers with a short note). internal/webui/dist is not committed.
See Getting Started. In short: scripts/dev.sh in one terminal, npm run dev in web/ in another (port 5173, forwards /api to 127.0.0.1:8600; /mcp is not forwarded).
go test ./... # Go unit and integration tests
go vet ./...
cd web && npm test # web app tests (vitest, watch mode)
cd web && npm test -- --run # once
cd web && npm run lint # oxlint
cd web && npm run build # type check, then bundle
INSECURE=1 scripts/smoke.sh # end-to-end against a running scripts/dev.sh
scripts/commit-type_test.sh # the commit message check
actions/publish/publish_test.sh # the GitHub Action against a real ownpaneldactions/publish/publish_test.sh builds ownpaneld (or uses OWNPANELD=<path>), starts it with a stand-in for Caddy's admin API (needs python3), creates sites and tokens, and runs the action's script for success and every error it explains (wrong token, unknown site, read-only token, missing or empty folder, too large, unreachable panel). CI runs it in the action job when actions/ or the API changes.
scripts/smoke.sh signs in (or does the first-run setup), creates a site, deploys, redeploys, rolls back, checks that a malicious archive and a cookie request without the header are refused, then deletes the site. Its options (API, DOMAIN, WEB, HTTP_PORT, HTTPS_PORT, SITE, CERT_WAIT, SETUP_CODE_FILE, ADMIN_NAME, ADMIN_PASSWORD, OWNPANEL_TOKEN, KEEP, INSECURE) are documented at the top of the script.
Two tests talk to real services and are behind the live build tag, so go test ./... never runs them:
| Test | Command | Needs |
|---|---|---|
Hetzner Cloud API: lists zones, creates and removes records named _ownpanel-live-test* in the given zone, leaves nothing else changed |
HETZNER_TOKEN=… HETZNER_TEST_ZONE=example.com go test -tags live -run Live -v ./internal/dns/hetzner |
HETZNER_TOKEN: a Read & Write token; HETZNER_TEST_ZONE: a primary zone in that project. Skipped if either is unset |
| Authoritative DNS lookups: read-only, logs what a few names resolve to | go test -tags live -run Live -v ./internal/dns |
network access; no environment variables (the names it looks up are written in the test file) |
-
Permission checks only in
internal/panel. The API (internal/api), MCP (internal/mcp) and any future front door only authenticate and translate. If you need a new rule, add it tointernal/panelso every front door gets it. -
New API route groups are a new file plus an entry in
routeGroups(internal/api/api.go). -
UI text (from
web/AGENTS.md): text shown to people describes what happens for them. No library, protocol or implementation names in labels, titles, hints or messages. Passwords and token secrets are never written to storage or logs. Example: say "Simplify names", not the name of the algorithm behind it. - Web modules never import from each other; see Architecture.
-
The web app is built with ui-sdk. Before using it, read
web/AGENTS.mdand theui-sdkskill it points to. -
Error messages from
internal/panelare meant to be shown to people as they are; internal errors are logged, never sent to clients. -
Database changes are changes to the row structs in
internal/store/repos.go(ablage repositories): ablage adds new tables, fields and indexes at start, and never drops or renames anything, so rename a field only with adbtag that keeps the old column name. No joins: load related rows in one query per relation. The SQL files ininternal/store/legacy/are the schema from before ablage; they are only used to convert old databases once (internal/store/legacy.go) and never change. - Release builds can set the reported version:
-ldflags "-X main.version=…". -
Commit messages and pull request titles follow Conventional Commits:
<type>(<scope>): <description>, scope optional, typesfeat,fix,perf,docs,chore,ci,refactor,test,build, e.g.feat(dns): add Hetzner zones. The version of a stable release is computed from them (see Releases). Pull requests are merged with a merge commit, so the version comes from the individual commits, not from the title: write every commit that lands onmainin this format. The required checkcommitschecks the title and every commit of a pull request intomain; reword commits that fail withgit rebase -i. Pull requests intoreleaseonly warn about older commits and show which release the merge will make.
Two channels, both built by .github/workflows/release.yml with scripts/package.sh (see Installation):
-
Nightly: every push to
mainthat changes something built into the archives (cmd/,internal/,web/,go.mod/go.sum,install.sh,update.sh,deploy/,scripts/package.sh,Makefile) rebuilds the prereleasenightly; pushes that only change documentation, the wiki or other workflows build nothing: the tagnightlymoves to the new commit, the archives are replaced, the version isnightly-YYYYMMDD-<commit>. Never marked "latest". -
Stable: releases are made from the long-lived branch
release. To release, open a pull requestmain → releaseand merge it with a merge commit. The push toreleasestarts the workflow: itstagjob reads the commits since the lastv*tag and computes the next version,fix:/perf:the patch,feat:the minor andfeat!:(or aBREAKING CHANGE:line) the major version, and pushes the tagv<version>. Thereleasejob then builds and publishes it as the "latest" release, with notes listing the pull requests merged since the previous tag. A push withoutfeat:,fix:orperf:commits releases nothing. Thecommitscheck on that pull request shows which release it will make.
Pull requests and pushes to release run CI like main. CI only runs the jobs whose files changed: on pull requests compared with the base branch, on pushes compared with the previous commit. If a stable release fails after its tag was pushed, use "Re-run failed jobs" on the run (re-running the tag job finds the tag and releases nothing). The workflow can also be started by hand: dry-run builds the archives without publishing (kept as a workflow artifact for 7 days), nightly publishes a nightly from main now.
ownpanel: https://github.com/danielgtmn/ownpanel. This wiki is generated from the wiki/ folder in the repository; edit the files there, not in the wiki.
ownpanel
Get going
Using ownpanel
- Sites and Publishing
- GitHub Action
- GitHub
- Git repositories
- Users and Access
- DNS
- Redirects
- MCP
- API
- Backup and Restore
Background