Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions iso/scripts/download_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source /tmp/vars.sh

DAPPNODE_CORE_DIR="/images"
DAPPNODE_HASH_FILE="${DAPPNODE_CORE_DIR}/packages-content-hash.csv"
CONTENT_HASH_PKGS=(geth openethereum nethermind)
CONTENT_HASH_PKGS=(geth nethermind)
IPFS_ENDPOINT=${IPFS_ENDPOINT:-"http://ipfs.io"}

SWGET="wget -q -O-"
Expand All @@ -24,7 +24,7 @@ for comp in "${components[@]}"; do
if [[ ${!ver} == /ipfs/* ]]; then
DOWNLOAD_URL="${IPFS_ENDPOINT}/api/v0/cat?arg=${!ver%:*}"
fi

eval "${comp}_URL=\"${DOWNLOAD_URL}/${comp,,}.dnp.dappnode.eth_${!ver##*:}_linux-amd64.txz\""
eval "${comp}_YML=\"${DOWNLOAD_URL}/docker-compose.yml\""
eval "${comp}_MANIFEST=\"${DOWNLOAD_URL}/dappnode_package.json\""
Expand Down
28 changes: 17 additions & 11 deletions scripts/dappnode_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ DAPPNODE_ACCESS_CREDENTIALS_URL="https://github.com/dappnode/DAppNode/releases/l
WGET="wget -q --show-progress --progress=bar:force"
SWGET="wget -q -O-"
# Other
CONTENT_HASH_PKGS=(geth openethereum nethermind)
CONTENT_HASH_PKGS=(geth nethermind)
ARCH=$(dpkg --print-architecture)
WELCOME_MESSAGE="\nChoose a way to connect to your DAppNode, then go to \e[1mhttp://my.dappnode\e[0m\n\n\e[1m- Wifi\e[0m\t\tScan and connect to DAppNodeWIFI. Get wifi credentials with \e[32mdappnode_wifi\e[0m\n\n\e[1m- Local Proxy\e[0m\tConnect to the same router as your DAppNode. Then go to \e[1mhttp://dappnode.local\e[0m\n\n\e[1m- Wireguard\e[0m\tDownload Wireguard app on your device. Get your dappnode wireguard credentials with \e[32mdappnode_wireguard\e[0m\n\n\e[1m- Open VPN\e[0m\tDownload OPen VPN app on your device. Get your openVPN creds with \e[32mdappnode_openvpn\e[0m\n\n\nTo see a full list of commands available execute \e[32mdappnode_help\e[0m\n"

Expand Down Expand Up @@ -57,7 +57,7 @@ is_iso_install() {

# Check is port 80 in used (necessary for HTTPS)
is_port_used() {
lsof -i -P -n | grep ":80 (LISTEN)" &>/dev/null && IS_PORT_USED=true || IS_PORT_USED=false
lsof -i -P -n | grep ":80 (LISTEN)" &>/dev/null && IS_PORT_USED=true || IS_PORT_USED=false
}

# Determine packages to be installed
Expand Down Expand Up @@ -89,8 +89,8 @@ function valid_ip() {
IFS='.'
ip=("$ip")
IFS=$OIFS
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 && \
${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 &&
${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
stat=$?
fi
return $stat
Expand Down Expand Up @@ -138,7 +138,10 @@ dappnode_core_build() {
apt-get install -y git
fi
TMPDIR=$(mktemp -d)
pushd "$TMPDIR" || { echo "Error on pushd"; exit 1; }
pushd "$TMPDIR" || {
echo "Error on pushd"
exit 1
}
git clone -b "${!ver##*:}" https://github.com/dappnode/DNP_"${comp}"
# Change version in YAML to the custom one
DOCKER_VER=$(echo "${!ver##*:}" | sed 's/\//_/g')
Expand All @@ -147,7 +150,10 @@ dappnode_core_build() {
cp ./DNP_"${comp}"/docker-compose.yml "${DAPPNODE_CORE_DIR}"/docker-compose-"${comp,,}".yml
cp ./DNP_"${comp}"/dappnode_package.json "${DAPPNODE_CORE_DIR}"/dappnode_package-"${comp,,}".json
rm -r ./DNP_"${comp}"
popd || { echo "Error on popd"; exit 1; }
popd || {
echo "Error on popd"
exit 1
}
fi
done
}
Expand All @@ -161,10 +167,10 @@ dappnode_core_download() {
eval "[ -f \$${comp}_FILE ] || $WGET -O \$${comp}_FILE \$${comp}_URL || exit 1"
# Download DAppNode Core docker-compose yml files if it's needed
echo "Downloading ${comp} yml..."
eval "[ -f \$${comp}_YML_FILE ] || $WGET -O \$${comp}_YML_FILE \$${comp}_YML || exit 1";
# Download DAppNode Core manifest files if it's needed
eval "[ -f \$${comp}_YML_FILE ] || $WGET -O \$${comp}_YML_FILE \$${comp}_YML || exit 1"
# Download DAppNode Core manifest files if it's needed
echo "Downloading ${comp} manifest..."
eval "[ -f \$${comp}_MANIFEST_FILE ] || $WGET -O \$${comp}_MANIFEST_FILE \$${comp}_MANIFEST || exit 1";
eval "[ -f \$${comp}_MANIFEST_FILE ] || $WGET -O \$${comp}_MANIFEST_FILE \$${comp}_MANIFEST || exit 1"
fi
done
}
Expand All @@ -187,7 +193,7 @@ customMotd() {
|___/_/ \_\ .__/ .__/_|\_\___/\__,_\___|
|_| |_|
EOF
echo -e "$WELCOME_MESSAGE" >> "$MOTD_FILE"
echo -e "$WELCOME_MESSAGE" >>"$MOTD_FILE"
fi
}

Expand Down Expand Up @@ -303,7 +309,7 @@ installExtraDpkg
echo -e "\e[32mGrabbing latest content hashes...\e[0m" 2>&1 | tee -a $LOGFILE
grabContentHashes

if [ "$ARCH" == "amd64" ]; then
if [ "$ARCH" == "amd64" ]; then
echo -e "\e[32mInstalling SGX modules...\e[0m" 2>&1 | tee -a $LOGFILE
installSgx

Expand Down