]> source.dussan.org Git - gitea.git/commitdiff
Fix #145
authorUnknown <joe2010xtmf@163.com>
Mon, 5 May 2014 06:49:33 +0000 (02:49 -0400)
committerUnknown <joe2010xtmf@163.com>
Mon, 5 May 2014 06:49:33 +0000 (02:49 -0400)
modules/base/conf.go

index 126fd63d2ef9ee853552ccc0c994eef2f3598726..73552732b1deaa0360cec2f09ff17cd1000bb5b1 100644 (file)
@@ -316,10 +316,12 @@ func NewConfigContext() {
        }
        Cfg.BlockMode = false
 
-       cfgPath = filepath.Join(workDir, "custom/conf/app.ini")
-       if com.IsFile(cfgPath) {
-               if err = Cfg.AppendFiles(cfgPath); err != nil {
-                       qlog.Fatalf("Cannot load config file(%s): %v\n", cfgPath, err)
+       cfgPaths := []string{os.Getenv("GOGS_CONFIG"), filepath.Join(workDir, "custom/conf/app.ini")}
+       for _, cfgPath := range cfgPaths {
+               if com.IsFile(cfgPath) {
+                       if err = Cfg.AppendFiles(cfgPath); err != nil {
+                               qlog.Fatalf("Cannot load config file(%s): %v\n", cfgPath, err)
+                       }
                }
        }