From 637f32ae7f5eae7ad1d56f470d9e58715876a183 Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Mon, 13 Sep 2021 20:44:43 +0100 Subject: [PATCH] Always emit the configuration path Often when handling problems it is not clear which configuration file Gitea is using. This PR simply ensures that the configuration file is emitted. Signed-off-by: Andrew Thornton --- cmd/convert.go | 1 + cmd/dump_repo.go | 1 + cmd/migrate.go | 1 + cmd/migrate_storage.go | 1 + routers/init.go | 1 + routers/install/setting.go | 1 + 6 files changed, 6 insertions(+) diff --git a/cmd/convert.go b/cmd/convert.go index e2ffd403acbc3..aa404d64fae51 100644 --- a/cmd/convert.go +++ b/cmd/convert.go @@ -31,6 +31,7 @@ func runConvert(ctx *cli.Context) error { log.Info("AppWorkPath: %s", setting.AppWorkPath) log.Info("Custom path: %s", setting.CustomPath) log.Info("Log path: %s", setting.LogRootPath) + log.Info("Configuration file: %s", setting.CustomConf) setting.InitDBConfig() if !setting.Database.UseMySQL { diff --git a/cmd/dump_repo.go b/cmd/dump_repo.go index 69813e3c872f6..3ea82f6d1a0cb 100644 --- a/cmd/dump_repo.go +++ b/cmd/dump_repo.go @@ -84,6 +84,7 @@ func runDumpRepository(ctx *cli.Context) error { log.Info("AppWorkPath: %s", setting.AppWorkPath) log.Info("Custom path: %s", setting.CustomPath) log.Info("Log path: %s", setting.LogRootPath) + log.Info("Configuration file: %s", setting.CustomConf) setting.InitDBConfig() var ( diff --git a/cmd/migrate.go b/cmd/migrate.go index 23bc97b0c41f2..afed07f538d09 100644 --- a/cmd/migrate.go +++ b/cmd/migrate.go @@ -32,6 +32,7 @@ func runMigrate(ctx *cli.Context) error { log.Info("AppWorkPath: %s", setting.AppWorkPath) log.Info("Custom path: %s", setting.CustomPath) log.Info("Log path: %s", setting.LogRootPath) + log.Info("Configuration file: %s", setting.CustomConf) setting.InitDBConfig() if err := models.NewEngine(context.Background(), migrations.Migrate); err != nil { diff --git a/cmd/migrate_storage.go b/cmd/migrate_storage.go index 8123716f9ba95..08524953b4c21 100644 --- a/cmd/migrate_storage.go +++ b/cmd/migrate_storage.go @@ -114,6 +114,7 @@ func runMigrateStorage(ctx *cli.Context) error { log.Info("AppWorkPath: %s", setting.AppWorkPath) log.Info("Custom path: %s", setting.CustomPath) log.Info("Log path: %s", setting.LogRootPath) + log.Info("Configuration file: %s", setting.CustomConf) setting.InitDBConfig() if err := models.NewEngine(context.Background(), migrations.Migrate); err != nil { diff --git a/routers/init.go b/routers/init.go index fe89c738effca..52eacfd02b17e 100644 --- a/routers/init.go +++ b/routers/init.go @@ -81,6 +81,7 @@ func GlobalInit(ctx context.Context) { log.Info("AppWorkPath: %s", setting.AppWorkPath) log.Info("Custom path: %s", setting.CustomPath) log.Info("Log path: %s", setting.LogRootPath) + log.Info("Configuration file: %s", setting.CustomConf) log.Info("Run Mode: %s", strings.Title(setting.RunMode)) // Setup i18n diff --git a/routers/install/setting.go b/routers/install/setting.go index 7b9b7bd8c225b..e2af66cfb4553 100644 --- a/routers/install/setting.go +++ b/routers/install/setting.go @@ -22,6 +22,7 @@ func PreloadSettings(ctx context.Context) bool { log.Info("AppWorkPath: %s", setting.AppWorkPath) log.Info("Custom path: %s", setting.CustomPath) log.Info("Log path: %s", setting.LogRootPath) + log.Info("Configuration file: %s", setting.CustomConf) log.Info("Preparing to run install page") translation.InitLocales() if setting.EnableSQLite3 {