Bug fix for variable PG_USER not used in self-hosting Docker .env file #4636
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I notice that when I deployed the self-hosting environment in Docker, I tried to modify
$PG_USERvariable to make it different from the default value for security but it didn't work. I checked thesetup.shthat the migrate image used, and found this bug that$PG_USERseems to be an obsolete variable, only having a definition but never being used in the script.I added the assignment with an exception detection (should never catch that, since there are pre-defined default values in the
.env.examplefile (here) for variable$PG_USERand$PG_PASSWORD, moved them forward before where they are used, and modify theCREATE USERSQL query from default valueapp_userto$PG_USERin order to make it work.This is my first time opening a pull request ever in GitHub, so please let me know if there are any problems with the code or if there is anything I should do to follow the rules and merge this commit. Thank you!
Best,
Jinxuan (Hins) Fang