feat: add web ui and dynamic private users

This commit is contained in:
OpenClaw Agent
2026-09-22 01:14:15 +08:00
parent 035c3600bf
commit 77572e610b
7 changed files with 418 additions and 7 deletions
+10 -1
View File
@@ -11,6 +11,7 @@ import (
type AccountConfig struct {
Username string
Password string
Role string
Default string
None []string
Read []string
@@ -30,13 +31,15 @@ type Config struct {
SessionTimeout int
HTMLTitle string
HTMLNotice string
UserFile string
UserHome string
SSLCert string
SSLKey string
Accounts []AccountConfig
}
func Default() Config {
return Config{Path: []string{"."}, Port: 80, FileRemove: 1, ImagePreview: true, FolderDownload: "enable", SessionTimeout: 30}
return Config{Path: []string{"."}, Port: 80, FileRemove: 1, ImagePreview: true, FolderDownload: "enable", SessionTimeout: 30, UserHome: "users"}
}
func Load(path string) (Config, error) {
@@ -73,6 +76,8 @@ func Load(path string) (Config, error) {
switch strings.ToLower(key) {
case "password":
section.Password = val
case "role":
section.Role = strings.ToLower(val)
case "rule.default":
section.Default = val
case "rule.none":
@@ -121,6 +126,10 @@ func Load(path string) (Config, error) {
c.HTMLTitle = val
case "html.notice":
c.HTMLNotice = val
case "user.file":
c.UserFile = val
case "user.home":
c.UserHome = strings.Trim(val, "/")
case "ssl.cert":
c.SSLCert = val
case "ssl.key":