fix: multiple fixes

This commit is contained in:
fufsob committed 2026-09-15 03:08:32 +00:00
1 parent 5c6b2b4163
commit f325e76b2f
22 files changed
+107 -92

No files matched your search

+5 -43
View File
@@ -1,50 +1,12 @@
# nixpkgs' AmneziaWG 3.1 packages plus this suite's patches.
{ pkgs }:
let
# Tools and the kernel module currently publish 3.1.20260812, while the
# userspace implementation has follow-up 3.1 fixes through 20260828.
# nixpkgs itself still tracks AWG 3.0.
version = "3.1.20260812";
userspaceVersion = "3.1.20260828";
{
tools = pkgs.amneziawg-tools.overrideAttrs (old: {
inherit version;
src = pkgs.fetchFromGitHub {
owner = "amnezia-vpn";
repo = "amneziawg-tools";
tag = "v${version}";
hash = "sha256-6GEb41ERhR0Hg3RbSyIHdXPSKaxugoFCmFS5S0UiZso=";
};
patches = (old.patches or [ ]) ++ [ ./patches/amneziawg-tools-force-userspace.patch ];
});
userspace = pkgs.amneziawg-go.overrideAttrs (_: {
version = userspaceVersion;
src = pkgs.fetchFromGitHub {
owner = "amnezia-vpn";
repo = "amneziawg-go";
tag = "v${userspaceVersion}";
hash = "sha256-vZb72SA+6v8FXZX247K05yiVEBWpLqAAIyw6bEE4eUQ=";
};
patches = [ ./patches/amneziawg-go-random-trailers-transport.patch ];
# The 3.1 releases keep the dependency set used by nixpkgs' 3.0 package.
vendorHash = "sha256-Y2dCwlKMVLrkzDcNKyCPxFJwMbCA2mQKkakvzwbamCY=";
userspace = pkgs.amneziawg-go.overrideAttrs (old: {
patches = (old.patches or [ ]) ++ [ ./patches/amneziawg-go-random-trailers-transport.patch ];
});
kernelModule = kernelPackages: kernelPackages.amneziawg.overrideAttrs (_: {
inherit version;
src = pkgs.fetchFromGitHub {
owner = "amnezia-vpn";
repo = "amneziawg-linux-kernel-module";
tag = "v${version}";
hash = "sha256-dJ7Au4J8iPlphSzTa3Gol/LMlroroSc2IUmXZfjA0k8=";
};
});
in
{
inherit
version
userspaceVersion
tools
userspace
kernelModule
;
kernelModule = kernelPackages: kernelPackages.amneziawg;
}
+5 -1
View File
@@ -544,6 +544,9 @@ def _overall_state(snapshot):
label = "Proxy only" if label == "Proxy" else label
elif snapshot["awg"]["active"]:
label = "AmneziaWG"
elif traffic:
# TUN runs its own backend, without proxy-suite-socks.
label = "TUN" + (" + zapret" if zapret else "")
else:
label = "Zapret only" if zapret else "Inactive"
units = snapshot.get("units") or {}
@@ -2350,7 +2353,8 @@ ALIASES = {
def cmd_logs(*units):
if units:
_exec(["journalctl", "-fu", *units])
# One -u per unit: a bare second name would be taken as a journal match.
_exec(["journalctl", "-f", *(f"--unit={u}" for u in units)])
# journalctl takes unit globs, so the default needs no unit list of its own.
_exec(["journalctl", "-f", "-u", "proxy-suite-*"])
+7 -2
View File
@@ -297,6 +297,10 @@ def _enabled(name):
return lambda _: ctl.env(name) == "1"
def _sub_url(row):
return bool(row["user"]) and bool(ctl.env("INBOUNDS_SUB_BASE_URL"))
def _zapret_toggle(row, _, states):
return ["zapret", "off" if states.get("proxy-suite-zapret") == "active" else "on"]
@@ -412,8 +416,9 @@ TABS = [
Action("c", "copy share link", lambda r, *_: _link(r), when=ROW, mode="copy"),
Action("Q", "share link as QR", lambda r, *_: _link(r, "--qr"), when=ROW, mode="dialog"),
Action("s", "subscription URL", lambda r, *_: ["inbounds", "sub", r["user"]], when=lambda r: bool(r["user"]), mode="dialog"),
Action("S", "subscription URL as QR", lambda r, *_: ["inbounds", "sub", r["user"], "--qr"], when=lambda r: bool(r["user"]), mode="dialog"),
Action("y", "copy subscription URL", lambda r, *_: ["inbounds", "sub", r["user"]], when=lambda r: bool(r["user"]), mode="copy"),
# Without subscriptions.baseUrl there is only a file path, with a hint after it: nothing to encode or copy.
Action("S", "subscription URL as QR", lambda r, *_: ["inbounds", "sub", r["user"], "--qr"], when=_sub_url, mode="dialog"),
Action("y", "copy subscription URL", lambda r, *_: ["inbounds", "sub", r["user"]], when=_sub_url, mode="copy"),
Action("t", "traffic per user", lambda r, *_: ["inbounds", "stats"], mode="dialog"),
],
),
+5 -1
View File
@@ -607,7 +607,11 @@ class ProxyTui(App):
def perform(self, action, row):
def with_text(text=""):
argv = action.argv(row, text, self.states)
try:
argv = action.argv(row, text, self.states)
except (ValueError, IndexError) as e: # an unbalanced quote in a typed command
self.feedback(f"Cannot run that: {e}", False)
return
confirm = action.confirm(row) if callable(action.confirm) else action.confirm
if confirm:
self.push_screen(Confirm(f"proxy-ctl {shlex.join(argv)}"), lambda ok: ok and self.run_argv(action.mode, argv))
+1
View File
@@ -624,6 +624,7 @@ class StatusSnapshotTest(EnvTest):
both = self.overall(socks="active", zapret="active", tun="active")
self.assertEqual((both["base"], both["label"]), ("tunnel", "Proxy + traffic + zapret"))
self.assertEqual(self.overall(awg_work="active"), {"base": "tunnel", "badge": "", "label": "AmneziaWG"})
self.assertEqual(self.overall(tun="active")["label"], "TUN")
def test_badges(self):
self.assertEqual(self.overall(socks="active", tun="failed")["badge"], "failed")