DRONE_ADMIN not working as expected

I’m testing out the 0.9 version of drone along with the autoscaler on GCE and I’ve hit an issue where it doesn’t seem like DRONE_ADMIN is being read. Here’s how I start the server container.

   docker run \
  --volume=/var/run/docker.sock:/var/run/docker.sock \
  --volume=/var/lib/drone:/data \
  --env=DRONE_TLS_AUTOCERT=true \
  --env=DRONE_ORGS=MyCompany \
  --env=DRONE_ADMIN=southwel \
  --env=DRONE_GITHUB_CLIENT_ID=${DRONE_GITHUB_CLIENT_ID} \
  --env=DRONE_GITHUB_CLIENT_SECRET=${DRONE_GITHUB_CLIENT_SECRET} \
  --env=DRONE_SERVER_HOST=${DRONE_SERVER_HOST} \
  --env=DRONE_SERVER_PROTO=https \
  --env=DRONE_RUNNER_CAPACITY=0 \
  --env=DRONE_DATABASE_DATASOURCE=postgres://${DRONE_PSQL_USER}:${DRONE_PSQL_PASSWD}@${DRONE_PSQL_HOST}:${DRONE_PSQL_PORT}/drone\
  --env=DRONE_DATABASE_DRIVER=postgres \
  --env=DRONE_RPC_SECRET=forgetaboutit \
  --env=DRONE_LOGS_DEBUG=true \
  --publish=80:80 \
  --publish=443:443 \
  --restart=always \
  --detach=true \
  --name=drone \
  drone/drone:0.9.0-alpha.1

When I login I only get the options that a regular no admin user would get. No ability to add docker registry credentials etc.

DRONE_ADMIN is not a valid variable in 0.9

There have been a number of configuration changes (at https://readme.drone.io/reference/). All configuration parameters are documented, but this being an alpha, I haven’t created an upgrade guide yet.

Thanks! I looked there and in GitHub at the code, but didn’t see any obvious new equivalent. I’m guessing what I’m looking for is: https://readme.drone.io/reference/server/drone-user-create/

Yes, DRONE_USER_CREATE is exactly what you want. It will boostrap the system with a new user account. You can use this to create the first admin user (or an admin machine account) which can be used to then spawn new users.

Whether or not a user is an administrator is now stored in the database. I will eventually be adding screens to the user-interface to manage users, prior to the 0.9-rc.1 release which is still a couple of weeks away.

1 Like

How is this possible? We just add a:
–env=DRONE_USER_CREATE=usename:myname, machine:false,admin=true,token:mypassword
line to docker run command?
What exactly is token? https://readme.drone.io/reference/server/drone-user-create/ is not very clear on that.