small fix

This commit is contained in:
FUFSoB committed 2026-04-15 18:11:57 +05:00
1 parent f77f306acb
commit 415336e618
1 file changed
+8 -8
+8 -8
View File
@@ -65,7 +65,7 @@ let
findBin = "${pkgs.findutils}/bin/find"; findBin = "${pkgs.findutils}/bin/find";
proxySuiteScriptsDir = ../../scripts; proxySuiteScriptsDir = ../../scripts;
parserScriptsPythonPath = lib.escapeShellArg (toString proxySuiteScriptsDir); parserScriptsPythonPath = proxySuiteScriptsDir;
buildOutboundPy = "${proxySuiteScriptsDir}/build-outbound.py"; buildOutboundPy = "${proxySuiteScriptsDir}/build-outbound.py";
fetchSubscriptionPy = "${proxySuiteScriptsDir}/fetch-subscription.py"; fetchSubscriptionPy = "${proxySuiteScriptsDir}/fetch-subscription.py";
mkSubscriptionUrlSource = mkSubscriptionUrlSource =
@@ -73,15 +73,15 @@ let
if sub.urlFile != null then if sub.urlFile != null then
sub.urlFile sub.urlFile
else else
"${pkgs.writeText "proxy-suite-sub-url-${sub.tag}" sub.url}"; pkgs.writeText "proxy-suite-sub-url-${sub.tag}" sub.url;
mkSubscriptionFetchCommand = mkSubscriptionFetchCommand =
sub: sub:
let let
urlSource = mkSubscriptionUrlSource sub; urlSource = mkSubscriptionUrlSource sub;
in in
'' ''
printf '%s' "$(cat ${lib.escapeShellArg urlSource})" \ printf '%s' "$(cat "${urlSource}")" \
| PYTHONPATH=${parserScriptsPythonPath} ${python3} ${fetchSubscriptionPy} --tag-prefix ${lib.escapeShellArg sub.tag} | PYTHONPATH="${parserScriptsPythonPath}" ${python3} ${fetchSubscriptionPy} --tag-prefix ${lib.escapeShellArg sub.tag}
''; '';
# Build the shell code block for a single outbound entry. # Build the shell code block for a single outbound entry.
@@ -101,7 +101,7 @@ let
in in
'' ''
# outbound: ${tag} (static json) # outbound: ${tag} (static json)
OB_JSON=$(cat ${lib.escapeShellArg jsonFile}) OB_JSON=$(cat "${jsonFile}")
OUTBOUNDS_JSON=$(${jq} --argjson ob "$OB_JSON" '. + [$ob]' <<< "$OUTBOUNDS_JSON") OUTBOUNDS_JSON=$(${jq} --argjson ob "$OB_JSON" '. + [$ob]' <<< "$OUTBOUNDS_JSON")
'' ''
else else
@@ -112,12 +112,12 @@ let
else else
# Literal URL – write to nix store so the script can cat it. # Literal URL – write to nix store so the script can cat it.
# Less secret than urlFile, but convenient for non-sensitive configs. # Less secret than urlFile, but convenient for non-sensitive configs.
"${pkgs.writeText "proxy-suite-url-${ob.tag}" ob.url}"; pkgs.writeText "proxy-suite-url-${ob.tag}" ob.url;
in in
'' ''
# outbound: ${tag} # outbound: ${tag}
URL=$(cat ${lib.escapeShellArg urlSource}) URL=$(cat "${urlSource}")
OB_JSON=$(printf '%s' "$URL" | PYTHONPATH=${parserScriptsPythonPath} ${python3} ${buildOutboundPy} --tag ${lib.escapeShellArg tag}${markArg}) OB_JSON=$(printf '%s' "$URL" | PYTHONPATH="${parserScriptsPythonPath}" ${python3} ${buildOutboundPy} --tag ${lib.escapeShellArg tag}${markArg})
OUTBOUNDS_JSON=$(${jq} --argjson ob "$OB_JSON" '. + [$ob]' <<< "$OUTBOUNDS_JSON") OUTBOUNDS_JSON=$(${jq} --argjson ob "$OB_JSON" '. + [$ob]' <<< "$OUTBOUNDS_JSON")
''; '';