Skip to content

Automated world backups#593

Merged
Volte6 merged 2 commits into
masterfrom
world-backups
May 30, 2026
Merged

Automated world backups#593
Volte6 merged 2 commits into
masterfrom
world-backups

Conversation

@Volte6
Copy link
Copy Markdown
Member

@Volte6 Volte6 commented May 30, 2026

World Backups with Scheduled S3 Uploads

Adds automatic world data backups with configurable scheduling and optional upload to Amazon S3. Operators can protect against data loss from hardware failure, accidental deletions, or bad config changes without any external tooling. The system creates consistent point-in-time snapshots by briefly locking the MUD during archive creation, then uploads to S3 after the lock is released so players experience minimal disruption.

Also fixes a few rough edges in the config admin page around redacted/secret values and empty fields.

Changes

  • Admins can download a world backup on demand — A "Download World Backup" button on the admin home page creates a .tar.gz archive of all world data and streams it to the browser. A confirmation dialog warns that the server will be briefly unresponsive. Only admin-role users see the button (not moderators).

  • Operators can schedule automatic backups — A new Backup.Schedule config option supports nightly, weekly, or monthly automatic backups, all running at 3:00 AM server time. The scheduler runs as a background goroutine, re-reads config each cycle, and can be signaled to recalculate immediately when backup settings change. Setting the schedule to never or leaving it empty disables automatic backups.

  • Backups can be uploaded to Amazon S3 — When Backup.S3.Enabled is true, completed archives are automatically uploaded to a configured S3 bucket. Supports bucket name, region, key prefix, and credentials via config or environment variables (BACKUP_S3_ACCESS_KEY, BACKUP_S3_SECRET_KEY). Uses the AWS SDK v2 with static credentials and least-privilege IAM policy guidance.

  • Config changes trigger live rescheduling — An OnChanged callback system in the config package lets subsystems react to runtime config mutations. The backup scheduler uses this to immediately recalculate the next backup time when any Backup.* key is updated, without requiring a server restart.

  • Full backup documentation in the admin panel — A new "Backup Guide" docs page walks operators through the entire S3 setup process: creating an AWS account, creating a bucket, setting up an IAM user with least-privilege permissions, obtaining access keys, configuring GoMud, and verifying the setup. Includes a config reference table, environment variable reference, and troubleshooting guide.

  • Config wizard supports backup settings — The config wizard now includes a Backup section with all backup-related fields, including enum selection for the schedule and clearly described S3 fields.

  • Redacted config values can no longer be accidentally saved — Both the config page UI and the PATCH /admin/api/v1/config endpoint now reject attempts to save the *** REDACTED *** placeholder string as a config value, preventing operators from accidentally overwriting secrets with the display placeholder.

  • Empty config values are visually distinguished — Config keys with empty string values now show (empty) in italicized placeholder styling instead of a blank cell, making it easier to tell whether a value is unset vs. whitespace.

  • Admin-only route protection — A new RequireAdmin middleware restricts endpoints to admin-role users only (unlike RequirePermission which also allows mods with the right permission). The backup download endpoint uses this to ensure only full admins can trigger server-locking operations.

@Volte6 Volte6 merged commit abbae77 into master May 30, 2026
8 checks passed
@Volte6 Volte6 deleted the world-backups branch May 30, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant