Add configuration option to disable registration endpoint (#51)

This commit is contained in:
Joona Hoikkala
2018-03-14 23:35:39 +02:00
committed by GitHub
parent d542ee03b5
commit 5c2e60a828
4 changed files with 18 additions and 11 deletions

View File

@ -67,7 +67,9 @@ func startHTTPAPI() {
// Logwriter for saner log output
c.Log = stdlog.New(logwriter, "", 0)
}
api.POST("/register", webRegisterPost)
if !Config.API.DisableRegistration {
api.POST("/register", webRegisterPost)
}
api.POST("/update", Auth(webUpdatePost))
host := Config.API.IP + ":" + Config.API.Port