Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
complete rework & working ss using config instead of cli args
  • Loading branch information
jodobear committed Aug 3, 2020
commit 818589e414693a26937f8b842f5f525d3fa4ae4b
90 changes: 90 additions & 0 deletions Scripts/scripts-conf/ss conf.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
################################################
# Blockchain Commons Standup Script Config file
################################################

# To setup a bitcoin server using standup scripts set the following
# environment variables accordingly.

###########################
# system
###########################
# Promp user befor continuing with the installation. Gives the user
# a chance to check the configuration before installing. Set it to
# true to remove the prompt
NOPROMPT=false
# Set password for user "standup". Good practice to use at least 8
# character long password. Don't ignore this.
USERPASSWORD=


###########################
# vps
###########################
# If you are using a VPS, set it to true and set the HOSTNAME, FQDN &
# REGION variables.
VPS=false
# the name for your server
HOSTNAME=
# the domain name(website) where you will host/access the server.
FQDN=
# the region in which the server is hosted. Required for timezone settings
REGION=


###########################
# bitcoind
###########################
# The bitcoin network you want bitcoind to start with. Valid choices:
# mainnet, testnet or regtest
NETWORK=mainnet
# Integer value to specify level of prune node. Minimum value is 550.
PRUNE=
# If you want to speed up the Initial Block Download then set it to true.
# Currently not implemented. It will use the btcpayserver snapshot hosted at:
#
# documentation: https://github.com/btcpayserver/btcpayserver-docker/tree/master/contrib/FastSync
# DISCLAIMER: It is always better to let your node validate blocks from the
# beginning. This script uses blockchain data signed by BTCPay Server.
# Trust at your own risk.
FASTSYNC=false
# Choose to install HWI: Hardware Wallet Interface
HWI=false


###########################
# lightning
###########################
# Choose your lightning network installation. By default the script will
# not install lightning. Valid options: c-lightning, lnd or empty
LIGHTNING=
# Set alias of your lightning node
LN_ALIAS=StandUp


###########################
# services
###########################
# set to true if you want to install an esplora server
ESPLORA=false
# set to true if you want to install btcpay server
BTCPAYSERVER=false


###########################
# Tor & SSH
###########################
# set a Tor public key if you have one.
TOR_PUBKEY=
# set an SSH key if you have one.
SSH_KEY=
# set a comma seperated set of white listed IPs that can SSH into the server.
SYS_SSH_IP=


###########################
# btcpay server
###########################
# the domain name where you will host your BTCPay Server.
BTCPAY_HOST=
# set the lightning network implementation for your BTCPay Server.
BTCPAY_LN=
91 changes: 91 additions & 0 deletions Scripts/scripts-conf/ss.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
################################################
# Blockchain Commons Standup Script Config file
################################################

# To setup a bitcoin server using standup scripts set the following
# environment variables accordingly by uncommenting and/or setting
# appropriate values.

###########################
# system
###########################
# Promp user befor continuing with the installation. Gives the user
# a chance to check the configuration before installing. Set it to
# true to remove the prompt
NOPROMPT=false
# Set password for user "standup". Good practice to use at least 8
# character long password. Don't ignore this.
USERPASSWORD=


###########################
# vps
###########################
# If you are using a VPS, set it to true and set the HOSTNAME, FQDN &
# REGION variables.
VPS=false
# the name for your server
#HOSTNAME=
# the domain name(website) where you will host/access the server.
#FQDN=
# the region in which the server is hosted. Required for timezone settings
#REGION=


###########################
# bitcoind
###########################
# The bitcoin network you want bitcoind to start with. Valid choices:
# mainnet, testnet or regtest
NETWORK=mainnet
# Integer value to specify level of prune node. Minimum value is 550.
#PRUNE=
# If you want to speed up the Initial Block Download then set it to true.
# Currently not implemented. It will use the btcpayserver snapshot hosted at:
#
# documentation: https://github.com/btcpayserver/btcpayserver-docker/tree/master/contrib/FastSync
# DISCLAIMER: It is always better to let your node validate blocks from the
# beginning. This script uses blockchain data signed by BTCPay Server.
# Trust at your own risk.
FASTSYNC=false
# Choose to install HWI: Hardware Wallet Interface
HWI=false


###########################
# lightning
###########################
# Choose your lightning network installation. By default the script will
# not install lightning. Valid options: c-lightning, lnd or empty
#LIGHTNING=
# Set alias of your lightning node
LN_ALIAS=StandUp


###########################
# services
###########################
# set to true if you want to install an esplora server
ESPLORA=false
# set to true if you want to install btcpay server
BTCPAYSERVER=false


###########################
# Tor & SSH
###########################
# set a Tor public key if you have one.
#TOR_PUBKEY=
# set an SSH key if you have one.
#SSH_KEY=
# set a comma seperated set of white listed IPs that can SSH into the server.
#SYS_SSH_IP=


###########################
# btcpay server
###########################
# the domain name where you will host your BTCPay Server.
#BTCPAY_HOST=
# set the lightning network implementation for your BTCPay Server.
#BTCPAY_LN=
57 changes: 57 additions & 0 deletions Scripts/scripts-conf/ss_00.1_vps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash

# standup script - vps hostname settings

IPADDR=""

# Check for FQDN & HOSTNAME if --vps
if "$VPS" && [[ -z "$HOSTNAME" ]] || [[ "$HOSTNAME" == "__UNDEFINED__" ]]; then
echo "You provided the '--vps' flag but didn't provide --fqdn"
while [ -z "$HOSTNAME" ]; do
read -rp "You need to enter hostname of the server: " HOSTNAME
done
fi

if "$VPS" && [[ -z "$FQDN" ]] || [[ "$FQDN" == "__UNDEFINED__" ]]; then
echo "You provided the '--vps' flag but didn't provide --fqdn."
while [ -z "$FQDN" ]; do
read -rp "You need to enter the fqdn of the server: " FQDN
done
fi

if "$VPS" && [[ -z "$REGION" ]] || [[ "$REGION" == "__UNDEFINED__" ]]; then
echo "You provided the '--vps' flag but didn't provide --region."
while [ -z "$REGION" ]; do
read -rp "You need to enter the region of the server to set the timezone: " REGION
done
fi

echo "
----------------"
HOSTNAME: $HOSTNAME" > /etc/hostname
----------------
"
/bin/hostname "$HOSTNAME"

# Set the variable $IPADDR to the IP address the new Linode receives.
IPADDR=$(/sbin/ifconfig eth0 | awk '/inet / { print $2 }' | sed 's/addr://')

echo "$0 - Set hostname as $FQDN ($IPADDR)"
echo "
***********************"
$MESSAGE_PREFIX TODO: Put $FQDN with IP $IPADDR in your main DNS file."
***********************
"
echo "$0 - Set Time Zone to $REGION"
echo $REGION > /etc/timezone
cp /usr/share/zoneinfo/${REGION} /etc/localtime

echo "
$MESSAGE_PREFIX Hostname, IP address and timezon are set. Put $FQDN with IP $IPADDR in your main DNS file.
"
# Add localhost aliases

echo "127.0.0.1 localhost" > /etc/hosts
echo "127.0.1.1 $FQDN $HOSTNAME" >> /etc/hosts

echo "$0 - Set localhost"
Loading