DEV Community

Kushal Baral
Kushal Baral

Posted on Edited on

Released bunker v0.3.0 and v0.4.0

Sign in to view linked content

Top comments (7)

Collapse
 
kushal1o1 profile image
Kushal Baral •

bunker v0.3.0

Snapshots can now go to S3, to local disk, or to both.

Storage: local, S3 or both

Where you set a location is where snapshots go:

storage:
  dir: ~/backups          # local
  s3:                     # S3-compatible: AWS S3, Cloudflare R2, Backblaze B2, MinIO
    endpoint: https://s3.eu-central-1.amazonaws.com
    bucket: my-bunker
    region: eu-central-1  # optional
    prefix: prod/         # optional
Enter fullscreen mode Exit fullscreen mode
  • dir only: local disk
  • s3 only: streamed straight to S3, nothing on disk
  • both: written locally first, then uploaded

New

  • bunker storage sync [server...] uploads local snapshots that are not in S3 yet.
  • bunker backup verify --remote verifies the S3 copy. It is streamed and never saved to disk.
  • backup list shows LOCAL and S3 columns when both are set.
  • retention apply deletes from both places.
  • If an upload fails, the local snapshot is kept and bunker exits with code 1. Retry with bunker storage sync.
  • manifest.json is written last on S3 too, so a half-uploaded snapshot never counts as complete.

Also since v0.2.0-dev

  • Connect timeout, SSH keepalive, and a clean Ctrl-C during a transfer
  • CI: gofmt, vet, build and go test -race on every PR
  • CONTRIBUTING.md, SECURITY.md, issue and PR templates
  • Install guide for the prebuilt binaries

Breaking

storage.type has been removed. Delete it from bunker.yaml, or config loading will fail with an unknown field error.

Full docs: kushal1o1.github.io/bunker

The "Also since" section exists because the previous stable release was v0.1.0, so the keepalive work in v0.2.0-dev is also new to anyone upgrading from stable.

Collapse
 
kushal1o1 profile image
Kushal Baral •

bunker v0.4.0

Back up with the public key only, so the machine that runs backups cannot read them.

Public key only

encryption:
  recipient: age1...   # public key: enough to back up
Enter fullscreen mode Exit fullscreen mode
  • With recipient set, backups are encrypted to it and the private key does not have to be on this machine.
  • If the private key file is also there, it must match recipient, or backup run stops before connecting.
  • backup verify runs where the private key is, for example your laptop with --remote.
  • backup run --dry-run shows which key it encrypts to.

This is the base for agent mode later: a hacked server gets only the public key.

keygen

  • bunker keygen --public prints only the public key, ready to paste into recipient.
  • --force now prints the new and the old public key on their own lines.
  • --force writes the new key first and then replaces the old one, so a failed write never leaves you without a key.
  • --force also replaces a key file that cannot be read.

resolve issue iref(#16) opened by @Osin1o1

Collapse
 
robertpaschal profile image
Odinaka Robert Nnamani •

If an upload dies halfway, does the retry pick up the local snapshot or start over from scratch?

Collapse
 
kushal1o1 profile image
Kushal Baral •

Good question. Today it restarts that snapshot's upload, but from the local copy, so nothing is dumped from the server again, and snapshots already in S3 are skipped. Resumable uploads for very large snapshots are planned for a future release: only the artifacts that didn't make it get uploaded again. Thanks for raising it!

Collapse
 
robertpaschal profile image
Odinaka Robert Nnamani •

Skipping what's already in S3 and restarting from the local copy is a solid middle ground. Resumable for the big snapshots is the part I'd want next.

Thread Thread
 
kushal1o1 profile image
Kushal Baral • • Edited

yes : ) , First we will create postgres(containerized) volumes backups then agent on server .Then we will move towards the Bigger Backups handing concerning your suggestions .

Thread Thread
 
robertpaschal profile image
Odinaka Robert Nnamani •

Local Postgres first, then the agent watching for changes is a clean order. What happens to the queue when the destination is down for a while?