diff options
| author | Sanaei <ho3ein.sanaei@gmail.com> | 2025-09-07 23:35:38 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-07 23:35:38 +0300 |
| commit | b008ff4ad236f20f0937dd02e747ca6581e776f3 (patch) | |
| tree | efcb43872da9f46f3e6a307424fb5e309e0e7737 /web/html | |
| parent | da6b89fdcd2270aa116297d9ff620b6331f39df9 (diff) | |
Vlessenc (#3426)
* mlkem768
* VlessEnc
Diffstat (limited to 'web/html')
| -rw-r--r-- | web/html/form/outbound.html | 5 | ||||
| -rw-r--r-- | web/html/form/protocol/vless.html | 24 | ||||
| -rw-r--r-- | web/html/form/tls_settings.html | 8 | ||||
| -rw-r--r-- | web/html/inbounds.html | 6 | ||||
| -rw-r--r-- | web/html/modals/inbound_info_modal.html | 6 | ||||
| -rw-r--r-- | web/html/modals/inbound_modal.html | 48 |
6 files changed, 77 insertions, 20 deletions
diff --git a/web/html/form/outbound.html b/web/html/form/outbound.html index c7a786b7..cfaaafd7 100644 --- a/web/html/form/outbound.html +++ b/web/html/form/outbound.html @@ -226,6 +226,11 @@ </template> <!-- vless settings --> + <template v-if="outbound.protocol === Protocols.VLESS"> + <a-form-item label='encryption'> + <a-input v-model.trim="outbound.settings.encryption"></a-input> + </a-form-item> + </template> <template v-if="outbound.canEnableTlsFlow()"> <a-form-item label='Flow'> <a-select v-model="outbound.settings.flow" :dropdown-class-name="themeSwitcher.currentTheme"> diff --git a/web/html/form/protocol/vless.html b/web/html/form/protocol/vless.html index 3cebda6e..6f421731 100644 --- a/web/html/form/protocol/vless.html +++ b/web/html/form/protocol/vless.html @@ -18,7 +18,29 @@ </table> </a-collapse-panel> </a-collapse> -<template v-if="inbound.isTcp"> +<template v-if="!inbound.stream.isTLS || !inbound.stream.isReality"> + <a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }"> + <a-form-item label="Authentication"> + <a-select v-model="inbound.settings.selectedAuth" @change="getNewVlessEnc" :dropdown-class-name="themeSwitcher.currentTheme"> + <a-select-option value="X25519, not Post-Quantum">X25519 (not Post-Quantum)</a-select-option> + <a-select-option value="ML-KEM-768, Post-Quantum">ML-KEM-768 (Post-Quantum)</a-select-option> + </a-select> + </a-form-item> + <a-form-item label="decryption"> + <a-input v-model.trim="inbound.settings.decryption"></a-input> + </a-form-item> + <a-form-item label="encryption"> + <a-input v-model="inbound.settings.encryption" disabled></a-input> + </a-form-item> + <a-form-item label=" "> + <a-space> + <a-button type="primary" icon="import" @click="getNewVlessEnc">Get New keys</a-button> + <a-button danger @click="clearKeys">Clear</a-button> + </a-space> + </a-form-item> + </a-form> +</template> +<template v-if="inbound.isTcp && !inbound.settings.encryption"> <a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }"> <a-form-item label="Fallbacks"> <a-button icon="plus" type="primary" size="small" @click="inbound.settings.addFallback()"></a-button> diff --git a/web/html/form/tls_settings.html b/web/html/form/tls_settings.html index 3a1802a3..82031bd7 100644 --- a/web/html/form/tls_settings.html +++ b/web/html/form/tls_settings.html @@ -5,13 +5,13 @@ <a-form-item label='{{ i18n "security" }}'> <a-radio-group v-model="inbound.stream.security" button-style="solid"> <a-radio-button value="none">{{ i18n "none" }}</a-radio-button> - <a-radio-button v-if="inbound.canEnableReality()" value="reality">Reality</a-radio-button> - <a-radio-button value="tls">TLS</a-radio-button> + <a-radio-button v-if="inbound.canEnableReality() && !inbound.settings.encryption" value="reality">Reality</a-radio-button> + <a-radio-button v-if="!inbound.settings.encryption" value="tls">TLS</a-radio-button> </a-radio-group> </a-form-item> <!-- tls settings --> - <template v-if="inbound.stream.isTls"> + <template v-if="inbound.stream.isTls && !inbound.settings.encryption"> <a-form-item label="SNI" placeholder="Server Name Indication"> <a-input v-model.trim="inbound.stream.tls.sni"></a-input> </a-form-item> @@ -121,7 +121,7 @@ </template> <!-- reality settings --> - <template v-if="inbound.stream.isReality"> + <template v-if="inbound.stream.isReality && !inbound.settings.encryption"> {{template "form/realitySettings"}} </template> </a-form> diff --git a/web/html/inbounds.html b/web/html/inbounds.html index dfccdd70..81ef1b39 100644 --- a/web/html/inbounds.html +++ b/web/html/inbounds.html @@ -706,7 +706,7 @@ }, { title: '{{ i18n "pages.inbounds.enable" }}', align: 'center', - width: 30, + width: 35, scopedSlots: { customRender: 'enable' }, }, { title: '{{ i18n "pages.inbounds.remark" }}', @@ -770,8 +770,8 @@ const innerColumns = [ { title: '{{ i18n "pages.inbounds.operate" }}', width: 65, scopedSlots: { customRender: 'actions' } }, - { title: '{{ i18n "pages.inbounds.enable" }}', width: 30, scopedSlots: { customRender: 'enable' } }, - { title: '{{ i18n "online" }}', width: 30, scopedSlots: { customRender: 'online' } }, + { title: '{{ i18n "pages.inbounds.enable" }}', width: 35, scopedSlots: { customRender: 'enable' } }, + { title: '{{ i18n "online" }}', width: 32, scopedSlots: { customRender: 'online' } }, { title: '{{ i18n "pages.inbounds.client" }}', width: 80, scopedSlots: { customRender: 'client' } }, { title: '{{ i18n "pages.inbounds.traffic" }}', width: 80, align: 'center', scopedSlots: { customRender: 'traffic' } }, { title: '{{ i18n "pages.inbounds.allTimeTraffic" }}', width: 80, align: 'center', scopedSlots: { customRender: 'allTime' } }, diff --git a/web/html/modals/inbound_info_modal.html b/web/html/modals/inbound_info_modal.html index a15172f3..4110c244 100644 --- a/web/html/modals/inbound_info_modal.html +++ b/web/html/modals/inbound_info_modal.html @@ -101,6 +101,12 @@ {{ i18n "security" }} <a-tag :color="inbound.stream.security == 'none' ? 'red' : 'green'">[[ inbound.stream.security ]]</a-tag> <br /> + <td>Authentication</td> + <a-tag :color="inbound.settings.selectedAuth ? 'green' : 'red'">[[ inbound.settings.selectedAuth ? inbound.settings.selectedAuth : '' ]]</a-tag> + <br /> + {{ i18n "encryption" }} + <a-tag :color="inbound.settings.encryption ? 'green' : 'red'">[[ inbound.settings.encryption ? inbound.settings.encryption : '' ]]</a-tag> + <br /> <template v-if="inbound.stream.security != 'none'"> {{ i18n "domainName" }} <a-tag v-if="inbound.serverName" :color="inbound.serverName ? 'green' : 'orange'">[[ inbound.serverName ? inbound.serverName : '' ]]</a-tag> diff --git a/web/html/modals/inbound_modal.html b/web/html/modals/inbound_modal.html index b77e74e2..a7a59c99 100644 --- a/web/html/modals/inbound_modal.html +++ b/web/html/modals/inbound_modal.html @@ -1,9 +1,7 @@ {{define "modals/inboundModal"}} -<a-modal id="inbound-modal" v-model="inModal.visible" :title="inModal.title" - :dialog-style="{ top: '20px' }" @ok="inModal.ok" - :confirm-loading="inModal.confirmLoading" :closable="true" :mask-closable="false" - :class="themeSwitcher.currentTheme" - :ok-text="inModal.okText" cancel-text='{{ i18n "close" }}'> +<a-modal id="inbound-modal" v-model="inModal.visible" :title="inModal.title" :dialog-style="{ top: '20px' }" + @ok="inModal.ok" :confirm-loading="inModal.confirmLoading" :closable="true" :mask-closable="false" + :class="themeSwitcher.currentTheme" :ok-text="inModal.okText" cancel-text='{{ i18n "close" }}'> {{template "form/inbound"}} </a-modal> <script> @@ -20,7 +18,7 @@ ok() { ObjectUtil.execute(inModal.confirm, inModal.inbound, inModal.dbInbound); }, - show({ title = '', okText = '{{ i18n "sure" }}', inbound = null, dbInbound = null, confirm = (inbound, dbInbound) => {}, isEdit = false }) { + show({ title = '', okText = '{{ i18n "sure" }}', inbound = null, dbInbound = null, confirm = (inbound, dbInbound) => { }, isEdit = false }) { this.title = title; this.okText = okText; if (inbound) { @@ -41,7 +39,7 @@ inModal.visible = false; inModal.loading(false); }, - loading(loading=true) { + loading(loading = true) { inModal.confirmLoading = loading; }, }; @@ -105,9 +103,9 @@ }, SSMethodChange() { this.inModal.inbound.settings.password = RandomUtil.randomShadowsocksPassword(this.inModal.inbound.settings.method) - + if (this.inModal.inbound.isSSMultiUser) { - if (this.inModal.inbound.settings.shadowsockses.length ==0){ + if (this.inModal.inbound.settings.shadowsockses.length == 0) { this.inModal.inbound.settings.shadowsockses = [new Inbound.ShadowsocksSettings.Shadowsocks()]; } if (!this.inModal.inbound.isSS2022) { @@ -123,7 +121,7 @@ client.password = RandomUtil.randomShadowsocksPassword(this.inModal.inbound.settings.method) }) } else { - if (this.inModal.inbound.settings.shadowsockses.length > 0){ + if (this.inModal.inbound.settings.shadowsockses.length > 0) { this.inModal.inbound.settings.shadowsockses = []; } } @@ -154,7 +152,7 @@ }, async getNewEchCert() { inModal.loading(true); - const msg = await HttpUtil.post('/server/getNewEchCert', {sni: inModal.inbound.stream.tls.sni}); + const msg = await HttpUtil.post('/server/getNewEchCert', { sni: inModal.inbound.stream.tls.sni }); inModal.loading(false); if (!msg.success) { return; @@ -162,8 +160,34 @@ inModal.inbound.stream.tls.echServerKeys = msg.obj.echServerKeys; inModal.inbound.stream.tls.settings.echConfigList = msg.obj.echConfigList; }, + async getNewVlessEnc() { + inModal.loading(true); + const msg = await HttpUtil.post('/server/getNewVlessEnc'); + inModal.loading(false); + + if (!msg.success) { + return; + } + + const auths = msg.obj.auths || []; + const selected = inModal.inbound.settings.selectedAuth; + const block = auths.find(a => a.label === selected); + + if (!block) { + console.error("No auth block for", selected); + return; + } + + inModal.inbound.settings.decryption = block.decryption; + inModal.inbound.settings.encryption = block.encryption; + }, + clearKeys() { + this.inbound.settings.decryption = 'none'; + this.inbound.settings.encryption = ''; + } + }, }); </script> -{{end}} +{{end}}
\ No newline at end of file |
