nacos config
This commit is contained in:
parent
25903207dc
commit
d39633060b
|
@ -3,6 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"fusenapi/utils/fsconfig"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
|
@ -118,12 +119,14 @@ func main() {
|
||||||
ServerAddress := ":9900"
|
ServerAddress := ":9900"
|
||||||
log.Println("listen on ", ServerAddress)
|
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 {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
pemdata, err := os.ReadFile("/opt/server.fusen.3718.cn.pem")
|
pemdata, err := os.ReadFile(envcfg.ProxyServer.PemFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,15 @@ type EnvConfig struct {
|
||||||
NamespaceId string `yaml:"namespace"`
|
NamespaceId string `yaml:"namespace"`
|
||||||
DataId string `yaml:"dataid"`
|
DataId string `yaml:"dataid"`
|
||||||
Group string `yaml:"group"`
|
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", "./", "../", "../../"}
|
var optPathDirs = []string{"/opt", "./", "../", "../../"}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user