Incorrect linkback from Bitbucket Cloud

I don’t know if this is related to this ticket Payload URL generation of webhooks ignores DRONE_HOST

But that hasn’t been updated in a while.

When I go to bitbucket there is a link to the actual build instance.

IE: should be:

http://<dns_name>/<account>/<repository_name>/85

But what I get is:

https://bitbucket.org/ip-172-17-130-168.domain.ad/<account>/<repo_name>/86

docker-compose.yml file:

version: '2'
services:
  drone-server:
    image: drone/drone:0.8
    ports:
      - 80:8000
      - 9000:9000
    volumes:
      - /var/lib/drone:/var/lib/drone/
      - /etc/drone/key.pem:/etc/drone/key.pem
    restart: always
    environment:
      - DRONE_OPEN=true
      - DRONE_HOST=${DRONE_HOST}
      - DRONE_BITBUCKET=true
      - DRONE_BITBUCKET_CLIENT=${DRONE_BITBUCKET_CLIENT}
      - DRONE_BITBUCKET_SECRET=${DRONE_BITBUCKET_SECRET}
      - DRONE_DATABASE_DRIVER=mysql
      - DRONE_DATABASE_DATASOURCE=${DRONE_DATABASE_DATASOURCE}
      - DRONE_SECRET=${DRONE_SECRET}

DRONE_HOST is part of the problem - as I’m setting it to the ec2 (ip-172-17-130-168.domain.ad).

However it’s also injecting bitbucket.org.

I know Bitbucket Cloud may not fully support this feature, but it seems as if I were to change DRONE_HOST I’d still have an issue.

DRONE_HOST must be <proto>://<host> format. The Bitbucket status API is fully supported and there are no known issues with this feature. We do frequently see individuals having issues when this value is misconfigured, which seems to be the case here (missing proto).

1 Like

Alright. I’ll test that. Thanks.

It doesn’t appear that detail is mentioned in the docs that I was able to find, and the only mentions look like this: DRONE_HOST=${DRONE_HOST} which isn’t as helpful as one would like.

Oh, found it here: https://docs.drone.io/server/overview/

Drone needs to know its own address. You must therefore provide the address in <scheme>://<hostname> format. Please omit trailing slashes.

Having a concrete example in the code example below this line would likely help. Perhaps a PR opportunity for me or some other ambitious individual. Thanks all!

Perhaps this will help: https://github.com/drone/drone/pull/2286