mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
fix: settings init issue #66
This commit is contained in:
parent
83883c1ab9
commit
4c54a9e43d
1 changed files with 8 additions and 8 deletions
16
main.go
16
main.go
|
@ -21,6 +21,14 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
var confPath string
|
||||||
|
flag.StringVar(&confPath, "config", "app.ini", "Specify the configuration file")
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
settings.Init(confPath)
|
||||||
|
|
||||||
|
gin.SetMode(settings.ServerSettings.RunMode)
|
||||||
|
|
||||||
r, err := service.GetRuntimeInfo()
|
r, err := service.GetRuntimeInfo()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -33,7 +41,6 @@ func main() {
|
||||||
Fetcher: &fetcher.File{Path: r.ExPath},
|
Fetcher: &fetcher.File{Path: r.ExPath},
|
||||||
TerminateTimeout: 0,
|
TerminateTimeout: 0,
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func prog(state overseer.State) {
|
func prog(state overseer.State) {
|
||||||
|
@ -41,13 +48,6 @@ func prog(state overseer.State) {
|
||||||
// See https://github.com/golang/go/issues/32350
|
// See https://github.com/golang/go/issues/32350
|
||||||
_ = mime.AddExtensionType(".js", "text/javascript; charset=utf-8")
|
_ = mime.AddExtensionType(".js", "text/javascript; charset=utf-8")
|
||||||
|
|
||||||
var confPath string
|
|
||||||
flag.StringVar(&confPath, "config", "app.ini", "Specify the configuration file")
|
|
||||||
flag.Parse()
|
|
||||||
|
|
||||||
gin.SetMode(settings.ServerSettings.RunMode)
|
|
||||||
|
|
||||||
settings.Init(confPath)
|
|
||||||
log.Printf("Nginx config dir path: %s", nginx.GetConfPath())
|
log.Printf("Nginx config dir path: %s", nginx.GetConfPath())
|
||||||
if "" != settings.ServerSettings.JwtSecret {
|
if "" != settings.ServerSettings.JwtSecret {
|
||||||
model.Init()
|
model.Init()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue