mirror of
https://github.com/grafana/grafana.git
synced 2025-09-25 09:23:58 +08:00
Settings: Add setting for hiding version number for anonymous users (#24919)
* Settings: Add setting for hiding version number for anonymous users Fixes #12925 * Hide version string from footer when unavailable * Settings: Test frontend settings with hide version for anonymous users * Settings: Add hide version variable to frontend settings * Make AnonymousHideVersion non-global Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Settings: Improve test neighbor friendliness, reset state before and after * Settings: Use T.Cleanup Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
@ -4,13 +4,14 @@ import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"github.com/grafana/grafana/pkg/services/search"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
"sync"
|
||||
|
||||
"github.com/grafana/grafana/pkg/services/search"
|
||||
|
||||
"github.com/grafana/grafana/pkg/plugins/backendplugin"
|
||||
|
||||
"github.com/grafana/grafana/pkg/api/live"
|
||||
@ -351,8 +352,10 @@ func (hs *HTTPServer) healthHandler(ctx *macaron.Context) {
|
||||
|
||||
data := simplejson.New()
|
||||
data.Set("database", "ok")
|
||||
data.Set("version", setting.BuildVersion)
|
||||
data.Set("commit", setting.BuildCommit)
|
||||
if !hs.Cfg.AnonymousHideVersion {
|
||||
data.Set("version", setting.BuildVersion)
|
||||
data.Set("commit", setting.BuildCommit)
|
||||
}
|
||||
|
||||
if err := bus.Dispatch(&models.GetDBHealthQuery{}); err != nil {
|
||||
data.Set("database", "failing")
|
||||
|
Reference in New Issue
Block a user