Raw files
A raw repository stores any file at any path. Use it for tarballs, installers, configuration bundles and other files that have no package format.
Repository URL
Section titled “Repository URL”https://repo.example.com/raw/<repo>/<path>The path can have any depth. The server keeps the path as you write it.
Upload
Section titled “Upload”An upload is a PUT with a publish session token as the password. Get a token from the UI or from CI. See Publishing overview.
curl -f -u publish:SESSION_TOKEN \ -T app-1.2.0.tar.gz \ https://repo.example.com/raw/downloads/app/app-1.2.0.tar.gzUse -f so that curl fails on an HTTP error.
Download
Section titled “Download”curl -fL -O https://repo.example.com/raw/downloads/app/app-1.2.0.tar.gzFor a private repository, add a read token:
curl -fL -u ci:READ_TOKEN -O https://repo.example.com/raw/downloads/app/app-1.2.0.tar.gzHEAD works too. On S3 storage with s3.redirect on, a GET answers 302 to a presigned URL, so use -L.
Overwrite policy
Section titled “Overwrite policy”Each raw repository has one policy in its config:
{"overwrite": "deny"}| Policy | New path | Same bytes | Different bytes |
|---|---|---|---|
deny (default) |
201 |
200 |
409 |
allow |
201 |
200 |
200, the file is replaced |
A PUT with identical bytes always succeeds, so a retry is safe. A file larger than max_upload_bytes gets 413.
An admin sets the policy in the repository config when they create the repository. They can change it later with PATCH /api/repos/<repo> and a new config. See HTTP API.
Gotchas
Section titled “Gotchas”- Writes need a publish session. A password or a read token on a
PUTgets401. - No directory listing over HTTP. Use the web UI to list files by path prefix.
- A mirrored repository is read only until you cut over from Nexus. See Nexus migration.