feat(forgejo): allow loopback webhook destinations #2

Open
Alpers-Ai-Agent wants to merge 1 commit from Alpers-Ai-Agent/MyServers:agent/forgejo-webhook-hosts into main
Contributor

Why

The Forgejo→Hermes agent-trigger webhook needs a loopback destination: the
Hermes webhook adapter on this same host listens on 127.0.0.1:8644 on purpose,
so the trigger path never touches the public internet (unlike the GitHub route,
which needs a caddy path exception because GitHub delivers from outside).

Forgejo's ALLOWED_HOST_LIST defaults to external, which refuses loopback
targets — deliveries would fail with a host-not-allowed error.

Change

settings.webhook.ALLOWED_HOST_LIST = "external,loopback" in
hetzner/server-1/forgejo.nix — external stays first so Crow CI's own forge
webhooks (public ci. vhost) keep delivering unchanged.

Verification

  • nix-instantiate --parse clean.
  • Full nix build .#nixosConfigurations.hetzner-server-1.config.system.build.toplevel green.
  • nix eval …config.services.forgejo.settings.webhook.ALLOWED_HOST_LIST → external,loopback.

After merge+deploy, the Forgejo webhook on Alper/MyServers starts delivering;
the Hermes side (route script + dispatcher + subscription) is already live.

## Why The Forgejo→Hermes agent-trigger webhook needs a loopback destination: the Hermes webhook adapter on this same host listens on `127.0.0.1:8644` on purpose, so the trigger path never touches the public internet (unlike the GitHub route, which needs a caddy path exception because GitHub delivers from outside). Forgejo's `ALLOWED_HOST_LIST` defaults to `external`, which refuses loopback targets — deliveries would fail with a host-not-allowed error. ## Change `settings.webhook.ALLOWED_HOST_LIST = "external,loopback"` in `hetzner/server-1/forgejo.nix` — `external` stays first so Crow CI's own forge webhooks (public ci. vhost) keep delivering unchanged. ## Verification - `nix-instantiate --parse` clean. - Full `nix build .#nixosConfigurations.hetzner-server-1.config.system.build.toplevel` green. - `nix eval …config.services.forgejo.settings.webhook.ALLOWED_HOST_LIST` → `external,loopback`. After merge+deploy, the Forgejo webhook on `Alper/MyServers` starts delivering; the Hermes side (route script + dispatcher + subscription) is already live.
Forgejo's ALLOWED_HOST_LIST defaults to "external", which refuses
loopback targets. The Forgejo→Hermes agent-trigger webhook needs exactly
that: it delivers to http://127.0.0.1:8644/webhooks/forgejo-ac-agent on
the same host, where the Hermes webhook adapter listens loopback-bound
on purpose — keeping the trigger path off the public internet entirely
(no caddy exception needed, unlike the GitHub route).

"external" stays first so Crow CI's own forge webhooks (public ci.
vhost) keep delivering unchanged.
Author
Contributor

fj_ac_agent_selftest — pipeline smoke test; ignore this comment.

fj_ac_agent_selftest — pipeline smoke test; ignore this comment.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u agent/forgejo-webhook-hosts:Alpers-Ai-Agent-agent/forgejo-webhook-hosts
git switch Alpers-Ai-Agent-agent/forgejo-webhook-hosts

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff Alpers-Ai-Agent-agent/forgejo-webhook-hosts
git switch Alpers-Ai-Agent-agent/forgejo-webhook-hosts
git rebase main
git switch main
git merge --ff-only Alpers-Ai-Agent-agent/forgejo-webhook-hosts
git switch Alpers-Ai-Agent-agent/forgejo-webhook-hosts
git rebase main
git switch main
git merge --no-ff Alpers-Ai-Agent-agent/forgejo-webhook-hosts
git switch main
git merge --squash Alpers-Ai-Agent-agent/forgejo-webhook-hosts
git switch main
git merge --ff-only Alpers-Ai-Agent-agent/forgejo-webhook-hosts
git switch main
git merge Alpers-Ai-Agent-agent/forgejo-webhook-hosts
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Alper/MyServers!2
No description provided.