guessi / docker-yourls

Dockerize YOURLS service (Shorten URL Service)
https://hub.docker.com/r/guessi/docker-yourls/
28 stars 16 forks source link

Can't login... #13

Closed stevenmcastano closed 5 months ago

stevenmcastano commented 7 months ago

No matter what username and password I enter, it doesn't work...

I have an old install running under nginx/php-fpm, and I'm trying to deploy this docker container to connect to that other DB... the debug into shows that I'm connected, but after entering the admin username and password, I just get kicked back to the login screen again and told it's an invalid username or password...

Any ideas what to try next??

guessi commented 7 months ago

@stevenmcastano it's aim to provide quick start experience for new users, as for migrating from existed ones, you would need to go through backup restore process, or manually edit env files before you do "docker compose up". Check README.md for more details.

stevenmcastano commented 7 months ago

I did modify the env file, it does appear to be connecting to the database... when I turn on debug messages it shows me on the login screen that it is connect to my remote database, but no matter I do, I can't get it to let me log in.

guessi commented 7 months ago

@stevenmcastano

As you mentioned you are using existed database, I would assume you are not using the one created by docker-compose.yaml, definition HERE. If you are going to use existed database, you would need to change the line HERE to make it possible to connected to external one. Could you please check on that? check the message below for detailed explanation.

Explanation

The setup below created link between yourls and mysql (the container, created by compose), at the same time, it would create an alias for that, called mysql (the domain name) https://github.com/guessi/docker-yourls/blob/695c0224d9d1fcca4020d062c59d9b7ae7a8aca1/docker-compose.yaml#L33-L34

Then, the env.yours defines where the database for yourls is https://github.com/guessi/docker-yourls/blob/695c0224d9d1fcca4020d062c59d9b7ae7a8aca1/env.yourls#L22-L23

And replace the actual variable at config.php https://github.com/guessi/docker-yourls/blob/695c0224d9d1fcca4020d062c59d9b7ae7a8aca1/conf/opt/yourls/user/config.php#L23-L25

Additional notes

As the env files are in ini format, it would have some limitations, please be aware of that.

Space `, equal sign=and number sign#` are not allowed

If it still not resolving your issue, please describe more about how you turn on the debug mode? and what message did you got? and from database side of view, is there any new connection established after compose up?

I hope that help.

guessi commented 5 months ago

No response after month, closing...