configs mostly working. Need to add in public dns default check.

This commit is contained in:
afeiszli
2021-05-05 22:03:37 +00:00
parent 46a81c9767
commit de3d81db3a
10 changed files with 163 additions and 210 deletions

View File

@@ -9,9 +9,8 @@ import (
"net/http"
"strings"
"time"
"os"
"github.com/gorilla/mux"
"github.com/gravitl/netmaker/config"
"github.com/gravitl/netmaker/servercfg"
"github.com/gravitl/netmaker/functions"
"github.com/gravitl/netmaker/models"
"github.com/gravitl/netmaker/mongoconn"
@@ -83,7 +82,7 @@ func securityCheck(next http.Handler) http.HandlerFunc {
//Consider a more secure way of setting master key
func authenticateMaster(tokenString string) bool {
if tokenString == config.Config.Server.MasterKey || (tokenString == os.Getenv("MASTER_KEY") && tokenString != "") {
if tokenString == servercfg.GetMasterKey() {
return true
}
return false