feat: support warp config generators
This commit is contained in:
5 files changed
+56
-4
No files matched your search
@@ -56,6 +56,16 @@ let
|
||||
configFile = null;
|
||||
};
|
||||
autoTunnel = tunnelOf auto;
|
||||
generator = mkFixture "sing-box" {
|
||||
asOutbound = true;
|
||||
configFile = null;
|
||||
generatorUrl = "https://gen.example.com/api/warp?mode=awg2";
|
||||
};
|
||||
registerOf =
|
||||
fixture:
|
||||
generated.readDerivation fixture.config.systemd.services."proxy-suite-warp".serviceConfig.ExecStart;
|
||||
autoRegister = registerOf auto;
|
||||
generatorRegister = registerOf generator;
|
||||
|
||||
amneziaWg = evalProxySuite [
|
||||
{
|
||||
@@ -185,6 +195,14 @@ in
|
||||
&& hasInfix "until [ -s \"$profile\" ]" autoTunnel;
|
||||
true
|
||||
)
|
||||
# A generator only backs up wgcf, fetched directly with the URL quoted.
|
||||
(
|
||||
assert
|
||||
hasInfix "register || register || generate" generatorRegister
|
||||
&& hasInfix "'https://gen.example.com/api/warp?mode=awg2'" generatorRegister
|
||||
&& !(hasInfix "generate()" autoRegister);
|
||||
true
|
||||
)
|
||||
(
|
||||
assert amneziaWg.config.services.proxy-suite.amneziaWg.profiles.warp.configFile == profile;
|
||||
true
|
||||
|
||||
Reference in new issue
Block a user