1 Commits
Author SHA1 Message Date
sneak ce0824b253 VACUUM snapshot metadata through the sqlite driver, not a CLI (closes #120)
check / check (pull_request) Failing after 1s
snapshot create vacuumed the exported metadata database by shelling out
to a sqlite3 binary, so a backup failed at the very end on any host
without that CLI. vacuumDatabase now opens the database with the
modernc.org/sqlite driver and runs VACUUM through it, outside any
transaction; internal/snapshot no longer imports os/exec. The database
opens in WAL mode, so the close after VACUUM checkpoints the rewrite
into the main file that is compressed and uploaded. A new test deletes
marked rows, vacuums, and asserts the file shrank and no longer holds
the deleted bytes. script/bootstrap and the Dockerfile stop installing
the CLI in both the test-build and the shipped runtime stage, so the
image no longer carries the dependency this change removes.

Model: opus-4-8
2026-09-21 17:10:12 +00:00
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ RUN CGO_ENABLED=0 go build -ldflags "-X 'sneak.berlin/go/vaultik/internal/global
# alpine:3.21, 2026-02-25 # alpine:3.21, 2026-02-25
FROM alpine:3.21@sha256:c3f8e73fdb79deaebaa2037150150191b9dcbfba68b4a46d70103204c53f4709 FROM alpine:3.21@sha256:c3f8e73fdb79deaebaa2037150150191b9dcbfba68b4a46d70103204c53f4709
RUN apk add --no-cache ca-certificates sqlite RUN apk add --no-cache ca-certificates
# Copy binary from builder # Copy binary from builder
COPY --from=builder /vaultik /usr/local/bin/vaultik COPY --from=builder /vaultik /usr/local/bin/vaultik
+4 -3
View File
@@ -30,9 +30,10 @@ release" is exactly the contradiction
out to the external `sqlite` command-line binary (issue #120). A out to the external `sqlite` command-line binary (issue #120). A
backup no longer needs that binary on `PATH`, so `make check` passes backup no longer needs that binary on `PATH`, so `make check` passes
on a stock `go install` host; `script/bootstrap` and the `Dockerfile` on a stock `go install` host; `script/bootstrap` and the `Dockerfile`
test image no longer install it, and a new test asserts the uploaded (both the test-build and the shipped runtime stage) no longer install
database keeps no pages from deleted rows. Dropped the now-false note it, and a new test asserts the uploaded database keeps no pages from
on the 2026-08-07 entry below that said bootstrap installs it. deleted rows. Dropped the now-false note on the 2026-08-07 entry below
that said bootstrap installs it.
- 2026-09-21: Made `.gitea/workflows/check.yml` run on pushes to `main` - 2026-09-21: Made `.gitea/workflows/check.yml` run on pushes to `main`
and `next` and on pull requests against either, so unit PRs (whose and `next` and on pull requests against either, so unit PRs (whose
base is `next`) and `next` itself get a CI run instead of relying on a base is `next`) and `next` itself get a CI run instead of relying on a