Add packaging #10

Closed
opened 2024-07-06 12:39:24 +01:00 by danny · 8 comments
danny commented 2024-07-06 12:39:24 +01:00 (Migrated from gitlab.keyop.co.uk)

RPM and DEB required, also need to include systemd configuration.

RPM and DEB required, also need to include systemd configuration.
danny commented 2024-07-07 10:40:21 +01:00 (Migrated from gitlab.keyop.co.uk)

mentioned in issue #7

mentioned in issue #7
danny commented 2026-07-04 16:51:45 +01:00 (Migrated from gitlab.keyop.co.uk)

Note: Installation should be in /usr/local/bin, since we will need to also include the 'iptables' binary with it's enhanced capabilities. The systemd user service file should be included in a 'docs' directory (packaged in correct location for the packaging mechanism expectations).

This is still intended to run as a '--user' systemd service, so the packages should not attempt to actually install or start the service - that will be up to the user. We should include a README.md in the docs detailing how to do this, along with the sample configuration also.

Note: Installation should be in /usr/local/bin, since we will need to also include the 'iptables' binary with it's enhanced capabilities. The systemd user service file should be included in a 'docs' directory (packaged in correct location for the packaging mechanism expectations). This is still intended to run as a '--user' systemd service, so the packages should not attempt to actually install or start the service - that will be up to the user. We should include a README.md in the docs detailing how to do this, along with the sample configuration also.
danny commented 2026-07-04 17:43:04 +01:00 (Migrated from gitlab.keyop.co.uk)

We should also consider other Linux packaging formats for other distributions. Arch, Alpine and Nix all come to mind, but there may be others which are worth considering. Anything which goreleaser can handle for us should be handled. Anything stepping outside of goreleaser is probably too much work to maintain.

We should also consider other Linux packaging formats for other distributions. Arch, Alpine and Nix all come to mind, but there may be others which are worth considering. Anything which goreleaser can handle for us should be handled. Anything stepping outside of goreleaser is probably too much work to maintain.
danny commented 2026-07-05 14:49:50 +01:00 (Migrated from gitlab.keyop.co.uk)

mentioned in commit a103a09430

mentioned in commit a103a09430ab2267d5f008544e7f733a5b1e3781
danny commented 2026-07-05 14:50:31 +01:00 (Migrated from gitlab.keyop.co.uk)

mentioned in merge request !61

mentioned in merge request !61
danny commented 2026-07-05 16:03:24 +01:00 (Migrated from gitlab.keyop.co.uk)

mentioned in commit b792f81ce2

mentioned in commit b792f81ce273b2cfb846ecafbc018ca9b8b4b084
danny (Migrated from gitlab.keyop.co.uk) closed this issue 2026-07-05 16:03:25 +01:00
danny commented 2026-07-05 16:04:34 +01:00 (Migrated from gitlab.keyop.co.uk)

Resolved via MR !61 (merged in b792f81), and published end-to-end as the project's first release, v1.0.0: https://gitlab.keyop.co.uk/keyop/go/nfq_forwarder/-/releases/v1.0.0

What shipped

  • Fixed and completed the previously partial nfpms: block in .goreleaser.yaml (wrong bindir, placeholder description, missing files) and added apk/archlinux formats alongside deb/rpm - Nix confirmed out of scope (nfpm has no Nix output at all).
  • Capabilities are granted via a postinstall scriptlet (scripts/nfpm-postinstall.sh) against the installed paths - nfpm has no native capability field, and capabilities are xattrs that don't reliably survive .deb/.rpm/.apk archive packaging.
  • nfq_forwarder.service, config.example.yaml, and a new packaging-quickstart docs/README.md are shipped as inert reference copies under /usr/share/doc/nfq_forwarder/ - packages never touch systemd themselves, matching the --user-service design from the discussion above. nfq_forwarder.pam is the one file that does install to a live path (/etc/pam.d/nfq_forwarder), since it's dormant until actively used.
  • Added a make package (snapshot, safe anywhere) and make release (real publish, CI-only) target, and a tag-triggered GitLab CI release stage - pushing a vX.Y.Z tag now automatically builds, packages, and publishes a GitLab Release with all four package formats uploaded to the Package Registry.

Bonus fix, outside this repo

Getting the release pipeline working end-to-end surfaced an instance-wide nginx bug: path-based project addressing (/api/v4/projects/keyop%2Fgo%2Fnfq_forwarder/...) was 404ing for every project on this GitLab instance, due to a proxy_pass https://gitlab.keyop.co.uk:8443/; trailing-slash in compose-configs' nginx config causing %2F to get decoded before reaching GitLab. Fixed by removing the trailing slash. This was blocking goreleaser's GitLab client entirely (it only ever addresses projects by path, never numeric ID), and may have been silently affecting other tooling too.

Still needs real-host verification (tracked separately)

  • Installing the .deb/.rpm on real Debian/RHEL hosts and confirming setcap -v shows both capability grants post-install.
  • The .apk/Arch packages on real Alpine/Arch hosts, including confirming the libcap dependency name resolves correctly on each.
Resolved via MR !61 (merged in b792f81), and published end-to-end as the project's first release, **v1.0.0**: https://gitlab.keyop.co.uk/keyop/go/nfq_forwarder/-/releases/v1.0.0 ## What shipped - Fixed and completed the previously partial `nfpms:` block in `.goreleaser.yaml` (wrong `bindir`, placeholder description, missing files) and added `apk`/`archlinux` formats alongside `deb`/`rpm` - Nix confirmed out of scope (nfpm has no Nix output at all). - Capabilities are granted via a `postinstall` scriptlet (`scripts/nfpm-postinstall.sh`) against the installed paths - nfpm has no native capability field, and capabilities are xattrs that don't reliably survive `.deb`/`.rpm`/`.apk` archive packaging. - `nfq_forwarder.service`, `config.example.yaml`, and a new packaging-quickstart `docs/README.md` are shipped as inert reference copies under `/usr/share/doc/nfq_forwarder/` - **packages never touch systemd themselves**, matching the `--user`-service design from the discussion above. `nfq_forwarder.pam` is the one file that does install to a live path (`/etc/pam.d/nfq_forwarder`), since it's dormant until actively used. - Added a `make package` (snapshot, safe anywhere) and `make release` (real publish, CI-only) target, and a tag-triggered GitLab CI `release` stage - pushing a `vX.Y.Z` tag now automatically builds, packages, and publishes a GitLab Release with all four package formats uploaded to the Package Registry. ## Bonus fix, outside this repo Getting the release pipeline working end-to-end surfaced an **instance-wide nginx bug**: path-based project addressing (`/api/v4/projects/keyop%2Fgo%2Fnfq_forwarder/...`) was 404ing for every project on this GitLab instance, due to a `proxy_pass https://gitlab.keyop.co.uk:8443/;` trailing-slash in `compose-configs`' nginx config causing `%2F` to get decoded before reaching GitLab. Fixed by removing the trailing slash. This was blocking `goreleaser`'s GitLab client entirely (it only ever addresses projects by path, never numeric ID), and may have been silently affecting other tooling too. ## Still needs real-host verification (tracked separately) - Installing the `.deb`/`.rpm` on real Debian/RHEL hosts and confirming `setcap -v` shows both capability grants post-install. - The `.apk`/Arch packages on real Alpine/Arch hosts, including confirming the `libcap` dependency name resolves correctly on each.
danny commented 2026-07-06 07:42:17 +01:00 (Migrated from gitlab.keyop.co.uk)

mentioned in commit e925bbe2ae

mentioned in commit e925bbe2aebe69eb1509ae28bbdf165c1c7ad515
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
keyop-go/nfq_forwarder#10
No description provided.