nacos config

This commit is contained in:
eson 2023-09-19 19:16:26 +08:00
parent 25903207dc
commit d39633060b
2 changed files with 14 additions and 2 deletions

View File

@ -3,6 +3,7 @@ package main
import (
"crypto/tls"
"fmt"
"fusenapi/utils/fsconfig"
"io"
"io/ioutil"
"log"
@ -118,12 +119,14 @@ func main() {
ServerAddress := ":9900"
log.Println("listen on ", ServerAddress)
keydata, err := os.ReadFile("/opt/server.fusen.3718.cn.key")
envcfg := fsconfig.GetEnvCofing()
keydata, err := os.ReadFile(envcfg.ProxyServer.KeyFile)
if err != nil {
panic(err)
}
pemdata, err := os.ReadFile("/opt/server.fusen.3718.cn.pem")
pemdata, err := os.ReadFile(envcfg.ProxyServer.PemFile)
if err != nil {
panic(err)
}

View File

@ -21,6 +21,15 @@ type EnvConfig struct {
NamespaceId string `yaml:"namespace"`
DataId string `yaml:"dataid"`
Group string `yaml:"group"`
ProxyServer struct {
KeyFile string `yaml:"key"`
PemFile string `yaml:"pem"`
} `yaml:"proxyserver"`
ServerBackend struct {
KeyFile string `yaml:"key"`
PemFile string `yaml:"pem"`
} `yaml:"serverbackend"`
}
var optPathDirs = []string{"/opt", "./", "../", "../../"}