Alexander Kondaurov
Alexander Kondaurov

Reputation: 4123

Can't run drone CI with my local gitea server, getting error while authenitcating

I want to play with drone CI on my local machine.

I have installed gitea on my mac via brew. I can login with root login http://0.0.0.0:3000/ and everything works

Then I start the drone server like that:

version: '2'

services:
  drone-server:
    image: drone/drone:0.8.1
    ports:
      - 8001:8000
    volumes:
      - /Users/aleksandr/ci/drone_gitea/data:/var/lib/drone/
    restart: always
    environment:
      - DRONE_OPEN=true
      - DRONE_HOST=0.0.0.0
      - DRONE_GITEA=true
      - DRONE_GITEA_URL=http://0.0.0.0:3000/
      - DRONE_SECRET=123123

After that, I want to authorize drone with gitea, so I go to 0.0.0.0:8001, enter login and password but the drone server returns an error:

drone-server_1  | time="2017-10-07T10:11:50Z" level=error msg="cannot authenticate user. Post http://0.0.0.0:3000/api/v1/users/root/tokens: dial tcp 0.0.0.0:3000: getsockopt: connection refused"

Upvotes: 0

Views: 3156

Answers (1)

Brad Rydzewski
Brad Rydzewski

Reputation: 2563

The issue is that 0.0.0.0 refers to the internal container network. Unless gitea and drone are running on the same network and in the same container, this will not work.

Instead you should provide drone with the Gitea hostname (eg http://gitea.company.com) or the Gitea public IP address.

Upvotes: 1

Related Questions