fix: use internal Forgejo URL for token exchange and verification

Public git.georgsen.dk unreachable from LAN due to hairpin NAT.
Authorization endpoint stays public (browser redirect), but
token exchange and token verification use internal 10.5.0.14:3000.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mikkel Georgsen 2026-03-30 11:44:39 +00:00
parent 5d08e15b0f
commit d60b0208db

View file

@ -53,12 +53,14 @@ class ForgejoTokenVerifier(TokenVerifier):
creds = load_credentials()
FORGEJO_INTERNAL = "http://10.5.0.14:3000"
auth = OAuthProxy(
upstream_authorization_endpoint=f"{FORGEJO_URL}/login/oauth/authorize",
upstream_token_endpoint=f"{FORGEJO_URL}/login/oauth/access_token",
upstream_token_endpoint=f"{FORGEJO_INTERNAL}/login/oauth/access_token",
upstream_client_id=creds["FORGEJO_OAUTH_CLIENT_ID"],
upstream_client_secret=creds["FORGEJO_OAUTH_CLIENT_SECRET"],
token_verifier=ForgejoTokenVerifier(),
token_verifier=ForgejoTokenVerifier(forgejo_url=FORGEJO_INTERNAL),
base_url="https://mcp.georgsen.dk",
)