From 78449f19fbd2f4b4cc744552e717d2da38d26d58 Mon Sep 17 00:00:00 2001 From: Rafael Taranto Date: Wed, 6 Mar 2019 17:03:06 -0300 Subject: [PATCH] Get install script up to date with lamassu-install --- lamassu-remote-install/install | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lamassu-remote-install/install b/lamassu-remote-install/install index 40f7e24d..5b90d219 100755 --- a/lamassu-remote-install/install +++ b/lamassu-remote-install/install @@ -12,8 +12,8 @@ CA_KEY_PATH=$KEY_DIR/Lamassu_OP_Root_CA.key CA_PATH=$CERT_DIR/Lamassu_OP_Root_CA.pem SERVER_KEY_PATH=$KEY_DIR/Lamassu_OP.key SERVER_CERT_PATH=$CERT_DIR/Lamassu_OP.pem -SEEDS_DIR=$HOME/seeds -SEED_FILE=$SEEDS_DIR/seed.txt +MNEMONIC_DIR=$CONFIG_DIR/mnemonics +MNEMONIC_FILE=$MNEMONIC_DIR/mnemonic.txt BACKUP_DIR=/var/backups/postgresql BLOCKCHAIN_DIR=/mnt/blockchains OFAC_DATA_DIR=/var/lamassu/ofac @@ -67,8 +67,10 @@ fi release=$(lsb_release -rs) processor=$(uname -i) if [ "$release" != "16.04" ] || [ "$processor" != "x86_64" ]; then - echo "You're attempting to install on an unsupported Linux distribution or release." + echo "You're attempting to install on an unsupported Linux distribution or release ("$release $processor")." + echo uname -a + echo echo "Please return to DigitalOcean and create a droplet running Ubuntu 16.04 x64 instead." exit 1 fi @@ -90,10 +92,11 @@ apt update >> $LOG_FILE 2>&1 decho "Installing necessary packages..." apt install nodejs python-minimal build-essential supervisor postgresql libpq-dev -y -q >> $LOG_FILE 2>&1 -decho "Generating seed..." -mkdir -p $SEEDS_DIR >> $LOG_FILE 2>&1 +decho "Generating mnemonic..." +mkdir -p $MNEMONIC_DIR >> $LOG_FILE 2>&1 SEED=$(openssl rand -hex 32) -echo $SEED > $SEED_FILE +MNEMONIC=$(bip39 $SEED) +echo "$MNEMONIC" > $MNEMONIC_FILE decho "Installing latest npm package manager for node..." retry 3 npm -g --unsafe-perm install npm@5 >> $LOG_FILE 2>&1 @@ -166,7 +169,7 @@ mkdir -p $OFAC_DATA_DIR cat < $CONFIG_DIR/lamassu.json { "postgresql": "postgres://lamassu_pg:$POSTGRES_PW@localhost/lamassu", - "seedPath": "$SEED_FILE", + "mnemonicPath": "$MNEMONIC_FILE", "lamassuCaPath": "$LAMASSU_CA_PATH", "caPath": "$CA_PATH", "certPath": "$SERVER_CERT_PATH",