mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-08-25 16:35:07 +03:00
Add password authentication to WebUI and implement session management
- Updated WebUI configuration to include a password field for authentication. - Enhanced the WebUI server to handle login and logout functionality with session management. - Added tests for authentication and session handling. - Updated README and example configuration to reflect new authentication features.
This commit is contained in:
parent
51e1ef3ed0
commit
113dcbb72a
17 changed files with 676 additions and 74 deletions
|
@ -308,7 +308,12 @@ func main() {
|
|||
listenAddr = fmt.Sprintf("%s:%d", cfg.WebUI.Host, cfg.WebUI.Port)
|
||||
}
|
||||
|
||||
n.webui = webui.Server(listenAddr, logger)
|
||||
n.webui = webui.Server(listenAddr, cfg.WebUI.Password, logger)
|
||||
if cfg.WebUI.Password != "" {
|
||||
logger.Infof("WebUI password authentication enabled")
|
||||
} else {
|
||||
logger.Warnf("WebUI running without password protection")
|
||||
}
|
||||
go func() {
|
||||
if err := n.webui.Start(); err != nil {
|
||||
logger.Errorf("WebUI server error: %v", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue