Chore: Add WARN log if grafana server process is running with elevated privileges (#35205)

* warn on linux

* add warning for grpc plugins

* add windows support

* update go.mod

* reorganize imports

* update naming

* remove Windows logic

* simplify and add check for when UID and EUID don't match

* fix build

* tidy go.mod

* feedback

* cleanup + migrate
This commit is contained in:
Will Browne
2021-09-13 17:46:47 +02:00
committed by GitHub
parent 40267f5ea0
commit 1a71f0fe13
6 changed files with 51 additions and 18 deletions

View File

@@ -807,24 +807,6 @@ func NewCfgFromArgs(args CommandLineArgs) (*Cfg, error) {
return cfg, nil
}
var theCfg *Cfg
// GetCfg gets the Cfg singleton.
// XXX: This is only required for integration tests so that the configuration can be reset for each test,
// as due to how the current DI framework functions, we can't create a new Cfg object every time (the services
// constituting the DI graph, and referring to a Cfg instance, get created only once).
func GetCfg() *Cfg {
if theCfg != nil {
return theCfg
}
theCfg, err := NewCfgFromArgs(CommandLineArgs{})
if err != nil {
panic(err)
}
return theCfg
}
func (cfg *Cfg) validateStaticRootPath() error {
if skipStaticRootValidation {
return nil