mirror of
https://github.com/Retropex/apolloapi-v2.git
synced 2025-05-20 15:10:43 +02:00
Log password generation just to be sure
This commit is contained in:
parent
afb49898b0
commit
14a63e726f
@ -7,7 +7,6 @@ const { knex } = require('./db')
|
||||
|
||||
initEnvFile()
|
||||
runMigrations()
|
||||
runGenerateBitcoinPassword()
|
||||
.then(startServer)
|
||||
|
||||
async function initEnvFile () {
|
||||
@ -32,7 +31,9 @@ async function initEnvFile () {
|
||||
|
||||
async function runMigrations () {
|
||||
try {
|
||||
console.log('Run migrations')
|
||||
const resp = await knex.migrate.latest()
|
||||
await runGenerateBitcoinPassword();
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
@ -40,9 +41,10 @@ async function runMigrations () {
|
||||
|
||||
async function runGenerateBitcoinPassword () {
|
||||
try {
|
||||
console.log('Checking bitcoin password existence')
|
||||
const [ settings ] = await knex('settings').select(['node_rpc_password as nodeRpcPassword'])
|
||||
|
||||
if (settings && settings.nodeRpcPassword) return
|
||||
if (settings && settings.nodeRpcPassword) return console.log('Bitcoin password found')
|
||||
else await utils.auth.changeNodeRpcPassword()
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
|
@ -23,6 +23,8 @@ module.exports.auth = {
|
||||
|
||||
async changeNodeRpcPassword () {
|
||||
try {
|
||||
console.log('Generating and saving bitcoin password')
|
||||
|
||||
const password = generator.generate({
|
||||
length: 12,
|
||||
numbers: true
|
||||
|
Loading…
Reference in New Issue
Block a user