Unleash/unleash

Define a default admin username and password with an env variable

dramamask opened this issue · 3 comments

Describe the feature request

I'm using the unleash docker image.
Is there a way to set the default username and password for the Unleash UI admin user? I know I can log in and create a new admin user, or use an api call to do so. Those options are not ideal for us though.
I really like the unleash env variables INIT_CLIENT_API_TOKENS and the other ones like it. It would be great if there was a similar way to initialize the admin username and password.

Background

One of our products, that uses Unleash, is deployed to our customer by means of basically a docker compose file. If the customer buys the product they get an installer that spins up the docker compose file on their own server. On the customer's server. I want to be able to put a custom Unleash UI username and password in that docker-compose file.

Solution suggestions

Env variables seem like a good way to do it to me. It's basically the same thing that is done with default tokens.

This sounds reasonable to me. I assume this should only take effect when the admin user is actually created, and not override the password, if already set?

Correct @ivarconr. That's how I imagine it to work. Just like it works with the tokens.

@ivarconr Is this something you've gotten around to? If not, I'll be happy to pick this up!
UPDATE: This ended up being such a simple change that I took the liberty to open a PR. Feel free to close as a duplicate if you already have something in the works for this one!