|
|
@ -16,7 +16,6 @@ var ( |
|
|
|
SyndicationTargets []SyndicationTarget |
|
|
|
SelectedStorage Storage |
|
|
|
SelectedMediaStorage MediaStorage |
|
|
|
SelectedNotificationServices NotificationServices |
|
|
|
SelectedImageCompression ImageCompression |
|
|
|
DefaultLanguage string |
|
|
|
Languages map[string]Language |
|
|
@ -35,7 +34,6 @@ type YamlConfig struct { |
|
|
|
Languages map[string]Language `yaml:"languages"` |
|
|
|
Git GitConfig `yaml:"git"` |
|
|
|
BunnyCdn BunnyCdnConfig `yaml:"bunnyCdn"` |
|
|
|
Telegram TelegramConfig `yaml:"telegram"` |
|
|
|
Tinify TinifyConfig `yaml:"tinify"` |
|
|
|
SyndicationTargets []string `yaml:"syndication"` |
|
|
|
} |
|
|
@ -45,11 +43,6 @@ type BunnyCdnConfig struct { |
|
|
|
StorageName string `yaml:"storageName"` |
|
|
|
} |
|
|
|
|
|
|
|
type TelegramConfig struct { |
|
|
|
UserId int `yaml:"userId"` |
|
|
|
BotToken string `yaml:"botToken"` |
|
|
|
} |
|
|
|
|
|
|
|
type TinifyConfig struct { |
|
|
|
Key string `yaml:"key"` |
|
|
|
} |
|
|
@ -172,21 +165,6 @@ func initConfig() (err error) { |
|
|
|
if SelectedMediaStorage == nil { |
|
|
|
log.Println("no media storage configured") |
|
|
|
} |
|
|
|
// Find configured notification services (optional)
|
|
|
|
SelectedNotificationServices = func() NotificationServices { |
|
|
|
var notificationServices []NotificationService = nil |
|
|
|
// Telegram
|
|
|
|
if cfg.Telegram.UserId > 0 && len(cfg.Telegram.BotToken) > 0 { |
|
|
|
notificationServices = append(notificationServices, &Telegram{ |
|
|
|
userId: cfg.Telegram.UserId, |
|
|
|
botToken: cfg.Telegram.BotToken, |
|
|
|
}) |
|
|
|
} |
|
|
|
return notificationServices |
|
|
|
}() |
|
|
|
if SelectedNotificationServices == nil { |
|
|
|
log.Println("No notification services configured") |
|
|
|
} |
|
|
|
// Find configured image compression service (optional)
|
|
|
|
SelectedImageCompression = func() ImageCompression { |
|
|
|
// Tinify
|
|
|
|