MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / Init

Function Init

core/init/hook/hook.go:17–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15)
16
17func Init() {
18 settingRepo := repo.NewISettingRepo()
19 global.CONF.Conn.Port, _ = settingRepo.GetValueByKey("ServerPort")
20 global.CONF.Conn.Ipv6, _ = settingRepo.GetValueByKey("Ipv6")
21 global.CONF.Base.Edition, _ = settingRepo.GetValueByKey("Edition")
22 global.CONF.Conn.BindAddress, _ = settingRepo.GetValueByKey("BindAddress")
23 global.CONF.Conn.SSL, _ = settingRepo.GetValueByKey("SSL")
24 global.CONF.Base.Version, _ = settingRepo.GetValueByKey("SystemVersion")
25 if err := settingRepo.Update("SystemStatus", "Free"); err != nil {
26 global.LOG.Fatalf("init service before start failed, err: %v", err)
27 }
28
29 handleUserInfo(global.CONF.Base.ChangeUserInfo, settingRepo)
30
31 generateKey()
32 initDockerConf()
33}
34
35func handleUserInfo(tags string, settingRepo repo.ISettingRepo) {
36 if len(tags) == 0 {

Callers

nothing calls this directly

Calls 5

GetValueByKeyMethod · 0.95
UpdateMethod · 0.95
handleUserInfoFunction · 0.85
generateKeyFunction · 0.85
initDockerConfFunction · 0.70

Tested by

no test coverage detected