chore: fix infinity calling Fatal, add a backup reference

This commit is contained in:
Jonas Kaninda
2024-10-10 04:14:42 +02:00
parent df490af7b6
commit e5dd7e76ce
9 changed files with 133 additions and 59 deletions

View File

@@ -12,20 +12,23 @@ type MailConfig struct {
SkipTls bool
}
type NotificationData struct {
File string
BackupSize int64
Database string
StartTime string
EndTime string
Storage string
BackupLocation string
File string
BackupSize int64
Database string
StartTime string
EndTime string
Storage string
BackupLocation string
BackupReference string
}
type ErrorMessage struct {
Database string
EndTime string
Error string
Database string
EndTime string
Error string
BackupReference string
}
// loadMailConfig gets mail environment variables and returns MailConfig
func loadMailConfig() *MailConfig {
return &MailConfig{
MailHost: os.Getenv("MAIL_HOST"),
@@ -39,4 +42,18 @@ func loadMailConfig() *MailConfig {
}
// TimeFormat returns the format of the time
func TimeFormat() string {
format := os.Getenv("TIME_FORMAT")
if format == "" {
return "2006-01-02 at 15:04:05"
}
return format
}
func backupReference() string {
return os.Getenv("BACKUP_REFERENCE")
}
const templatePath = "/config/templates"