Fix config map time limit and commands, add client password

This commit is contained in:
chris
2020-08-20 08:38:32 -04:00
committed by Chris Marshall
parent f92180af5e
commit f29bb81865
9 changed files with 123 additions and 37 deletions

View File

@ -48,8 +48,19 @@ func NewRouter(cfg *Config) (*echo.Echo, error) {
// default route
e.GET("/", func(c echo.Context) error {
return c.Render(http.StatusOK, "index", map[string]string{
m, err := quakenet.GetInfo(cfg.ServerAddr)
if err != nil {
return err
}
needsPass := false
if v, ok := m["g_needpass"]; ok {
if v == "1" {
needsPass = true
}
}
return c.Render(http.StatusOK, "index", map[string]interface{}{
"ServerAddr": cfg.ServerAddr,
"NeedsPass": needsPass,
})
})