fix: fix: Woodpecker token auto-generation fails — OAuth2 redirect URI mismatch (#172) #177

Merged
dev-qwen merged 1 commit from fix/issue-172 into main 2026-04-03 07:26:10 +00:00
Collaborator

Fixes #172

Changes

Fixes #172 ## Changes
dev-qwen added 1 commit 2026-04-03 07:19:35 +00:00
fix: fix: Woodpecker token auto-generation fails — OAuth2 redirect URI mismatch (#172)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
e8beabfd05
Collaborator

AI Review

Summary\n\nAdds WOODPECKER_HOST=http://localhost:8000 to the .env variables written by create_woodpecker_oauth(). Without this, Woodpecker constructs its callback URL from a different source (e.g. container hostname), which doesn't match the redirect_uri registered with Forgejo (http://localhost:8000/authorize, line 1492), causing the OAuth2 flow to fail.\n\n### Verification\n\n- redirect_uri at line 1492 is hardcoded to http://localhost:8000/authorize — the new WOODPECKER_HOST value matches exactly.\n- generate_woodpecker_token() already defaults WOODPECKER_SERVER to http://localhost:8000 (line 1561), confirming this is the intended local address.\n- The fix slots cleanly into the existing wp_vars array and the upsert loop handles both first-write and idempotent re-runs correctly.\n\n### No Issues Found\n\nChange is correct, self-contained, and consistent with surrounding conventions.

Verdict

APPROVE — Correctly aligns WOODPECKER_HOST with the hardcoded OAuth2 redirect_uri — minimal, targeted fix


Reviewed at e8beabf | AGENTS.md

## AI Review <!-- reviewed: e8beabfd05eb53c2c164948acc22237962676707 --> ### Summary\n\nAdds `WOODPECKER_HOST=http://localhost:8000` to the `.env` variables written by `create_woodpecker_oauth()`. Without this, Woodpecker constructs its callback URL from a different source (e.g. container hostname), which doesn't match the `redirect_uri` registered with Forgejo (`http://localhost:8000/authorize`, line 1492), causing the OAuth2 flow to fail.\n\n### Verification\n\n- `redirect_uri` at line 1492 is hardcoded to `http://localhost:8000/authorize` — the new `WOODPECKER_HOST` value matches exactly.\n- `generate_woodpecker_token()` already defaults `WOODPECKER_SERVER` to `http://localhost:8000` (line 1561), confirming this is the intended local address.\n- The fix slots cleanly into the existing `wp_vars` array and the upsert loop handles both first-write and idempotent re-runs correctly.\n\n### No Issues Found\n\nChange is correct, self-contained, and consistent with surrounding conventions. ### Verdict **APPROVE** — Correctly aligns WOODPECKER_HOST with the hardcoded OAuth2 redirect_uri — minimal, targeted fix --- *Reviewed at `e8beabf` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-03 07:23:07 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — Correctly aligns WOODPECKER_HOST with the hardcoded OAuth2 redirect_uri — minimal, targeted fix

AI Review: **APPROVE** — Correctly aligns WOODPECKER_HOST with the hardcoded OAuth2 redirect_uri — minimal, targeted fix
dev-qwen merged commit 2c08a95fdb into main 2026-04-03 07:26:10 +00:00
dev-qwen deleted branch fix/issue-172 2026-04-03 07:26:10 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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: disinto-admin/disinto#177
No description provided.