3
0
mirror of https://kolaente.dev/konrad/docker-db-backup.git synced 2026-01-10 02:50:08 +01:00

feat: add completion webhook url

This commit is contained in:
kolaente
2023-06-05 18:35:21 +02:00
parent e43e8c3959
commit 07c2fae209
4 changed files with 46 additions and 3 deletions

View File

@@ -17,6 +17,7 @@ type conf struct {
fullCurrentBackupPath string
Schedule string
MaxBackups int
CompletionWebhookURL string
}
var (
@@ -25,9 +26,10 @@ var (
)
const (
envBackupFolder = `BACKUP_FOLDER`
envSchedule = `BACKUP_SCHEDULE`
envMax = `BACKUP_MAX`
envBackupFolder = `BACKUP_FOLDER`
envSchedule = `BACKUP_SCHEDULE`
envMax = `BACKUP_MAX`
envCompletionWebhookURL = `BACKUP_COMPLETION_WEBHOOK_URL`
)
func init() {
@@ -60,6 +62,11 @@ func init() {
config.MaxBackups = int(maxBackups)
}
webhookURL, has := os.LookupEnv(envCompletionWebhookURL)
if has {
config.CompletionWebhookURL = webhookURL
}
updateFullBackupPath()
}