mirror of
https://github.com/yhl452493373/frps-panel.git
synced 2026-04-04 06:16:59 +08:00
rename tls config
This commit is contained in:
@@ -124,12 +124,17 @@ func ParseConfigFile(file string) (controller.HandleController, server.TLS, erro
|
||||
common.DashboardUser = commonSection.Key("dashboard_user").Value()
|
||||
common.DashboardPwd = commonSection.Key("dashboard_pwd").Value()
|
||||
|
||||
tls.Enable = commonSection.Key("dashboard_tls_mode").MustBool(false)
|
||||
tls.Cert = commonSection.Key("dashboard_tls_cert_file").MustString("")
|
||||
tls.Key = commonSection.Key("dashboard_tls_key_file").MustString("")
|
||||
tls.Enable = commonSection.Key("tls_mode").MustBool(false)
|
||||
tls.Cert = commonSection.Key("tls_cert_file").MustString("")
|
||||
tls.Key = commonSection.Key("tls_key_file").MustString("")
|
||||
if tls.Enable {
|
||||
tls.Protocol = "HTTPS"
|
||||
}
|
||||
if tls.Enable && (strings.TrimSpace(tls.Cert) == "" || strings.TrimSpace(tls.Key) == "") {
|
||||
tls.Enable = false
|
||||
tls.Protocol = "HTTP"
|
||||
log.Printf("fail to enable tls: tls cert or key not exist, use http as default.")
|
||||
}
|
||||
|
||||
portsSection, err := iniFile.GetSection("ports")
|
||||
if err != nil {
|
||||
|
||||
@@ -5,15 +5,17 @@ plugin_addr = 127.0.0.1
|
||||
plugin_port = 7200
|
||||
admin_user = admin
|
||||
admin_pwd = admin
|
||||
|
||||
; enable tls
|
||||
tls_mode = false
|
||||
; tls_cert_file = cert.crt
|
||||
; tls_key_file = cert.key
|
||||
|
||||
; frp dashboard info
|
||||
dashboard_addr = 127.0.0.1
|
||||
dashboard_port = 7500
|
||||
dashboard_user = admin
|
||||
dashboard_pwd = admin
|
||||
; enable tls
|
||||
dashboard_tls_mode = false
|
||||
dashboard_tls_cert_file = cert.crt
|
||||
dashboard_tls_key_file = cert.key
|
||||
|
||||
; user tokens
|
||||
[users]
|
||||
|
||||
Reference in New Issue
Block a user