Drone

How to add admin user

I followed the official drone installation for docker and set up the environment I needed.

Now I need to grant a “trusted” settings to one of my repos, and I need admin privileges for that. Unfortunately, running commands like drone user update akoidan --admin will fail, because user akoidan is not an admin user, which I didn’t create in the first case.

Atm I see the only way to archive it: delete the existing docker container and create a new one (because docker doesn’t allow adding env variables to existing containers), which will lead to completely losing all the data.

So I have 2 questions:

  • How can I get the admin user by following official drone documentation?
  • Why there’s no persistent docker volume while creating a drone server?

delete the existing docker container and create a new one […] which will lead to completely losing all the data.

you will not lose any data as long as you mounted the volume as shown in the install instructions (--volume=/var/lib/drone:/data). The host volume ensures the sqlite database is persisted to the host and is not lost when you remove the container.

Right, my bad, I was checking drone-runner container instead of server one, while creating this post, thinking that there’s no volume

Maybe it’s worth updating drone documentation on the initial setup part with admin envs, like this one. I believe the admin user would be required by every setup at the end of the day.

2 Likes