add optional user/password for sing-box

This commit is contained in:
FUFSoB committed 2026-04-22 17:29:12 +05:00
1 parent b696821d8c
commit 43935daeb1
9 files changed
+373 -16

No files matched your search

+5 -1
View File
@@ -79,6 +79,10 @@ let
subscriptionUpdate = "proxy-suite-subscription-update";
};
localProxyAuthEnabled =
singBoxCfg.auth.username != null
&& (singBoxCfg.auth.password != null || singBoxCfg.auth.passwordFile != null);
tproxyUpScript = pkgs.writeShellScript "proxy-suite-tproxy-up" ''
${nft} delete table ip singbox 2>/dev/null || true
${nft} -f ${nftablesRulesFile}
@@ -254,7 +258,7 @@ in
globalTproxy.enable || perAppRoutingTun.enable || perAppRoutingTproxy.enable || perAppZapretEnabled
) (lib.mkDefault true);
users.groups = lib.mkIf (cfg.enable && userControlEnabled) {
users.groups = lib.mkIf (cfg.enable && (userControlEnabled || localProxyAuthEnabled)) {
"${userControlCfg.group}" = { };
};