small fixes
This commit is contained in:
5 files changed
+38
-44
No files matched your search
@@ -154,19 +154,15 @@ let
|
||||
r.proxy.geoips ++ direct.geoips ++ r.block.geoips ++ lib.concatMap (rule: rule.geoips) customRules
|
||||
);
|
||||
|
||||
geositeRuleSets = map (name: {
|
||||
tag = "geosite-${name}";
|
||||
mkRuleSet = kind: pkg: name: {
|
||||
tag = "${kind}-${name}";
|
||||
type = "local";
|
||||
format = "binary";
|
||||
path = "${pkgs.sing-geosite}/share/sing-box/rule-set/geosite-${name}.srs";
|
||||
}) allGeositeNames;
|
||||
path = "${pkg}/share/sing-box/rule-set/${kind}-${name}.srs";
|
||||
};
|
||||
|
||||
geoIPRuleSets = map (name: {
|
||||
tag = "geoip-${name}";
|
||||
type = "local";
|
||||
format = "binary";
|
||||
path = "${pkgs.sing-geoip}/share/sing-box/rule-set/geoip-${name}.srs";
|
||||
}) allGeoIPNames;
|
||||
geositeRuleSets = map (mkRuleSet "geosite" pkgs.sing-geosite) allGeositeNames;
|
||||
geoIPRuleSets = map (mkRuleSet "geoip" pkgs.sing-geoip) allGeoIPNames;
|
||||
|
||||
routingRules = lib.flatten [
|
||||
{
|
||||
|
||||
@@ -197,6 +197,11 @@ let
|
||||
}
|
||||
];
|
||||
|
||||
perAppZapretDesyncMarks = [
|
||||
67108864
|
||||
134217728
|
||||
];
|
||||
|
||||
forbiddenValueAssertions =
|
||||
map (item: forbiddenValues item.condition item.value item.disallowed item.message)
|
||||
[
|
||||
@@ -212,46 +217,31 @@ let
|
||||
{
|
||||
condition = perAppZapretCfg.enable;
|
||||
value = globalTproxy.fwmark;
|
||||
disallowed = [
|
||||
67108864
|
||||
134217728
|
||||
];
|
||||
disallowed = perAppZapretDesyncMarks;
|
||||
message = "proxy-suite: singBox.tproxy.fwmark must not use per-app-zapret internal desync mark bits";
|
||||
}
|
||||
{
|
||||
condition = perAppZapretCfg.enable;
|
||||
value = globalTproxy.proxyMark;
|
||||
disallowed = [
|
||||
67108864
|
||||
134217728
|
||||
];
|
||||
disallowed = perAppZapretDesyncMarks;
|
||||
message = "proxy-suite: singBox.tproxy.proxyMark must not use per-app-zapret internal desync mark bits";
|
||||
}
|
||||
{
|
||||
condition = perAppRoutingTun.enable && perAppZapretCfg.enable;
|
||||
value = perAppRoutingTun.fwmark;
|
||||
disallowed = [
|
||||
67108864
|
||||
134217728
|
||||
];
|
||||
disallowed = perAppZapretDesyncMarks;
|
||||
message = "proxy-suite: singBox.tun.perApp.fwmark must not use per-app-zapret internal desync mark bits";
|
||||
}
|
||||
{
|
||||
condition = perAppRoutingTproxy.enable && perAppZapretCfg.enable;
|
||||
value = perAppRoutingTproxy.fwmark;
|
||||
disallowed = [
|
||||
67108864
|
||||
134217728
|
||||
];
|
||||
disallowed = perAppZapretDesyncMarks;
|
||||
message = "proxy-suite: singBox.tproxy.perApp.fwmark must not use per-app-zapret internal desync mark bits";
|
||||
}
|
||||
{
|
||||
condition = perAppZapretCfg.enable;
|
||||
value = perAppZapretCfg.filterMark;
|
||||
disallowed = [
|
||||
67108864
|
||||
134217728
|
||||
];
|
||||
disallowed = perAppZapretDesyncMarks;
|
||||
message = "proxy-suite: zapret.perApp.filterMark must not use per-app-zapret internal desync mark bits";
|
||||
}
|
||||
];
|
||||
|
||||
@@ -10,16 +10,18 @@ let
|
||||
t = cfg.tgWsProxy;
|
||||
tgPkg = packages.tg-ws-proxy;
|
||||
|
||||
dcArgs = lib.concatMapStrings (id: " --dc-ip=${id}:${t.dcIps.${id}}") (builtins.attrNames t.dcIps);
|
||||
dcArgs = lib.concatMapStrings
|
||||
(id: " --dc-ip=${lib.escapeShellArg "${id}:${t.dcIps.${id}}"}")
|
||||
(builtins.attrNames t.dcIps);
|
||||
startScript = pkgs.writeShellScript "proxy-suite-tg-ws-proxy-start" ''
|
||||
exec ${tgPkg}/bin/tg-ws-proxy \
|
||||
--port=${toString t.port} \
|
||||
--host=${t.host} \
|
||||
--host=${lib.escapeShellArg t.host} \
|
||||
${
|
||||
if t.secretFile != null then
|
||||
"--secret-file=$CREDENTIALS_DIRECTORY/tg_ws_proxy_secret"
|
||||
else
|
||||
"--secret=${t.secret}"
|
||||
"--secret=${lib.escapeShellArg t.secret}"
|
||||
}${dcArgs}
|
||||
'';
|
||||
in
|
||||
|
||||
Reference in new issue
Block a user