You are browsing as a guest. Sign up (or log in) to start making projects!

49m 11s logged

Today I added deduplicated, encrypted backups to Realm, my game server panel. Previously every backup was a full .tar.gz archive — so backing up a 125MB server ten times ate over a gigabyte of disk, even though almost nothing changed between backups. Painful if you want frequent backups.

Now backups can run through rustic, a Rust backup tool that deduplicates and encrypts data. Ten backups of that same server now cost a fraction of the disk, because identical blocks are stored once and shared across every snapshot. You can turn it on per node, or set it as the panel-wide default — one dropdown in the node settings.

What I built:

  • A new rustic backup adapter in Wings (the Go daemon), covering the full lifecycle:
    init the repository, back up on delete. Since rustic hasno Go bindings I shell out to the binary, with a per-repository lock so concurrent
    backups on a shared node repgo through env vars, neverthe process args, and the repo is daemon-owned so game containers never see the path
    or password.
  • A backup_adapter column on nodes (plus migration) and the panel-side logic to pick
    the adapter, with a per-nodes a global backupdestination.
  • A “Backup adapter” dropdowd hiding the Download buttonfor rustic backups since they live in a shared repo instead of as one downloadable file.
  • A production Docker image that bundles the rustic binary, plus docs: a full setup guide and a config reference

The interesting part was tesd TypeScript was happy, but I spun up the whole dev stack and ran it against a real rustic binary and a real game
server anyway — and immediatiler couldn’t see. My deletecommand was missing a flag and crashed every time, my snapshot filter was silently
returning nothing (which broxpected the wrong outputshape, and the Dockerfile pinned a rustic version that didn’t exist. Two of those
would have shipped a featureothing. After fixing them, Iwatched the full create → restore → delete flow run clean through the real
panel-to-daemon path: a snapestored from it, and deleting it cleared the snapshot and reclaimed the space.

Not a flashy feature, but it means you can now keep way more backups for way less disk — and it was a good remindere near “it works.”

0
1

Comments 0

No comments yet. Be the first!