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

Add ability to get mysql password from file #67

Merged
merged 5 commits into from
Jan 15, 2022
Merged

Add ability to get mysql password from file #67

merged 5 commits into from
Jan 15, 2022

Conversation

skimpax
Copy link
Contributor

@skimpax skimpax commented Dec 30, 2021

Hello,

To avoid putting cleartext password in docker-compose file, use the facility to put the password in a file, as used by docker secrets.
The file path is to be set set in MYSQL_PASS_FILE.
In case of use in docker secret, path shall be /run/secrets/my_docker_secret_name

Regards.

backup.sh Outdated
then
echo "==> Dumping database: $db"
FILENAME=/backup/$DATE.$db.sql
LATEST=/backup/latest.$db.sql.gz
if mysqldump --single-transaction -h "$MYSQL_HOST" -P "$MYSQL_PORT" -u "$MYSQL_USER" -p"$MYSQL_PASS" "$db" $MYSQLDUMP_OPTS > "$FILENAME"
if mysqldump --single-transaction -h "$MYSQL_HOST" -P "$MYSQL_PORT" -u "$MYSQL_USER" -p"$MYSQL_PASS" "$db" "$MYSQLDUMP_OPTS" > "$FILENAME"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think MYSQLDUMP_OPTS may include double quotes and this will break some cases. Can you leave it unquoted as it was before?

@fradelg
Copy link
Owner

fradelg commented Jan 8, 2022

Hi! Thank you for your contribution. If you can address my comment I will be happy to merge your PR with master

@skimpax
Copy link
Contributor Author

skimpax commented Jan 15, 2022

Sorry for the delay. Shall be OK now.

@fradelg
Copy link
Owner

fradelg commented Jan 15, 2022

No worries, thanks for your contribution

@fradelg fradelg merged commit f0e5cb6 into fradelg:master Jan 15, 2022
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

Successfully merging this pull request may close these issues.

2 participants