From 89b91d3ca7d72bbd1f5a1bd6458c3a22728db3f1 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Fri, 9 Oct 2026 06:59:44 -0400 Subject: [PATCH] wireguard fixes --- brc2 | 40 +++++++++++++++---- .../systemd/system/wg-quick-tr-pre@.service | 1 + .../systemd/system/wg-quick-tr-pre@.service | 3 +- .../etc/systemd/system/wg-quick-tr@.service | 4 +- .../systemd/system/wg-quick-tr-pre@.service | 1 + .../etc/openvpn/client-config-hole/frodo | 2 +- .../systemd/system/wg-quick-tr-pre@.service | 1 + .../systemd/system/wg-quick-tr-pre@.service | 1 + .../systemd/system/wg-quick-tr-pre@.service | 1 + .../systemd/system/wg-quick-tr-pre@.service | 1 + .../systemd/system/wg-quick-tr-pre@.service | 1 + .../systemd/system/wg-quick-tr-pre@.service | 1 + .../systemd/system/wg-quick-tr-pre@.service | 1 + mail-setup | 18 ++++++--- 14 files changed, 58 insertions(+), 18 deletions(-) diff --git a/brc2 b/brc2 index 172e006..3c3ac99 100644 --- a/brc2 +++ b/brc2 @@ -1541,12 +1541,35 @@ apache-strip() { } chro() { + local prtmp pid ret=0 if type -p chromium &>/dev/null; then cmd=chromium else cd / cmd="schroot -c bookworm chromium" - CHROMIUM_FLAGS='--enable-remote-extensions' $cmd -- "$@" & r + fi + # without --no-sandbox, it fails due to not having user namespaces + # enabled. As of 2026, User namespaces has too often been a + # mechanism for giving root rather than being useful as a security + # measure. + echo "iank: running CHROMIUM_FLAGS=--enable-remote-extensions $cmd -- --no-sandbox $*" + CHROMIUM_FLAGS=--enable-remote-extensions $cmd -- --no-sandbox "$@" & + pid=$! + # wait in case it dies right away so that we print the output instead of exiting + sleep 2 + prtmp=$(jobs -s; jobs -r) + if (( ${#prtmp} != 0 )); then + printf '\n\n\n\n\n#################\n\n' + echo "iank: exiting this shell for convenience" + sleep 0.5 + r + else + # background: The pid arg is required to get the exit code. + wait $pid || ret=$? + printf '\n\n\n\n\n#################\n\n' + echo "iank: detected chromium exit with success (perhaps it was already running). exiting this shell for convenience" + sleep 2 + r fi } @@ -2200,6 +2223,7 @@ Description=Initial setup of netns for wg-quick-tr %I [Service] Type=oneshot +ExecStartPre=/p/c/mullvad-wg-config-validate %i ExecStart=/usr/bin/flock -w 20 /tmp/newns.flock /usr/local/bin/newns -n 10.174.$ipsuf start %i ExecStop=/usr/bin/flock -w 20 /tmp/newns.flock /usr/local/bin/newns stop %i RemainAfterExit=yes @@ -2322,12 +2346,13 @@ EOF for host in ${!vpn_ips[@]}; do ipsuf=${vpn_ips[$host]} cat <