v0.8.0 — Hardening release
· 3 min read
v0.8.0 is a major hardening release rolling up four merged integration PRs. Every layer of the project — metrics correctness, HTTP server, container, CI/CD, docs — got polish. No breaking changes for default-config deployments; auth and tenant scoping remain opt-in.
Metrics correctness & performance
- Tenant-leak fix:
Conversation.estimatedDocumentCount()(which is tenant-blind by design) was replaced withcountDocuments({})so the tenant hook applies. Fixes inflatedlibrechat_cost_per_conversation_avgfor multi-tenant installs. - 6× redundant
$lookupagainstuserseliminated — all six places now use the pre-loadeduserIdToEmailmap. Material advanced-scrape speedup on large installs. allowDiskUse: trueadded to every$facet/$groupthat touches the fullmessagesortransactionscollection. Prevents Mongo's 100 MB in-memory aggregation limit from biting on real LibreChat installs.- Index assertions extended: now warns on missing recommended indexes for
messages.createdAt,messages.{isCreatedByUser,createdAt},files.user,transactions.user,transactions.conversationId.
HTTP hardening + optional auth
helmetapplied with sensible defaults (no CSP since/metricsreturns text, no CORP).compressionmiddleware — significant payload reduction on/metrics.express-rate-limitwith separate per-IP limiters for/metrics(default 120/min) and/health(600/min)./metricsauth — four optional methods, all off by default: static bearer (METRICS_BEARER_TOKEN), HTTP Basic (METRICS_BASIC_AUTH_USER+METRICS_BASIC_AUTH_PASSWORD), OAuth2/OIDC JWT (METRICS_OAUTH2_*), IP allowlist (METRICS_ALLOWED_IPS). Constant-time comparison; rate-limited reject logging. See Auth.METRICS_PORT— optionally bind/metricson a separate port so it can be internal-only while/healthstays public-reachable.
Tooling foundation
pinostructured logging — everyconsole.*call swapped for the singleton logger. Pretty in dev, JSON in prod.zodenv validation — every env var schema-checked at boot. Misconfig fails fast with a clear list of issues. Replaces ad-hocparseIntandenvFlag.vitest+ 46 tests acrossconfig,util,tenantHooks,metricsAuth. JWT signing + JWKS mocking vianockfor the OAuth2 path.prettier+husky+lint-stagedfor consistent style and pre-commit hooks.- tsconfig modernization:
target: ES2023,noUncheckedIndexedAccess: true,exactOptionalPropertyTypes: true,sourceMap: true.
Container + CI/CD
- Base image: distroless → Chainguard
cgr.dev/chainguard/node:latest. Daily rebuilds against the latest CVE fixes; currently zero CRITICAL/HIGH CVEs at every severity. - OCI labels + annotations via
docker/metadata-action— description, vendor, source, license, documentation all visible on the GHCR Packages page (no more "No description provided"). - SLSA build provenance + SBOM attestation via GitHub's native framework (
actions/attest-build-provenance@v4+actions/attest-sbom@v4).push-to-registry: falseso they live in GitHub's attestation DB and don't clutter GHCR. Verifiable withgh attestation verify oci://.... cosignkeyless signing of every published tag via Sigstore.- Multi-arch-safe cleanup workflow —
actions/delete-package-versions@v5is not manifest-aware (known upstream bugs); replaced withdataaxiom/ghcr-cleanup-action@v1which understands manifest lists, cosign signatures, and attestation referrers. - Weekly Trivy scan of the published
:latest— catches CVEs introduced after publish (base-image regression, new Debian advisories) and reports them to GitHub Code Scanning. - PR-time
docker buildadded to CI so Dockerfile regressions surface at review time, not after merge.
Upgrading
docker pull ghcr.io/rubentalstra/librechat-prom-exporter:0.8.0. No env-var changes needed for existing deployments.- New env vars are all opt-in: see Environment variables.
Thanks to everyone who reported issues during the integration PRs.
(A separate documentation site landed in v0.9.0 — that's the recommended way to read these docs going forward.)
