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

DB_ Environment Variables not populated #36

Open
1 of 2 tasks
powellcn opened this issue Dec 21, 2023 · 6 comments
Open
1 of 2 tasks

DB_ Environment Variables not populated #36

powellcn opened this issue Dec 21, 2023 · 6 comments

Comments

@powellcn
Copy link
Contributor

powellcn commented Dec 21, 2023

This repository's issues are reserved for feature requests and bug reports.

  • I'm submitting a ...

    • bug report
    • feature request
  • ** please explain your feature or bug report**

setup/start.sh not populating DB_ ENV variables.

  • What is the current behavior?

MYSQL_* variables are supposed to populate the DB_ via the setup/start.sh script. However the DB_ variables are not populated.

DB_* variables should be populated.

  • What is the motivation / use case for changing the behavior?

The DB settings in Setup were not populated.
After setting the DB_ variables in compose the DB settings were filled in.

  • Please tell us about your environment:

Docker
This is for image 1.6.1.1

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
@powellcn
Copy link
Contributor Author

Here are the ENV variables I am using. I'm not sure why the start.sh script isn't working.

 - DB_HOSTNAME=${MYSQL_HOST}
  - DB_USERNAME=${MYSQL_USER}
  - DB_PASSWORD=${MYSQL_PASSWORD}
  - DB_DATABASE=${MYSQL_DB}
  - DB_PORT=${MYSQL_PORT}
  - MYSQL_HOST=${MYSQL_HOST}
  - MYSQL_USER=${MYSQL_USER}
  - MYSQL_PASSWORD=${MYSQL_PASSWORD}
  - MYSQL_DB=${MYSQL_DB}
  - MYSQL_PORT=${MYSQL_PORT}
  - IP_URL=${IP_URL}
  - DISABLE_SETUP=${DISABLE_SETUP}
  - SETUP_COMPLETED=${SETUP_COMPLETED}

@powellcn powellcn changed the title Environment Variables DB_ Environment Variables not populated Dec 21, 2023
@nielsdrost7
Copy link

There are 2 ways to look at this:
From the Dockerfile perspective
From the environment files perspective

From the Dockerfile perspective:
In Dockerfile#L15C4-L17C30 the username / password / database are hardcoded. They could become environment variables which would help.

So let's say in your environment variables you're using:

  - DB_USERNAME=ip
  - DB_PASSWORD=ip_super_secret
  - DB_DATABASE=invoiceplane_db

From the Dockerfile perspective the database, username, password is set up with hardcoded values. So these values from the environment variables don't work (yet)

From the environment files perspective:
The environment variables are sent to the Docker container. Only look in your ipconfig.php if those environment variables are set properly.
So if you used those same variables:

  - DB_USERNAME=ip
  - DB_PASSWORD=ip_super_secret
  - DB_DATABASE=invoiceplane_db

Then check ipconfig.php if those variables are actually set.
If that's the case, then the Dockerfile did its job.

You then still have the problem, that the username / password / database name are hardcoded, but that can be solved.

@mhzawadi
Copy link
Owner

Thanks for your bug report, PR #37 has the fix for it.

will test and if all looks good merge in a bit

@mhzawadi
Copy link
Owner

PR #37 merged

@the-hotmann
Copy link

This actually also would be fixed by #39
This has to do with the way environment variables currently are set.
Once a ipconfig.php file exists no environment variable will be written in to the file.

Such behaviour will result in unwanted behaviour, as there is no real source of truth.
If #39 is implemented, it makes the environment variables the only source of truth (for the dockerized setup) which I think is what should be the case for a dockerized version.

@mhzawadi
Copy link
Owner

mhzawadi commented Jul 1, 2024

Hello 👋🏼

Is this now sorted as the PR for full config in env is merged?

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

4 participants