Skip to content

Commit 8219155

Browse files
feat(ENG-9724): update generic docs (#313)
* feat(ENG-9724): update generic docs
1 parent 49a6941 commit 8219155

10 files changed

Lines changed: 337 additions & 23 deletions

File tree

Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
import { Tag, Note, BlockImage, Video } from '@/components';
2+
3+
import genericUpstream from './images/generic/generic-upstream.png';
4+
import upstreamIndex from './images/generic/generic-upstream-index.png';
5+
6+
# Generic Repository
7+
8+
<Note variant="note" headline="Early Access">
9+
The Generic format and upstreams are in Early Access. [Contact us](https://cloudsmith.com/company/contact-us) to enable it for your organization
10+
</Note>
11+
12+
Cloudsmith provides public & private repositories for Generic files
13+
14+
Cloudsmith supports Generic files, a flexible format for managing any file or binary that relies on specific file paths rather than semantic versioning.
15+
16+
<Note variant="note" headline="HTML-based upstreams">
17+
Generic upstreams work with simple HTML-based sources. The upstream must consist of simple, unstyled HTML pages with no JavaScript. Each page should contain only links to package files or subdirectories. Examples include Gradle distributions, Apache releases, and Node distributions.
18+
</Note>
19+
20+
<Note variant="note" headline="Contextual Documentation">
21+
The examples in this document are generic. Cloudsmith provides contextual setup instructions within each repository, complete with copy and paste snippets (with your namespace/repo pre-configured).
22+
</Note>
23+
24+
In the following examples:
25+
26+
| Identifier | Description |
27+
| :------------ | :---------------------------------------------------------------------------------------- |
28+
| OWNER | Your Cloudsmith account name or organization name (namespace) |
29+
| REPOSITORY | Your Cloudsmith Repository name (also called "slug") |
30+
| TOKEN | Your Cloudsmith Entitlement Token (see [Entitlements](/software-distribution/entitlement-tokens) for more details) |
31+
| USERNAME | Your Cloudsmith username |
32+
| PASSWORD | Your Cloudsmith password |
33+
| API-KEY | Your Cloudsmith API Key |
34+
| PATH_TO_FILE | The local path to the file you want to upload (e.g., `~/downloads/file.tar.gz`) |
35+
| FILEPATH | The repository path where the file will be stored (e.g., `path/to/file.tar.gz`) |
36+
| UPSTREAM_PREFIX | Optional upstream prefix (e.g., `node_distributions/`) for files cached from upstreams |
37+
38+
## Why Generic Format?
39+
40+
The Generic format is designed for artifacts that rely on specific file paths rather than semantic versions. Key benefits include:
41+
42+
- **Path-Based Identification**: Uses the filepath as the unique identifier, enabling exact replication of upstream directory structures
43+
- **Upstream Proxying and Caching**: Proxy and cache files from simple HTML-based upstream sources
44+
- **Supply Chain Management**: Bring custom scripts, installers, and binaries into your managed supply chain
45+
- **Consistent URLs**: Internal URLs remain consistent with upstream sources
46+
47+
### Generic vs Raw Format
48+
49+
The Generic format is optimized for path-based file distribution and upstream proxying. It relies strictly on the filepath as the unique identifier and does not support:
50+
- Package naming (separate from filepath)
51+
- Package versioning (semantic versions)
52+
- End User License Agreements (EULA)
53+
54+
If you need package naming, semantic versioning, or EULA support, use the [Raw format](/formats/raw-repository) instead. The Raw format provides traditional package management features including distinct package names, version tracking, and license acceptance workflows.
55+
56+
<Note variant="note" headline="File-Based Storage">
57+
Generic packages are treated as files and binaries. Unlike native package formats (Python, npm, Maven), Generic packages do not have metadata, version information, or vulnerability scanning capabilities. They are stored and served as-is without package-specific processing.
58+
</Note>
59+
60+
## Upload a File
61+
62+
### Upload via the Cloudsmith CLI
63+
64+
For full details of how to install and setup the Cloudsmith CLI, see [Command Line Interface](/developer-tools/cli)
65+
66+
The command to upload via the Cloudsmith CLI is:
67+
68+
```shell
69+
cloudsmith push generic OWNER/REPOSITORY PATH_TO_FILE --filepath FILEPATH
70+
```
71+
72+
Example:
73+
74+
```shell
75+
cloudsmith push generic your-account/your-repo ~/downloads/file.tar.gz --filepath distributions/latest/file.tar.gz
76+
```
77+
78+
<Note variant="note" headline="Filepath parameter">
79+
The `--filepath` parameter specifies where the file will be stored in the repository structure. This path becomes the unique identifier for the package and determines its download URL.
80+
</Note>
81+
82+
### Upload via Cloudsmith web app
83+
84+
Please see [upload a package](/artifact-management/package-upload) for details of how to upload via the Cloudsmith web app.
85+
86+
## Download a Package
87+
88+
### Download via Cloudsmith web app
89+
90+
#### Public Repositories
91+
92+
When logged into Cloudsmith via a Web Browser, use the Download button located within the traffic light button dropdown on the package details page to download a generic package.
93+
94+
#### Private Repositories
95+
96+
For downloading from a private repository via the Cloudsmith web app, use the Use Package button to download a generic package using the default Entitlement Token for the repository. Use the dropdown arrow within the pop-up window to select a different authentication method.
97+
98+
### Download via Command Line
99+
100+
To download a Generic package, fetch uploaded files using a well-crafted URL. The package URL format is based on the filepath used when uploading.
101+
102+
#### Public Repositories
103+
104+
```text
105+
https://generic.cloudsmith.io/public/OWNER/REPOSITORY/FILEPATH
106+
```
107+
108+
For files cached from an upstream with a prefix:
109+
110+
```text
111+
https://generic.cloudsmith.io/public/OWNER/REPOSITORY/UPSTREAM_PREFIX/FILEPATH
112+
```
113+
114+
Example `curl` commands to download a generic package from a public repository:
115+
116+
```shell
117+
curl -sLf -O 'https://generic.cloudsmith.io/public/OWNER/REPOSITORY/path/to/file.tar.gz'
118+
```
119+
120+
With upstream prefix:
121+
122+
```shell
123+
curl -sLf -O 'https://generic.cloudsmith.io/public/OWNER/REPOSITORY/node_distributions/latest/node-v4.9.1.tar.gz'
124+
```
125+
126+
#### Private Repositories
127+
128+
<Note variant="note" headline="Private Repositories">
129+
Private Cloudsmith repositories require authentication. You can choose between Entitlement Token Authentication or HTTP Basic Authentication. The setup method will differ depending on what authentication type you choose to use.
130+
</Note>
131+
132+
<Note variant="warning" headline="Secrets management">
133+
Entitlement Tokens, User Credentials, and API-Keys should be treated as secrets. You should ensure that you do not commit them in configurations files along with source code, or expose them in any logs.
134+
</Note>
135+
136+
Using Entitlement Token authentication:
137+
138+
```shell
139+
curl -sLf -O 'https://generic.cloudsmith.io/TOKEN/OWNER/REPOSITORY/FILEPATH'
140+
```
141+
142+
With upstream prefix:
143+
144+
```shell
145+
curl -sLf -O 'https://generic.cloudsmith.io/TOKEN/OWNER/REPOSITORY/UPSTREAM_PREFIX/FILEPATH'
146+
```
147+
148+
Using HTTP Basic authentication:
149+
150+
```shell
151+
curl -sLf -u "USERNAME:PASSWORD" -O 'https://generic.cloudsmith.io/basic/OWNER/REPOSITORY/FILEPATH'
152+
```
153+
154+
With upstream prefix:
155+
156+
```shell
157+
curl -sLf -u "USERNAME:PASSWORD" -O 'https://generic.cloudsmith.io/basic/OWNER/REPOSITORY/UPSTREAM_PREFIX/FILEPATH'
158+
```
159+
160+
## HTML Indexes
161+
162+
Cloudsmith supports serving Apache-style HTML formatted indexes of generic package files in the repository.
163+
164+
<Note variant="note" headline="Disabled by Default">
165+
HTML index generation is disabled by default. Enable it in [Repository Settings](/repositories/repository-settings) under the Generic section.
166+
</Note>
167+
168+
When HTML index is disabled, the repository only supports direct file downloads. Requests for specific files will still proxy and cache from configured upstreams (if the file exists on the upstream) or serve cached files from the repository.
169+
170+
When HTML index is enabled, requests to directory paths (without specifying a file) will return an HTML view showing the index of available files and subdirectories.
171+
172+
173+
When enabled, the HTML index is available at:
174+
175+
#### Public Repositories
176+
177+
```
178+
https://generic.cloudsmith.io/public/OWNER/REPOSITORY/
179+
```
180+
181+
#### Private Repositories
182+
183+
```shell Entitlement Token Auth
184+
https://generic.cloudsmith.io/TOKEN/OWNER/REPOSITORY/
185+
```
186+
```shell HTTP Basic Auth
187+
https://generic.cloudsmith.io/basic/OWNER/REPOSITORY/
188+
```
189+
190+
<Note variant="note" headline="Browser Access">
191+
To view the HTML index in a browser for private repositories, use `TOKEN` as the username and your entitlement token as the password when prompted for authentication.
192+
</Note>
193+
194+
<BlockImage src={upstreamIndex} alt="Generic Upstream Index"></BlockImage>
195+
196+
## Upstream Proxying / Caching
197+
198+
<Tag variant="dark-green" theme="legacy">Supported</Tag>
199+
200+
The Generic format supports upstream proxying and caching for simple HTML-based sources and select non-HTML sources. When a file is requested, Cloudsmith checks for a local copy. If missing, it fetches the file from the upstream, caches it as a first-class local package, and serves it.
201+
202+
### Supported Upstream Sources
203+
204+
The following upstream sources are explicitly supported and work out of the box:
205+
206+
- **Gradle** - Gradle distributions
207+
- **Node** - Node.js distributions
208+
- **Hashicorp** - Hashicorp releases
209+
- **Fluentbit** - Fluentbit distributions
210+
- **HTML-based sources** - Simple, unstyled HTML pages with no JavaScript, where each page contains only links to files or subdirectories (e.g., Apache releases, Project Gutenberg)
211+
212+
Generic format accepts any files or binaries, not just traditional software packages.
213+
214+
<Note variant="note" headline="Enterprise Repository Support">
215+
Enterprise repository managers like Artifactory and Sonatype Nexus require additional configuration and will not work out of the box. These sources also have practical size limits—repositories with millions of packages may not be processable. [Contact support](/support) to discuss setup for these upstream sources.
216+
</Note>
217+
218+
### Configure an Upstream
219+
220+
To configure an upstream for your Generic repository, browse to your repository overview page and click the **Upstreams** tab. Then, click **+ Add Upstream Proxy** and choose the **Generic** format upstream.
221+
222+
In the upstream creation menu, define a name for your upstream and enter the upstream URL. Optionally specify an **Upstream Prefix** to prevent file collisions when using multiple upstreams. The prefix becomes part of the file's permanent path in the repository, ensuring files from different upstreams never collide even with identical filenames.
223+
224+
<BlockImage src={genericUpstream} alt="Generic Upstream Configuration"></BlockImage>
225+
226+
Please see our [Upstream Proxying](/repositories/upstreams#create-a-generic-upstream) documentation for further instructions on configuring upstreams.
227+
228+
### Upstream Priority
229+
230+
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.
231+
232+
Local packages (directly uploaded to the repository) always take precedence over upstream packages. When viewing the HTML index, cached packages display with a different icon than packages that will be proxied on demand.
233+
234+
## Key Signing Support
235+
236+
<Tag variant="blue" theme="legacy">GPG</Tag>
237+
238+
Please see [Package Signing](/supply-chain-security/signing-keys) for information about key support by package format.
239+
240+
## Troubleshooting
241+
242+
Please see the [Troubleshooting](/troubleshooting) page for further help and information.
76.5 KB
Loading
402 KB
Loading

src/content/menu.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@
7474
"title": "Docker",
7575
"path": "/formats/docker-registry"
7676
},
77+
{
78+
"title": "Generic",
79+
"path": "/formats/generic-repository"
80+
},
7781
{
7882
"title": "Go",
7983
"path": "/formats/go-registry"
@@ -365,7 +369,7 @@
365369
{
366370
"title": "API Key Policy",
367371
"path": "/policy-management/api-key-policy"
368-
},
372+
},
369373
{
370374
"title": "License Policy",
371375
"path": "/policy-management/license-policy"
@@ -379,11 +383,11 @@
379383
{
380384
"title": "Enterprise Policy Manager",
381385
"path": "/supply-chain-security/epm",
382-
"children":[
386+
"children":[
383387
{
384388
"title": "Getting Started",
385389
"path": "/supply-chain-security/epm/getting-started"
386-
},
390+
},
387391
{
388392
"title": "Rego Recipes",
389393
"path": "/supply-chain-security/epm/rego"
@@ -397,11 +401,11 @@
397401
{
398402
"title": "Malware Detection",
399403
"path": "/supply-chain-security/malware-detection",
400-
"children":[
404+
"children":[
401405
{
402406
"title": "Malware Scanning",
403407
"path": "/supply-chain-security/malware-detection/malware-scanning"
404-
},
408+
},
405409
{
406410
"title": "Malicious Packages",
407411
"path": "/supply-chain-security/malware-detection/malicious-packages"
@@ -605,7 +609,7 @@
605609
{
606610
"title": "Renovate",
607611
"path": "/integrations/integrating-with-renovate"
608-
},
612+
},
609613
{
610614
"title": "Semaphore CI",
611615
"path": "/integrations/integrating-with-semaphore-ci"
@@ -621,11 +625,11 @@
621625
{
622626
"title": "TeamCity",
623627
"path": "/integrations/integrating-with-teamcity"
624-
},
628+
},
625629
{
626630
"title": "Theia IDE",
627631
"path": "/developer-tools/vscode"
628-
},
632+
},
629633
{
630634
"title": "Travis CI",
631635
"path": "/integrations/integrating-with-travis-ci"
402 KB
Loading

0 commit comments

Comments
 (0)