summaryrefslogtreecommitdiff
path: root/internal/config
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-09-12 21:53:54 +0300
committerPaul Buetow <paul@buetow.org>2024-09-12 21:53:54 +0300
commitc2671a57fea7457fb24a3d65f5f4a2a1cc65bebe (patch)
tree32bf5ef04e61a8c9ae38d2eddc4d48031b8cceaf /internal/config
parente012a4e256e5dab4b37c5af318fa5faf1eb55910 (diff)
add pending.delete
Diffstat (limited to 'internal/config')
-rw-r--r--internal/config/server/server.go25
1 files changed, 14 insertions, 11 deletions
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()