aboutsummaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-07-03 17:50:35 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2023-07-03 17:50:35 +0200
commit2418216388eef71e53dff60d36345fbf1c4db684 (patch)
treeb06bac16c427ac6bc0f6828ce15f6f41c43a4c49 /config.go
parentd05c1f7d4590e3af6eb6ea25be75487a8a706ce0 (diff)
downloadWRMS-2418216388eef71e53dff60d36345fbf1c4db684.tar.gz
WRMS-2418216388eef71e53dff60d36345fbf1c4db684.zip
add admin-password and button to become admin from the client
Diffstat (limited to 'config.go')
-rw-r--r--config.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/config.go b/config.go
index d12ad64..2483079 100644
--- a/config.go
+++ b/config.go
@@ -6,6 +6,7 @@ import (
"path"
"github.com/google/uuid"
+ "golang.org/x/exp/slices"
"gopkg.in/yaml.v3"
"muhq.space/go/wrms/llog"
)
@@ -17,7 +18,8 @@ type Config struct {
UploadDir string `yaml:"upload-dir"`
LogLevel string `yaml:"loglevel"`
MpvFlags string `yaml:"mpv_flags"`
- Admin uuid.UUID `yaml:"admin"`
+ AdminPW string `yaml:"admin-password"`
+ Admins []uuid.UUID `yaml:"admins"`
Spotify *SpotifyConfig `yaml:"spotify"`
HasUpload bool
}
@@ -28,7 +30,7 @@ func defaultConfig() Config {
}
func (c Config) IsAdmin(id uuid.UUID) bool {
- return c.Admin == id
+ return slices.Contains(c.Admins, id)
}
func findConfig() string {