Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

docker-hub-webhooks

БесплатноЗапускает вложенные скриптыНе проверен

Receive Docker Hub repository webhooks. Use when building a Docker Hub push webhook receiver, because Docker Hub webhooks are UNSIGNED — there is no signature…

hookdeckот hookdeck★ 104 звезды на GitHub

Об этом скилле

Docker Hub Webhooks

Docker Hub (hub.docker.com) is Docker Inc.'s container image registry. A Docker Hub repository webhook is configured per repository (repository → Webhooks tab → name + destination URL → Create) and fires on a push to that repository.

Two things make Docker Hub unlike most providers in this repo, and both must be reflected in your handler:

  1. There is no signature verification. None. No signature header, no shared secret, no HMAC, no timestamp, no token field, no auth option. The create form takes exactly two inputs — a name and a destination URL. You cannot verify that a POST came from Docker Hub.
  2. There is no event type. Docker Hub webhooks have exactly one trigger — a push — and the payload carries no event, type or action field, and the request carries no X-...-Event header. Do not write switch (event.type). Route on repository.repo_name and push_data.tag.

Scope note: this skill covers Docker Hub repository webhooks only. It does not cover Docker Build Cloud, Docker Scout integrations, the self-hosted distribution registry's notifications: endpoints (a different envelope, with its own optional custom headers), GitHub Container Registry registry_package webhooks, or Docker Engine events. Do not borrow payloads or auth from those.

When to Use This Skill

  • How do I receive Docker Hub webhooks?
  • How do I verify a Docker Hub webhook signature? (You can't — there is none.)
  • Is there an X-Docker-Signature / X-Hub-Signature header on Docker Hub webhooks? (No.)
  • How do I secure an unsigned Docker Hub push webhook endpoint?
  • How do I read push_data.tag, push_data.pusher and repository.repo_name?
  • Which Docker Hub webhook event types exist? (One trigger, no event field.)
  • What do I do with callback_url? (Nothing — it is legacy and unsupported.)
  • How do I handle dhi_metadata on a mirrored Docker Hardened Image repository?
  • Where is the image digest in the payload? (Not there — look it up via the Hub API.)

Verification (core): there is none — use a secret URL token

Docker Hub does not sign webhooks. Do not write an HMAC verifier, a signature-header check, a timestamp/replay window, or a shared-secret comparison against anything Docker Hub sends — none of those inputs exist, and inventing one produces a handler that only pretends to check. Docker also publishes no source-IP allowlist, so do not fabricate one.

The closest available control is a long random token you put in the URL you register, compared in constant time. This is a bearer secret in a URL: Docker Hub sees it, and it can leak through logs and proxies — rotate it and keep it out of access logs. A path segment and a ?token= query param are equally visible to Docker Hub; the path segment is a style preference, not a security gain. If the token env var is unset, fail closed (500) — never accept.

const crypto = require('crypto');

// NOT a Docker Hub signature — Docker Hub signs nothing. This is your own
// secret, placed in the URL you registered and echoed straight back to you.
function verifyUrlToken(provided, expected) {
  if (!expected) return null;               // unset => caller MUST fail closed (500)
  if (typeof provided !== 'string') return false;
  const a = Buffer.from(provided);
  const b = Buffer.from(expected);
  // Guard length first: timingSafeEqual throws on a length mismatch.
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.

Then layer on the controls that actually matter for an unsigned source:

  • Treat the payload as an untrusted hint, not a fact. Before deploying, promoting or pulling, re-confirm against Docker Hub itself: GET https://hub.docker.com/v2/namespaces/{namespace}/repositories/{repository}/tags/{tag} (operationId GetRepositoryTag) and check the tag exists and its tag_last_pushed / image digest are what you expect — and/or pull by digest rather than by tag. Auth: no header at all for a public repository; for a private one, a JWT obtained from POST /v2/auth/token with {"identifier": "<username or org>", "secret": "<PAT or OAT>"} — a raw PAT/OAT is not itself a bearer token for the Hub API, and an unrecognised bearer value turns a public repo's 200 into a 401.
  • Validate the shape defensively — require push_data.tag and repository.repo_name as non-empty strings, reject malformed bodies with 400.
  • Allowlist expected repositories (DOCKER_HUB_ALLOWED_REPOS) so someone who learns the URL cannot trigger actions for arbitrary repos.

See references/verification.md for the full rationale, the Hub API re-check, and the Hookdeck note.

The Payload

Documented example (from the

Полный SKILL.md на GitHub

Установить docker-hub-webhooks в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/express/.env.exampleexamples/express/README.mdexamples/express/package.jsonexamples/express/src/index.jsexamples/fastapi/.env.exampleexamples/fastapi/README.mdexamples/fastapi/main.pyexamples/fastapi/requirements.txtexamples/fastapi/test_webhook.pyexamples/nextjs/.env.exampleexamples/nextjs/README.mdexamples/nextjs/app/webhooks/docker-hub/[token]/route.tsexamples/nextjs/app/webhooks/docker-hub/route.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

Что делает скилл docker-hub-webhooks?

Receive Docker Hub repository webhooks. Use when building a Docker Hub push webhook receiver, because Docker Hub webhooks are UNSIGNED — there is no signature header, no shared secret, no HMAC, no timestamp and no auth option, so signature verification is impossible and must be replaced with a secret URL token plus a re-check against the Docker Hub API. Use when parsing the push_data.tag / push_data.pusher / repository.repo_name payload, when handling the dhi_metadata object on mirrored Docker Hardened Image repositories, when asking why there is no event type field to switch on, or when wondering what to do about the legacy callback_url field.

Как установить скилл docker-hub-webhooks?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл docker-hub-webhooks запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить docker-hub-webhooks с