From 02e53fe110807ea479c6c45f2a4073c2593066a0 Mon Sep 17 00:00:00 2001 From: Pascal Bleser Date: Tue, 23 Jun 2026 11:39:51 +0200 Subject: [PATCH] groupware: introduce temporary configuration property GROUPWARE_ENABLE_MOCK_DATA that controls whether the mock addressbook and mock contacts should be injected or not; default is false/disabled since it is not fully functional yet --- services/groupware/pkg/config/config.go | 2 ++ services/groupware/pkg/config/defaults/defaultconfig.go | 1 + services/groupware/pkg/groupware/framework.go | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) 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)