full tls override in inbound multi-domain
This commit is contained in:
@@ -24,30 +24,7 @@
|
||||
</v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col cols="12" sm="6" md="4" v-if="optionTLS">
|
||||
<v-switch
|
||||
:label="$t('tls.enable')"
|
||||
color="primary"
|
||||
hide-details
|
||||
@update:model-value="updateTls($event)"
|
||||
v-model="addr.tls" />
|
||||
</v-col>
|
||||
<v-col cols="12" sm="6" md="4" v-if="optionSNI">
|
||||
<v-text-field
|
||||
label="SNI"
|
||||
hide-details
|
||||
v-model="addr.server_name">
|
||||
</v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="6" md="4" v-if="optionInsecure">
|
||||
<v-switch
|
||||
:label="$t('tls.insecure')"
|
||||
hide-details
|
||||
color="primary"
|
||||
v-model="addr.insecure" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
<OutTLS :outbound="addr" v-if="optionTLS" />
|
||||
<v-row>
|
||||
<v-spacer></v-spacer>
|
||||
<v-col cols="auto" align="end" justify="center">
|
||||
@@ -63,12 +40,6 @@
|
||||
<v-list-item v-if="hasTls">
|
||||
<v-switch v-model="optionTLS" color="primary" :label="$t('objects.tls')" hide-details></v-switch>
|
||||
</v-list-item>
|
||||
<v-list-item v-if="addr.tls">
|
||||
<v-switch v-model="optionSNI" color="primary" label="SNI" hide-details></v-switch>
|
||||
</v-list-item>
|
||||
<v-list-item v-if="addr.tls">
|
||||
<v-switch v-model="optionInsecure" color="primary" :label="$t('tls.insecure')" hide-details></v-switch>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-card>
|
||||
</v-menu>
|
||||
@@ -77,6 +48,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import OutTLS from '@/components/tls/OutTLS.vue'
|
||||
export default {
|
||||
props: ['addr', 'hasTls'],
|
||||
data() {
|
||||
@@ -87,28 +59,15 @@ export default {
|
||||
computed: {
|
||||
optionTLS: {
|
||||
get(): boolean { return this.$props.addr.tls != undefined },
|
||||
set(v:boolean) { this.$props.addr.tls = v ? true : undefined; this.updateTls(v) }
|
||||
},
|
||||
optionSNI: {
|
||||
get(): boolean { return this.$props.addr.server_name != undefined },
|
||||
set(v:boolean) { this.$props.addr.server_name = v ? '' : undefined }
|
||||
set(v:boolean) { this.$props.addr.tls = v ? { enabled: true } : undefined; }
|
||||
},
|
||||
optionRemark: {
|
||||
get(): boolean { return this.$props.addr.remark != undefined },
|
||||
set(v:boolean) { this.$props.addr.remark = v ? '' : undefined }
|
||||
},
|
||||
optionInsecure: {
|
||||
get(): boolean { return this.$props.addr.insecure != undefined },
|
||||
set(v:boolean) { this.$props.addr.insecure = v ? false : undefined }
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateTls(v:boolean) {
|
||||
if (!v) {
|
||||
delete this.$props.addr.insecure
|
||||
delete this.$props.addr.server_name
|
||||
}
|
||||
}
|
||||
components: {
|
||||
OutTLS
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -161,7 +161,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { acme } from '@/types/inTls'
|
||||
import { acme } from '@/types/tls'
|
||||
|
||||
export default {
|
||||
props: ['tls'],
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<script lang="ts">
|
||||
import { i18n } from '@/locales'
|
||||
import HttpUtils from '@/plugins/httputil'
|
||||
import { ech } from '@/types/inTls'
|
||||
import { ech } from '@/types/tls'
|
||||
import { push } from 'notivue'
|
||||
|
||||
export default {
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { oTls, defaultOutTls } from '@/types/outTls'
|
||||
import { oTls, defaultOutTls } from '@/types/tls'
|
||||
export default {
|
||||
props: ['outbound'],
|
||||
data() {
|
||||
@@ -275,7 +275,7 @@ export default {
|
||||
},
|
||||
tlsEnable: {
|
||||
get() { return Object.hasOwn(this.tls, 'enabled') ? this.tls.enabled : false },
|
||||
set(newValue: boolean) { this.$props.outbound.tls = newValue ? { enabled: true } : {} }
|
||||
set(newValue: boolean) { this.$props.outbound.tls = newValue ? { enabled: true } : { enabled: false } }
|
||||
},
|
||||
disable_sni: {
|
||||
get() { return this.tls.disable_sni ?? false },
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<template v-for="addr,index in inbound.addrs">
|
||||
{{ $t('in.addr') }} #{{ (index+1) }} <v-icon icon="mdi-delete" @click="inbound.addrs?.splice(index,1)" />
|
||||
<v-divider></v-divider>
|
||||
<AddrVue :addr="addr" :hasTls="Object.hasOwn(inbound,'tls')" />
|
||||
<AddrVue :addr="addr" :hasTls="HasTls.includes(inbound.type)" />
|
||||
</template>
|
||||
</v-card>
|
||||
</v-window-item>
|
||||
|
||||
@@ -289,8 +289,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { iTls, defaultInTls } from '@/types/inTls'
|
||||
import { oTls, defaultOutTls } from '@/types/outTls'
|
||||
import { tls, iTls, defaultInTls, oTls, defaultOutTls } from '@/types/tls'
|
||||
import AcmeVue from '@/components/tls/Acme.vue'
|
||||
import EchVue from '@/components/tls/Ech.vue'
|
||||
import HttpUtils from '@/plugins/httputil'
|
||||
@@ -302,7 +301,7 @@ export default {
|
||||
emits: ['close', 'save'],
|
||||
data() {
|
||||
return {
|
||||
tls: { id: 0, name: '', server: <iTls>{ enabled: true }, client: <oTls>{} },
|
||||
tls: <tls>{ id: 0, name: '', server: <iTls>{ enabled: true }, client: <oTls>{} },
|
||||
title: "add",
|
||||
loading: false,
|
||||
menu: false,
|
||||
@@ -355,7 +354,7 @@ export default {
|
||||
methods: {
|
||||
updateData() {
|
||||
if (this.$props.id > 0) {
|
||||
const newData = JSON.parse(this.$props.data)
|
||||
const newData = <tls>JSON.parse(this.$props.data)
|
||||
this.tls = newData
|
||||
if (this.tls.server == null) this.tls.server = {}
|
||||
if (this.tls.client == null) this.tls.client = {}
|
||||
@@ -364,7 +363,7 @@ export default {
|
||||
this.title = "edit"
|
||||
}
|
||||
else {
|
||||
this.tls = { id: 0, name: '', server: {enabled: true}, client: {} }
|
||||
this.tls = <tls>{ id: 0, name: '', server: {enabled: true}, client: {} }
|
||||
this.tlsType = 0
|
||||
this.usePath = 0
|
||||
this.title = "add"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { iMultiplex } from "./multiplex"
|
||||
import { iTls } from "./inTls"
|
||||
import { iTls } from "./tls"
|
||||
import { Dial } from "./outbounds"
|
||||
import { Transport } from "./transport"
|
||||
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
export interface oTls {
|
||||
enabled?: boolean
|
||||
disable_sni?: boolean
|
||||
server_name?: string
|
||||
insecure?: boolean
|
||||
alpn?: string[]
|
||||
min_version?: string
|
||||
max_version?: string
|
||||
cipher_suites?: string[]
|
||||
certificate?: string
|
||||
certificate_path?: string
|
||||
ech?: {
|
||||
enabled: boolean
|
||||
pq_signature_schemes_enabled?: boolean
|
||||
dynamic_record_sizing_disabled?: boolean
|
||||
config?: string[],
|
||||
config_path?: string
|
||||
},
|
||||
utls?: {
|
||||
enabled: boolean
|
||||
fingerprint: string
|
||||
},
|
||||
reality?: {
|
||||
enabled: boolean
|
||||
public_key: string
|
||||
short_id: string
|
||||
}
|
||||
}
|
||||
|
||||
export const defaultOutTls: oTls = {
|
||||
alpn: ['h3', 'h2', 'http/1.1'],
|
||||
min_version: "1.2",
|
||||
max_version: "1.3",
|
||||
cipher_suites: [],
|
||||
utls: {
|
||||
enabled: true,
|
||||
fingerprint: "chrome",
|
||||
},
|
||||
reality: {
|
||||
enabled: true,
|
||||
public_key: "",
|
||||
short_id: "",
|
||||
},
|
||||
ech: {
|
||||
enabled: true,
|
||||
pq_signature_schemes_enabled: false,
|
||||
dynamic_record_sizing_disabled: false,
|
||||
config_path: "",
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
import { Dial } from "./dial"
|
||||
|
||||
export interface tls {
|
||||
id: number
|
||||
name: string
|
||||
server: iTls
|
||||
client: oTls
|
||||
}
|
||||
|
||||
export interface iTls {
|
||||
enabled?: boolean
|
||||
server_name?: string
|
||||
@@ -63,3 +70,54 @@ export const defaultInTls: iTls = {
|
||||
max_version: "1.3",
|
||||
cipher_suites: [],
|
||||
}
|
||||
|
||||
export interface oTls {
|
||||
enabled?: boolean
|
||||
disable_sni?: boolean
|
||||
server_name?: string
|
||||
insecure?: boolean
|
||||
alpn?: string[]
|
||||
min_version?: string
|
||||
max_version?: string
|
||||
cipher_suites?: string[]
|
||||
certificate?: string
|
||||
certificate_path?: string
|
||||
ech?: {
|
||||
enabled: boolean
|
||||
pq_signature_schemes_enabled?: boolean
|
||||
dynamic_record_sizing_disabled?: boolean
|
||||
config?: string[],
|
||||
config_path?: string
|
||||
},
|
||||
utls?: {
|
||||
enabled: boolean
|
||||
fingerprint: string
|
||||
},
|
||||
reality?: {
|
||||
enabled: boolean
|
||||
public_key: string
|
||||
short_id: string
|
||||
}
|
||||
}
|
||||
|
||||
export const defaultOutTls: oTls = {
|
||||
alpn: ['h3', 'h2', 'http/1.1'],
|
||||
min_version: "1.2",
|
||||
max_version: "1.3",
|
||||
cipher_suites: [],
|
||||
utls: {
|
||||
enabled: true,
|
||||
fingerprint: "chrome",
|
||||
},
|
||||
reality: {
|
||||
enabled: true,
|
||||
public_key: "",
|
||||
short_id: "",
|
||||
},
|
||||
ech: {
|
||||
enabled: true,
|
||||
pq_signature_schemes_enabled: false,
|
||||
dynamic_record_sizing_disabled: false,
|
||||
config_path: "",
|
||||
}
|
||||
}
|
||||
@@ -88,9 +88,9 @@
|
||||
import TlsVue from '@/layouts/modals/Tls.vue'
|
||||
import Data from '@/store/modules/data'
|
||||
import { computed, ref } from 'vue'
|
||||
import { Inbound, inboundWithUsers } from '@/types/inbounds'
|
||||
import { Inbound } from '@/types/inbounds'
|
||||
import { Client } from '@/types/clients'
|
||||
import { Link, LinkUtil } from '@/plugins/link'
|
||||
import { tls } from '@/types/tls'
|
||||
|
||||
const tlsConfigs = computed((): any[] => {
|
||||
return Data().tlsConfigs
|
||||
|
||||
Reference in New Issue
Block a user