Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add external MySQL support #266

Closed
xXAzazelXx opened this issue May 17, 2024 · 9 comments
Closed

Please add external MySQL support #266

xXAzazelXx opened this issue May 17, 2024 · 9 comments

Comments

@xXAzazelXx
Copy link

Hey !

Is it please possible to add support for var to point to external MySQL??

similar to this:

DB_DATABASE="linguacafe"
DB_USERNAME="linguacafe"
DB_PASSWORD="linguacafe"

eg DB_HOST=

@simjanos-dev
Copy link
Owner

Sure, it can be added. Actually, you can add it yourself in the meantime I think.

You can modify the docker-compose.yml if you are using v0.12:

    webserver:
        image: ghcr.io/simjanos-dev/linguacafe-webserver:${VERSION:-latest}
        container_name: linguacafe-webserver
        restart: unless-stopped
        depends_on:
            - mysql
        volumes:
            - ./storage:/var/www/html/storage
        environment:
            DB_DATABASE: ${DB_DATABASE:-linguacafe}
            DB_USERNAME: ${DB_USERNAME:-linguacafe}
            DB_PASSWORD: ${DB_PASSWORD:-linguacafe}
            DB_HOST: ${DB_HOST:-linguacafe-database}
            DB_PORT: ${DB_PORT:-3306}

Then add these variables to a .env file.

At startup it will create the necessary tables, but you will have to create the database itself before that.

@xXAzazelXx
Copy link
Author

xXAzazelXx commented May 17, 2024

OK that worked, i just had to get rid of "" in the .env

Thank you!

@simjanos-dev
Copy link
Owner

I added support for this in the docker-compose.yml files in the repo.

@sergiolaverde0: Could you please double check if it's good? I'm a bit paranoid with docker. I tested it, it works for me. I assumed only the port number must be without "" marks.

Here's the commit.

@sergiolaverde0
Copy link
Contributor

I tested it without the quotes since I remembered them not being needed; after all, our default values are without quotes.

I tested it with Spanish as per not to spend time waiting for Japanese to be installed and it all seemed to work minus for a weird error message when trying to finish a chapter. After testing using quotes and using the default values I found the behaviour was the same. So quotes are optional and it all "works" except for a bug that seems to be entirely unrelated.

Later this week I will test more and open an issue once I get more info, but your changes are good to go.

@simjanos-dev
Copy link
Owner

Thank you!

@sergiolaverde0
Copy link
Contributor

minus for a weird error message when trying to finish a chapter

Couldn't reproduce today with none of Japanese, Spanish nor English so let's call it a red herring and hope it doesn't happen again.

@simjanos-dev
Copy link
Owner

@xXAzazelXx

Hi!

Do you use linguacafe yourself, or do you host it for someone else?

I made a mistake in a function, that affects your use-case. Any user that is logged in to linguacafe can request any laravel config values, which includes MySQL host/database/username/password. I'll release a hotfix.

@xXAzazelXx
Copy link
Author

Just myself, local only

@simjanos-dev
Copy link
Owner

Then it could have caused no problems, and the hotfix is released now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants