mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
Modify MySQL commands to skip SSL requirement
Added --skip-ssl option to MySQL commands for database creation and user alteration. https://github.com/alexbelgium/hassio-addons/issues/2113#issuecomment-3315292129
This commit is contained in:
@@ -105,11 +105,20 @@ case $(bashio::config 'DB_CONNECTION') in
|
||||
bashio::log.warning "Uninstalling the MariaDB addon will remove any data"
|
||||
|
||||
bashio::log.info "Creating database for Firefly-iii if required"
|
||||
# Create database without SSL requirement
|
||||
mysql \
|
||||
-u "${DB_USERNAME}" -p"${DB_PASSWORD}" \
|
||||
-h "${DB_HOST}" -P "${DB_PORT}" \
|
||||
-e "CREATE DATABASE IF NOT EXISTS \`firefly\` ;"
|
||||
;;
|
||||
--skip-ssl \
|
||||
-u "${DB_USERNAME}" -p"${DB_PASSWORD}" \
|
||||
-h "${DB_HOST}" -P "${DB_PORT}" \
|
||||
-e "CREATE DATABASE IF NOT EXISTS \`firefly\`;"
|
||||
|
||||
# Ensure the user does not require SSL
|
||||
mysql \
|
||||
--skip-ssl \
|
||||
-u "${DB_USERNAME}" -p"${DB_PASSWORD}" \
|
||||
-h "${DB_HOST}" -P "${DB_PORT}" \
|
||||
-e "ALTER USER '${DB_USERNAME}'@'%' REQUIRE NONE;"
|
||||
;;
|
||||
|
||||
# Use remote
|
||||
*)
|
||||
|
||||
Reference in New Issue
Block a user