Go 1.26 monorepo. Two binaries, three kernels.
cmd/xboard-node— main daemon. Entry:cmd/xboard-node/main.gocmd/xbctl— CLI management tool. Entry:cmd/xbctl/main.gointernal/kernel/— kernel adapters:singbox/,xray/,mihomo/internal/machine/— machine-mode orchestrator (single instance)internal/service/— node-mode service (spawned per node)internal/config/— config loading, normalization, hot-reload watcherinternal/panel/— panel API client + WebSocketinternal/controlplane/— inbound listener managementinternal/cert/— TLS certificate management (HTTP/DNS-01)internal/limiter/— per-user speed limiting + traffic trackinginternal/tracker/— alive-IP trackinginternal/monitor/— health monitoringinternal/model/— data types + validation
Three kernels are embedded as Go libraries (not external processes). The go.mod uses replace directives to use patched forks of sing-box, xray-core, and mihomo.
make build # build xboard-node + xbctl (current platform)
make build-linux # cross-compile linux/amd64
make build-linux-arm64 # cross-compile linux/arm64
make build-all # both linux targets
make test # go test -v -race -count=1 ./internal/...
make clean # remove build artifacts
make install # build + copy to /usr/local/bin, install example config
make docker # build Docker imageBuild tags required for full feature set: with_quic with_utls with_wireguard with_acme with_clash_api
Tests: make test runs all ./internal/... tests with race detector. No test framework beyond go test. Benchmarks are in files matching *_bench_test.go (gitignored).
- Config file:
config.ymlis gitignored. Copy fromconfig.yml.exampleor runmake install. - Sing-box fork: The
go.modreplacesgithub.com/sagernet/sing-boxwithgithub.com/cedar2025/sing-box— do not assume upstream sing-box APIs are stable. - Xray fork: Similarly replaced with
github.com/cedar2025/Xray-core. - Mihomo fork: Replaced with
github.com/Fearless743/mihomo. - Multi-instance: A single config can define multiple panel bindings via
instances:. The daemon spawns one service per node or one machine orchestrator per instance. - Hot reload: Config changes trigger a full restart of all instances (SIGINT → graceful shutdown → re-parse → restart).
- Health endpoint:
/healthzon configurable port (default 65530). Port 0 disables it. - Environment variables: Panel config can be supplied entirely via env vars (
API_HOST,API_KEY,NODE_ID,KERNEL,DOMAIN,CERT_FILE,KEY_FILE,LOG_LEVEL) — no config file needed. - Release flow: Tag pushes trigger CI release.
devbranch auto-releases on binary changes (detected bycmd/,internal/,go.mod,go.sum). Version bump is conventional-commits-based (feat→minor,fix/perf→patch,breaking!→major). - Docker: Uses
--network=hostby default. Alpine-based multi-stage build. - Installer:
install.shsupportssystemdandopenrc. Requires root. Has rollback on failure.
- Custom routes:
docs-custom-routes.md - Custom outbounds:
docs-custom-outbounds.md - DNS providers (ACME):
docs-dns-providers.md - Mihomo kernel specifics:
docs-mihomo-kernel.md