From 44d548c603f6ab39c1662c2225220b78767bff22 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Fri, 18 Feb 2022 07:10:08 -0700 Subject: [PATCH] use cookie over path for namespace --- server/main.go | 3 ++- server/public/ui/templates/_namespace.ctmpl | 3 ++- server/server.go | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/server/main.go b/server/main.go index 0e034d3..b09b4c6 100644 --- a/server/main.go +++ b/server/main.go @@ -10,10 +10,11 @@ func main() { as := args.NewArgSet() as.Append(args.INT, "p", "port to listen on", 3004) as.Append(args.STRING, "d", "root dir with /index.html and /media and /files", "./public") + as.Append(args.BOOL, "ldap", "ldap features", false) if err := as.Parse(); err != nil { panic(err) } - s := NewServer(as.GetString("d")) + s := NewServer(as.GetString("d"), as.GetBool("ldap")) if err := s.Routes(); err != nil { panic(err) } diff --git a/server/public/ui/templates/_namespace.ctmpl b/server/public/ui/templates/_namespace.ctmpl index 7dc3bf3..3b17f96 100644 --- a/server/public/ui/templates/_namespace.ctmpl +++ b/server/public/ui/templates/_namespace.ctmpl @@ -2,7 +2,8 @@ {{ if .This.Namespaces }} diff --git a/server/server.go b/server/server.go index 08316bc..32617d4 100644 --- a/server/server.go +++ b/server/server.go @@ -28,12 +28,14 @@ import ( type Server struct { router *router.Router root string + ldap bool } -func NewServer(root string) *Server { +func NewServer(root string, ldap bool) *Server { return &Server{ router: router.New(), root: root, + ldap: ldap, } }