mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 16:29:17 +08:00
fix: 解决本地服务启动失败的问题
This commit is contained in:
parent
1ae5f945b1
commit
0f70d37950
@ -92,9 +92,7 @@ var InitSetting = &gormigrate.Migration{
|
|||||||
if err := tx.Create(&model.Setting{Key: "EncryptKey", Value: encryptKey}).Error; err != nil {
|
if err := tx.Create(&model.Setting{Key: "EncryptKey", Value: encryptKey}).Error; err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := os.Stat("/opt/1panel/nodeJson"); err != nil {
|
if _, err := os.Stat("/opt/1panel/nodeJson"); err == nil {
|
||||||
return err
|
|
||||||
}
|
|
||||||
type nodeInfo struct {
|
type nodeInfo struct {
|
||||||
ServerCrt string `json:"serverCrt"`
|
ServerCrt string `json:"serverCrt"`
|
||||||
ServerKey string `json:"serverKey"`
|
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 {
|
if err := tx.Create(&model.Setting{Key: "ServerCrt", Value: itemCrt}).Error; err != nil {
|
||||||
return err
|
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
|
return err
|
||||||
}
|
}
|
||||||
global.CurrentNode = node.CurrentNode
|
|
||||||
|
|
||||||
if err := tx.Create(&model.Setting{Key: "SystemIP", Value: ""}).Error; err != nil {
|
if err := tx.Create(&model.Setting{Key: "SystemIP", Value: ""}).Error; err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user