mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 21:42:24 +00:00
some changes
undo secret key gen for wireguard
This commit is contained in:
parent
9c05aa514b
commit
5d007435ab
5 changed files with 24 additions and 11 deletions
|
@ -223,8 +223,6 @@ func (s *SubJsonService) streamData(stream string) map[string]interface{} {
|
||||||
streamSettings["wsSettings"] = s.removeAcceptProxy(streamSettings["wsSettings"])
|
streamSettings["wsSettings"] = s.removeAcceptProxy(streamSettings["wsSettings"])
|
||||||
case "httpupgrade":
|
case "httpupgrade":
|
||||||
streamSettings["httpupgradeSettings"] = s.removeAcceptProxy(streamSettings["httpupgradeSettings"])
|
streamSettings["httpupgradeSettings"] = s.removeAcceptProxy(streamSettings["httpupgradeSettings"])
|
||||||
case "splithttp":
|
|
||||||
streamSettings["splithttpSettings"] = s.removeAcceptProxy(streamSettings["splithttpSettings"])
|
|
||||||
}
|
}
|
||||||
return streamSettings
|
return streamSettings
|
||||||
}
|
}
|
||||||
|
|
|
@ -1084,6 +1084,7 @@ Outbound.WireguardSettings = class extends CommonClass {
|
||||||
super();
|
super();
|
||||||
this.mtu = mtu;
|
this.mtu = mtu;
|
||||||
this.secretKey = secretKey;
|
this.secretKey = secretKey;
|
||||||
|
this.pubKey = secretKey.length>0 ? Wireguard.generateKeypair(secretKey).publicKey : '';
|
||||||
this.address = address instanceof Array ? address.join(',') : address;
|
this.address = address instanceof Array ? address.join(',') : address;
|
||||||
this.workers = workers;
|
this.workers = workers;
|
||||||
this.domainStrategy = domainStrategy;
|
this.domainStrategy = domainStrategy;
|
||||||
|
|
|
@ -1391,7 +1391,7 @@ class Inbound extends XrayCommonClass {
|
||||||
type: 'none',
|
type: 'none',
|
||||||
tls: security,
|
tls: security,
|
||||||
};
|
};
|
||||||
let network = this.stream.network;
|
const network = this.stream.network;
|
||||||
if (network === 'tcp') {
|
if (network === 'tcp') {
|
||||||
const tcp = this.stream.tcp;
|
const tcp = this.stream.tcp;
|
||||||
obj.type = tcp.type;
|
obj.type = tcp.type;
|
||||||
|
@ -1402,11 +1402,11 @@ class Inbound extends XrayCommonClass {
|
||||||
if (host) obj.host = host;
|
if (host) obj.host = host;
|
||||||
}
|
}
|
||||||
} else if (network === 'kcp') {
|
} else if (network === 'kcp') {
|
||||||
let kcp = this.stream.kcp;
|
const kcp = this.stream.kcp;
|
||||||
obj.type = kcp.type;
|
obj.type = kcp.type;
|
||||||
obj.path = kcp.seed;
|
obj.path = kcp.seed;
|
||||||
} else if (network === 'ws') {
|
} else if (network === 'ws') {
|
||||||
let ws = this.stream.ws;
|
const ws = this.stream.ws;
|
||||||
obj.path = ws.path;
|
obj.path = ws.path;
|
||||||
obj.host = ws.host?.length>0 ? ws.host : this.getHeader(ws, 'host');
|
obj.host = ws.host?.length>0 ? ws.host : this.getHeader(ws, 'host');
|
||||||
} else if (network === 'http') {
|
} else if (network === 'http') {
|
||||||
|
@ -1424,11 +1424,11 @@ class Inbound extends XrayCommonClass {
|
||||||
obj.type = 'multi'
|
obj.type = 'multi'
|
||||||
}
|
}
|
||||||
} else if (network === 'httpupgrade') {
|
} else if (network === 'httpupgrade') {
|
||||||
let httpupgrade = this.stream.httpupgrade;
|
const httpupgrade = this.stream.httpupgrade;
|
||||||
obj.path = httpupgrade.path;
|
obj.path = httpupgrade.path;
|
||||||
obj.host = httpupgrade.host?.length>0 ? httpupgrade.host : this.getHeader(httpupgrade, 'host');
|
obj.host = httpupgrade.host?.length>0 ? httpupgrade.host : this.getHeader(httpupgrade, 'host');
|
||||||
} else if (network === 'splithttp') {
|
} else if (network === 'splithttp') {
|
||||||
let splithttp = this.stream.splithttp;
|
const splithttp = this.stream.splithttp;
|
||||||
obj.path = splithttp.path;
|
obj.path = splithttp.path;
|
||||||
obj.host = splithttp.host?.length>0 ? splithttp.host : this.getHeader(splithttp, 'host');
|
obj.host = splithttp.host?.length>0 ? splithttp.host : this.getHeader(splithttp, 'host');
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,9 +72,23 @@
|
||||||
</template>
|
</template>
|
||||||
<a-input v-model.trim="outbound.settings.address"></a-input>
|
<a-input v-model.trim="outbound.settings.address"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label='{{ i18n "pages.xray.wireguard.secretKey" }}'>
|
<a-form-item>
|
||||||
|
<template slot="label">
|
||||||
|
<a-tooltip>
|
||||||
|
<template slot="title">
|
||||||
|
<span>{{ i18n "reset" }}</span>
|
||||||
|
</template>
|
||||||
|
{{ i18n "pages.xray.wireguard.secretKey" }}
|
||||||
|
<a-icon type="sync"
|
||||||
|
@click="[outbound.settings.pubKey, outbound.settings.secretKey] = Object.values(Wireguard.generateKeypair())">
|
||||||
|
</a-icon>
|
||||||
|
</a-tooltip>
|
||||||
|
</template>
|
||||||
<a-input v-model.trim="outbound.settings.secretKey"></a-input>
|
<a-input v-model.trim="outbound.settings.secretKey"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<a-form-item label='{{ i18n "pages.xray.wireguard.publicKey" }}'>
|
||||||
|
<a-input disabled v-model="outbound.settings.pubKey"></a-input>
|
||||||
|
</a-form-item>
|
||||||
<a-form-item label='{{ i18n "pages.xray.wireguard.domainStrategy" }}'>
|
<a-form-item label='{{ i18n "pages.xray.wireguard.domainStrategy" }}'>
|
||||||
<a-select v-model="outbound.settings.domainStrategy" :dropdown-class-name="themeSwitcher.currentTheme">
|
<a-select v-model="outbound.settings.domainStrategy" :dropdown-class-name="themeSwitcher.currentTheme">
|
||||||
<a-select-option v-for="wds in ['', ...WireguardDomainStrategy]" :value="wds">[[ wds ]]</a-select-option>
|
<a-select-option v-for="wds in ['', ...WireguardDomainStrategy]" :value="wds">[[ wds ]]</a-select-option>
|
||||||
|
|
|
@ -19,10 +19,10 @@
|
||||||
</a-input>
|
</a-input>
|
||||||
</a-input-group>
|
</a-input-group>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="max Upload Size">
|
<a-form-item label="Max Upload Size (MB)">
|
||||||
<a-input-number v-model="inbound.stream.splithttp.maxUploadSize" :min="0"></a-input-number>
|
<a-input-number v-model="inbound.stream.splithttp.maxUploadSize" :min="0"></a-input-number>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="max Concurrent Uploads">
|
<a-form-item label="Max Concurrent Upload">
|
||||||
<a-input-number v-model="inbound.stream.splithttp.maxConcurrentUploads" :min="0"></a-input-number>
|
<a-input-number v-model="inbound.stream.splithttp.maxConcurrentUploads" :min="0"></a-input-number>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
|
|
Loading…
Reference in a new issue