fix: hardening

This commit is contained in:
FUFSoB committed 2026-10-05 22:44:09 +05:00
1 parent 017a947a18
commit a435942b4f
168 files changed
+9166 -1644

No files matched your search

@@ -13,7 +13,7 @@ check_runtime() {
--arg user "" \
--arg password "" \
--argjson route_enabled true \
--argjson route_rules '[]' \
--slurpfile route_rules <(echo '[]') \
--arg route_final "proxy" \
--arg dns_final "remote" \
--argjson clear_dns_rules false \
@@ -44,7 +44,7 @@
"172.19.0.1/30"
checkConstants.globalTunIPv6Address
];
assert tunInbound.sniffing.destOverride == [ "fakedns" ];
assert tunInbound.sniffing.destOverride == [ "fakedns+others" ];
assert tunInbound.sniffing.metadataOnly == false;
assert xrayTunConfig.routing.domainStrategy == "IPIfNonMatch";
assert tunHasFinalRuleTag;
@@ -99,11 +99,13 @@
assert pkgs.lib.hasInfix
"rule add pref ${toString checkConstants.tunAutoRouteRulePriority} not fwmark 2 table ${toString checkConstants.tunAutoRouteTableIndex}"
xrayTunUpScript;
# Both families, but IPv6 only where the kernel has it (ipv6.disable=1 refuses every -6).
assert pkgs.lib.hasInfix "if [ -e /proc/net/if_inet6 ]; then families+=(-6); fi" xrayTunUpScript;
assert pkgs.lib.hasInfix
"-6 rule add pref ${toString checkConstants.xrayTunPerAppTunRulePriority} fwmark 16 table 101"
''"$family" rule add pref ${toString checkConstants.xrayTunPerAppTunRulePriority} fwmark 16 table 101''
xrayTunUpScript;
assert pkgs.lib.hasInfix
"-6 rule add pref ${toString checkConstants.tunAutoRouteRulePriority} not fwmark 2 table ${toString checkConstants.tunAutoRouteTableIndex}"
''"$family" rule add pref ${toString checkConstants.tunAutoRouteRulePriority} not fwmark 2 table ${toString checkConstants.tunAutoRouteTableIndex}''
xrayTunUpScript;
assert pkgs.lib.hasInfix
''"$family" rule add pref ${toString checkConstants.xrayTunMarkBypassRulePriority} fwmark 2 lookup main''
@@ -25,7 +25,7 @@
"172.20.0.1/30"
checkConstants.perAppTunIPv6Address
];
assert perAppTunInbound.sniffing.destOverride == [ "fakedns" ];
assert perAppTunInbound.sniffing.destOverride == [ "fakedns+others" ];
assert perAppTunInbound.sniffing.metadataOnly == false;
assert xrayPerAppTunConfig.routing.domainStrategy == "IPIfNonMatch";
assert (builtins.head xrayPerAppTunConfig.dns.servers).address == "fakedns";