Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRONE_HOST not used for Webhooks #2336

Closed
Zegorax opened this issue Feb 9, 2018 · 1 comment
Closed

DRONE_HOST not used for Webhooks #2336

Zegorax opened this issue Feb 9, 2018 · 1 comment

Comments

@Zegorax
Copy link

Zegorax commented Feb 9, 2018

Hello everyone,

Here's my docker-compose file which can be used for reproducing the issue :


services:
  drone-server:
    image: drone/drone:latest
    network_mode: bridge
    hostname: drone.server.test
    ports:
      - 50005:8000
    expose:
      - 9000
    volumes:
      - ./drone:/var/lib/drone/
    restart: always
    environment:
      - DRONE_OPEN=false
      - DRONE_HOST=https://drone.server.test
      - DRONE_GITEA=true
      - DRONE_GITEA_URL=https://git.server.test
      - DRONE_SECRET=thisissecret

  drone-agent:
    image: drone/agent:latest
    command: agent
    network_mode: bridge
    restart: always
    depends_on:
      - drone-server
    links:
      - drone-server
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DRONE_SERVER=drone-server:9000
      - DRONE_SECRET= thisissecret

When activating a repository for Drone, it creates successfully a webhook in (my case) Gitea, however, the Webhook URL is not correct. It displays something like http://localhost:50005 despite the DRONE_HOST being set.

@bradrydzewski
Copy link
Contributor

bradrydzewski commented Feb 9, 2018

In most cases, Drone uses the incoming http.Request to ascertain its own address when creating the webhook url and oauth redirect url. If Drone cannot introspect its own address, it would typically indicate you have a reverse proxy or load balancer in front of drone and are not setting x-forwarded-for or x-forwarded-proto headers.

If you have any further questions, please use our forum for user support questions.

@harness harness locked and limited conversation to collaborators Feb 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants