diff --git a/backend/cmd/migration/1_2.go b/backend/cmd/migration/1_2.go
index f808db9..0e138a7 100644
--- a/backend/cmd/migration/1_2.go
+++ b/backend/cmd/migration/1_2.go
@@ -113,6 +113,11 @@ func moveJsonToDb(db *gorm.DB) error {
inbObj["out_json"] = json.RawMessage("{}")
inbObj["addrs"] = json.RawMessage("[]")
}
+ // Delete deprecated fields
+ delete(inbObj, "sniff")
+ delete(inbObj, "sniff_override_destination")
+ delete(inbObj, "sniff_timeout")
+ delete(inbObj, "domain_strategy")
inbJson, _ := json.Marshal(inbObj)
var newInbound model.Inbound
@@ -127,6 +132,9 @@ func moveJsonToDb(db *gorm.DB) error {
}
delete(oldConfig, "inbounds")
+ blockOutboundTags := []string{}
+ dnsOutboundTags := []string{}
+
oldOutbounds := oldConfig["outbounds"].([]interface{})
db.Migrator().DropTable(&model.Outbound{}, &model.Endpoint{})
db.AutoMigrate(&model.Outbound{}, &model.Endpoint{})
@@ -149,14 +157,69 @@ func moveJsonToDb(db *gorm.DB) error {
if err != nil {
return err
}
- err = db.Create(&newOutbound).Error
- if err != nil {
- return err
+ // Delete deprecated fields
+ if newOutbound.Type == "direct" {
+ var options map[string]interface{}
+ json.Unmarshal(newOutbound.Options, &options)
+ delete(options, "override_address")
+ delete(options, "override_port")
+ newOutbound.Options, _ = json.Marshal(options)
+ }
+
+ switch newOutbound.Type {
+ case "dns":
+ dnsOutboundTags = append(dnsOutboundTags, newOutbound.Tag)
+ case "block":
+ blockOutboundTags = append(blockOutboundTags, newOutbound.Tag)
+ default:
+ err = db.Create(&newOutbound).Error
+ if err != nil {
+ return err
+ }
}
}
}
delete(oldConfig, "outbounds")
+ // Check routing rules
+ if routingRules, ok := oldConfig["route"].(map[string]interface{}); ok {
+ if rules, hasRules := routingRules["rules"].([]interface{}); hasRules {
+ hasDns := false
+ for index, rule := range rules {
+ ruleObj, _ := rule.(map[string]interface{})
+ isBlock := false
+ isDns := false
+ outboundTag, _ := ruleObj["outbound"].(string)
+ for _, tag := range blockOutboundTags {
+ if tag == outboundTag {
+ isBlock = true
+ delete(ruleObj, "outbound")
+ ruleObj["action"] = "reject"
+ break
+ }
+ }
+ for _, tag := range dnsOutboundTags {
+ if tag == outboundTag {
+ isDns = true
+ hasDns = true
+ delete(ruleObj, "outbound")
+ ruleObj["action"] = "hijack-dns"
+ break
+ }
+ }
+ if !isBlock && !isDns {
+ ruleObj["action"] = "route"
+ }
+ rules[index] = ruleObj
+ }
+ if hasDns {
+ rules = append(rules, map[string]interface{}{"action": "sniff"})
+ }
+ routingRules["rules"] = rules
+ }
+ oldConfig["route"] = routingRules
+ }
+
// Remove v2rayapi and clashapi from experimental config
experimental := oldConfig["experimental"].(map[string]interface{})
delete(experimental, "v2ray_api")
diff --git a/frontend/src/components/Listen.vue b/frontend/src/components/Listen.vue
index 8ea85dc..d037edb 100644
--- a/frontend/src/components/Listen.vue
+++ b/frontend/src/components/Listen.vue
@@ -29,24 +29,6 @@
v-model="inbound.detour">
-
-
-
-
-
-
-
-
-
-
-
@@ -70,16 +52,6 @@
v-model.number="udpTimeout">
-
-
-
-
-
-
@@ -97,9 +69,6 @@
-
-
-
@@ -120,10 +89,6 @@ export default {
get() { return this.$props.inbound.udp_timeout ? parseInt(this.$props.inbound.udp_timeout.replace('m','')) : 5 },
set(newValue:number) { this.$props.inbound.udp_timeout = newValue > 0 ? newValue + 'm' : '5m' }
},
- sniffTimeout: {
- get() { return this.$props.inbound.sniff_timeout ? parseInt(this.$props.inbound.sniff_timeout.replace('ms','')) : 300 },
- set(newValue:number) { this.$props.inbound.sniff_timeout = newValue > 0 ? newValue + 'ms' : '300ms' }
- },
optionTCP: {
get(): boolean {
return this.$props.inbound.tcp_fast_open != undefined &&
@@ -147,10 +112,6 @@ export default {
optionDetour: {
get(): boolean { return this.$props.inbound.detour != undefined },
set(v:boolean) { this.$props.inbound.detour = v ? this.inTags[0]?? '' : undefined }
- },
- optionDS: {
- get(): boolean { return this.$props.inbound.domain_strategy != undefined },
- set(v:boolean) { this.$props.inbound.domain_strategy = v ? 'prefer_ipv4' : undefined }
}
}
}
diff --git a/frontend/src/components/protocols/Direct.vue b/frontend/src/components/protocols/Direct.vue
index c88423a..34823fc 100644
--- a/frontend/src/components/protocols/Direct.vue
+++ b/frontend/src/components/protocols/Direct.vue
@@ -1,7 +1,7 @@
-
+
@@ -28,7 +28,7 @@
import Network from '@/components/Network.vue'
export default {
- props: ['direction','data'],
+ props: ['data'],
data() {
return {}
},
diff --git a/frontend/src/components/tls/OutTLS.vue b/frontend/src/components/tls/OutTLS.vue
index eea3480..8bdc9ff 100644
--- a/frontend/src/components/tls/OutTLS.vue
+++ b/frontend/src/components/tls/OutTLS.vue
@@ -252,11 +252,6 @@ export default {
],
fingerprints: [
{ title: "Chrome", value: "chrome" },
- { title: "Chrome PSK", value: "chrome_psk" },
- { title: "Chrome PSK Shuffle", value: "chrome_psk_shuffle" },
- { title: "Chrome Padding PSK Shuffle", value: "chrome_padding_psk_shuffle" },
- { title: "Chrome Post-Quantum", value: "chrome_pq" },
- { title: "Chrome Post-Quantum PSK", value: "chrome_pq_psk" },
{ title: "Firefox", value: "firefox" },
{ title: "Microsoft Edge", value: "edge" },
{ title: "Apple Safari", value: "safari" },
diff --git a/frontend/src/layouts/modals/Client.vue b/frontend/src/layouts/modals/Client.vue
index 1bf1e7a..47f28ac 100644
--- a/frontend/src/layouts/modals/Client.vue
+++ b/frontend/src/layouts/modals/Client.vue
@@ -70,15 +70,14 @@
-
+ >
diff --git a/frontend/src/layouts/modals/Inbound.vue b/frontend/src/layouts/modals/Inbound.vue
index 159860c..e085d8d 100644
--- a/frontend/src/layouts/modals/Inbound.vue
+++ b/frontend/src/layouts/modals/Inbound.vue
@@ -40,7 +40,7 @@
-
+
diff --git a/frontend/src/layouts/modals/Outbound.vue b/frontend/src/layouts/modals/Outbound.vue
index 111ba93..6685953 100644
--- a/frontend/src/layouts/modals/Outbound.vue
+++ b/frontend/src/layouts/modals/Outbound.vue
@@ -48,7 +48,6 @@
-
@@ -139,8 +138,8 @@ export default {
link: "",
loading: false,
outTypes: OutTypes,
- NoDial: [OutTypes.Block, OutTypes.DNS, OutTypes.Selector, OutTypes.URLTest],
- NoServer: [OutTypes.Direct, OutTypes.Block, OutTypes.DNS, OutTypes.Selector, OutTypes.URLTest, OutTypes.Tor],
+ NoDial: [OutTypes.Selector, OutTypes.URLTest],
+ NoServer: [OutTypes.Direct, OutTypes.Selector, OutTypes.URLTest, OutTypes.Tor],
}
},
methods: {
diff --git a/frontend/src/layouts/modals/Rule.vue b/frontend/src/layouts/modals/Rule.vue
index 256bb9c..c73f906 100644
--- a/frontend/src/layouts/modals/Rule.vue
+++ b/frontend/src/layouts/modals/Rule.vue
@@ -12,7 +12,7 @@
- {{ $t('actions.add') + " " + $t('objects.rule') }}
+ {})" hide-details>{{ $t('actions.add') + " " + $t('objects.rule') }}
@@ -35,12 +35,12 @@
:rsTags="rsTags" />
-
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -78,8 +167,9 @@