feat: packaging — .deb/.rpm via nfpm and Docker image#14
Merged
Conversation
Operators can now install ja4monitor via apt/rpm or run it in Docker. ## .deb / .rpm (via nfpm) packaging/ nfpm.yaml — nfpm package config (arch/version templated from env) ja4monitor.service — systemd unit with capability bounding set + hardening scripts/postinst — creates ja4monitor system user, data dir, setcap scripts/prerm — stops/disables systemd unit before removal scripts/postrm — purge removes user, data, and config dirs postinst grants CAP_NET_RAW and CAP_NET_ADMIN via setcap so the daemon runs as the ja4monitor system user without root. Falls back gracefully when setcap is unavailable (prints a warning). ## Docker Dockerfile — two-stage build (golang:1.25-bookworm builder + debian:bookworm-slim runtime). Runtime image: libpcap + ca-certificates, non-root ja4monitor user, /data volume for SQLite. Capabilities granted at runtime via --cap-add; binary is NOT setuid in the container. .dockerignore added to exclude testdata, captures, and build artifacts. ## Release workflow .github/workflows/release.yml updated to: 1. Install nfpm after building 2. Package amd64 and arm64 .deb and .rpm 3. Upload all packages alongside binaries in the GitHub Release Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Crank-Git
added a commit
that referenced
this pull request
May 9, 2026
feat: packaging — .deb/.rpm via nfpm and Docker image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.deb/.rpmpackages via nfpm: amd64 + arm64 for both formats, produced in the release workflow on every tag pushDockerfile— two-stage build, non-root user, capabilities granted at runtime via--cap-addpackaging/postinst— createsja4monitorsystem user/group, data + log dirs, grantsCAP_NET_RAW+CAP_NET_ADMINviasetcapso the daemon runs without root.deb/.rpmpackages to GitHub ReleasesCapability model
.deb/.rpmpostinstrunssetcap cap_net_raw,cap_net_admin=eip /usr/bin/ja4monitor; daemon runs asja4monitorsystem userdocker run --cap-add NET_RAW --cap-add NET_ADMIN --network hostQuick start after install
Test plan
go build ./...+go test ./...all green+xand useset -epostinstis idempotent (usesgetentchecks beforeuseradd/groupadd)postrm purgecleans up user, group, and data dirs; plainremoveleaves data intactnfpm.yamlpaths match what the release workflow produces (../dist/ja4monitor).debinstalls cleanly on Ubuntu 22.04 + 24.04🤖 Generated with Claude Code