store auth information with session

This commit is contained in:
2023-09-14 12:45:21 +08:00
parent 79bbf4a39c
commit 8eb72831c1
12 changed files with 110 additions and 53 deletions

View File

@@ -119,12 +119,17 @@ func ParseConfigFile(file string) (controller.HandleController, server.TLS, erro
common.PluginPort = commonSection.Key("plugin_port").MustInt(7200)
common.User = commonSection.Key("admin_user").Value()
common.Pwd = commonSection.Key("admin_pwd").Value()
common.KeepTime = commonSection.Key("admin_keep_time").MustInt(0)
common.DashboardAddr = commonSection.Key("dashboard_addr").MustString("127.0.0.1")
common.DashboardPort = commonSection.Key("dashboard_port").MustInt(7500)
common.DashboardUser = commonSection.Key("dashboard_user").Value()
common.DashboardPwd = commonSection.Key("dashboard_pwd").Value()
common.DashboardTLS = strings.HasPrefix(strings.ToLower(common.DashboardAddr), "https://")
if common.KeepTime < 0 {
common.KeepTime = 0
}
tls.Enable = commonSection.Key("tls_mode").MustBool(false)
tls.Cert = commonSection.Key("tls_cert_file").MustString("")
tls.Key = commonSection.Key("tls_key_file").MustString("")