feat: per-app awg and custom via

This commit is contained in:
FUFSoB committed 2026-10-04 15:39:56 +05:00
1 parent af5b3ff27a
commit 65082aad88
43 files changed
+2674 -197

No files matched your search

+18
View File
@@ -91,6 +91,10 @@ let
path = constants.runtimeAwgDir;
scope = "amneziaWg";
}
++ lib.optional cfg.perAppRouting.enable {
path = constants.runtimeAppsDir;
scope = "perApp";
}
++ lib.optional derived.zapretCutoffEnabled {
path = "${constants.zapret2CutoffDir}/requests";
scope = "zapret";
@@ -352,6 +356,20 @@ lib.mkMerge [
"${constants.runtimeInboundsDir}/listeners"
]
))
# Per-app profiles added at runtime: read by everyone who runs apps, written with the
# perApp scope.
(lib.mkIf (cfg.enable && cfg.perAppRouting.enable) [
"d ${constants.runtimeAppsDir} ${
if !constants.privileged then
"0700 - -"
else if userControlAllows "perApp" then
"2775 root ${userControlCfg.group}"
else if derived.userControlAnyAllows "perApp" then
"2775 root root"
else
"0755 root root"
} -"
])
# Global AmneziaWG profiles added at runtime. Listable, so the tray and TUI show
# their names to everyone; each file is 0600 (amneziawg_config.py writes it so).
(lib.mkIf (cfg.enable && derived.awgRuntimeGlobal) [