From 6aedf0f68b036a5b606fedc627a1571f5ba2ff42 Mon Sep 17 00:00:00 2001 From: lwch Date: Tue, 18 Oct 2022 10:26:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/client/global/conf.go | 14 ++++++++++++++ code/server/global/conf.go | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/code/client/global/conf.go b/code/client/global/conf.go index a3b0890..a1f9e66 100644 --- a/code/client/global/conf.go +++ b/code/client/global/conf.go @@ -73,6 +73,20 @@ func LoadConf(dir string) *Configure { Rules []Rule `yaml:"rules"` CodeDir string `yaml:"codedir"` } + cfg.ID = "unset" + cfg.Server = "127.0.0.1:6154" + cfg.SSL.Enabled = false + cfg.SSL.Insecure = false + cfg.Dashboard.Enabled = true + cfg.Dashboard.Listen = "0.0.0.0" + cfg.Dashboard.Port = 8080 + cfg.Secret = "0123456789" + cfg.Link.ReadTimeout = time.Second + cfg.Link.WriteTimeout = time.Second + cfg.Log.Dir = "./logs" + cfg.Log.Size = 50 * 1024 * 1024 + cfg.Log.Rotate = 7 + cfg.CodeDir = "./code" runtime.Assert(yaml.Decode(dir, &cfg)) for i, t := range cfg.Rules { switch t.Type { diff --git a/code/server/global/conf.go b/code/server/global/conf.go index 28d91cf..d82ee85 100644 --- a/code/server/global/conf.go +++ b/code/server/global/conf.go @@ -43,6 +43,13 @@ func LoadConf(dir string) *Configure { Crt string `yaml:"crt"` } `yaml:"tls"` } + cfg.Listen = 6154 + cfg.Secret = "0123456789" + cfg.Link.ReadTimeout = time.Second + cfg.Link.WriteTimeout = time.Second + cfg.Log.Dir = "./logs" + cfg.Log.Size = 50 * 1024 * 1024 + cfg.Log.Rotate = 7 runtime.Assert(yaml.Decode(dir, &cfg)) if !filepath.IsAbs(cfg.Log.Dir) { dir, err := os.Executable()