From c2671a57fea7457fb24a3d65f5f4a2a1cc65bebe Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 12 Sep 2024 21:53:54 +0300 Subject: add pending.delete --- internal/config/server/server.go | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'internal/config') diff --git a/internal/config/server/server.go b/internal/config/server/server.go index 8454c34..8d0d15c 100644 --- a/internal/config/server/server.go +++ b/internal/config/server/server.go @@ -6,20 +6,21 @@ import ( "os" "codeberg.org/snonux/gos/internal/config" + "codeberg.org/snonux/gos/internal/types" ) type ServerConfig struct { - ListenAddr string `json:"ListenAddr,omitempty"` - Partners []string `json:"Partners,omitempty"` - APIKey string `json:"APIKey,omitempty"` - DataDir string `json:"StateDir,omitempty"` - EmailTo string `json:"EmailTo,omitempty"` - EmailFrom string `json:"EmailFrom,omitempty"` - SMTPServer string `json:"SMTPServer,omitempty"` - MergeIntervalS int `json:"MergeInterval,omitempty"` - ScheduleIntervalS int `json:"ScheduleInterval,omitempty"` - // SocialPlatformsEnable []string `json:"SocialPlatformsEnable,omitempty"` - Secrets SecretsConfig `json:"Secrets,omitempty"` + ListenAddr string `json:"ListenAddr,omitempty"` + Partners []string `json:"Partners,omitempty"` + APIKey string `json:"APIKey,omitempty"` + DataDir string `json:"StateDir,omitempty"` + EmailTo string `json:"EmailTo,omitempty"` + EmailFrom string `json:"EmailFrom,omitempty"` + SMTPServer string `json:"SMTPServer,omitempty"` + MergeIntervalS int `json:"MergeInterval,omitempty"` + ScheduleIntervalS int `json:"ScheduleInterval,omitempty"` + SocialPlatformsEnabled []string `json:"SocialPlatformsEnabled,omitempty"` + Secrets SecretsConfig `json:"Secrets,omitempty"` } func New(configFile, secretsFile string) (ServerConfig, error) { @@ -41,6 +42,8 @@ func New(configFile, secretsFile string) (ServerConfig, error) { conf.DataDir = config.Str("GOS_DATA_DIR", conf.DataDir, "data") conf.EmailTo = config.Str("GOS_EMAIL_TO", conf.EmailTo) conf.EmailFrom = config.Str("GOS_EMAIL_FROM", conf.EmailFrom) + conf.SocialPlatformsEnabled = config.StrSlice("GOS_SOCIAL_PLATFORMS_ENABLED", + []string{types.Mastodon, types.LinkedIn}) conf.SMTPServer = config.Str("GOS_SMTP_SERVER", conf.SMTPServer, func() string { hostname, err := os.Hostname() -- cgit v1.2.3