mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user