fix jsonsub required rules #451

This commit is contained in:
Alireza Ahmadi
2025-02-15 14:13:54 +01:00
parent 66c3f142a7
commit 1535338e0b
2 changed files with 5 additions and 1 deletions
-1
View File
@@ -67,7 +67,6 @@ func InitDB(dbPath string) error {
db.Migrator().CreateTable(&model.Outbound{}) db.Migrator().CreateTable(&model.Outbound{})
defaultOutbound := []model.Outbound{ defaultOutbound := []model.Outbound{
{Type: "direct", Tag: "direct", Options: json.RawMessage(`{}`)}, {Type: "direct", Tag: "direct", Options: json.RawMessage(`{}`)},
{Type: "dns", Tag: "dns-out", Options: json.RawMessage(`{}`)},
} }
db.Create(&defaultOutbound) db.Create(&defaultOutbound)
} }
+5
View File
@@ -211,12 +211,17 @@ func (j *JsonService) addDefaultOutbounds(outbounds *[]map[string]interface{}, o
func (j *JsonService) addOthers(jsonConfig *map[string]interface{}) error { func (j *JsonService) addOthers(jsonConfig *map[string]interface{}) error {
rules := []interface{}{ rules := []interface{}{
map[string]interface{}{
"action": "sniff",
},
map[string]interface{}{ map[string]interface{}{
"clash_mode": "Direct", "clash_mode": "Direct",
"action": "route",
"outbound": "direct", "outbound": "direct",
}, },
map[string]interface{}{ map[string]interface{}{
"clash_mode": "Global", "clash_mode": "Global",
"action": "route",
"outbound": "proxy", "outbound": "proxy",
}, },
} }