From 524a5beb108e51ab122d6f7d11ee111b09f9cd06 Mon Sep 17 00:00:00 2001 From: dnomd343 Date: Sun, 21 Aug 2022 16:31:11 +0800 Subject: [PATCH] update: remove redundant config --- cmd/proxy/config.go | 22 ---------------------- cmd/proxy/main.go | 6 ++++-- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/cmd/proxy/config.go b/cmd/proxy/config.go index b1b52e9..508b891 100644 --- a/cmd/proxy/config.go +++ b/cmd/proxy/config.go @@ -6,31 +6,9 @@ import ( "path" ) -var dnsConfig = `{ - "dns": { - "servers": [ - "localhost" - ] - } -}` - -var routeConfig = `{ - "routing": { - "domainStrategy": "AsIs", - "rules": [ - { - "type": "field", - "network": "tcp,udp", - "outboundTag": "node" - } - ] - } -}` - var outboundsConfig = `{ "outbounds": [ { - "tag": "node", "protocol": "freedom", "settings": {} } diff --git a/cmd/proxy/main.go b/cmd/proxy/main.go index 75e6ab3..b2ebfe8 100644 --- a/cmd/proxy/main.go +++ b/cmd/proxy/main.go @@ -2,6 +2,7 @@ package proxy import ( "XProxy/cmd/common" + log "github.com/sirupsen/logrus" "path" ) @@ -56,12 +57,13 @@ func Load(configDir string, exposeDir string, config *Config) { common.CreateFolder(path.Join(exposeDir, "log")) common.CreateFolder(path.Join(exposeDir, "config")) common.CreateFolder(configDir) - saveConfig(path.Join(exposeDir, "config"), "dns", dnsConfig, false) - saveConfig(path.Join(exposeDir, "config"), "routing", routeConfig, false) saveConfig(path.Join(exposeDir, "config"), "outbounds", outboundsConfig, false) saveConfig(configDir, "inbounds", loadInbounds(config), true) saveConfig(configDir, "log", loadLogConfig(config.Log, path.Join(exposeDir, "log")), true) for _, configFile := range common.ListFiles(path.Join(exposeDir, "config"), ".json") { + if configFile == "log.json" || configFile == "inbounds" { + log.Warningf("Config file %s will be override", configFile) + } common.CopyFile(path.Join(exposeDir, "config", configFile), path.Join(configDir, configFile)) } }