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) {