Skip to content

zip-archive

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/app-name.json:

config/app-name.json
{
"type": "ZIP_ARCHIVE",
"apiKeys": {
"REPLACE_WITH_A_LONG_RANDOM_SECRET": "gitlab-ci-token"
},
"dir": "/opt/app-name/config"
}

Create the ZIP (jar produces a clean archive with no manifest noise), then upload it:

.gitlab-ci.yml job
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-name

POST /dc-agent/zip-archive/{name} — {name} selects the config file and the request body is the raw ZIP.

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

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.