Add new AmneziaWG parameters (implemented in 3.0/3.1) (#1363)
Docker Build and Push / docker_build (push) Waiting to run
Docker Build and Push / docker_scan (push) Blocked by required conditions

This commit is contained in:
Evgeny Volferts
2026-10-29 10:46:10 +01:00
committed by GitHub
parent d4661a8f0f
commit fa13569d4b
5 changed files with 62 additions and 11 deletions
+18
View File
@@ -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,
+9
View File
@@ -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,
+10 -1
View File
@@ -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:
@@ -197,7 +197,7 @@ const deleteConfigurationModal = ref(false)
v-model="data[key]"
:id="'configuration_' + key">
</div>
<div v-for="key in ['Jc', 'Jmin', 'Jmax', 'S1', 'S2', 'S3', 'S4', 'H1', 'H2', 'H3', 'H4', 'I1', 'I2', 'I3', 'I4', 'I5']"
<div v-for="key in ['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']"
v-if="configurationInfo.Protocol === 'awg'">
<label :for="'configuration_' + key" class="form-label">
<small class="text-muted">
+24 -9
View File
@@ -49,11 +49,20 @@ export default {
H2: 0,
H3: 0,
H4: 0,
I1: "0",
I2: "0",
I3: "0",
I4: "0",
I5: "0"
I1: "",
I2: "",
I3: "",
I4: "",
I5: "",
HeaderProtectionKey: "",
ContentPaddingAddition: "0-64",
RekeyAfterTime: "100-140",
RekeyTimeout: "4-7",
RejectAfterTime: "160-200",
KeepaliveTimeout: "8-12",
MaxHandshakeAttempts: "14-20",
RandomTrailers: "on",
DisableCookies: "on"
},
numberOfAvailableIPs: "0",
error: false,
@@ -72,9 +81,15 @@ export default {
this.newConfiguration[key] = this.rand(1, 2**31);
});
// Initialize I1 to I5 as "0"
['I1', 'I2', 'I3', 'I4', 'I5'].forEach(key => {
this.newConfiguration[key] = "0";
// Initialize HeaderProtectionKey
let headerProtectionKey = new Uint8Array(32);
window.crypto.getRandomValues(headerProtectionKey);
this.newConfiguration.HeaderProtectionKey = btoa(String.fromCharCode(...headerProtectionKey));
// S1-S4 are recommended be the same to work with RandomTrailers and must 12 or more to work with HeaderProtectionKey
let constantS = 12 + this.rand(1, 2**5);
['S1', 'S2', 'S3', 'S4'].forEach(key => {
this.newConfiguration[key] = constantS;
});
},
methods: {
@@ -388,7 +403,7 @@ export default {
<div class="card rounded-3"
v-if="this.newConfiguration.Protocol === 'awg'"
v-for="key in ['Jc', 'Jmin', 'Jmax', 'S1', 'S2', 'S3', 'S4', 'H1', 'H2', 'H3', 'H4', 'I1', 'I2', 'I3', 'I4', 'I5']">
v-for="key in ['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']">
<div class="card-header">{{ key }}</div>
<div class="card-body">
<input type="text"