diff --git a/src/addons.js b/src/addons.js index 12e6bef56..d4b97dcc4 100644 --- a/src/addons.js +++ b/src/addons.js @@ -142,7 +142,7 @@ function initialize(callback) { certificates.getAdminCertificatePath(function (error, certFilePath, keyFilePath) { if (error) return callback(error); - shell.sudo('seutp_infra', [ SETUP_INFRA_CMD, paths.DATA_DIR, config.fqdn(), config.adminFqdn(), certFilePath, keyFilePath ], callback); + shell.sudo('seutp_infra', [ SETUP_INFRA_CMD, paths.DATA_DIR, config.fqdn(), config.adminFqdn(), certFilePath, keyFilePath, config.database().name, config.database().password ], callback); }); } diff --git a/src/database.js b/src/database.js index 2e35a3438..4069605f1 100644 --- a/src/database.js +++ b/src/database.js @@ -1,5 +1,3 @@ -/* jslint node: true */ - 'use strict'; exports = module.exports = { diff --git a/src/scripts/setup_infra.sh b/src/scripts/setup_infra.sh index 8208a32ec..b3b4df52b 100755 --- a/src/scripts/setup_infra.sh +++ b/src/scripts/setup_infra.sh @@ -20,6 +20,8 @@ readonly fqdn="$2" readonly mail_fqdn="$3" readonly mail_tls_cert="$4" readonly mail_tls_key="$5" +readonly db_name="$6" +readonly db_password="$7" # removing containers ensures containers are launched with latest config updates # restore code in appatask does not delete old containers @@ -164,10 +166,10 @@ fi if [[ "${infra_version}" == "none" ]]; then # if no existing infra was found (for new, upgraded and restored cloudons), download app backups echo "Marking installed apps for restore" - mysql -u root -ppassword -e 'UPDATE apps SET installationState = "pending_restore", oldConfigJson = NULL WHERE installationState = "installed"' box + mysql -u root --password="${db_password}" -e 'UPDATE apps SET installationState = "pending_restore", oldConfigJson = NULL WHERE installationState = "installed"' ${db_name} else # if existing infra was found, just mark apps for reconfiguration - mysql -u root -ppassword -e 'UPDATE apps SET installationState = "pending_configure", oldConfigJson = NULL WHERE installationState = "installed"' box + mysql -u root --password="${db_password}" -e 'UPDATE apps SET installationState = "pending_configure", oldConfigJson = NULL WHERE installationState = "installed"' ${db_name} fi echo -n "${INFRA_VERSION}" > "${data_dir}/INFRA_VERSION"