◉ Pulse
Loopcv avatar
#39 today

Loopcv/swarmhook

Go Tool

Push-to-deploy webhook for Docker Swarm. No SSH, no exposed daemon, no CI runner.

Created Jul 29, 2026
Stars
6
Today
+6
Forks
0
Quality
90/100
Momentum
19

README

Fetched from GitHub on Oct 30, 2026, 10:15 PM UTC · README.md

View original on GitHub

Third-party content — Open Source Pulse is not the owner of this repository.

This README belongs to Loopcv/swarmhook and its contributors. We fetch it directly from the project’s public GitHub repository and display it for reference only. All text, code, images and trademarks remain the property of their respective authors. See the repository for its license terms. Copyright / takedown policy.

Swarmhook

A tiny, self-hosted webhook that push-to-deploys Docker Swarm services — no SSH, no exposed Docker API, no CI runner on your infra.

How it works

  1. CI builds and pushes an image, e.g. ghcr.io/yourorg/api:abc123.
  2. CI POSTs {"image": "ghcr.io/yourorg/api:abc123", "version": "1.4.0"} to Swarmhook's /deploy endpoint, with a bearer token. version is optional and, if given, is included in the Slack notification.
  3. Swarmhook finds every Swarm service labeled autodeploy.enabled=true that's currently running an image from that same repository (any tag), and runs docker service update --image ... on it.
  4. Everything else is left untouched. Swarmhook never touches docker-compose.yml and never runs docker stack deploy.
  5. Optionally posts a summary to Slack.

Getting started

1. Build and push the image (must be run from a git clone — the binary's version is stamped in automatically from git):

docker build -t ghcr.io/yourorg/swarmhook:latest .
docker push ghcr.io/yourorg/swarmhook:latest

2. Create the required secrets on your Swarm manager:

openssl rand -hex 32   # this becomes your WEBHOOK_SECRET env var below
echo "yourdockerhubusername" | docker secret create dockerhub_username -
echo "yourdockerhubtoken"    | docker secret create dockerhub_password -
echo "https://hooks.slack.com/services/..." | docker secret create slack_webhook_url -  # optional

3. Deploy the stack — see examples/docker-compose.yml:

export WEBHOOK_SECRET=<the token you generated above>
docker stack deploy -c docker-compose.yml myapp

4. Label the services you want managed:

services:
  api:
    image: ghcr.io/yourorg/api:latest
    deploy:
      labels:
        - "autodeploy.enabled=true"

5. Trigger a deploy from CI:

curl -sf -X POST https://deploy.yourdomain.com/deploy \
  -H "Authorization: Bearer $WEBHOOK_SECRET" \
  -H "Content-Type: application/json" \
  -d "{\"image\": \"ghcr.io/yourorg/api:$GIT_SHA\", \"version\": \"$SERVICE_VERSION\"}"

Endpoints

  • POST /deploy — body: JSON {"image": "registry/repo:tag", "version": "1.4.0"}. version is optional and, if provided, is included in the Slack notification. Requires Authorization: Bearer <WEBHOOK_SECRET>.
  • GET /healthz — returns environment and version. No auth required.

Configuration

Env var Required Description
WEBHOOK_SECRET yes Bearer token required on every /deploy request.
ENVIRONMENT no Free-form label shown in logs and Slack.
SLACK_WEBHOOK_URL no Slack Incoming Webhook URL; omit to disable Slack.

Security notes

  • Put Swarmhook behind a reverse proxy with TLS — never expose it over plain HTTP.
  • Registry credentials are passed as Docker secrets, never plain env vars.
  • Swarmhook needs /var/run/docker.sock mounted, which is root-equivalent control of the host — restrict who can trigger deploys and keep the webhook secret out of logs.

License

MIT — see LICENSE.

Rendered by GitHub from the repository’s README. Scroll to read the full file.
First trending

Jul 30, 2026

first spotted on the list

Best rank

#39

highest position reached

Appearances

1

times on the trending list

Quality score

90

out of 100

Momentum

19

trend strength indicator

Star velocity

0.06

stars per day since creation

Activity — last 60 days

daily counts, collected every 6 hours
  • Stars
  • Forks
  • Merged PRs
  • Issues
  • Closed issues

Collecting activity data since launch — check back in a few days.

Star history

total stars per snapshot

Not enough snapshots yet — check back soon.

Rank history

position on trending · lower is better

Not enough snapshots yet — check back soon.

3D card for your website

Live HTML card with a glass surface and pointer tilt. Paste the iframe on any website.

<iframe src="https://www.notionpulse.cc/embed/Loopcv/swarmhook" width="420" height="240" style="border:0;max-width:100%;background:transparent" loading="lazy" title="Loopcv/swarmhook — trending on Open Source Pulse"></iframe>

Stars badge

Show current stars in your README or profile. Auto-updates every 6 hours.

Loopcv/swarmhook stars badge
Markdown
[![Loopcv/swarmhook](https://www.notionpulse.cc/api/badge/Loopcv/swarmhook.svg)](https://www.notionpulse.cc/repo/Loopcv/swarmhook)
HTML
<a href="https://www.notionpulse.cc/repo/Loopcv/swarmhook"><img src="https://www.notionpulse.cc/api/badge/Loopcv/swarmhook.svg" alt="Loopcv/swarmhook stars badge" /></a>

Repository of the Day

#39 Repository of the Day

Repository of the Week

#39 Repository of the Week

Repository of the Month

#39 Repository of the Month