From 1988b2a15860c21da7d2f57aa2e8fae2108b81c8 Mon Sep 17 00:00:00 2001 From: Alex McGrath Date: Fri, 10 Sep 2021 09:12:38 +0100 Subject: make path to themes configurable via ldflags --- server.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'server.go') diff --git a/server.go b/server.go index c4386d9..17018c1 100644 --- a/server.go +++ b/server.go @@ -204,7 +204,7 @@ func (s *Server) load() error { plugins = append(plugins, l...) } - renderer := newRenderer(s.e.Logger, s.Options.Theme) + renderer := newRenderer(s.e.Logger, s.Options.ThemesPath, s.Options.Theme) if err := renderer.Load(plugins); err != nil { return fmt.Errorf("failed to load templates: %v", err) } @@ -365,10 +365,11 @@ func handleUnauthenticated(next echo.HandlerFunc, ctx *Context) error { } type Options struct { - Upstreams []string - Theme string - Debug bool - LoginKey *fernet.Key + Upstreams []string + Theme string + ThemesPath string + Debug bool + LoginKey *fernet.Key } // New creates a new server. @@ -454,7 +455,7 @@ func New(e *echo.Echo, options *Options) (*Server, error) { } }) - e.Static("/themes", "themes") + e.Static("/themes", options.ThemesPath) return s, nil } -- cgit v1.2.3