common: add jq to systemPackages
jq was only ever on the `path` of the units that call it, so it was absent from an interactive shell — which made the hook-migration commands in the README unrunnable on the host they target. It is a general-purpose tool and every host already carries curl, so it belongs alongside it rather than being pulled in per-unit. Also simplifies those README commands now that jq is present, and uses mars's existing `hermes` alias instead of spelling out the podman exec. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S94o42aQ8VkBmEWvDem5xa
This commit is contained in:
@@ -59,19 +59,21 @@ Retiring the pre-rename `gitea-events` route is therefore a one-off, done by
|
||||
hand after the first deploy of both hosts:
|
||||
|
||||
```
|
||||
# on mars — drop the old subscription
|
||||
sudo podman exec hermes-agent hermes webhook remove gitea-events
|
||||
# on mars — drop the old subscription (`hermes` is the alias in common.nix)
|
||||
hermes webhook remove gitea-events
|
||||
|
||||
# on jupiter — delete the old hook (it posts to the relay's bare /gitea path)
|
||||
api=http://127.0.0.1:3000/api/v1; repo=darman/homelab
|
||||
tok="$(sudo cat /run/secrets/gitea_provisioning_token)"
|
||||
old="$(curl -fsS -H "Authorization: token $tok" "$api/repos/$repo/hooks" \
|
||||
| jq -r '.[] | select(.config.url == "http://mars.orbit.sol:8645/gitea") | .id')"
|
||||
for id in $old; do
|
||||
curl -fsS -H "Authorization: token $tok" -X DELETE "$api/repos/$repo/hooks/$id"
|
||||
auth=(-H "Authorization: token $(sudo cat /run/secrets/gitea_provisioning_token)")
|
||||
for id in $(curl -fsS "${auth[@]}" "$api/repos/$repo/hooks" \
|
||||
| jq -r '.[] | select(.config.url == "http://mars.orbit.sol:8645/gitea") | .id'); do
|
||||
curl -fsS "${auth[@]}" -X DELETE "$api/repos/$repo/hooks/$id"
|
||||
done
|
||||
```
|
||||
|
||||
Or just delete it in the web UI: repo Settings -> Webhooks, the entry whose
|
||||
URL ends in `:8645/gitea` with no route after it.
|
||||
|
||||
Check `hermes webhook list` and the repo's webhook page afterwards; until the
|
||||
old hook is gone both it and the new one fire, so events arrive twice.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user