feat: awg runtime add

This commit is contained in:
fufsob committed 2026-09-28 18:51:47 +00:00
1 parent cd3aa5a53f
commit 364bed8d51
39 files changed
+1581 -190

No files matched your search

@@ -66,6 +66,25 @@ in
];
};
runtime = {
enable = mkOption {
type = types.bool;
default = true;
description = ''
Let `proxy-ctl` add configs and `vpn://` links without a rebuild: `proxy-ctl awg add`
for a global profile (root hosts only), and `proxy-ctl proxy outbounds add` for an
outbound, which runs in wireproxy (needs `proxy.enable`). wg-quick hooks such as
`PostUp` are always refused in them. With this on, `profiles` may be empty.
'';
};
interfaceName = mkOption {
type = types.strMatching "^[A-Za-z0-9_.-]{1,15}$";
default = "awg-rt";
description = "Interface of the global profiles added at runtime. Only one of them runs at a time, so they share it.";
};
};
profiles = mkOption {
type = types.attrsOf t.profileType;
default = { };
+17
View File
@@ -30,6 +30,23 @@ in
example = "vpn.example.com";
};
serverAliases = mkOption {
type = types.listOf (types.strMatching "[^[:space:]]+");
default = [ ];
description = ''
Other names and IPs of this host that clients reach through the tunnel, such as a
TURN relay's name beside the site on `serverAddress`. Like `serverAddress`, they go
direct on the listener ports instead of looping back through `routing.via`, which
often cannot reach this host at all. List the IPs too: a client that resolves a name
itself hands XRay the address, which no name rule matches.
'';
example = [
"turn.example.com"
"203.0.113.10"
"2001:db8::10"
];
};
openFirewall = bool true "Open the firewall for every listener not on loopback.";
shareLinks = bool true "Generate client share links for `proxy-ctl inbounds link`. Readable by root, and by `userControl.group` with the secrets scope.";
@@ -25,6 +25,7 @@ in
"zapret"
"stats"
"whitelistBypass"
"amneziaWg"
]
);
default = [ ];
@@ -39,6 +40,9 @@ in
- "zapret": change zapret2's learned sites, and `zapret cutoff probe`.
- "stats": `inbounds stats`.
- "whitelistBypass": everything under `proxy-ctl wl`.
- "amneziaWg": add and remove global AmneziaWG profiles (`proxy-ctl awg add`, `awg rm`).
A global profile takes over the host's routes and DNS. Starting and stopping one is
"services"; an AmneziaWG outbound is "outbounds".
'';
example = [
"services"