Skip to content

Add release download script - #123

Merged
LarsLaskowski merged 4 commits into
mainfrom
codex/add-release-download-script
Aug 22, 2026
Merged

Add release download script#123
LarsLaskowski merged 4 commits into
mainfrom
codex/add-release-download-script

Conversation

@LarsLaskowski

Copy link
Copy Markdown
Owner

Pull Request

📖 Description

Automating release retrieval avoids requiring users to manually resolve the latest tag and select a package architecture.

🎫 Issues

N/A

👩‍💻 Reviewer Notes

None

📑 Test Plan

✅ Checklist

General

  • I have added/updated tests for my changes (go test ./... -race -cover passes locally).
  • go vet ./... and golangci-lint run are clean.
  • I have tested my changes.
  • I have read the CONTRIBUTING documentation and followed the project's code style guidelines.
  • I have updated ARCHITECTURE.md if this changes a documented design decision.

REST API / configuration / packaging

  • I have updated docs/API.md to reflect a REST API change.
  • No breaking change to /api/v1/... response shapes, or a new API version
    (/api/v2/...) was introduced instead.
  • I have updated README.md / packaging/pimonitor.example.yaml to reflect a new or
    changed configuration option.
  • I have updated packaging/install.sh or the systemd units if this changes
    installation/packaging, and kept the unprivileged/privileged service split intact
    (see SECURITY.md).

⏭ Next Steps

None

Automating release retrieval avoids requiring users to manually resolve the latest tag and select a package architecture.

@LarsLaskowski LarsLaskowski left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the new packaging/download-latest.sh release helper against this repo's conventions (error handling, command execution safety, and consistency with the existing manual instructions in README.md). go build/go vet/go test ./... -race -cover all pass on this branch (unaffected by this change). One correctness issue inline.

Comment thread packaging/download-latest.sh Outdated

LarsLaskowski commented Aug 22, 2026

Copy link
Copy Markdown
Owner Author

SonarCloud flagged two shell:S6506 findings on packaging/download-latest.sh (redirects not restricted to HTTPS, lines 45 and 64). Opened #124 against this PR's branch with a fix — both the API-metadata request and the release-archive download now go through curl --proto '=https' --proto-redir '=https'; the archive download switches from wget to that same call, since wget has no equivalent guard against an HTTP-downgrade redirect on a non-recursive download. Merging #124 into this branch should clear the SonarCloud check.

Enforce HTTPS-only redirects in download-latest.sh

SonarCloud flagged both curl/wget calls in the new release-download
script (rule shell:S6506): a redirect could silently downgrade the
transfer to plain HTTP, allowing a MITM to serve a tampered release.

- The GitHub API request now runs through a shared curl invocation
  with --proto '=https' --proto-redir '=https', which rejects both an
  insecure initial URL and an insecure redirect target.
- The release-archive download switches from wget to the same curl
  invocation, since wget (tested against a local redirecting server)
  has no equivalent way to reject an HTTP redirect target for a
  non-recursive download; --https-only only restricts recursive link
  following, not redirects. This also drops wget from the script's
  required-commands check.
@sonarqubecloud

Copy link
Copy Markdown

@LarsLaskowski
LarsLaskowski merged commit 012287c into main Aug 22, 2026
5 checks passed
@LarsLaskowski
LarsLaskowski deleted the codex/add-release-download-script branch August 22, 2026 11:53
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.

1 participant