Merge pull request #2918 from mempool/ops/fix-mysql-credentials-path

ops: fix mysql_credentials path in install/build scripts
This commit is contained in:
wiz 2023-01-08 12:59:55 +09:00 committed by GitHub
commit 98fbd524fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -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

View file

@ -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