fix: verify the metadata database certificate with sslmode=verify-full

- Switch every `metadata_db_sslmode` passed to bincraft in `.crow/` and `local/` from `require` to `verify-full`.
- Pass `sslrootcert = bincraft::postgres_sslrootcert("verify-full")` alongside `verify-full` in the scripts that call `DBI::dbConnect()` themselves, since libpq does not read the system trust store.
- Note in the README that the endpoint serves a Let's Encrypt certificate and how to verify it.

Part of rpkgs/bincraft#225.
This commit is contained in:
Patrick Schratz 2026-10-17 07:41:23 +00:00
commit 0c59dfb3df
No known key found for this signature in database
GPG key ID: 62050D5BC68AB6DC

View file

@ -10,7 +10,8 @@ con <- DBI::dbConnect(
port = 15432,
user = "r_binaries",
password = Sys.getenv("PGPASS"),
sslmode = "require"
sslmode = "verify-full",
sslrootcert = bincraft::postgres_sslrootcert("verify-full")
)
`%nin%` <- Negate(`%in%`)
@ -45,12 +46,12 @@ data <- dbGetQuery(
"SELECT name FROM single_builds WHERE platform = $1 AND arch = $2 and removed = FALSE;",
params = list(platform, arch)
)
removed_pkgs = get_removed_cran_packages(lubridate::interval(
removed_pkgs <- get_removed_cran_packages(lubridate::interval(
lubridate::today(),
lubridate::today() - 2
))$name
pkgs_db <- unique(data$name)
pkgs_db = setdiff(pkgs_db, removed_pkgs)
pkgs_db <- setdiff(pkgs_db, removed_pkgs)
pkgs <- setdiff(cran_pkgs, pkgs_db)
formatted_pkgs <- gsub(