Adding admin creation, conf and other items
* Config now added, accessible via config.Config * Admin can now be generated via a randomized URL if there are no admins in the system * Added a shared floor to login attempts to block enumeration attacks
This commit is contained in:
27
config/config.go
Normal file
27
config/config.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
)
|
||||
|
||||
type StackConfiguration struct {
|
||||
ConfigLoaded bool
|
||||
AllowFreshAdminGeneration bool
|
||||
AdminEmails []string
|
||||
AdminHmacEnv string
|
||||
UserHmacEnv string
|
||||
}
|
||||
|
||||
var Config = StackConfiguration{}
|
||||
|
||||
func LoadConfig() {
|
||||
file, _ := os.Open("conf.json")
|
||||
defer file.Close()
|
||||
dec := json.NewDecoder(file)
|
||||
if err := dec.Decode(&Config); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Config.ConfigLoaded = true
|
||||
}
|
||||
Reference in New Issue
Block a user