fix(deploy): home's tunnel rules loaded by systemd, outside wg-quick's AppArmor profile (ADR 0039, D9)
Ubuntu 26.04 confines wg-quick in an AppArmor profile whose nft sub-profile may read nothing in /etc/wireguard, so the tunnel failed to come up at home. The unit's drop-in (wg-quick-halkyon.conf, before-docker.conf before) loads the rules before the interface exists and deletes them after it is gone, so the tunnel never runs without them. ramiel, on 24.04, keeps PostUp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
4d8ea9c3a5
commit
3f6581d6e2
1 changed files with 54 additions and 21 deletions
17
deploy/host/wg-quick-halkyon.conf
Normal file
17
deploy/host/wg-quick-halkyon.conf
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# What wg-quick@wg-halkyon needs beyond wg-quick itself on the instance's host at home
|
||||
# (ADR 0039, D9, D12), as /etc/systemd/system/wg-quick@wg-halkyon.service.d/halkyon.conf.
|
||||
#
|
||||
# The tunnel comes up before Docker: Caddy publishes 443 on the tunnel's address alone
|
||||
# (compose.forwarded.yaml), which must exist when Docker starts the container.
|
||||
#
|
||||
# Its rules (wg-halkyon.nft) are loaded here, before the interface exists, and deleted
|
||||
# after it is gone, so the tunnel is never up without them: they match it by name. Not
|
||||
# by wg-quick's PostUp, as on ramiel: Ubuntu 26.04 confines wg-quick in an AppArmor
|
||||
# profile whose nft may read nothing in /etc/wireguard (found 8 Nov 2026), and which
|
||||
# no local override reaches. systemd runs these unconfined.
|
||||
[Unit]
|
||||
Before=docker.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/sbin/nft -f /etc/wireguard/wg-halkyon.nft
|
||||
ExecStopPost=-/usr/sbin/nft delete table inet halkyon_tunnel
|
||||
Loading…
Reference in a new issue