Commit graph

9 commits

Author SHA1 Message Date
TronoSfera
ff8882d864 fix(pipeline): pass-through compressed bytes when encryption_enabled=false
Previously the runner unconditionally invoked the passthrough DEK
resolver, which required a 32-byte key. Jobs configured with
encryption_enabled=false arrive with EncryptedDek=nil and the resolver
returned an 'expected 32-byte DEK, got 0' error, failing every run.

When EncryptedDek is empty the runner now skips the encrypt stage and
io.Copy()s the compressed stream straight into the upload pipe. The
encrypted_dek on BackupCompleted stays empty as well, matching the
server's expectation for an un-encrypted run.
2026-05-18 17:49:26 +03:00
TronoSfera
6fe4d9165d fix(upload): stage encrypted body in temp file for known Content-Length
MinIO (and stricter S3 endpoints) reject presigned PUTs sent with
chunked transfer-encoding, returning HTTP 411 'Length Required'. The
pipeline could not know the final encrypted size up-front so it
streamed the request body with ContentLength=-1.

Drain the encrypt stage into a temp file, then issue the PUT with an
explicit Content-Length. The dump → compress → encrypt goroutines
still overlap because the drain reads from the encrypt pipe; only the
upload itself is sequenced after encryption completes.
2026-05-18 14:51:40 +03:00
TronoSfera
3cfac4daca fix(sqlite): stage snapshot in temp file instead of /dev/stdout
The Alpine sqlite3 binary refuses to open /dev/stdout when running as
a non-root uid in a container ('Error: cannot open "/dev/stdout"'),
which breaks every backup attempt. Switch the dump path to stage the
snapshot in a temp file, then stream that file through gzip into the
pipeline. Adds streamSideEffect to the test mockRunner so the existing
gzip-wrap test can simulate the sqlite3 process writing to its
destination path.
2026-05-18 14:46:48 +03:00
TronoSfera
6a56577dab fix(docker): bundle readline runtime so sqlite3 client loads
The Alpine sqlite3 binary dynamically links against libreadline.so.8;
without it the agent crashes at the validate stage of the pipeline
with 'Error loading shared library libreadline.so.8: No such file or
directory'.

Add the readline package to the runtime stage so sqlite3 starts
cleanly.
2026-05-18 14:41:22 +03:00
TronoSfera
f9160a7686 fix(agent): env vars BACKUPY_* and accept 64-hex agent keys
Two defects exposed by the first real-world deployment (Flw VPS):
- Env tags were BACKUP_* (no Y). Server + dashboard use BACKUPY_*.
- agentKeyPattern only matched bkpy_(live|test)_<32 alnum>; server's
  generateAgentKey emits 64 lowercase hex chars. Accept both.
2026-05-18 14:17:54 +03:00
TronoSfera
f2a203d6cc docs: GHCR tags semver-formatted (0.1.0, not v0.1.0)
docker/metadata-action's semver template strips the v-prefix per Docker
image convention (matches postgres:16, redis:7, etc.). Update README +
compose snippet so users pull what we actually push.
2026-05-17 20:32:03 +03:00
TronoSfera
55571c7c4c docs: add docker-compose.example.yml (user-facing one-paste setup) 2026-05-17 20:26:14 +03:00
TronoSfera
cc96a0b773 fix: include apps/agent/internal/state package (gitignore was eating it)
The .gitignore rule "state/" was unanchored, so git also ignored
apps/agent/internal/state/ — the BoltDB-backed queue persistence
package. CI build failed with:
  internal/queue/queue.go:13:2: no required module provides package
  github.com/backupy/backupy/apps/agent/internal/state

Anchored the rule to repo root (/state/, /var/) so it only matches
the runtime data directory, never a Go package.
2026-05-17 20:26:04 +03:00
TronoSfera
8b0c978337 feat(initial): Backupy agent + backupy-decrypt CLI
Source ports from the TronoSfera/backupy-cloud monorepo:
- apps/agent/        — Go agent (WSS client, persistent queue, Docker
                       discovery, 5 DB drivers: PG/MySQL/Mongo/Redis/SQLite,
                       pre/post hooks, Prometheus metrics)
- apps/backupy-decrypt/ — standalone CLI for client-side decryption
- packages/proto/    — protobuf wire format (generated .pb.go committed
                       so the repo builds without protoc)
- docs/              — agent spec + wire-protocol contract

Apache-2.0 license. Image published to ghcr.io/tronosfera/backupy-agent
on every v* tag via .github/workflows/release.yml (multi-arch amd64+arm64).
2026-05-17 20:22:35 +03:00