|
@@ -98,15 +98,10 @@ var (
|
|
|
func init() {
|
|
func init() {
|
|
|
IsWindows = runtime.GOOS == "windows"
|
|
IsWindows = runtime.GOOS == "windows"
|
|
|
log.NewLogger(0, "console", `{"level": 0}`)
|
|
log.NewLogger(0, "console", `{"level": 0}`)
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-func getWorkDir() string {
|
|
|
|
|
- p, _ := filepath.Abs(".")
|
|
|
|
|
- return p
|
|
|
|
|
|
|
+ WorkDir, _ = filepath.Abs(".")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func findConfigFiles() []string {
|
|
func findConfigFiles() []string {
|
|
|
- WorkDir = getWorkDir()
|
|
|
|
|
ConfRootPath = path.Join(WorkDir, "conf")
|
|
ConfRootPath = path.Join(WorkDir, "conf")
|
|
|
filenames := make([]string, 0)
|
|
filenames := make([]string, 0)
|
|
|
|
|
|
|
@@ -152,6 +147,10 @@ func ToAbsUrl(relativeUrl string) string {
|
|
|
return AppUrl + relativeUrl
|
|
return AppUrl + relativeUrl
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func loadEnvVariableOverrides() {
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
func NewConfigContext() {
|
|
func NewConfigContext() {
|
|
|
configFiles := findConfigFiles()
|
|
configFiles := findConfigFiles()
|
|
|
|
|
|
|
@@ -170,6 +169,8 @@ func NewConfigContext() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ loadEnvVariableOverrides()
|
|
|
|
|
+
|
|
|
AppName = Cfg.Section("").Key("app_name").MustString("Grafana")
|
|
AppName = Cfg.Section("").Key("app_name").MustString("Grafana")
|
|
|
Env = Cfg.Section("").Key("app_mode").MustString("development")
|
|
Env = Cfg.Section("").Key("app_mode").MustString("development")
|
|
|
|
|
|