mirror of
https://github.com/Unkn0wnCat/matrix-veles.git
synced 2025-06-10 14:41:57 +02:00
Create auth API & comment code
This commit is contained in:
parent
1b15b12859
commit
c8d1c33cb4
17 changed files with 475 additions and 101 deletions
|
@ -58,6 +58,9 @@ func init() {
|
|||
viper.SetDefault("bot.mongo.collection.entries", "entries")
|
||||
viper.SetDefault("bot.mongo.collection.lists", "lists")
|
||||
viper.SetDefault("bot.mongo.collection.rooms", "rooms")
|
||||
viper.SetDefault("bot.mongo.collection.users", "users")
|
||||
viper.SetDefault("bot.web.listen", "127.0.0.1:8123")
|
||||
viper.SetDefault("bot.web.secret", "hunter2")
|
||||
|
||||
cobra.OnInitialize(loadConfig)
|
||||
}
|
||||
|
@ -75,4 +78,8 @@ func loadConfig() {
|
|||
if err := viper.ReadInConfig(); err == nil {
|
||||
log.Println("Using config file:", viper.ConfigFileUsed())
|
||||
}
|
||||
|
||||
if viper.GetString("bot.web.secret") == "hunter2" {
|
||||
log.Println("Web secret is not set! YOUR INSTALLATION IS INSECURE!")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue