diff --git a/services/groupware/pkg/config/config.go b/services/groupware/pkg/config/config.go index e20b8ed6a2..5fdf6fdc0b 100644 --- a/services/groupware/pkg/config/config.go +++ b/services/groupware/pkg/config/config.go @@ -23,6 +23,8 @@ type Config struct { TokenManager *TokenManager `yaml:"token_manager"` Context context.Context `yaml:"-"` + + EnableMockData bool `env:"GROUPWARE_ENABLE_MOCK_DATA"` } type MailMasterAuth struct { diff --git a/services/groupware/pkg/config/defaults/defaultconfig.go b/services/groupware/pkg/config/defaults/defaultconfig.go index cc181dc822..7e2e502029 100644 --- a/services/groupware/pkg/config/defaults/defaultconfig.go +++ b/services/groupware/pkg/config/defaults/defaultconfig.go @@ -58,6 +58,7 @@ func DefaultConfig() *config.Config { Service: config.Service{ Name: "groupware", }, + EnableMockData: false, } } diff --git a/services/groupware/pkg/groupware/framework.go b/services/groupware/pkg/groupware/framework.go index 848e5c730e..538dc5da08 100644 --- a/services/groupware/pkg/groupware/framework.go +++ b/services/groupware/pkg/groupware/framework.go @@ -399,7 +399,7 @@ func NewGroupware(config *config.Config, logger *log.Logger, mux *chi.Mux, prome addressBookListSuppliers = append(addressBookListSuppliers, j) contactCardQuerySuppliers = append(contactCardQuerySuppliers, j) } - { + if config.EnableMockData { m := newMockContactCardSupplier() addressBookListSuppliers = append(addressBookListSuppliers, m) contactCardQuerySuppliers = append(contactCardQuerySuppliers, m)