Cracker0dks
Cracker0dks

Reputation: 2490

failed to generate token from DRONE_AGENT_SECRET

Im running gogs with success by:

docker run --name=gogs --restart always -p 10080:3000 -v /home/gogs:/data -d gogs/gogs

its working... link: removed

And I want to add a drone.io container with:

docker run -it --name=drone -p 8080:80 -v /var/run/docker.sock:/var/run/docker.sock -v /home/drone/volume/drone:/var/lib/drone -e DRONE_GOGS=true -e DRONE_GOGS_URL=https://removed/gogs drone/drone

But I always get:

FATA[0000] failed to generate token from DRONE_AGENT_SECRET

in the console right at the start.

But why? Thanks for your help :)

Upvotes: 2

Views: 331

Answers (1)

Brad Rydzewski
Brad Rydzewski

Reputation: 2563

You need to provide the server and agent with a shared secret, defined in the DRONE_SECRET environment variable.

Here is the example configuration for the drone:0.5 setup that includes the secret. Notice that it is provided to both the server and agent:

services:
  drone-server:
    image: drone/drone:0.5
    ports:
      - 80:8000
    volumes:
      - ./drone:/var/lib/drone/
    restart: always
    environment:
      - DRONE_OPEN=true
      - DRONE_GITHUB=true
      - DRONE_GITHUB_CLIENT=...
      - DRONE_GITHUB_SECRET=...
      - DRONE_SECRET=...

  drone-agent:
    image: drone/drone:0.5
    command: agent
    restart: always
    depends_on: [ drone-server ]
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      DRONE_SERVER=ws://drone-server:8000/ws/broker
      DRONE_SECRET=...

Brief description of the field and its purpose:

Drone server and agents use a shared secret to authenticate communication. This should be a random string of your choosing and should be kept private.

Reference documentation: http://readme.drone.io/admin/installation-guide/

Upvotes: 2

Related Questions