Close out HTTP upload documentation

This commit is contained in:
2026-06-03 15:30:02 +00:00
parent 0f1ef9e622
commit dc1f1f11f9
8 changed files with 116 additions and 664 deletions

View File

@@ -92,28 +92,29 @@ pipelines:
- id: reports
source:
backend: http_upload
token_env: REPORTS_UPLOAD_TOKEN
token_env: DISTRIBUTOR_EXAMPLE_UPLOAD_TOKEN
destinations:
- id: archive
backend: local
path: /srv/reports/archive
```
Create `/run/secrets/distributor/REPORTS_UPLOAD_TOKEN` or set the real process
environment variable before starting the server. Distributor does not read
literal upload tokens from YAML.
Create `/run/secrets/distributor/DISTRIBUTOR_EXAMPLE_UPLOAD_TOKEN` or set the
real process environment variable before starting the server. Distributor does
not read literal upload tokens from YAML.
Start the server:
Start the maintained local example:
```sh
go run ./cmd/distributor serve --config <config-path>
DISTRIBUTOR_EXAMPLE_UPLOAD_TOKEN=<token> \
go run ./cmd/distributor serve --config examples/http-upload-local.yml
```
Submit a tar or tar.gz source bundle:
```sh
curl -X POST http://127.0.0.1:8080/upload \
-H "Authorization: Bearer $REPORTS_UPLOAD_TOKEN" \
-H "Authorization: Bearer $DISTRIBUTOR_EXAMPLE_UPLOAD_TOKEN" \
-H "Content-Type: application/gzip" \
--data-binary @bundle.tar.gz
```