feat: add more info

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
Henrique Dias 2018-12-28 20:27:35 +00:00
parent a9addc0e8a
commit 6c7d096166
2 changed files with 12 additions and 1 deletions

@ -1 +1 @@
Subproject commit 16f1dab96546a6e1dbbda0a99f4e325eaf36310f Subproject commit b9dc7e02e718b39c6b12e6946c7ce01b1b08890f

View File

@ -8,6 +8,8 @@ import (
"strings" "strings"
"text/template" "text/template"
"github.com/filebrowser/filebrowser/auth"
"github.com/GeertJohan/go.rice" "github.com/GeertJohan/go.rice"
"github.com/filebrowser/filebrowser/types" "github.com/filebrowser/filebrowser/types"
"github.com/gorilla/mux" "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 // TODO: baseurl must always not have the trailing slash
data := map[string]interface{}{ data := map[string]interface{}{
"BaseURL": baseURL, "BaseURL": baseURL,
"Version": types.Version,
"StaticURL": staticURL, "StaticURL": staticURL,
"Signup": e.Settings.Signup, "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) { index := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {