Repository navigation
Releases
v0.5.0
bunker v0.5.0: agent mode
bunker can now run on the server itself and push backups straight to S3. No machine of yours has to be on, and nothing logs in to the server. SSH pull mode is unchanged and stays the default.
Agent mode
The agent holds only the age public key and an upload-only S3 key, so a compromised server can neither read nor delete old backups. Verify, retention and restore stay on your laptop.
Two ways to run it:
- Host agent: a systemd timer on a plain server, running as an unprivileged
bunkeruser. - Container agent: one container next to your Docker stacks. Covers databases in containers and named volumes without root, capabilities or the Docker socket.
Agent mode is for Linux servers. The laptop side works on Linux, macOS and
Windows.
New commands
| Command | What it does |
|---|---|
bunker agent run |
one backup of this machine to S3 |
bunker agent check |
checks config, pg_dump, database access, pgpass, paths and S3 without backing up |
bunker agent install |
writes the systemd service and timer, or /etc/cron.d/bunker-agent with --docker; --at sets the time, --dry-run shows the files |
bunker agent uninstall |
removes them; config and snapshots stay |
bunker status |
each server's newest snapshot and its agent's last run; exits 1 when one needs attention |
Other changes
servers.<name>.agent: trueinbunker.yaml:list,verify,
retentionandstatusread agent servers from S3.bunker statuschecks servers in parallel and prints each row as soon as
it is ready. One server failing to list no longer hides the others.retention applyremoves snapshots left without a manifest by a run that
died halfway, after 24 hours.- Release binaries are fully static and run on any Linux, including Alpine.
Container image
docker pull ghcr.io/kushal1o1/bunker:v0.5.0
For linux/amd64 and linux/arm64. Includes pg_dump 18 and tar, and
runs as uid 10001. latest now points to this release.
Getting started for agents
See Agent mode .
Upgrading from v0.4.0
Nothing to change. Existing bunker.yaml files and snapshots work as before.
v0.5.0-dev
bunker v0.5.0-dev: agent mode
Don't Run this release on Prod
This is a development release for testing. Feedback welcome before v0.5.0.
Agent mode
bunker can now run on the server itself and push backups straight to S3. No machine of yours has to be on, and nothing logs in to the server.
The agent holds only the age public key and an upload-only S3 key, so a compromised server can neither read nor delete old backups. Verify, retention and restore stay on your laptop.
Two ways to run it:
- Host agent: a systemd timer on a plain server, running as an
unprivilegedbunkeruser. - Container agent: one container next to your Docker stacks. Covers databases in containers and named volumes without root, capabilities or the Docker socket.
New commands
| Command | What it does |
|---|---|
bunker agent run |
one backup of this machine to S3 |
bunker agent check |
checks config, pg_dump, database access, paths and S3 without uploading |
bunker agent install |
writes the systemd service and timer, or /etc/cron.d/bunker-agent with --docker |
bunker agent uninstall |
removes them; config and snapshots stay |
bunker status |
each server's newest snapshot and its agent's last run; exits 1 when one needs attention |
Other changes
servers.<name>.agent: trueinbunker.yaml:list,verify,retentionandstatusread agent servers from S3.retention applyremoves snapshots left without a manifest by a run that died halfway, after 24 hours.pg_dumpruns with-w.- Release binaries are now fully static and run on any Linux, including Alpine.
Container image
docker pull ghcr.io/kushal1o1/bunker:v0.5.0-dev
For linux/amd64 and linux/arm64. Includes pg_dump 18 and tar, and
runs as uid 10001. latest moves only on stable releases.
Getting started
See Agent mode and the ready-made files in examples/agent/.
Notes
- This is a development release. SSH pull mode is unchanged and stays the
default. - Postgres and files are supported in agent mode.
v0.4.0
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- 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 --publicprints only the public key, ready to paste into recipient.--forcenow prints the new and the old public key on their own lines.--forcewrites the new key first and then replaces the old one, so a failed write never leaves you without a key.--forcealso replaces a key file that cannot be read.
v0.3.0
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- 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: https://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.
v0.2.0-dev
bunker v0.2.0-dev
Changes
Back up several servers at once
bunker backup run --allnow backs up up toconcurrencyservers in parallel (default 3).- Every server is attempted. One failing server no longer stops the rest.
- Live progress table in the terminal, plain prefixed log lines in cron and pipes.
- A summary at the end, and exit code
1if any server failed, so cron and monitors can alert on it. - Naming the same server twice backs it up once.
Retention
- New
bunker retention apply [server...]with a daily / weekly / monthly policy (defaults 7 / 4 / 6). - Preview by default; nothing is deleted without
--yes. - The newest snapshot is always kept, and incomplete snapshots are never deleted.
Snapshot listing
- New
bunker backup list [server...]shows every stored snapshot with its date, artifact count, size and status. Reads local storage only: no network, no key.
No more hanging on dead servers
ssh.connect_timeout(default10s): a server that never answers fails fast with a clear message instead of hanging the run. Also covers the SSH handshake.ssh.keepalive_interval(default15s): a server that freezes or drops off the network mid-backup is dropped after 3 unanswered checks (about a minute). Slow commands like a bigpg_dumpon a live server are never cut off.Ctrl-Cnow stops right away, even in the middle of a transfer, and deletes the partial snapshot.
Next-step hints
- After a command, bunker suggests the one command you most likely want next (for example,
verifyafter a backup). Shown only in a terminal; turn off with--no-hintsorBUNKER_NO_HINTS=1.
Config
All new fields are optional with defaults, so existing bunker.yaml files work unchanged:
concurrency: 3
retention:
daily: 7
weekly: 4
monthly: 6
servers:
my-vps:
ssh:
connect_timeout: 10s
keepalive_interval: 15sUpgrading
Replace the binary. No config changes required.
PRs ref
- Feat: add hint and configuration doc by @kushal1o1 in #6
- Feat: add rentention and snapshot list with testcases by @kushal1o1 in #8
- Feat:concurrency and timeouts with liveness check by @kushal1o1 in #12
Full Changelog: v0.1.0...v0.2.0-dev
What's Changed
- Feat: add hint and configuration doc by @kushal1o1 in #6
- Feat: add rentention and snapshot list with testcases by @kushal1o1 in #8
- Feat:concurrency and timeouts with liveness check by @kushal1o1 in #12
New Contributors
- @kushal1o1 made their first contribution in #6
Full Changelog: v0.1.0...v0.2.0-dev
v0.1.0
Full Changelog: v0.0.1-beta...v0.1.0
v0.0.1-beta
Initial version v0.0.1-beta
Global flags
| Flag | Default | Meaning |
|---|---|---|
-c, --config <path> |
bunker.yaml |
config file to load |
-h, --help |
help for any command | |
-v, --version |
print version |
Every command that reads config accepts -c. Paths inside the config support
~ expansion.
Commands
| Command | Purpose |
|---|---|
bunker version |
print version |
bunker keygen [--force] |
generate the age encryption identity |
bunker server list |
show configured servers |
bunker backup run [server...] |
run a backup |
bunker backup verify <server> <snapshot> |
verify a snapshot's checksums, archive integrity and decryption |
bunker completion <shell> |
generate a shell completion script |
bunker help [command] |
cobra help |