mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 10:17:17 +08:00
feat: 安全入口及应用安装检查中间件
This commit is contained in:
@@ -358,18 +358,18 @@ func (s *CliService) Init(ctx context.Context, cmd *cli.Command) error {
|
||||
|
||||
settings := []biz.Setting{{Key: biz.SettingKeyName, Value: "耗子面板"}, {Key: biz.SettingKeyMonitor, Value: "1"}, {Key: biz.SettingKeyMonitorDays, Value: "30"}, {Key: biz.SettingKeyBackupPath, Value: filepath.Join(app.Root, "backup")}, {Key: biz.SettingKeyWebsitePath, Value: filepath.Join(app.Root, "wwwroot")}, {Key: biz.SettingKeyVersion, Value: app.Conf.String("app.version")}}
|
||||
if err := app.Orm.Create(&settings).Error; err != nil {
|
||||
return fmt.Errorf("初始化失败: %v", err)
|
||||
return fmt.Errorf("初始化失败:%v", err)
|
||||
}
|
||||
|
||||
value, err := hash.NewArgon2id().Make(str.RandomString(32))
|
||||
if err != nil {
|
||||
return fmt.Errorf("初始化失败: %v", err)
|
||||
return fmt.Errorf("初始化失败:%v", err)
|
||||
}
|
||||
|
||||
user := data.NewUserRepo()
|
||||
_, err = user.Create("admin", value)
|
||||
if err != nil {
|
||||
return fmt.Errorf("初始化失败: %v", err)
|
||||
return fmt.Errorf("初始化失败:%v", err)
|
||||
}
|
||||
|
||||
config := new(types.PanelConfig)
|
||||
|
||||
Reference in New Issue
Block a user