mirror of
https://github.com/fatedier/frp.git
synced 2025-07-21 05:10:58 +07:00
support yaml/json/toml configuration format, make ini deprecated (#3599)
This commit is contained in:
@ -39,7 +39,7 @@ func (svr *Service) RunDashboardServer(address string) (err error) {
|
||||
router.HandleFunc("/healthz", svr.Healthz)
|
||||
|
||||
// debug
|
||||
if svr.cfg.PprofEnable {
|
||||
if svr.cfg.WebServer.PprofEnable {
|
||||
router.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
|
||||
router.HandleFunc("/debug/pprof/profile", pprof.Profile)
|
||||
router.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
|
||||
@ -49,7 +49,7 @@ func (svr *Service) RunDashboardServer(address string) (err error) {
|
||||
|
||||
subRouter := router.NewRoute().Subrouter()
|
||||
|
||||
user, passwd := svr.cfg.DashboardUser, svr.cfg.DashboardPwd
|
||||
user, passwd := svr.cfg.WebServer.User, svr.cfg.WebServer.Password
|
||||
subRouter.Use(utilnet.NewHTTPAuthMiddleware(user, passwd).SetAuthFailDelay(200 * time.Millisecond).Middleware)
|
||||
|
||||
// metrics
|
||||
@ -82,8 +82,8 @@ func (svr *Service) RunDashboardServer(address string) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
if svr.cfg.DashboardTLSMode {
|
||||
cert, err := tls.LoadX509KeyPair(svr.cfg.DashboardTLSCertFile, svr.cfg.DashboardTLSKeyFile)
|
||||
if svr.cfg.WebServer.TLS != nil {
|
||||
cert, err := tls.LoadX509KeyPair(svr.cfg.WebServer.TLS.CertFile, svr.cfg.WebServer.TLS.KeyFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user