From d8ee36ed4df8e8130235da588750f446a0a0a2b1 Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Fri, 21 May 2021 20:33:00 +0100 Subject: [PATCH 1/2] Ensure settings for Service and Mailer are read on the install page NewContext does not set the mailer or service settings so add a new function that will run this. Fix #15894 Signed-off-by: Andrew Thornton --- modules/setting/setting.go | 5 +++++ routers/init.go | 1 + 2 files changed, 6 insertions(+) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 4244b55939b2..391fc325dc1b 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -1179,3 +1179,8 @@ func NewServices() { newProject() newMimeTypeMap() } + +func NewServicesForInstall() { + newService() + newMailService() +} diff --git a/routers/init.go b/routers/init.go index 220d87a29da8..bdbeff6f6c77 100644 --- a/routers/init.go +++ b/routers/init.go @@ -100,6 +100,7 @@ func PreInstallInit(ctx context.Context) bool { log.Info("SQLite3 Supported") } setting.InitDBConfig() + setting.NewServicesForInstall() svg.Init() } From 12f3b56229eef1d8b98b6b9652b8f66f923ef287 Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Sun, 23 May 2021 18:18:45 +0100 Subject: [PATCH 2/2] placate lint Signed-off-by: Andrew Thornton --- modules/setting/setting.go | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index d72777a37980..564b8a2e33aa 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -1181,6 +1181,7 @@ func NewServices() { newMimeTypeMap() } +// NewServicesForInstall initializes the services for install func NewServicesForInstall() { newService() newMailService()