feat: per-app keep-running

This commit is contained in:
FUFSoB committed 2026-10-10 16:19:54 +05:00
1 parent 91f2397ac5
commit d70bcb317f
15 files changed
+570 -22

No files matched your search

+21 -1
View File
@@ -512,7 +512,27 @@ let
"proxy-suite: perAppRouting profile '${profile.name}': '${profile.outbound}' is both a global AmneziaWG profile and an outbound; say \"awg:${target.name}\" or \"outbound:${target.name}\""
)
]
) perAppRoutingCfg.profiles;
++ [
(mkAssertion (!profile.keepRunning || derived.perAppProfileUnits profile != null)
"proxy-suite: perAppRouting profile '${profile.name}': keepRunning has nothing to keep for route \"${profile.route}\" with no outbound"
)
]
) perAppRoutingCfg.profiles
# Kept pins never give their slot back: they have to leave none short.
++
map
(
route:
let
kept = builtins.filter (lib.hasPrefix "${route}-") derived.perAppKeptViaKeys;
in
mkAssertion (builtins.length kept <= derived.perAppPinSlots)
"proxy-suite: perAppRouting profiles keep ${toString (builtins.length kept)} outbounds running through per-app ${route}, more than perAppRouting.via.pinSlots (${toString derived.perAppPinSlots})"
)
[
"tun"
"tproxy"
];
localProxyAuthCfg = proxyCfg.listener.auth;
localProxyAuthUsed =