Skip to content

fix(caddy): correct caddy-ratelimit commit SHA pin#304

Merged
Cre-eD merged 1 commit into
mainfrom
fix/caddy-ratelimit-sha
May 30, 2026
Merged

fix(caddy): correct caddy-ratelimit commit SHA pin#304
Cre-eD merged 1 commit into
mainfrom
fix/caddy-ratelimit-sha

Conversation

@Cre-eD

@Cre-eD Cre-eD commented May 30, 2026

Copy link
Copy Markdown
Contributor

Summary

The xcaddy --with line in caddy.Dockerfile pinned github.com/mholt/caddy-ratelimit at an invalid 40-char SHA: 16aecbb24beddc9095da2716fa8d3a30fa2dc8ea. The first 7 characters match the real commit, but the rest of the SHA was not a real revision in the upstream repository.

The correct full SHA for the "Add ipv4_prefix and ipv6_prefix options for subnet-based rate limiting" commit (2026-05-21) is 16aecbbcb8ca07dc1c671e263379606ff9493c55.

Verified:

$ curl -s "https://api.github.com/repos/mholt/caddy-ratelimit/commits/16aecbb" | jq '.sha'
"16aecbbcb8ca07dc1c671e263379606ff9493c55"

Effect on the 2026.5.42 release

go get rejected the bad revision (go: github.com/mholt/caddy-ratelimit@...: invalid version: unknown revision), the Docker build and push caddy matrix entry failed, and the other three matrix entries (kubectl, github-actions, cloud-helpers-aws) got cancelled mid-flight. The release tag was published but no docker images were pushed for 2026.5.42 → any consumer pointing wrappers at @2026.5.42 would fail at image pull.

Failed run: https://github.com/simple-container-com/api/actions/runs/26684021578

Why earlier preview builds passed

Most likely Go module proxy caching on short-SHA prefix lookups masked the issue intermittently — preview builds aren't a reliable signal for commit-pin correctness because xcaddy + the Go module proxy can sometimes accept a fabricated full SHA that prefix-matches a real one if a cache hit exists. The production-path build (no cache) failed loudly.

Fix

One-line change: replace the fabricated SHA with the real one. No behavior change beyond restoring the build.

Test plan

  • Docker build and push caddy succeeds in the matrix.
  • All four docker images push for the new release tag (2026.5.43 or whatever calver lands).
  • docker run --rm simplecontainer/caddy:<new-tag> caddy list-modules | grep http.handlers.rate_limit returns the module.

The xcaddy `--with` directive in caddy.Dockerfile pinned
github.com/mholt/caddy-ratelimit at an INVALID 40-char SHA:
`16aecbb24beddc9095da2716fa8d3a30fa2dc8ea`. The first 7 characters
match the real commit, but the rest of the SHA didn't correspond to
anything in the upstream repository.

The real SHA for that commit ("Add ipv4_prefix and ipv6_prefix options
for subnet-based rate limiting", 2026-05-21) is
`16aecbbcb8ca07dc1c671e263379606ff9493c55`.

Verified via:
  $ curl -s "https://api.github.com/repos/mholt/caddy-ratelimit/commits/16aecbb" \
      | jq '.sha'
  "16aecbbcb8ca07dc1c671e263379606ff9493c55"

Effect of the bad pin on the 2026.5.42 release: `go get` rejected the
invalid revision (`go: github.com/mholt/caddy-ratelimit@...: invalid
version: unknown revision`), the `Docker build and push caddy` job
failed, and the other three docker-build matrix entries got cancelled
mid-flight. The release tag `2026.5.42` was published but NO docker
images were pushed — consumer wrappers pointing at `@2026.5.42` would
fail at image pull because `simplecontainer/github-actions:2026.5.42`
doesn't exist.

This fix-forward restores the build. Why the earlier preview builds
passed despite the wrong SHA: most likely Go module proxy caching on
short-SHA prefix lookups masked the issue intermittently — preview
runs aren't a reliable signal for commit-pin correctness.

No behavior change beyond restoring the build. The intent (pin
caddy-ratelimit to the ipv4_prefix/ipv6_prefix + metrics commit on
main, since the only formal tag v0.1.0 predates those features) is
preserved exactly.

Signed-off-by: Dmitrii Creed <creeed22@gmail.com>
@github-actions

Copy link
Copy Markdown

Semgrep Scan Results

Repository: api | Commit: 1f4aa79

Check Status Details
✅ Semgrep Pass 0 total findings (no error/warning)

Scanned at 2026-05-30 13:50 UTC

@github-actions

Copy link
Copy Markdown

Security Scan Results

Repository: api | Commit: 1f4aa79

Check Status Details
✅ Secret Scan Pass No secrets detected
✅ Dependencies (Trivy) Pass 0 total (no critical/high)
✅ Dependencies (Grype) Pass 0 total (no critical/high)
📦 SBOM Generated 527 components (CycloneDX)

Scanned at 2026-05-30 13:50 UTC

@Cre-eD
Cre-eD merged commit 9affab3 into main May 30, 2026
21 checks passed
@Cre-eD
Cre-eD deleted the fix/caddy-ratelimit-sha branch May 30, 2026 15:02
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.

3 participants