1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 16:29:17 +08:00

fix: 解决本地服务启动失败的问题

This commit is contained in:
ssongliu 2024-08-02 17:29:04 +08:00
parent 1ae5f945b1
commit 0f70d37950

View File

@ -92,9 +92,7 @@ var InitSetting = &gormigrate.Migration{
if err := tx.Create(&model.Setting{Key: "EncryptKey", Value: encryptKey}).Error; err != nil {
return err
}
if _, err := os.Stat("/opt/1panel/nodeJson"); err != nil {
return err
}
if _, err := os.Stat("/opt/1panel/nodeJson"); err == nil {
type nodeInfo struct {
ServerCrt string `json:"serverCrt"`
ServerKey string `json:"serverKey"`
@ -116,10 +114,13 @@ var InitSetting = &gormigrate.Migration{
if err := tx.Create(&model.Setting{Key: "ServerCrt", Value: itemCrt}).Error; err != nil {
return err
}
if err := tx.Create(&model.Setting{Key: "CurrentNode", Value: node.CurrentNode}).Error; err != nil {
global.CurrentNode = node.CurrentNode
} else {
global.CurrentNode = "127.0.0.1"
}
if err := tx.Create(&model.Setting{Key: "CurrentNode", Value: global.CurrentNode}).Error; err != nil {
return err
}
global.CurrentNode = node.CurrentNode
if err := tx.Create(&model.Setting{Key: "SystemIP", Value: ""}).Error; err != nil {
return err