From fa13569d4bee7a34fab07795f9b979f8ce142f30 Mon Sep 17 00:00:00 2001 From: Evgeny Volferts Date: Thu, 29 Oct 2026 17:46:10 +0800 Subject: [PATCH] Add new AmneziaWG parameters (implemented in 3.0/3.1) (#1363) --- src/modules/AmneziaConfiguration.py | 18 ++++++++++ src/modules/Peer.py | 9 +++++ src/modules/WireguardConfiguration.py | 11 ++++++- .../editConfiguration.vue | 2 +- src/static/app/src/views/newConfiguration.vue | 33 ++++++++++++++----- 5 files changed, 62 insertions(+), 11 deletions(-) diff --git a/src/modules/AmneziaConfiguration.py b/src/modules/AmneziaConfiguration.py index fde96e09..29674c61 100644 --- a/src/modules/AmneziaConfiguration.py +++ b/src/modules/AmneziaConfiguration.py @@ -37,6 +37,15 @@ class AmneziaConfiguration(WireguardConfiguration): self.I3 = "" self.I4 = "" self.I5 = "" + self.HeaderProtectionKey = "" + self.ContentPaddingAddition = 0 + self.RekeyAfterTime = 0 + self.RekeyTimeout = 0 + self.RejectAfterTime = 0 + self.KeepaliveTimeout = 0 + self.MaxHandshakeAttempts = 0 + self.RandomTrailers = 0 + self.DisableCookies = 0 self.J1 = "" self.J2 = "" self.J3 = "" @@ -84,6 +93,15 @@ class AmneziaConfiguration(WireguardConfiguration): "I3": self.I3, "I4": self.I4, "I5": self.I5, + "HeaderProtectionKey": self.HeaderProtectionKey, + "ContentPaddingAddition": self.ContentPaddingAddition, + "RekeyAfterTime": self.RekeyAfterTime, + "RekeyTimeout": self.RekeyTimeout, + "RejectAfterTime": self.RejectAfterTime, + "KeepaliveTimeout": self.KeepaliveTimeout, + "MaxHandshakeAttempts": self.MaxHandshakeAttempts, + "RandomTrailers": self.RandomTrailers, + "DisableCookies": self.DisableCookies, "J1": self.J1, "J2": self.J2, "J3": self.J3, diff --git a/src/modules/Peer.py b/src/modules/Peer.py index 68421f42..8ecf6d2f 100644 --- a/src/modules/Peer.py +++ b/src/modules/Peer.py @@ -207,6 +207,15 @@ class Peer: "I3": self.configuration.I3, "I4": self.configuration.I4, "I5": self.configuration.I5, + "HeaderProtectionKey": self.configuration.HeaderProtectionKey, + "ContentPaddingAddition": self.configuration.ContentPaddingAddition, + "RekeyAfterTime": self.configuration.RekeyAfterTime, + "RekeyTimeout": self.configuration.RekeyTimeout, + "RejectAfterTime": self.configuration.RejectAfterTime, + "KeepaliveTimeout": self.configuration.KeepaliveTimeout, + "MaxHandshakeAttempts": self.configuration.MaxHandshakeAttempts, + "RandomTrailers": self.configuration.RandomTrailers, + "DisableCookies": self.configuration.DisableCookies, "J1": self.configuration.J1, "J2": self.configuration.J2, "J3": self.configuration.J3, diff --git a/src/modules/WireguardConfiguration.py b/src/modules/WireguardConfiguration.py index 51928c29..ced79abf 100644 --- a/src/modules/WireguardConfiguration.py +++ b/src/modules/WireguardConfiguration.py @@ -126,6 +126,15 @@ class WireguardConfiguration: "I3": self.I3, "I4": self.I4, "I5": self.I5, + "HeaderProtectionKey": self.HeaderProtectionKey, + "ContentPaddingAddition": self.ContentPaddingAddition, + "RekeyAfterTime": self.RekeyAfterTime, + "RekeyTimeout": self.RekeyTimeout, + "RejectAfterTime": self.RejectAfterTime, + "KeepaliveTimeout": self.KeepaliveTimeout, + "MaxHandshakeAttempts": self.MaxHandshakeAttempts, + "RandomTrailers": self.RandomTrailers, + "DisableCookies": self.DisableCookies, "J1": self.J1, "J2": self.J2, "J3": self.J3, @@ -1029,7 +1038,7 @@ class WireguardConfiguration: allowEdit = ["Address", "PreUp", "PostUp", "PreDown", "PostDown", "ListenPort", "Table"] awgKeys = [] if self.Protocol == 'awg': - awgKeys = ["Jc", "Jmin", "Jmax", "S1", "S2", "S3", "S4", "H1", "H2", "H3", "H4", "I1", "I2", "I3", "I4", "I5", "J1", "J2", "J3", "Itime"] + awgKeys = ["Jc", "Jmin", "Jmax", "S1", "S2", "S3", "S4", "H1", "H2", "H3", "H4", "I1", "I2", "I3", "I4", "I5", "HeaderProtectionKey", "ContentPaddingAddition", "RekeyAfterTime", "RekeyTimeout", "RejectAfterTime", "KeepaliveTimeout", "MaxHandshakeAttempts", "RandomTrailers", "DisableCookies", "J1", "J2", "J3", "Itime"] allowEdit += awgKeys start = original.index("[Interface]") try: diff --git a/src/static/app/src/components/configurationComponents/editConfiguration.vue b/src/static/app/src/components/configurationComponents/editConfiguration.vue index f5d67dc4..bca8e775 100644 --- a/src/static/app/src/components/configurationComponents/editConfiguration.vue +++ b/src/static/app/src/components/configurationComponents/editConfiguration.vue @@ -197,7 +197,7 @@ const deleteConfigurationModal = ref(false) v-model="data[key]" :id="'configuration_' + key"> -