fix: vless fixes
This commit is contained in:
7 files changed
+171
-13
No files matched your search
@@ -200,6 +200,19 @@ let
|
||||
minimalProxyCtlWrapper = _minimalProxyCtl.wrapper;
|
||||
minimalProxyCtlScript = _minimalProxyCtl.script;
|
||||
minimalSocksService = minimal.config.systemd.services."proxy-suite-socks";
|
||||
customSingBoxPackage = pkgs.writeShellScriptBin "sing-box" ''
|
||||
exit 0
|
||||
'';
|
||||
customSingBoxPackageFixture = evalProxySuite [
|
||||
baseModule
|
||||
{
|
||||
services.proxy-suite.singBox.package = customSingBoxPackage;
|
||||
}
|
||||
];
|
||||
customSingBoxPackageBin = "${builtins.unsafeDiscardStringContext (toString customSingBoxPackage)}/bin/sing-box";
|
||||
customSingBoxPackageStartScript = builtins.readFile (
|
||||
customSingBoxPackageFixture.config.systemd.services."proxy-suite-socks".serviceConfig.ExecStart
|
||||
);
|
||||
|
||||
routeModeFixture = evalProxySuite [
|
||||
baseModule
|
||||
@@ -1415,6 +1428,11 @@ let
|
||||
assert builtins.elem "network-online.target" zapretSyncService.wants;
|
||||
true
|
||||
)
|
||||
# -- sing-box package override propagates into generated service scripts --
|
||||
(
|
||||
assert pkgs.lib.hasInfix customSingBoxPackageBin customSingBoxPackageStartScript;
|
||||
true
|
||||
)
|
||||
(
|
||||
assert duplicateTags.success == false;
|
||||
true
|
||||
|
||||
+18
-2
@@ -19,6 +19,22 @@ let
|
||||
];
|
||||
};
|
||||
filterGeneratedOptions = lib.filterAttrs (name: _: name != "_module");
|
||||
docPackagePlaceholder = "__proxy_suite_doc_pkg_sing_box__";
|
||||
sanitizeConfigForDocs =
|
||||
config:
|
||||
config
|
||||
// {
|
||||
singBox =
|
||||
(config.singBox or { })
|
||||
// lib.optionalAttrs ((config.singBox or { }) ? package) {
|
||||
package = docPackagePlaceholder;
|
||||
};
|
||||
};
|
||||
renderConfigText =
|
||||
config:
|
||||
lib.replaceStrings [ "\"${docPackagePlaceholder}\"" ] [ "pkgs.sing-box" ] (
|
||||
lib.generators.toPretty { } (sanitizeConfigForDocs config)
|
||||
);
|
||||
mkGeneratedExampleValue =
|
||||
option:
|
||||
if (option ? _type) && option._type == "option" then
|
||||
@@ -32,8 +48,8 @@ let
|
||||
throw "Cannot generate example value for option ${lib.showOption option.loc}"
|
||||
else
|
||||
lib.mapAttrs (_: mkGeneratedExampleValue) (filterGeneratedOptions option);
|
||||
defaultConfigText = lib.generators.toPretty { } eval.config.services.proxy-suite;
|
||||
exampleConfigText = lib.generators.toPretty { } (
|
||||
defaultConfigText = renderConfigText eval.config.services.proxy-suite;
|
||||
exampleConfigText = renderConfigText (
|
||||
lib.mapAttrs (_: mkGeneratedExampleValue) (filterGeneratedOptions eval.options.services.proxy-suite)
|
||||
);
|
||||
repoRoot = toString ../.;
|
||||
|
||||
Reference in new issue
Block a user