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

+22
View File
@@ -66,6 +66,9 @@ Part of the [proxy-suite options reference](./index.md).
- [vpn](#services-proxy-suite-amneziawg-profiles-name-vpn)
- [vpnContainer](#services-proxy-suite-amneziawg-profiles-name-vpncontainer)
- [vpnFile](#services-proxy-suite-amneziawg-profiles-name-vpnfile)
- runtime
- [enable](#services-proxy-suite-amneziawg-runtime-enable)
- [interfaceName](#services-proxy-suite-amneziawg-runtime-interfacename)
- [serverUdpPorts](#services-proxy-suite-amneziawg-serverudpports)
- [toolsPackage](#services-proxy-suite-amneziawg-toolspackage)
- [userspacePackage](#services-proxy-suite-amneziawg-userspacepackage)
@@ -548,6 +551,25 @@ File with a vpn:// export\.
**Type:** null or string\
**Default:** `null`
<a id="services-proxy-suite-amneziawg-runtime-enable"></a>
## services\.proxy-suite\.amneziaWg\.runtime\.enable
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\.
**Type:** boolean\
**Default:** `true`
<a id="services-proxy-suite-amneziawg-runtime-interfacename"></a>
## services\.proxy-suite\.amneziaWg\.runtime\.interfaceName
Interface of the global profiles added at runtime\. Only one of them runs at a time, so they share it\.
**Type:** string matching the pattern ^\[A-Za-z0-9_\.-]{1,15}$\
**Default:** `"awg-rt"`
<a id="services-proxy-suite-amneziawg-serverudpports"></a>
## services\.proxy-suite\.amneziaWg\.serverUdpPorts
+14
View File
@@ -122,6 +122,7 @@ Part of the [proxy-suite options reference](./index.md).
- [via](#services-proxy-suite-inbounds-routing-via)
- [zapretDirect](#services-proxy-suite-inbounds-routing-zapretdirect)
- [serverAddress](#services-proxy-suite-inbounds-serveraddress)
- [serverAliases](#services-proxy-suite-inbounds-serveraliases)
- [shareLinks](#services-proxy-suite-inbounds-sharelinks)
- subscriptions
- [enable](#services-proxy-suite-inbounds-subscriptions-enable)
@@ -1137,6 +1138,19 @@ Public address for share links\. ` null `: detect the uplink IPv4\.
**Default:** `null`\
**Example:** `"vpn.example.com"`
<a id="services-proxy-suite-inbounds-serveraliases"></a>
## services\.proxy-suite\.inbounds\.serverAliases
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\.
**Type:** list of string matching the pattern \[^\[:space:]]+\
**Default:** `[ ]`\
**Example:** `[ "turn.example.com" "203.0.113.10" "2001:db8::10" ]`
<a id="services-proxy-suite-inbounds-sharelinks"></a>
## services\.proxy-suite\.inbounds\.shareLinks
+5
View File
@@ -43,6 +43,10 @@ services.proxy-suite = {
enable = false;
kernelModulePackage = ‹amneziawg from boot.kernelPackages on NixOS, null elsewhere›;
profiles = { };
runtime = {
enable = true;
interfaceName = "awg-rt";
};
serverUdpPorts = [ ];
toolsPackage = ‹proxy-suite's patched amneziawg-tools (pkgs/amneziawg.nix)›;
userspacePackage = ‹proxy-suite's patched amneziawg-go (pkgs/amneziawg.nix)›;
@@ -81,6 +85,7 @@ services.proxy-suite = {
zapretDirect = true;
};
serverAddress = null;
serverAliases = [ ];
shareLinks = true;
subscriptions = {
baseUrl = null;
+4 -1
View File
@@ -41,7 +41,10 @@ What the group may do\. Empty allows everything\.
- “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”\.
**Type:** list of (one of “services”, “perApp”, “routing”, “outbounds”, “secrets”, “autoProxy”, “zapret”, “stats”, “whitelistBypass”)\
**Type:** list of (one of “services”, “perApp”, “routing”, “outbounds”, “secrets”, “autoProxy”, “zapret”, “stats”, “whitelistBypass”, “amneziaWg”)\
**Default:** `[ ]`\
**Example:** `[ "services" "routing" ]`
+11
View File
@@ -0,0 +1,11 @@
{ config, lib, pkgs, ... }:
{
services.proxy-suite = {
enable = true;
amneziaWg.enable = true; # no profiles needed
userControl = {
enable = true;
scopes = [ "services" "amneziaWg" "outbounds" ]; # optional: no sudo for these
};
};
}
+38
View File
@@ -64,6 +64,43 @@ host's routes and DNS alone. Use it like any other outbound: for selection, in
| `"userspace"` | yes | no | Runs in wireproxy. The only mode on home-manager and Nix-on-Droid. |
| `"singBox"` | no | no | Plain WireGuard inside sing-box. For servers without obfuscation, such as WARP. |
## Add one without rebuilding
`amneziaWg.enable` alone is enough: profiles and outbounds can come from `proxy-ctl` instead
of the config.
```nix
services.proxy-suite = {
enable = true;
amneziaWg.enable = true; # no profiles needed
userControl = {
enable = true;
scopes = [ "services" "amneziaWg" "outbounds" ]; # optional: no sudo for these
};
};
```
```sh
proxy-ctl awg add vpn://AAAA… # named after the export, or the server's host
proxy-ctl awg add home ~/home.conf # a name first; a link, a file, or - for stdin
proxy-ctl awg on home
proxy-ctl awg rm home
proxy-ctl proxy outbounds add de ~/de.conf # an outbound instead (needs proxy.enable)
```
- A global profile works like a declared one: `awg on`, the tray menu, the kill switch. The
ones added this way share one interface, `amneziaWg.runtime.interfaceName`.
- An outbound runs in wireproxy (like `asOutbound = "userspace"`), so the obfuscation stays.
It cannot chain through another outbound.
- In `proxy-tui` and the desktop app, paste a `vpn://` link or a whole `.conf` onto a tab: on
the Outbounds tab it becomes an outbound, anywhere else a global profile. The AmneziaWG tab
also adds one from a prompt, and removes what was added.
- Hooks (`PostUp` and the like) are always refused, whoever adds the config.
`--container <name>` picks one from a `vpn://` export that holds several.
- Adding and removing takes root, or a `userControl` scope: `amneziaWg` for global profiles,
`outbounds` for outbounds. Turning a profile on and off is `services`.
- They are kept across reboots. `amneziaWg.runtime.enable = false` turns all of this off.
## Good to know
- A profile that stops getting handshake replies moves to a new source port on its own.
@@ -77,5 +114,6 @@ host's routes and DNS alone. Use it like any other outbound: for selection, in
## See also
- [`amneziaWg.profiles`](../options/amneziaWg.md#services-proxy-suite-amneziawg-profiles)
- [`amneziaWg.runtime`](../options/amneziaWg.md#services-proxy-suite-amneziawg-runtime-enable)
- [`asOutbound`](../options/amneziaWg.md#services-proxy-suite-amneziawg-profiles-name-asoutbound)
- [`settings`](../options/amneziaWg.md#services-proxy-suite-amneziawg-profiles-name-settings)
+10 -3
View File
@@ -37,7 +37,8 @@ Members of the group get the listed scopes. An empty `scopes` list grants all of
|---|---|
| `services` | turning services on, off and restarting them |
| `routing` | `proxy pin`, `proxy unpin`, `proxy mode` |
| `outbounds` | adding, removing, enabling and disabling outbounds and subscriptions |
| `outbounds` | adding, removing, enabling and disabling outbounds and subscriptions, AmneziaWG outbounds included |
| `amneziaWg` | `awg add` and `awg rm`: global AmneziaWG profiles, which take over the host's routes and DNS |
| `perApp` | `apps run` with `tun`, `tproxy` and `zapret` profiles |
| `secrets` | reading share links, subscription URLs and running configs |
| `autoProxy`, `zapret`, `stats`, `whitelistBypass` | the matching `proxy-ctl` groups |
@@ -49,13 +50,19 @@ admin password, or you run `proxy-ctl` with sudo.
| Change | Lasts |
|---|---|
| `proxy outbounds add`, `proxy subs add` | until removed with `rm`; kept across reboots |
| `proxy outbounds add`, `proxy subs add`, `awg add` | until removed with `rm`; kept across reboots |
| `proxy outbounds disable` | until `enable`; works on outbounds from Nix too |
| `proxy pin` | until `unpin`; kept across reboots |
| `proxy mode` | until the next reboot |
| `… on` / `… off` | until the next reboot; boot state comes from the config |
Outbounds from the Nix config cannot be removed at runtime, only disabled.
Outbounds from the Nix config cannot be removed at runtime, only disabled. The same goes for
AmneziaWG profiles: `awg rm` only removes those added with `awg add`.
In the TUI and the app, pasting a link onto a tab adds it there: a share link becomes an
outbound, a subscription URL a subscription. An AmneziaWG `vpn://` link or a whole `.conf`
becomes a global profile, or an outbound when pasted onto the Outbounds tab. See
[Use an AmneziaWG config](./amneziawg.md).
## Commands