Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
fix(build): close the gaps review found in the version-pinning change
Vlad Ligaic54f630a35c2
diff --git a/.github/actions/generate-openapi-spec/action.yml b/.github/actions/generate-openapi-spec/action.ymlindex 07e54f945e..d51d22fcce 100644--- a/.github/actions/generate-openapi-spec/action.yml+++ b/.github/actions/generate-openapi-spec/action.yml@@ -30,18 +30,22 @@ runs:using: "composite"steps:- name: Read pinned versions+ id: pinsshell: bash- # The base checkout predates this file, and its Dockerfile declares no ARG.+ # A step output, not GITHUB_ENV: this action runs twice in one job and+ # GITHUB_ENV would carry the first checkout's value into the second.run: |f="${{ inputs.source-path }}/build-versions.env"- if [ -f "$f" ]; then grep -E '^[A-Z_]+=' "$f" >> "$GITHUB_ENV"; fi+ v=""+ if [ -f "$f" ]; then v="$(grep -oE '^INFISICAL_CLI_VERSION=.+' "$f" | cut -d= -f2 || true)"; fi+ echo "cli=$v" >> "$GITHUB_OUTPUT"- name: Build the API imageuses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2with:context: ${{ inputs.source-path }}/backend- build-args: |- INFISICAL_CLI_VERSION=${{ env.INFISICAL_CLI_VERSION }}+ # Omitted when unknown; an explicit empty arg would override the ARG default.+ build-args: ${{ steps.pins.outputs.cli != '' && format('INFISICAL_CLI_VERSION={0}', steps.pins.outputs.cli) || '' }}load: truetags: ${{ inputs.container-name }}cache-from: type=gha,scope=openapi-specdiff --git a/.github/workflows/check-api-for-breaking-changes.yml b/.github/workflows/check-api-for-breaking-changes.ymlindex b7471001eb..cb2512d8eb 100644--- a/.github/workflows/check-api-for-breaking-changes.yml+++ b/.github/workflows/check-api-for-breaking-changes.yml@@ -28,6 +28,7 @@ on:- "backend/**"- ".github/workflows/check-api-for-breaking-changes.yml"- ".github/actions/generate-openapi-spec/**"+ - "build-versions.env"concurrency:group: check-api-breaking-${{ github.event.pull_request.number }}diff --git a/.github/workflows/check-dockerfile-pins.yml b/.github/workflows/check-dockerfile-pins.ymlindex 9eb63fb9b8..43d7a8f4f1 100644--- a/.github/workflows/check-dockerfile-pins.yml+++ b/.github/workflows/check-dockerfile-pins.yml@@ -24,7 +24,13 @@ jobs:want="$(grep -oE '^INFISICAL_CLI_VERSION=.+' build-versions.env | cut -d= -f2)"echo "build-versions.env: $want"bad=0- for f in $(grep -rl 'ARG INFISICAL_CLI_VERSION=' --include='Dockerfile*' .); do+ files="$(grep -rl 'ARG INFISICAL_CLI_VERSION=' --include='Dockerfile*' . || true)"+ n="$(printf '%s\n' "$files" | grep -c . || true)"+ if [ "$n" -lt 5 ]; then+ echo "::error::Expected 5 Dockerfiles declaring the ARG, found $n. A rename would make this check pass while asserting nothing."+ bad=1+ fi+ for f in $files; dogot="$(grep -oE '^ARG INFISICAL_CLI_VERSION=.+' "$f" | cut -d= -f2)"if [ "$got" != "$want" ]; thenecho "::error file=$f::ARG default is $got, build-versions.env says $want"diff --git a/.github/workflows/publish-fips-toolchain.yml b/.github/workflows/publish-fips-toolchain.ymlindex ed3ba1e3f6..5df3b3e6dc 100644--- a/.github/workflows/publish-fips-toolchain.yml+++ b/.github/workflows/publish-fips-toolchain.yml@@ -18,6 +18,7 @@ on:paths:- "backend/Dockerfile.fips-toolchain"- ".github/workflows/publish-fips-toolchain.yml"+ - "build-versions.env"workflow_dispatch:concurrency:diff --git a/.github/workflows/run-backend-bdd-tests.yml b/.github/workflows/run-backend-bdd-tests.ymlindex 049b954237..b7d1915df2 100644--- a/.github/workflows/run-backend-bdd-tests.yml+++ b/.github/workflows/run-backend-bdd-tests.yml@@ -8,6 +8,7 @@ on:- "!backend/README.md"- "!backend/.*"- "backend/.eslintrc.js"+ - "build-versions.env"workflow_call:jobs:diff --git a/.github/workflows/run-backend-tests.yml b/.github/workflows/run-backend-tests.ymlindex 751503f289..d8760e9044 100644--- a/.github/workflows/run-backend-tests.yml+++ b/.github/workflows/run-backend-tests.yml@@ -8,6 +8,7 @@ on:- "!backend/README.md"- "!backend/.*"- "backend/.eslintrc.js"+ - "build-versions.env"workflow_call:concurrency:@@ -81,7 +82,7 @@ jobs:echo "Using published toolchain $IMAGE:$TAG"TOOLCHAIN="$IMAGE:$TAG"else- echo "::notice::No published toolchain for $TAG (this PR changes backend/Dockerfile.fips-toolchain); building from source."+ echo "::notice::No published toolchain for $TAG (this PR changes backend/Dockerfile.fips-toolchain or build-versions.env); building from source."TOOLCHAIN="backend-fips-toolchain:$TAG"set -a; . ./build-versions.env; set +adocker build \diff --git a/CLAUDE.md b/CLAUDE.mdindex 459f9074ba..b3ef73897a 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -23,6 +23,7 @@ infisical/├── wasm/ # Rust crates compiled to WASM for the frontend (see wasm/<crate>/CLAUDE.md)├── e2e/ # External Playwright suite — gates prod deploys against gamma (see e2e/CLAUDE.md)├── docs/ # Documentation site (Mintlify-based)+├── build-versions.env # Versions pinned across several Dockerfiles (see Dependency Policy)├── docker-compose.dev.yml # Local dev (PostgreSQL, Redis, backend, frontend, Nginx)├── docker-compose.prod.yml # Production deployment stack├── docker-compose.bdd.yml # BDD testing environment@@ -52,6 +53,12 @@ Infisical supports self-hosted deployment via Docker. Key considerations:### Dependency Policy+`build-versions.env` holds versions that several Dockerfiles install, currently the bundled+Infisical CLI. Each Dockerfile keeps a matching `ARG` default so external builders (Northflank,+Render, a plain `docker build`) work without passing anything, and CI and compose override it from+that file. `check-dockerfile-pins.yml` fails a PR when the defaults drift from it, so change the+file and the `ARG` defaults together.+Both `backend/` and `frontend/` enforce a minimum release age of 7 days for npm packages (configured via `.npmrc` in each directory). This means `npm install` will only resolve package versions published at least 7 days ago, as a supply-chain security measure.## Cross-Cutting Patternsdiff --git a/backend/Dockerfile.dev b/backend/Dockerfile.devindex 48d349f986..9da3ea7c03 100644--- a/backend/Dockerfile.dev+++ b/backend/Dockerfile.dev@@ -14,6 +14,8 @@ RUN ARCH=$(dpkg --print-architecture) && \elif [ "$ARCH" = "arm64" ]; then \ORACLE_ZIP="instantclient-basic-linux.arm64-23.26.0.0.0.zip" && \EXPECTED_SHA="9c9a32051e97f087016fb334b7ad5c0aea8511ca8363afd8e0dc6ec4fc515c32"; \+ else \+ echo "Unsupported architecture: $ARCH" >&2 && exit 1; \fi && \ORACLE_URL="https://download.oracle.com/otn_software/linux/instantclient/2326000/${ORACLE_ZIP}" && \wget -q "$ORACLE_URL" && \@@ -49,7 +51,6 @@ RUN apt-get update && apt-get install -y \wget \perl \pkg-config \- unzip \libaio1t64 \unixodbc \unixodbc-dev \diff --git a/backend/Dockerfile.fips-toolchain b/backend/Dockerfile.fips-toolchainindex 7ca14149f5..abd3c40922 100644--- a/backend/Dockerfile.fips-toolchain+++ b/backend/Dockerfile.fips-toolchain@@ -36,6 +36,8 @@ RUN ARCH=$(dpkg --print-architecture) && \elif [ "$ARCH" = "arm64" ]; then \ORACLE_ZIP="instantclient-basic-linux.arm64-23.26.0.0.0.zip" && \EXPECTED_SHA="9c9a32051e97f087016fb334b7ad5c0aea8511ca8363afd8e0dc6ec4fc515c32"; \+ else \+ echo "Unsupported architecture: $ARCH" >&2 && exit 1; \fi && \ORACLE_URL="https://download.oracle.com/otn_software/linux/instantclient/2326000/${ORACLE_ZIP}" && \wget -q "$ORACLE_URL" && \@@ -68,7 +70,6 @@ RUN apt-get update && apt-get install -y \pkg-config \perl \wget \- unzip \libaio1t64 \unixodbc \unixodbc-dev \diff --git a/build-versions.env b/build-versions.envindex ee56a45599..db064bfc55 100644--- a/build-versions.env+++ b/build-versions.env@@ -1,5 +1,5 @@# Single source of truth for versions pinned across multiple Dockerfiles.# Read by the Makefile for compose builds and by CI for image builds.-# Dockerfiles declare the ARG without a default, so a build that does not pass-# it fails loudly rather than silently installing an unpinned version.+# The Dockerfiles carry matching ARG defaults so external builders work unaided;+# check-dockerfile-pins.yml asserts those defaults still match this file.INFISICAL_CLI_VERSION=0.43.128diff --git a/docker-compose.bdd.yml b/docker-compose.bdd.ymlindex fd4d1c35e7..7359997e9e 100644--- a/docker-compose.bdd.yml+++ b/docker-compose.bdd.yml@@ -42,7 +42,7 @@ services:context: ./backenddockerfile: Dockerfile.devargs:- INFISICAL_CLI_VERSION: "${INFISICAL_CLI_VERSION:?not set - run via make, or source build-versions.env first}"+ INFISICAL_CLI_VERSION: "${INFISICAL_CLI_VERSION:?not set - run: set -a; . ./build-versions.env; set +a}"depends_on:db:condition: service_starteddiff --git a/docker-compose.dev-read-replica.yml b/docker-compose.dev-read-replica.ymlindex dc368ddbba..dcb537c7c6 100644--- a/docker-compose.dev-read-replica.yml+++ b/docker-compose.dev-read-replica.yml@@ -85,7 +85,7 @@ services:context: ./backenddockerfile: Dockerfile.devargs:- INFISICAL_CLI_VERSION: "${INFISICAL_CLI_VERSION:?not set - run via make, or source build-versions.env first}"+ INFISICAL_CLI_VERSION: "${INFISICAL_CLI_VERSION:?not set - run: set -a; . ./build-versions.env; set +a}"env_file: .envenvironment:- DB_CONNECTION_URI=postgres://infisical:infisical@db/infisical?sslmode=disable@@ -99,7 +99,7 @@ services:context: ./backenddockerfile: Dockerfile.devargs:- INFISICAL_CLI_VERSION: "${INFISICAL_CLI_VERSION:?not set - run via make, or source build-versions.env first}"+ INFISICAL_CLI_VERSION: "${INFISICAL_CLI_VERSION:?not set - run: set -a; . ./build-versions.env; set +a}"depends_on:db:condition: service_started