feat: route install script downloads through the Dapr download gateway (Scarf) - #1689
Draft
nelson-parente wants to merge 4 commits into
Draft
feat: route install script downloads through the Dapr download gateway (Scarf)#1689nelson-parente wants to merge 4 commits into
nelson-parente wants to merge 4 commits into
Conversation
Artifact downloads in install.sh and install.ps1 now default to the Dapr download gateway (Scarf), which redirects to GitHub Releases and provides the project with anonymous download counts. Both scripts fall back to GitHub Releases automatically if the gateway is unreachable, and the download base is overridable (DAPR_DOWNLOAD_BASE / -DownloadBase). Version discovery and the darwin-arm64 availability probe remain on GitHub so existence checks are not counted as downloads. Signed-off-by: nelson.parente <nelson_parente@live.com.pt>
downloads.dapr.io has no DNS record, so the gateway attempt always failed and fell through to GitHub. Use the Scarf-provided subdomain, which resolves today and needs no dapr.io DNS change. Behaviour is otherwise unchanged: GitHub Releases remains the fallback, and DAPR_DOWNLOAD_BASE / -DownloadBase still bypass the gateway entirely. Signed-off-by: nelson.parente <nelson_parente@live.com.pt>
nelson-parente
force-pushed
the
scarf-download-gateway
branch
from
August 19, 2026 08:54
5512251 to
f21e6a8
Compare
The provisioned Scarf route resolves the artifact name itself from the
platform and arch path segments; it does not accept a filename. The
previous URLs (/{version}/{filename}) 404'd, so every install fell back
to GitHub and nothing was counted.
install.sh now builds the gateway URL from OS/ARCH, while any override of
DAPR_DOWNLOAD_BASE keeps the GitHub-shaped /{version}/{filename} form, so
the documented bypass is unchanged.
install.ps1 defaults the gateway off: the route template resolves to
.tar.gz, but the Windows artifact is a .zip, so every Windows request
would 404 and print a fallback warning. It can be turned on by setting
-DownloadBase once a Windows route exists in Scarf.
Signed-off-by: nelson.parente <nelson_parente@live.com.pt>
The Scarf package now carries a Windows route resolving
/cli/{version}/windows/{arch} to the .zip artifact, so install.ps1 can use
the gateway like install.sh does. Verified end-to-end across v1.15.0 and
v1.14.1 for windows/amd64 plus all linux and darwin targets: the gateway
returns 307 and the redirect target returns 200 in every case.
GitHub Releases remains the automatic fallback and -DownloadBase '' still
bypasses the gateway entirely.
Signed-off-by: nelson.parente <nelson_parente@live.com.pt>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR routes the install scripts' artifact downloads through the Dapr download gateway (Scarf) instead of hitting GitHub Releases directly, giving the project anonymous download counts for the CLI.
Context: the project already uses Scarf for analytics — the docs.dapr.io footer carries a Scarf pixel, and Scarf.sh is listed as a community-managed analytics tool in COMMUNITY-MANAGER.md. Scarf is also one of the analytics services CNCF makes available to its projects (CNCF hosted tools). The gateway is a plain redirect layer: it returns a 307 to the exact same GitHub Releases artifact and serves no bytes itself. The
Dapr CLIScarf package has existed since December 2022 and was never pointed at anything; this is the first change that uses it.Changes:
install.sh: artifact downloads default tohttps://dapr.gateway.scarf.sh/cli/<version>/<platform>/<arch>, overridable viaDAPR_DOWNLOAD_BASE. The gateway resolves the artifact filename itself from the platform and arch segments, so its URLs are shaped differently from GitHub's — anyDAPR_DOWNLOAD_BASEother than the gateway is treated as GitHub-shaped (<base>/<version>/<artifact>), which keeps the documented bypass working unchanged. Automatic fallback to GitHub Releases if the gateway is unreachable.curlnow uses-f, so HTTP errors are detected instead of saving an error page (pre-existing gap). Version discovery (releases.atom) and the darwin-arm64 availability probe intentionally stay on GitHub — the probe is an existence check and should not be counted as a download.install.ps1: new-DownloadBaseparameter (same default). Tries the gateway first, falls back to the GitHub API asset URL on failure. The GitHub auth header is not sent to the gateway.CustomAssetFactoryusers skip the gateway entirely. Windows resolves to the.zipartifact via a dedicated route, since the other platforms are.tar.gz.dapr.msi, and direct-GitHub install paths are untouched and remain uncounted.Privacy: the gateway derives coarse company and location information from the requesting IP to produce download counts, and does not retain the raw IP or expose it in reporting. Anyone preferring to bypass it entirely can set
DAPR_DOWNLOAD_BASE/-DownloadBasetohttps://github.com/dapr/cli/releases/download.Verification: every platform route was checked end-to-end — the gateway returns 307 and the redirect target returns 200 — across two releases:
/cli/{version}/windows/amd64dapr_windows_amd64.zip/cli/{version}/linux/amd64dapr_linux_amd64.tar.gz/cli/{version}/linux/arm64dapr_linux_arm64.tar.gz/cli/{version}/linux/armdapr_linux_arm.tar.gz/cli/{version}/darwin/amd64dapr_darwin_amd64.tar.gz/cli/{version}/darwin/arm64dapr_darwin_arm64.tar.gz12/12 passing on
v1.15.0andv1.14.1. A full install was also exercised on macOS (arm64) against an unprovisioned gateway, which validates the fallback path end-to-end.Remaining before merge:
/cli/{version}/{platform}/{arch}, plus the Windows.ziproute)Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: N/A — opened as a draft proposal; happy to open a tracking issue (here or in dapr/community) for the download-analytics initiative if maintainers prefer.
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: