docker icon indicating copy to clipboard operation
docker copied to clipboard

What is the default admin account?

Open vuens opened this issue 4 years ago • 13 comments

App key exists -- skipping
Migrating database
Creating default admin account
Seeding initial data
The absolute path to your media directory. If this is skipped (left blank) now, you can set it later via the web interface.
 Media path [/music]:
 > 
Now to front-end stuff
Oops! Koel installation or upgrade didn't finish successfully.
Please try again, or visit https://docs.koel.dev for manual installation.
😥 Sorry for this. You deserve better.

Creating default admin account What is the default admin account? The first run didn't let me create a new account

vuens avatar Apr 23 '21 15:04 vuens

Username: [email protected] Password: KoelIsCool

samstarnes avatar Apr 25 '21 19:04 samstarnes

Hi, It's unusual that it just created a default admin account, usually it asks for your email and password (twice). Indeed @samstarnes is correct, those are the default credentials (see the command's code).

If you need, there is also a command to reset the admin password, check out the docs here

Hyzual avatar Apr 28 '21 20:04 Hyzual

I just tried from a new installation and indeed it no longer asks what the admin account should be 😕

Hyzual avatar Apr 28 '21 21:04 Hyzual

So it turns out it was a feature from v5.1.0 I was unaware of. I've updated the README to explain that koel:init now creates a default admin account.

Hyzual avatar Apr 28 '21 21:04 Hyzual

Thank you for this! Been searching the username and password for a while!

Maybe consider adding this bit in this repo's github page?

C-Fu avatar Aug 24 '21 11:08 C-Fu

Just ran koel on docker and was NOT able to login without running the init command. But it is said the default user/pass would work. Any help here please ?

blmhemu avatar Dec 13 '21 07:12 blmhemu

Hi @blmhemu it's the expected outcome. You still need to run koel:init and then enter the default username and password

Hyzual avatar Dec 13 '21 08:12 Hyzual

Hi @Hyzual thanks for the clarification. I was wondering if it is possible to automate this, say, by adding the command in Dockerfile itself instead of user needing to manually execing into the container (which IMO is not a good practice)

blmhemu avatar Dec 13 '21 09:12 blmhemu

It should be possible, I'll look into it when I do the koel version bump

Hyzual avatar Dec 13 '21 13:12 Hyzual

Hi @blmhemu, so I tried changing the entrypoint script to run koel:init automatically but it does not work. If I just put the command in the entrypoint, it fails because connection to the database is refused. It is expected that it fails because the database can take some time to spin up and be ready to accept connections (for example, the mysql database container needs about 10 seconds before it's ready).

I could not find a Laravel command to verify that the database is ready :confused:. Since this image supports both postgreSQL and MySQL, I cannot hardcode a command with one of those clients to check the database. So I'm out of reliable options, I don't know how to wait for the database to be ready before running koel:init. If you have an idea, do not hesitate to share it here.

So, for the time being, I'm afraid I cannot automate this. People will still need to run koel:init manually...

Hyzual avatar Dec 30 '21 17:12 Hyzual

Hey ! Thanks for the effort @Hyzual ! I remember seeing a similar issue elsewhere... I think they got around it by using some kind of bash script which waits for the DB to be up and running before running the commands. Let me check if I can find it.

blmhemu avatar Dec 31 '21 02:12 blmhemu

Here are some which people tend to use.

  1. https://github.com/vishnubob/wait-for-it (Docker: https://github.com/whs/docker-wait-for-it)
  2. https://github.com/palfrey/wait-for-db
  3. https://github.com/eficode/wait-for
  4. https://github.com/nickjj/wait-until
  5. https://github.com/ufoscout/docker-compose-wait

blmhemu avatar Dec 31 '21 02:12 blmhemu

Thanks for the links, I didn't know those existed ! I don't know when I'll have time but I'll try those

Hyzual avatar Jan 03 '22 17:01 Hyzual