无法使用我的本地gitea服务器运行无人机CI,在进行身份验证时会出错

时间:2017-10-07 10:20:09

标签: drone drone.io gitea

我想在我的本地机器上玩无人机CI。

我已经通过brew在我的mac上安装了gitea。我可以使用root登录http://0.0.0.0:3000/登录,一切正常

然后我就像那样启动无人机服务器:

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

之后,我想用gitea授权无人机,所以我转到0.0.0.0:8001,输入登录名和密码,但无人机服务器返回错误:

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"

1 个答案:

答案 0 :(得分:1)

问题是0.0.0.0指的是内部容器网络。除非gitea和无人机在同一网络和同一容器中运行,否则这将无效。

相反,您应该为无人机提供Gitea主机名(例如http://gitea.company.com)或Gitea公共IP地址。