From 6c7d096166b2b970f052b5967951b9bd4f0d5ca7 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Fri, 28 Dec 2018 20:27:35 +0000 Subject: [PATCH] feat: add more info License: MIT Signed-off-by: Henrique Dias --- frontend | 2 +- http/http.go | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/frontend b/frontend index 16f1dab9..b9dc7e02 160000 --- a/frontend +++ b/frontend @@ -1 +1 @@ -Subproject commit 16f1dab96546a6e1dbbda0a99f4e325eaf36310f +Subproject commit b9dc7e02e718b39c6b12e6946c7ce01b1b08890f diff --git a/http/http.go b/http/http.go index 119630fd..3d68c8d2 100644 --- a/http/http.go +++ b/http/http.go @@ -8,6 +8,8 @@ import ( "strings" "text/template" + "github.com/filebrowser/filebrowser/auth" + "github.com/GeertJohan/go.rice" "github.com/filebrowser/filebrowser/types" "github.com/gorilla/mux" @@ -37,8 +39,17 @@ func (e *Env) getHandlers() (http.Handler, http.Handler) { // TODO: baseurl must always not have the trailing slash data := map[string]interface{}{ "BaseURL": baseURL, + "Version": types.Version, "StaticURL": staticURL, "Signup": e.Settings.Signup, + "ReCaptcha": false, + } + + if e.Settings.AuthMethod == auth.MethodJSONAuth { + auther := e.Auther.(auth.JSONAuth) + data["ReCaptcha"] = auther.ReCaptcha.Key != "" && auther.ReCaptcha.Secret != "" + data["ReCaptchaHost"] = auther.ReCaptcha.Host + data["ReCaptchaKey"] = auther.ReCaptcha.Key } index := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {