Node password on ENV variable, fix os_stat

This commit is contained in:
Michele 2022-06-09 20:38:10 +07:00
parent fd8928e869
commit c733bc3571
5 changed files with 9 additions and 4 deletions

@ -1 +1 @@
Subproject commit 2c4618f2bf01a078b6204f48f9a05d836b40daad
Subproject commit 79b38394821d3307f3b44126086ce21e96cd00ca

View File

@ -5,4 +5,4 @@ rpcpassword=futurebit
daemon=0
maxconnections=32
upnp=1
uacomment=FutureBit-Apollo-Node
uacomment=FutureBit-Apollo-Node

View File

@ -34,7 +34,7 @@ if [ -f "/sys/devices/virtual/thermal/thermal_zone0/temp" ]; then
else
TEMP="0"
fi
ACTIVE_WIFI=$(nmcli -t -f name c show --active | awk 'NR%2{printf "%s ",$0;next;}1')
ACTIVE_WIFI=$(nmcli -t -f name c show --active | sed -z 's/\n/,/g;s/,$/\n/')
MINER_TEMP="0"

View File

@ -75,7 +75,7 @@ const bitcoinClient = new bitcoin.Client({
host: '127.0.0.1',
port: 8332,
user: 'futurebit',
pass: 'futurebit',
pass: process.env.BITCOIND_PASSWORD,
timeout: 30000,
ssl: false
});
@ -171,3 +171,4 @@ function getNodeStats () {
]
)
}

View File

@ -21,7 +21,10 @@ module.exports.auth = {
changeNodeRpcPassword (password) {
exec(`sudo sed -i s/rpcpassword.*/rpcpassword=${password}/g /opt/apolloapi/backend/node/bitcoin.conf`)
if (process.env.BITCOIND_PASSWORD) exec(`sudo sed -i s/BITCOIND_PASSWORD.*/BITCOIND_PASSWORD=${password}/g /opt/apolloapi/.env`)
else exec(`sudo echo "BITCOIND_PASSWORD=${password}" >> /opt/apolloapi/.env`)
exec('sudo systemctl restart node')
exec('sudo systemctl restart apollo-ui')
},
generateAccessToken () {
@ -34,3 +37,4 @@ module.exports.auth = {
}
},
}