From bebf83f06c71336a4feae468f0e709684f2ee894 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sun, 20 Oct 2024 12:01:55 +0200 Subject: [PATCH] wireguard - noKernelTun --- web/assets/js/model/outbound.js | 12 ++++-------- web/assets/js/model/xray.js | 12 ++++-------- web/html/xui/form/outbound.html | 7 ++----- web/html/xui/form/protocol/wireguard.html | 7 ++----- web/html/xui/inbound_info_modal.html | 8 ++------ web/html/xui/warp_modal.html | 3 +-- 6 files changed, 15 insertions(+), 34 deletions(-) diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js index 4f8a82739b..1011278dc9 100644 --- a/web/assets/js/model/outbound.js +++ b/web/assets/js/model/outbound.js @@ -1182,8 +1182,7 @@ Outbound.WireguardSettings = class extends CommonClass { domainStrategy = '', reserved = '', peers = [new Outbound.WireguardSettings.Peer()], - kernelMode = false, - kernelTun = false + noKernelTun = false, ) { super(); this.mtu = mtu; @@ -1194,8 +1193,7 @@ Outbound.WireguardSettings = class extends CommonClass { this.domainStrategy = domainStrategy; this.reserved = Array.isArray(reserved) ? reserved.join(',') : reserved; this.peers = peers; - this.kernelMode = kernelMode; - this.kernelTun = kernelTun; + this.noKernelTun = noKernelTun; } addPeer() { @@ -1215,8 +1213,7 @@ Outbound.WireguardSettings = class extends CommonClass { json.domainStrategy, json.reserved, json.peers.map(peer => Outbound.WireguardSettings.Peer.fromJson(peer)), - json.kernelMode, - json.kernelTun, + json.noKernelTun, ); } @@ -1229,8 +1226,7 @@ Outbound.WireguardSettings = class extends CommonClass { domainStrategy: WireguardDomainStrategy.includes(this.domainStrategy) ? this.domainStrategy : undefined, reserved: this.reserved ? this.reserved.split(",").map(Number) : undefined, peers: Outbound.WireguardSettings.Peer.toJsonArray(this.peers), - kernelMode: this.kernelMode, - kernelTun: this.kernelTun, + noKernelTun: this.noKernelTun, }; } }; diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index 3e99ef3436..209a3140c2 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -2651,16 +2651,14 @@ Inbound.WireguardSettings = class extends XrayCommonClass { mtu = 1420, secretKey = Wireguard.generateKeypair().privateKey, peers = [new Inbound.WireguardSettings.Peer()], - kernelMode = false, - kernelTun = false, + noKernelTun = false ) { super(protocol); this.mtu = mtu; this.secretKey = secretKey; this.pubKey = secretKey.length > 0 ? Wireguard.generateKeypair(secretKey).publicKey : ''; this.peers = peers; - this.kernelMode = kernelMode; - this.kernelTun = kernelTun; + this.noKernelTun = noKernelTun; } addPeer() { @@ -2677,8 +2675,7 @@ Inbound.WireguardSettings = class extends XrayCommonClass { json.mtu, json.secretKey, json.peers.map(peer => Inbound.WireguardSettings.Peer.fromJson(peer)), - json.kernelMode, - json.kernelTun, + json.noKernelTun, ); } @@ -2687,8 +2684,7 @@ Inbound.WireguardSettings = class extends XrayCommonClass { mtu: this.mtu ?? undefined, secretKey: this.secretKey, peers: Inbound.WireguardSettings.Peer.toJsonArray(this.peers), - kernelMode: this.kernelMode, - kernelTun: this.kernelTun, + noKernelTun: this.noKernelTun, }; } }; diff --git a/web/html/xui/form/outbound.html b/web/html/xui/form/outbound.html index f35391cf49..07b8f27591 100644 --- a/web/html/xui/form/outbound.html +++ b/web/html/xui/form/outbound.html @@ -147,11 +147,8 @@ - - - - - + +