adze

command module
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 25 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Adze

A small webhook receiver that keeps your Docker Compose/Swarm services up to date.

Adze receives the webhook from the registry (or anything else), finds any Compose/swarm projects running that image, and pulls + redeploys them. No cron, no polling. Updates are queued and processed one at a time so nothing steps on anything else.

Works with Forgejo, Docker Hub and docker "distribution" based registry webhooks, or anything that can send a JSON body with an image field.

Configuration

Flag Env var Default Required Description
-addr ADDR :8080 N Address to listen on
-secret SECRET Y Shared secret(s) for webhook signatures, comma-separated
-danger-endpoints DANGER_ENDPOINTS 0 N Number of unauthenticated webhook endpoints to generate
-docker-config DOCKER_CONFIG /root/.docker N Path to the docker config directory inside the container (used to load docker credentials)
-webhook-url WEBHOOK_URL N URL to send notifications to when updates succeed or fail
-webhook-secret WEBHOOK_SECRET N Secret for signing outgoing notification webhooks
-include-only INCLUDE_ONLY false N Only update containers/services with the include label
-lock-dirs LOCK_DIRS true N Hold an exclusive flock on a Compose project's directory while updating it
-print-danger-endpoints PRINT_DANGER_ENDPOINTS false N Print the unauthenticated endpoint paths and exit
Directory locking

By default adze takes an exclusive flock on each Compose project's working directory before running up, and waits until the lock is free. Other tools that take the same lock (such as Drover) will not run Compose for that project at the same time. Set -lock-dirs=false (or LOCK_DIRS=false) to disable this. For locking to work, project directories must be mounted into the adze container at the same path as on the host; if a project's directory does not exist in the container, adze logs a warning and updates it without a lock.

Unauthenticated endpoints

If you have services that can't send signed webhooks, you can generate unauthenticated endpoints with -danger-endpoints <n> (or DANGER_ENDPOINTS). This creates n endpoints at /webhook/<guid> that accept requests without signature validation. The GUIDs are derived from your first configured secret, so they remain stable across restarts.

The paths are not logged. To see them, run adze with the same secret and endpoint count plus -print-danger-endpoints; it prints them and exits:

$ docker compose run --rm adze /adze -print-danger-endpoints
/webhook/a1b2c3d4-e5f6-7890-abcd-ef1234567890
/webhook/f9e8d7c6-b5a4-3210-fedc-ba0987654321

These endpoints are effectively passwords — treat the paths as secret.

Outgoing notifications

Adze can send webhook notifications to an external service whenever an update is processed. Set -webhook-url (or WEBHOOK_URL) to enable this. Two notifications are sent per project or service: one before the update starts and one after it completes.

Each notification payload is a POST request with a json payload, notifications are signed with HMAC-SHA256 when the webhook secret is set. The signature is sent in the X-Adze-Signature header.

Field Description
image The image that triggered the update
target The Compose project name or Swarm service name being updated
status pending , success, failure, or skipped
error Error message when status is failure, omitted otherwise
message Reason when status is skipped, omitted otherwise
owner Owner from the webhook or the image path, omitted if unknown
private false only for a public repository, and on Forgejo also a public owner
{
  "image": "myregistry/myapp",
  "target": "myproject",
  "status": "pending",
  "error": "",
  "owner": "myorg",
  "private": false
}
Updating adze's own stack

When adze runs as a Compose service, it never recreates its own container, as that would stop it mid-update. Other services in its project are still updated. If the updated image is the one adze's own container runs, adze logs a warning and sends a skipped notification; update adze manually.

Excluding containers from updates

To prevent a container or service from being updated, add the com.greboid.adze.excluded label. The label value is ignored.

Docker Compose
services:
  myapp:
    image: myregistry/myapp
    labels:
      - "com.greboid.adze.excluded"
Docker Swarm
docker service update --label-add com.greboid.adze.excluded myservice

Include-only mode

When -include-only (or INCLUDE_ONLY=true) is set, only containers and services with the com.greboid.adze.included label will be updated. All others are skipped, regardless of image match. In this mode the exclude label is ignored — if a container has the include label, it will be updated even if it also has the exclude label.

Docker Compose
services:
  myapp:
    image: myregistry/myapp
    labels:
      - "com.greboid.adze.included"
Docker Swarm
docker service update --label-add com.greboid.adze.included myservice

Running it

You need Docker with the Compose plugin available on the host. Adze needs access to the Docker socket and the filesystem containing your Compose files (it reads them directly, not through the Docker API).

Docker
# compose.yml
services:
  adze:
    image: ghcr.io/greboid/adze:latest
    environment:
      - ADDR=:8080
      - SECRET=your-webhook-secret
      - DOCKER_CONFIG=/docker
    ports:
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /path/to/your/compose/files:/path/to/your/compose/files:ro
      - /home/youruser/.docker:/docker:ro
docker compose up -d

Then point your registry webhook at http://<host>:8080/webhook.

Binary
go build -o adze .
./adze -addr :8080 -secret your-webhook-secret

Then point your registry webhook at http://<host>:8080/webhook.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL