diff --git a/README.md b/README.md index 67d981b..90ee105 100644 --- a/README.md +++ b/README.md @@ -11,17 +11,23 @@ ## Automatic updates -The webhook service in [`deploy/webhook`](deploy/webhook) pulls this checkout +The webhook service in [`webhook`](webhook) pulls this checkout when Tangled sends a signed push event for `main`. Glance watches its config and included files, so it reloads them without a container restart. 1. Ensure `/var/lib/glance` is a Git checkout whose current branch tracks the desired Tangled remote and that UID `1000` can write to it. -2. Add the contents of [`deploy/webhook/compose.yml`](deploy/webhook/compose.yml) +2. Add the contents of [`webhook/compose.yml`](webhook/compose.yml) to the Compose project containing Glance. 3. Generate a secret with `openssl rand -hex 32` and set the result as `GLANCE_WEBHOOK_SECRET` in the Compose environment. -4. Run `podman compose up -d --build glance-updater` once. +4. Build the updater on the host, then start it: + + ```sh + podman build -t localhost/glance-updater:latest /var/lib/glance/webhook + podman compose up -d glance-updater + ``` + 5. In Tangled, open **Settings > Hooks** and create an active push webhook: - Payload URL: `https:///hooks/glance` - Secret: the same value as `GLANCE_WEBHOOK_SECRET` diff --git a/deploy/webhook/Dockerfile b/webhook/Dockerfile similarity index 100% rename from deploy/webhook/Dockerfile rename to webhook/Dockerfile diff --git a/deploy/webhook/compose.yml b/webhook/compose.yml similarity index 91% rename from deploy/webhook/compose.yml rename to webhook/compose.yml index 318e7cb..e919aed 100644 --- a/deploy/webhook/compose.yml +++ b/webhook/compose.yml @@ -1,7 +1,7 @@ services: glance-updater: - build: - context: /var/lib/glance/deploy/webhook + image: localhost/glance-updater:latest + pull_policy: never hostname: glance-updater restart: unless-stopped user: "1000:1000" diff --git a/deploy/webhook/hooks.json.tmpl b/webhook/hooks.json.tmpl similarity index 100% rename from deploy/webhook/hooks.json.tmpl rename to webhook/hooks.json.tmpl diff --git a/deploy/webhook/update.sh b/webhook/update.sh similarity index 100% rename from deploy/webhook/update.sh rename to webhook/update.sh