fix(packaging): declare libcap dependency for setcap#24
Merged
Conversation
The post-install scripts run 'setcap cap_net_admin+ep' to grant CAP_NET_ADMIN, without which akon cannot create the TUN device. setcap was not declared as a package dependency, so on a system lacking it the install only printed a warning and akon silently failed to connect until libcap was installed manually. Declare the dependency so the package manager pulls it in: - deb: depends = libcap2-bin - rpm: requires libcap
There was a problem hiding this comment.
Pull request overview
This PR fixes a packaging defect where the deb/rpm post-install scripts invoke setcap cap_net_admin+ep /usr/bin/akon (to grant CAP_NET_ADMIN for TUN device creation) but the package never declared setcap as a dependency. On hosts lacking libcap tooling, the install only printed a warning and the VPN silently failed. The change declares the dependency so the package manager pulls in setcap automatically. I verified both debian/postinst and rpm/post-install.sh do indeed call setcap, and that libcap2-bin (deb) / libcap (rpm) provide it on their respective distro families.
Changes:
- Add
depends = "libcap2-bin"to the[package.metadata.deb]section. - Add
requires = { libcap = "*" }to the[package.metadata.generate-rpm]section. - Add explanatory comments tying the dependency to the post-install
setcapstep.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| priority = "optional" | ||
| # setcap (from libcap2-bin) is required by the post-install script to grant | ||
| # CAP_NET_ADMIN; without it akon cannot create the TUN device. | ||
| depends = "libcap2-bin" |
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.
Problem
The deb/rpm post-install scripts run
setcap cap_net_admin+ep /usr/bin/akonto grant theCAP_NET_ADMINakon needs to create the TUN device. Butsetcapwas not declared as a package dependency, so on a host without it the install merely printed a warning and akon silently failed to connect until the user installed libcap manually.Fix
Declare the dependency so the package manager pulls it in:
depends = "libcap2-bin"requires { libcap = "*" }resolvectl(systemd-resolved, used for DNS) is part of base systemd and is not added.Testing
The PR's package-building CI jobs build both the
.deband.rpm, validating the metadata. Verified the manifest parses (cargo metadata).