Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion migrations/1757326540_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,24 @@ func init() {
}

settings.Meta.AppName = "Primo CMS"
app.Save(settings)

// Enable automatic backups by default so a fresh deploy isn't one
// volume wipe away from total data loss. Stored on the pb_data
// volume (backups/ dir) — a floor, not off-site protection; wire up
// Backups.S3 for that. Env-overridable; only set when unconfigured
// so we never clobber a schedule set via the admin UI.
if settings.Backups.Cron == "" {
cron := os.Getenv("PRIMO_BACKUP_CRON")
if cron == "" {
cron = "0 3 * * *" // daily at 03:00
}
settings.Backups.Cron = cron
settings.Backups.CronMaxKeep = 7
}

if err := app.Save(settings); err != nil {
return err
}

superuserEmail := os.Getenv("PRIMO_SUPERUSER_EMAIL")
superuserPassword := os.Getenv("PRIMO_SUPERUSER_PASSWORD")
Expand Down