Add ability to customise god account names

This commit is contained in:
Eccentric 2024-02-03 02:09:09 +00:00
parent 3f5adcba6c
commit b3394099a8
2 changed files with 13 additions and 1 deletions

View File

@ -8,6 +8,9 @@ import (
) )
type CS struct { type CS struct {
Accounts struct {
Gods []string
}
Database struct { Database struct {
URI string URI string
Type string Type string
@ -51,6 +54,7 @@ func LoadConfig(file []byte) {
panic(err) panic(err)
} }
Config.Accounts.Gods = cfg.Section("accounts").Key("gods").Strings(",")
Config.Database.DropAllTables = cfg.Section("database").Key("drop").MustBool(false) Config.Database.DropAllTables = cfg.Section("database").Key("drop").MustBool(false)
Config.Database.URI = cfg.Section("database").Key("uri").String() Config.Database.URI = cfg.Section("database").Key("uri").String()
if Config.Database.URI == "" { if Config.Database.URI == "" {

View File

@ -1,9 +1,17 @@
[accounts]
; comma separated list of usernames that are considered administrators or server accounts
; these accounts will be created upon the first run of snow
; they will have max permissions with snow
; to disable this, remove the line
gods=god,snow
[database] [database]
; connect string ; connect string
uri="host=localhost user=postgres password=pass dbname=snow port=5432 sslmode=disable" uri="host=localhost user=postgres password=pass dbname=snow port=5432 sslmode=disable"
; currently only postgres is supported. memory and mongo will be added in the future ; currently only postgres is supported. memory and mongo will be added in the future
type="postgres" type="postgres"
; drop all tables at start of program ; WARNING: ONLY USE IF NECESSARY
; deletes and resets the entire database on startup
drop=false drop=false
[discord] [discord]