1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-25 08:09:43 +02:00

Show admins incomplete config indicator

SMTP checks to start with.
This commit is contained in:
sauls8t 2019-06-19 13:39:36 +01:00
parent b2cd375936
commit 80f0876b51
7 changed files with 31 additions and 4 deletions

View file

@ -27,6 +27,7 @@ import (
"github.com/documize/community/domain/auth"
"github.com/documize/community/domain/organization"
indexer "github.com/documize/community/domain/search"
"github.com/documize/community/domain/setting"
"github.com/documize/community/domain/store"
"github.com/documize/community/model/doc"
"github.com/documize/community/model/org"
@ -67,6 +68,13 @@ func (h *Handler) Meta(w http.ResponseWriter, r *http.Request) {
data.Storage = h.Runtime.StoreProvider.Type()
data.Location = h.Runtime.Flags.Location // reserved
// Is product setup complete? SMTP in this case.
data.Configured = true
cfg := setting.GetSMTPConfig(h.Store)
if len(cfg.Host) == 0 {
data.Configured = false
}
// Strip secrets
data.AuthConfig = auth.StripAuthSecrets(h.Runtime, org.AuthProvider, org.AuthConfig)