zip-archive
Purpose
Section titled “Purpose”Upload a ZIP archive and extract it into a directory on the host. The typical CI scenario:
ship a bundle of configuration files to /opt/<app>/config as part of a deploy, keeping the
files out of the application artifact itself.
Config
Section titled “Config”config/app-name.json:
{ "type": "ZIP_ARCHIVE", "apiKeys": { "REPLACE_WITH_A_LONG_RANDOM_SECRET": "gitlab-ci-token" }, "dir": "/opt/app-name/config"}type: ZIP_ARCHIVEapiKeys: REPLACE_WITH_A_LONG_RANDOM_SECRET: gitlab-ci-tokendir: /opt/app-name/configCreate the ZIP (jar produces a clean archive with no manifest noise), then upload it:
jar cfM configs.zip -C configs/ .
curl \ --data-binary @configs.zip \ --fail \ -H "api-key: $UPLOAD_KEY" \ https://dc-agent.example.com/dc-agent/zip-archive/app-namePOST /dc-agent/zip-archive/{name} — {name} selects the config file and the request body is
the raw ZIP.
Parameters
Section titled “Parameters”| Name | Description | Default | Required |
|---|---|---|---|
dir |
Directory the archive is extracted into | — | yes |
apiKeys |
Accepted secrets → owner labels | — | yes (without it every call gets 401) |
type |
ZIP_ARCHIVE; must match the endpoint — another type gets 401, a missing or misspelled one is accepted with a warning in the agent log |
— | recommended |
Result
Section titled “Result”The archive contents are extracted under dir. Extraction is guarded against
path-traversal (Zip Slip): any entry that would resolve outside dir — via ../ or an
absolute path — is rejected with an error. See Security.
- Success returns HTTP 200.
- A malformed archive or a traversal attempt returns an error response.