-
Notifications
You must be signed in to change notification settings - Fork 0
audit: idempotency, hardening, and consistency improvements #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -116,15 +116,21 @@ labels: | |||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Tag Strategy | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| | Tag | Description | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| |:---|:---| | ||||||||||||||||||||||||||||||||||||||||||||||||||
| | `latest` | Always points to the most recent successful build | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| | `2` · `2.11` · `2.11.2` | Semantic version pins at major / minor / patch | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| | `2.11.2-2026.03.28` | Version + build date for fully reproducible deployments | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| | `sha-abc1234` | Git SHA of the Dockerfile at build time | | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| For production deployments requiring immutability, use the digest from the | ||||||||||||||||||||||||||||||||||||||||||||||||||
| [Releases](https://github.com/atnplex/caddy/releases) page. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| | Tag | Registry | Description | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| |:---|:---|:---| | ||||||||||||||||||||||||||||||||||||||||||||||||||
| | `latest` | GHCR · DockerHub | Always points to the most recent successful build | | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor documentation inconsistency: The note on lines 127-130 states "DockerHub receives only immutable tags" to prevent silent overwrites, yet line 121 shows Consider clarifying that DockerHub receives 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||
| | `2` · `2.11` | GHCR only | Floating semver major / minor tags — updated on every build | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| | `2.11.2` | GHCR · DockerHub | Patch-level version pin | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| | `2.11.2-2026.03.28` | GHCR · DockerHub | Version + build date for fully reproducible deployments | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| | `sha-abc1234` | GHCR · DockerHub | Git SHA of the Dockerfile at build time | | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| > **Note:** Floating major/minor tags (`2`, `2.11`) are only pushed to GHCR. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| > DockerHub receives only immutable tags (patch version, date-stamped, and SHA) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+123
to
+128
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| | `2.11.2` | GHCR · DockerHub | Patch-level version pin | | |
| | `2.11.2-2026.03.28` | GHCR · DockerHub | Version + build date for fully reproducible deployments | | |
| | `sha-abc1234` | GHCR · DockerHub | Git SHA of the Dockerfile at build time | | |
| > **Note:** Floating major/minor tags (`2`, `2.11`) are only pushed to GHCR. | |
| > DockerHub receives only immutable tags (patch version, date-stamped, and SHA) | |
| | `2.11.2` | GHCR only | Patch-level version pin | | |
| | `2.11.2-2026.03.28` | GHCR · DockerHub | Version + build date for fully reproducible deployments | | |
| | `sha-abc1234` | GHCR · DockerHub | Git SHA of the Dockerfile at build time | | |
| > **Note:** Floating major/minor tags (`2`, `2.11`) and patch-level tags (`2.11.2`) are only pushed to GHCR. | |
| > DockerHub receives only immutable tags (date-stamped and SHA-based) |
Copilot
AI
Apr 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This note says DockerHub receives immutable tags including the patch version, but the workflow tag list doesn’t currently publish the plain ${version}/patch tag to DockerHub. Please adjust the note (and/or the workflow) so DockerHub tag policy is described accurately.
| | `2.11.2` | GHCR · DockerHub | Patch-level version pin | | |
| | `2.11.2-2026.03.28` | GHCR · DockerHub | Version + build date for fully reproducible deployments | | |
| | `sha-abc1234` | GHCR · DockerHub | Git SHA of the Dockerfile at build time | | |
| > **Note:** Floating major/minor tags (`2`, `2.11`) are only pushed to GHCR. | |
| > DockerHub receives only immutable tags (patch version, date-stamped, and SHA) | |
| | `2.11.2` | GHCR only | Patch-level version pin (GHCR-only; not published to DockerHub) | | |
| | `2.11.2-2026.03.28` | GHCR · DockerHub | Version + build date for fully reproducible deployments | | |
| | `sha-abc1234` | GHCR · DockerHub | Git SHA of the Dockerfile at build time | | |
| > **Note:** Floating major/minor tags (`2`, `2.11`) and patch tags (for example, `2.11.2`) | |
| > are only pushed to GHCR. DockerHub receives only immutable tags (date-stamped and SHA) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This note contradicts the Tag Strategy table, which shows the latest tag being pushed to both GHCR and DockerHub. To maintain consistency, the note should clarify that latest is an exception to the immutability policy on DockerHub.
| > DockerHub receives only immutable tags (patch version, date-stamped, and SHA) | |
| > to prevent silent overwrites for users who may have pinned these tags in | |
| > compose files expecting stability. | |
| > DockerHub receives only immutable tags (patch version, date-stamped, and SHA) | |
| > and the latest floating tag. Major/minor floating tags (2, 2.11) are | |
| > excluded from DockerHub to prevent silent overwrites for users. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,10 +1,13 @@ | ||||||||||||||||||||||||||||||||||||
| # ───────────────────────────────────────────────────────────────── | ||||||||||||||||||||||||||||||||||||
| # Stage 1: Builder | ||||||||||||||||||||||||||||||||||||
| # ───────────────────────────────────────────────────────────────── | ||||||||||||||||||||||||||||||||||||
| # IMPORTANT: The tag here (CADDY_VERSION-builder) must match the | ||||||||||||||||||||||||||||||||||||
| # CADDY_VERSION ARG in Stage 2. When upgrading Caddy, update both | ||||||||||||||||||||||||||||||||||||
| # the ARG default below AND the digest here together. | ||||||||||||||||||||||||||||||||||||
| # The SHA digest is version-specific; Renovate keeps it up to date. | ||||||||||||||||||||||||||||||||||||
| # IMPORTANT: The ARG default below AND the tag in the FROM line must | ||||||||||||||||||||||||||||||||||||
| # always be kept in sync. When upgrading Caddy, update BOTH the ARG | ||||||||||||||||||||||||||||||||||||
| # default AND the image tag (and its SHA digest) together in one commit. | ||||||||||||||||||||||||||||||||||||
| # The FROM tag cannot reference the ARG directly because ARGs declared | ||||||||||||||||||||||||||||||||||||
| # before the first FROM are not in scope inside the build stage. | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+7
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment incorrectly states that the FROM tag cannot reference the ARG directly. In Docker, ARGs declared before the first FROM are specifically designed to be used in FROM instructions, as demonstrated on line 12. The need for manual synchronization is due to the hardcoded SHA digest being tied to a specific version, not a scoping limitation of the tag itself. |
||||||||||||||||||||||||||||||||||||
| # Renovate keeps the SHA digest up to date automatically; the tag and | ||||||||||||||||||||||||||||||||||||
| # ARG default must be updated manually (or via a Renovate customManager). | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+4
to
+10
|
||||||||||||||||||||||||||||||||||||
| # IMPORTANT: The ARG default below AND the tag in the FROM line must | |
| # always be kept in sync. When upgrading Caddy, update BOTH the ARG | |
| # default AND the image tag (and its SHA digest) together in one commit. | |
| # The FROM tag cannot reference the ARG directly because ARGs declared | |
| # before the first FROM are not in scope inside the build stage. | |
| # Renovate keeps the SHA digest up to date automatically; the tag and | |
| # ARG default must be updated manually (or via a Renovate customManager). | |
| # IMPORTANT: The ARG default below, the tag in the FROM line, and the | |
| # pinned SHA digest must always describe the same Caddy version. The | |
| # global ARG CADDY_VERSION is in scope for the FROM instruction and is | |
| # used in `caddy:${CADDY_VERSION}-builder@sha256:...`. | |
| # When upgrading Caddy, update ALL of the following together in one commit: | |
| # 1) the CADDY_VERSION ARG default, | |
| # 2) the tag portion of the FROM image reference, and | |
| # 3) the SHA256 digest. | |
| # Renovate keeps the SHA digest up to date automatically; the tag and ARG | |
| # default must be updated manually (or via a Renovate customManager). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment says the diff will "compare only the parts that are present in both fingerprints", but the implementation compares up to
MAX_IDXand usesMISSINGfor absent entries (i.e., it compares the union and explicitly reports missing parts). Consider updating the comment to match the current behavior to avoid confusion during future audits.