Skip to content

fix(image): install ca-certificates so restic can reach HTTPS backup targets - #580

Open
nchornii wants to merge 1 commit into
keptinventory:mainfrom
nchornii:fix/image-ca-certificates
Open

nchornii wants to merge 1 commit into
keptinventory:mainfrom
nchornii:fix/image-ca-certificates

Conversation

@nchornii

Copy link
Copy Markdown

What and why

Fixes #573.

The runtime image has no system CA bundle (node:24 bookworm-slim ships none, and os-base doesn't install one). Node bundles its own roots, so Kept's own HTTPS calls work, but restic is a Go binary and reads /etc/ssl/certs. With an HTTPS S3 backup target (seen with Cloudflare R2) every restic request fails with x509: certificate signed by unknown authority. restic treats that as transient and retries without end, so kept admin backup and Admin → Status's snapshot list hang instead of failing.

This adds ca-certificates to the os-base install, pinned like the other OS packages to bookworm-security's version, 20250419~deb12u2 (architecture all, read from the Debian archive on 2026-11-18). ha-os builds on os-base, so the Home Assistant image gets it too.

What changes for people who run Kept: backups to AWS S3, R2, B2 and other HTTPS S3 endpoints work without a workaround. Until this is released, the workaround is mounting the host's CA bundle and setting SSL_CERT_FILE (which PASSED_ENV already forwards to restic); see #573.

Verified on a running install: with the host's bundle mounted through SSL_CERT_FILE, the same R2 target backs up normally, and the official restic/restic:0.19.1 image (which has CA certificates) reaches it at once.

Checks

  • bash scripts/ci-local.sh passes (or --fast, and say which steps you couldn't run): not run. The change is the Dockerfile only. Locally I built --target os-base on amd64: the pin resolves, /etc/ssl/certs/ca-certificates.crt is there, and restic in that stage reaches https://s3.amazonaws.com (a dummy key gets Access Denied at once, no x509 error). The full image, arm64 and the smoke test are left to images-amd64 / images-arm64.
  • Tests first, on their own database; the leak test and route catalogue updated for a new table or route: n/a, no tables or routes
  • Migrations are additive (a drop or rename takes two releases): n/a
  • New strings in every catalogue, Arabic in the house style; logical CSS; works at 375 px and 1280: n/a, no UI
  • Conventional commit messages; no AI attribution in commits or this description (D173)
  • The CLA signed (once, on your first pull request; see CONTRIBUTING.md)

…targets

The runtime image is based on node:24 bookworm-slim, which ships no system
CA bundle. Node bundles its own roots, so the app's own HTTPS calls work,
but restic is a Go binary and reads /etc/ssl/certs. Every request to an
HTTPS S3 target (seen with Cloudflare R2) failed with "x509: certificate
signed by unknown authority", which restic treats as transient and retries
without end, so `kept admin backup` and the snapshot list hung.

Pinned to bookworm-security's version like the other OS packages.

Fixes keptinventory#573
@nchornii
nchornii requested a review from a team as a code owner November 18, 2026 19:57
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@nchornii

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Nov 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backups to HTTPS S3 targets hang: the image has no CA certificates for restic

1 participant