diff --git a/src/content/formats/generic-repository.mdx b/src/content/formats/generic-repository.mdx index 3f2a8aea..c052830a 100644 --- a/src/content/formats/generic-repository.mdx +++ b/src/content/formats/generic-repository.mdx @@ -233,9 +233,11 @@ In the upstream creation menu, define a name for your upstream and enter the ups Please see our [Upstream Proxying](/repositories/upstreams#create-a-generic-upstream) documentation for further instructions on configuring upstreams. -### Example: Node.js Distributions +### Examples -This example demonstrates how upstream URLs, prefixes, and file paths work together. +#### Node.js Distributions + +This example demonstrates how upstream URLs, prefixes, and file paths are applied when working with Node.js distributions. **Upstream configuration:** - **Upstream URL**: `https://nodejs.org/dist/` @@ -261,6 +263,33 @@ curl -sLf -O 'https://generic.cloudsmith.io/OWNER/REPOSITORY/node_distributions/ The upstream prefix (`node_distributions`) ensures files from Node.js don't collide with files from other upstreams, even if they share identical file paths. +#### Github Releases + +This example demonstrates how upstream URLs, prefixes, and file paths are applied when working with GitHub Releases. + +**Upstream configuration:** +- **Upstream URL**: `https://api.github.com/repos///releases` +- **Upstream Prefix**: `github_releases` + +**How paths are resolved:** + +The upstream URL includes the base path (`/releases/`), so file paths are relative to that location. +To download `https://github.com/aquasecurity/trivy/releases/download/v0.69.3/trivy_0.69.3_Linux-ARM64.tar.gz`, request the path `v0.69.3/trivy_0.69.3_Linux-ARM64.tar.gz` from Cloudsmith: + +| Component | Value | +| :-------- | :---- | +| Upstream URL | `https://api.github.com/repos/aquasecurity/trivy/releases` | +| File path on upstream | `v0.69.3/trivy_0.69.3_Linux-ARM64.tar.gz` | +| Full upstream URL | `https://api.github.com/repos/aquasecurity/trivy/releases/v0.69.3/trivy_0.69.3_Linux-ARM64.tar.gz` | +| Upstream prefix | `github_releases` | +| Cloudsmith URL | `https://generic.cloudsmith.io/OWNER/REPOSITORY/github_releases/v0.69.3/trivy_0.69.3_Linux-ARM64.tar.gz` | + +**Download command:** + +```shell +curl -sLf -O 'https://generic.cloudsmith.io/OWNER/REPOSITORY/github_releases/v0.69.3/trivy_0.69.3_Linux-ARM64.tar.gz' +``` + ### Upstream Priority Upstream priority behaves differently for Generic repositories due to the nature of upstream prefixes. All upstreams within a prefix are given a priority of 1. Changing the priority setting does not impact package blending, as each upstream is uniquely namespaced within its own prefix.