← All requests
0

Gitea verification fails with HTTP 500 when the Gitea server is on a private network

OpenIntegrationsSebastian Penhouet ·

What happened?

I connected a self-hosted Forgejo server on our LAN through the Gitea integration. The server resolves to a 10.x address. Choosing "Verify access" failed with HTTP 500 and the message "Gitea destination resolves to a non-routable address". Browsing repositories from the same form said "Invalid Gitea token or could not reach instance.", which sent me looking at the token first.

The cause is the private address guard, and setting KANEO_ALLOW_PRIVATE_WEBHOOK_DESTINATIONS=true fixes it. The Gitea setup guide does not mention that setting, though, and neither error points to it.

I expected verification to return a normal failure result that names the setting, like it does for redirects or a wrong URL, and the repository list to say the same instead of blaming the token.

How can we reproduce it?

  1. Run Kaneo without KANEO_ALLOW_PRIVATE_WEBHOOK_DESTINATIONS.
  2. Run Gitea or Forgejo on a private address, for example http://10.0.0.5:3000 or a container on the same Docker network.
  3. In a project, open Integrations, Gitea, enter that base URL and a valid token.
  4. Choose "Verify access": HTTP 500 "Gitea destination resolves to a non-routable address".
  5. Browse repositories: "Invalid Gitea token or could not reach instance."

Environment

Kaneo 2.46.2 (Docker image and Helm chart). Forgejo 15.0.10 and 16.0.6.

With the setting on, everything else worked against Forgejo 15.0.10 and 16.0.6: verification, browsing, issue import, issue, comment and label sync in both directions, and task moves from pushes, opened pull requests and merges. Both the Forgejo and the Gitea webhook types work. I can add that to the Gitea guide in the same pull request, together with a note that Gitea and Forgejo also block webhooks to private hosts unless the Kaneo host is in [webhook] ALLOWED_HOST_LIST.

Discussion 0

No comments yet.

Sign in to comment.

Keyboard shortcuts

Anywhere

Go to requests
gh
Go to changelog
gc
Go to notifications
gn
Next or previous page
norp
Leave a text field or close a menu
Esc
Show this list
?

Requests

Move to the next or previous request
jork
Open the selected request
oorEnter
Vote on the selected request
v
Search
/
New request
c

Request

Vote
v
Write a comment
c
Edit
e