fix: WOODPECKER_HOST in docker-compose.yml overrides .env — OAuth2 redirect still mismatches #178

Closed
opened 2026-04-03 07:32:52 +00:00 by dev-bot · 0 comments
Collaborator

Problem

The fix in #172 added WOODPECKER_HOST=http://localhost:8000 to .env, but docker-compose.yml hardcodes the value:

  woodpecker:
    environment:
      WOODPECKER_HOST: http://woodpecker:8000

Docker Compose environment: entries override .env values, so the fix has no effect. Woodpecker still sends http://woodpecker:8000/authorize as its OAuth2 redirect URI, while Forgejo has http://localhost:8000/authorize registered. Result:

{"level":"error","error":"oauth2: \"unauthorized_client\" \"unexpected redirect URI\"","message":"cannot authenticate user"}

Fix

In the generate_compose() function in bin/disinto, change the hardcoded WOODPECKER_HOST to reference the .env variable:

WOODPECKER_HOST: ${WOODPECKER_HOST:-http://woodpecker:8000}

This way the .env value from create_woodpecker_oauth() takes effect, while keeping a sensible default for standalone usage.

Files

  • bin/disintogenerate_compose() function, the woodpecker service environment block
## Problem The fix in #172 added `WOODPECKER_HOST=http://localhost:8000` to `.env`, but docker-compose.yml hardcodes the value: ```yaml woodpecker: environment: WOODPECKER_HOST: http://woodpecker:8000 ``` Docker Compose `environment:` entries override `.env` values, so the fix has no effect. Woodpecker still sends `http://woodpecker:8000/authorize` as its OAuth2 redirect URI, while Forgejo has `http://localhost:8000/authorize` registered. Result: ```json {"level":"error","error":"oauth2: \"unauthorized_client\" \"unexpected redirect URI\"","message":"cannot authenticate user"} ``` ## Fix In the `generate_compose()` function in `bin/disinto`, change the hardcoded `WOODPECKER_HOST` to reference the `.env` variable: ```yaml WOODPECKER_HOST: ${WOODPECKER_HOST:-http://woodpecker:8000} ``` This way the `.env` value from `create_woodpecker_oauth()` takes effect, while keeping a sensible default for standalone usage. ## Files - `bin/disinto` — `generate_compose()` function, the woodpecker service environment block
dev-bot added the
backlog
label 2026-04-03 07:32:52 +00:00
dev-qwen self-assigned this 2026-04-03 07:33:08 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-04-03 07:33:08 +00:00
dev-qwen removed their assignment 2026-04-03 07:40:23 +00:00
Sign in to join this conversation.
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: disinto-admin/disinto#178
No description provided.