From d987669b1e3b419b4237ea69b3001e44551192d4 Mon Sep 17 00:00:00 2001 From: wiz Date: Sun, 8 Jan 2023 12:56:27 +0900 Subject: [PATCH] ops: fix mysql_credentials path in install/build scripts --- production/install | 4 +++- production/mempool-build-all | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/production/install b/production/install index ae28c2cdc..656143714 100755 --- a/production/install +++ b/production/install @@ -251,6 +251,7 @@ MEMPOOL_BISQ_PASS=$(head -150 /dev/urandom | ${MD5} | awk '{print $1}') MEMPOOL_HOME=/mempool MEMPOOL_USER=mempool MEMPOOL_GROUP=mempool +MEMPOOL_MYSQL_CREDENTIALS="${MEMPOOL_HOME}/.mysql_credentials" # name of Tor hidden service in torrc MEMPOOL_TOR_HS=mempool @@ -1869,7 +1870,7 @@ grant all on mempool_bisq.* to '${MEMPOOL_BISQ_USER}'@'localhost' identified by _EOF_ echo "[*] save MySQL credentials" -cat > ${MEMPOOL_HOME}/mysql_credentials << _EOF_ +cat > "${MEMPOOL_MYSQL_CREDENTIALS}" << _EOF_ declare -x MEMPOOL_MAINNET_USER="${MEMPOOL_MAINNET_USER}" declare -x MEMPOOL_MAINNET_PASS="${MEMPOOL_MAINNET_PASS}" declare -x MEMPOOL_TESTNET_USER="${MEMPOOL_TESTNET_USER}" @@ -1889,6 +1890,7 @@ declare -x MEMPOOL_LIQUIDTESTNET_PASS="${MEMPOOL_LIQUIDTESTNET_PASS}" declare -x MEMPOOL_BISQ_USER="${MEMPOOL_BISQ_USER}" declare -x MEMPOOL_BISQ_PASS="${MEMPOOL_BISQ_PASS}" _EOF_ +chown "${MEMPOOL_USER}:${MEMPOOL_GROUP}" "${MEMPOOL_MYSQL_CREDENTIALS}" ##### nginx diff --git a/production/mempool-build-all b/production/mempool-build-all index 048aeefdc..a4cb650d7 100755 --- a/production/mempool-build-all +++ b/production/mempool-build-all @@ -12,7 +12,7 @@ ELEMENTS_RPC_USER=$(grep '^rpcuser' /elements/elements.conf | cut -d '=' -f2) ELEMENTS_RPC_PASS=$(grep '^rpcpassword' /elements/elements.conf | cut -d '=' -f2) # get mysql credentials -MYSQL_CRED_FILE=${HOME}/mempool/mysql_credentials +MYSQL_CRED_FILE=${HOME}/.mysql_credentials if [ -f "${MYSQL_CRED_FILE}" ];then . ${MYSQL_CRED_FILE} fi