nm-upgrade.sh 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. #!/bin/bash
  2. CONFIG_FILE=netmaker.env
  3. # location of nm-quick.sh (usually `/root`)
  4. SCRIPT_DIR=$(dirname "$(realpath "$0")")
  5. CONFIG_PATH="$SCRIPT_DIR/$CONFIG_FILE"
  6. NM_QUICK_VERSION="0.1.0"
  7. LATEST=$(curl -s https://api.github.com/repos/gravitl/netmaker/releases/latest | grep "tag_name" | cut -d : -f 2,3 | tr -d [:space:],\")
  8. if [ "$(id -u)" -ne 0 ]; then
  9. echo "This script must be run as root"
  10. exit 1
  11. fi
  12. unset INSTALL_TYPE
  13. unset NETMAKER_BASE_DOMAIN
  14. # usage - displays usage instructions
  15. usage() {
  16. echo "nm-upgrade.sh v$NM_QUICK_VERSION"
  17. echo "usage: ./nm-upgrade.sh"
  18. exit 1
  19. }
  20. while getopts v flag; do
  21. case "${flag}" in
  22. v)
  23. usage
  24. exit 0
  25. ;;
  26. *)
  27. usage
  28. exit 0
  29. ;;
  30. esac
  31. done
  32. # print_logo - prints the netmaker logo
  33. print_logo() {
  34. cat <<"EOF"
  35. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  36. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  37. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  38. __ __ ______ ______ __ __ ______ __ __ ______ ______
  39. /\ "-.\ \ /\ ___\ /\__ _\ /\ "-./ \ /\ __ \ /\ \/ / /\ ___\ /\ == \
  40. \ \ \-. \ \ \ __\ \/_/\ \/ \ \ \-./\ \ \ \ __ \ \ \ _"-. \ \ __\ \ \ __<
  41. \ \_\\"\_\ \ \_____\ \ \_\ \ \_\ \ \_\ \ \_\ \_\ \ \_\ \_\ \ \_____\ \ \_\ \_\
  42. \/_/ \/_/ \/_____/ \/_/ \/_/ \/_/ \/_/\/_/ \/_/\/_/ \/_____/ \/_/ /_/
  43. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  44. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  45. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  46. EOF
  47. }
  48. # set_buildinfo - sets the information based on script input for how the installation should be run
  49. set_buildinfo() {
  50. MASTERKEY=$(grep MASTER_KEY docker-compose.yml | awk '{print $2;}' | tr -d '"')
  51. EMAIL=$(grep email Caddyfile | awk '{print $2;}' | tr -d '"')
  52. BROKER=$(grep SERVER_NAME docker-compose.yml | awk '{print $2;}' | tr -d '"')
  53. PREFIX="broker."
  54. NETMAKER_BASE_DOMAIN=${BROKER/#$PREFIX}
  55. echo "-----------------------------------------------------"
  56. echo "Would you like to install Netmaker Community Edition (CE), or Netmaker Professional (Pro)?"
  57. echo "Pro will require you to create an account at https://app.netmaker.io"
  58. echo "-----------------------------------------------------"
  59. select install_option in "Community Edition" "Enterprise Edition"; do
  60. case $REPLY in
  61. 1)
  62. echo "installing Netmaker CE"
  63. INSTALL_TYPE="ce"
  64. break
  65. ;;
  66. 2)
  67. echo "installing Netmaker Pro"
  68. INSTALL_TYPE="pro"
  69. break
  70. ;;
  71. *) echo "invalid option $REPLY" ;;
  72. esac
  73. done
  74. echo "-----------Build Options-----------------------------"
  75. echo " Pro or CE: $INSTALL_TYPE"
  76. echo " Version: $LATEST"
  77. echo " Installer: v$NM_QUICK_VERSION"
  78. echo "-----------------------------------------------------"
  79. }
  80. # install_yq - install yq if not present
  81. install_yq() {
  82. if ! command -v yq &>/dev/null; then
  83. wget -qO /usr/bin/yq https://github.com/mikefarah/yq/releases/download/v4.31.1/yq_linux_$(dpkg --print-architecture)
  84. chmod +x /usr/bin/yq
  85. fi
  86. set +e
  87. if ! command -v yq &>/dev/null; then
  88. set -e
  89. wget -qO /usr/bin/yq https://github.com/mikefarah/yq/releases/download/v4.31.1/yq_linux_amd64
  90. chmod +x /usr/bin/yq
  91. fi
  92. set -e
  93. if ! command -v yq &>/dev/null; then
  94. echo "failed to install yq. Please install yq and try again."
  95. echo "https://github.com/mikefarah/yq/#install"
  96. exit 1
  97. fi
  98. }
  99. # install and run upgrade tool
  100. upgrade() {
  101. wget -qO /tmp/nm-upgrade https://fileserver.netmaker.io/upgrade/nm-upgrade-${ARCH}
  102. chmod +x /tmp/nm-upgrade
  103. echo "generating netclient configuration files"
  104. /tmp/nm-upgrade
  105. }
  106. # setup_netclient - installs netclient
  107. setup_netclient() {
  108. wget -qO netclient https://github.com/gravitl/netclient/releases/download/$LATEST/netclient-linux-$ARCH
  109. chmod +x netclient
  110. ./netclient install -v 3
  111. }
  112. # wait_seconds - wait for the specified period of time
  113. wait_seconds() { (
  114. for ((a = 1; a <= $1; a++)); do
  115. echo ". . ."
  116. sleep 1
  117. done
  118. ); }
  119. # confirm - get user input to confirm that they want to perform the next step
  120. confirm() { (
  121. while true; do
  122. read -p 'Does everything look right? [y/n]: ' yn
  123. case $yn in
  124. [Yy]*)
  125. override="true"
  126. break
  127. ;;
  128. [Nn]*)
  129. echo "exiting..."
  130. exit 1
  131. # TODO start from the beginning instead
  132. ;;
  133. *) echo "Please answer yes or no." ;;
  134. esac
  135. done
  136. ) }
  137. save_config() { (
  138. echo "Saving the config to $CONFIG_PATH"
  139. touch "$CONFIG_PATH"
  140. save_config_item NM_EMAIL "$EMAIL"
  141. save_config_item NM_DOMAIN "$NETMAKER_BASE_DOMAIN"
  142. save_config_item UI_IMAGE_TAG "$LATEST"
  143. # version-specific entries
  144. if [ "$INSTALL_TYPE" = "pro" ]; then
  145. save_config_item NETMAKER_TENANT_ID "$TENANT_ID"
  146. save_config_item LICENSE_KEY "$LICENSE_KEY"
  147. save_config_item METRICS_EXPORTER "on"
  148. save_config_item PROMETHEUS "on"
  149. save_config_item SERVER_IMAGE_TAG "$LATEST-ee"
  150. else
  151. save_config_item METRICS_EXPORTER "off"
  152. save_config_item PROMETHEUS "off"
  153. save_config_item SERVER_IMAGE_TAG "$LATEST"
  154. fi
  155. # copy entries from the previous config
  156. local toCopy=("SERVER_HOST" "MASTER_KEY" "TURN_USERNAME" "TURN_PASSWORD" "MQ_USERNAME" "MQ_PASSWORD"
  157. "INSTALL_TYPE" "NODE_ID" "DNS_MODE" "NETCLIENT_AUTO_UPDATE" "API_PORT"
  158. "CORS_ALLOWED_ORIGIN" "DISPLAY_KEYS" "DATABASE" "SERVER_BROKER_ENDPOINT" "STUN_PORT" "VERBOSITY"
  159. "TURN_PORT" "USE_TURN" "DEBUG_MODE" "TURN_API_PORT" "REST_BACKEND"
  160. "DISABLE_REMOTE_IP_CHECK" "TELEMETRY" "AUTH_PROVIDER" "CLIENT_ID" "CLIENT_SECRET"
  161. "FRONTEND_URL" "AZURE_TENANT" "OIDC_ISSUER" "EXPORTER_API_PORT" "JWT_VALIDITY_DURATION" "RAC_AUTO_DISABLE")
  162. for name in "${toCopy[@]}"; do
  163. save_config_item $name "${!name}"
  164. done
  165. # preserve debug entries
  166. if test -n "$NM_SKIP_BUILD"; then
  167. save_config_item NM_SKIP_BUILD "$NM_SKIP_BUILD"
  168. fi
  169. if test -n "$NM_SKIP_CLONE"; then
  170. save_config_item NM_SKIP_CLONE "$NM_SKIP_CLONE"
  171. fi
  172. if test -n "$NM_SKIP_DEPS"; then
  173. save_config_item NM_SKIP_DEPS "$NM_SKIP_DEPS"
  174. fi
  175. ); }
  176. save_config_item() { (
  177. local NAME="$1"
  178. local VALUE="$2"
  179. #echo "$NAME=$VALUE"
  180. if test -z "$VALUE"; then
  181. # load the default for empty values
  182. VALUE=$(awk -F'=' "/^$NAME/ { print \$2}" "$SCRIPT_DIR/netmaker.default.env")
  183. # trim quotes for docker
  184. VALUE=$(echo "$VALUE" | sed -E "s|^(['\"])(.*)\1$|\2|g")
  185. #echo "Default for $NAME=$VALUE"
  186. fi
  187. # TODO single quote passwords
  188. if grep -q "^$NAME=" "$CONFIG_PATH"; then
  189. # TODO escape | in the value
  190. sed -i "s|$NAME=.*|$NAME=$VALUE|" "$CONFIG_PATH"
  191. else
  192. echo "$NAME=$VALUE" >>"$CONFIG_PATH"
  193. fi
  194. ); }
  195. # install_dependencies - install necessary packages to run netmaker
  196. install_dependencies() {
  197. if test -n "$NM_SKIP_DEPS"; then
  198. return
  199. fi
  200. echo "checking dependencies..."
  201. OS=$(uname)
  202. if [ -f /etc/debian_version ]; then
  203. dependencies="git wireguard wireguard-tools dnsutils jq docker.io docker-compose grep gawk"
  204. update_cmd='apt update'
  205. install_cmd='apt-get install -y'
  206. elif [ -f /etc/alpine-release ]; then
  207. dependencies="git wireguard jq docker.io docker-compose grep gawk"
  208. update_cmd='apk update'
  209. install_cmd='apk --update add'
  210. elif [ -f /etc/centos-release ]; then
  211. dependencies="git wireguard jq bind-utils docker.io docker-compose grep gawk"
  212. update_cmd='yum update'
  213. install_cmd='yum install -y'
  214. elif [ -f /etc/fedora-release ]; then
  215. dependencies="git wireguard bind-utils jq docker.io docker-compose grep gawk"
  216. update_cmd='dnf update'
  217. install_cmd='dnf install -y'
  218. elif [ -f /etc/redhat-release ]; then
  219. dependencies="git wireguard jq docker.io bind-utils docker-compose grep gawk"
  220. update_cmd='yum update'
  221. install_cmd='yum install -y'
  222. elif [ -f /etc/arch-release ]; then
  223. dependencies="git wireguard-tools dnsutils jq docker.io docker-compose grep gawk"
  224. update_cmd='pacman -Sy'
  225. install_cmd='pacman -S --noconfirm'
  226. elif [ "${OS}" = "FreeBSD" ]; then
  227. dependencies="git wireguard wget jq docker.io docker-compose grep gawk"
  228. update_cmd='pkg update'
  229. install_cmd='pkg install -y'
  230. else
  231. install_cmd=''
  232. fi
  233. if [ -z "${install_cmd}" ]; then
  234. echo "OS unsupported for automatic dependency install"
  235. # TODO shouldnt exit, check if deps available, if not
  236. # ask the user to install manually and continue when ready
  237. exit 1
  238. fi
  239. # TODO add other supported architectures
  240. ARCH=$(uname -m)
  241. if [ "$ARCH" = "x86_64" ]; then
  242. ARCH=amd64
  243. elif [ "$ARCH" = "aarch64" ]; then
  244. ARCH=arm64
  245. else
  246. echo "Unsupported architechure"
  247. # exit 1
  248. fi
  249. set -- $dependencies
  250. ${update_cmd}
  251. while [ -n "$1" ]; do
  252. if [ "${OS}" = "FreeBSD" ]; then
  253. is_installed=$(pkg check -d $1 | grep "Checking" | grep "done")
  254. if [ "$is_installed" != "" ]; then
  255. echo " " $1 is installed
  256. else
  257. echo " " $1 is not installed. Attempting install.
  258. ${install_cmd} $1
  259. sleep 5
  260. is_installed=$(pkg check -d $1 | grep "Checking" | grep "done")
  261. if [ "$is_installed" != "" ]; then
  262. echo " " $1 is installed
  263. elif [ -x "$(command -v $1)" ]; then
  264. echo " " $1 is installed
  265. else
  266. echo " " FAILED TO INSTALL $1
  267. echo " " This may break functionality.
  268. fi
  269. fi
  270. else
  271. if [ "${OS}" = "OpenWRT" ] || [ "${OS}" = "TurrisOS" ]; then
  272. is_installed=$(opkg list-installed $1 | grep $1)
  273. else
  274. is_installed=$(dpkg-query -W --showformat='${Status}\n' $1 | grep "install ok installed")
  275. fi
  276. if [ "${is_installed}" != "" ]; then
  277. echo " " $1 is installed
  278. else
  279. echo " " $1 is not installed. Attempting install.
  280. ${install_cmd} $1
  281. sleep 5
  282. if [ "${OS}" = "OpenWRT" ] || [ "${OS}" = "TurrisOS" ]; then
  283. is_installed=$(opkg list-installed $1 | grep $1)
  284. else
  285. is_installed=$(dpkg-query -W --showformat='${Status}\n' $1 | grep "install ok installed")
  286. fi
  287. if [ "${is_installed}" != "" ]; then
  288. echo " " $1 is installed
  289. elif [ -x "$(command -v $1)" ]; then
  290. echo " " $1 is installed
  291. else
  292. echo " " FAILED TO INSTALL $1
  293. echo " " This may break functionality.
  294. fi
  295. fi
  296. fi
  297. shift
  298. done
  299. echo "-----------------------------------------------------"
  300. echo "dependency check complete"
  301. echo "-----------------------------------------------------"
  302. }
  303. # set_install_vars - sets the variables that will be used throughout installation
  304. set_install_vars() {
  305. IP_ADDR=$(dig -4 myip.opendns.com @resolver1.opendns.com +short)
  306. if [ "$IP_ADDR" = "" ]; then
  307. IP_ADDR=$(curl -s ifconfig.me)
  308. fi
  309. if [ "$NETMAKER_BASE_DOMAIN" = "" ]; then
  310. NETMAKER_BASE_DOMAIN=nm.$(echo $IP_ADDR | tr . -).nip.io
  311. fi
  312. SERVER_HOST=$IP_ADDR
  313. if test -z "$MASTER_KEY"; then
  314. MASTER_KEY=$(
  315. tr -dc A-Za-z0-9 </dev/urandom | head -c 30
  316. echo ''
  317. )
  318. fi
  319. DOMAIN_TYPE="auto"
  320. echo "-----------------------------------------------------"
  321. echo "The following subdomains will be used:"
  322. echo " dashboard.$NETMAKER_BASE_DOMAIN"
  323. echo " api.$NETMAKER_BASE_DOMAIN"
  324. echo " broker.$NETMAKER_BASE_DOMAIN"
  325. if [ "$INSTALL_TYPE" = "pro" ]; then
  326. echo " prometheus.$NETMAKER_BASE_DOMAIN"
  327. echo " netmaker-exporter.$NETMAKER_BASE_DOMAIN"
  328. echo " grafana.$NETMAKER_BASE_DOMAIN"
  329. fi
  330. echo "-----------------------------------------------------"
  331. if [ "$INSTALL_TYPE" = "pro" ]; then
  332. echo "-----------------------------------------------------"
  333. echo "Provide Details for Pro installation:"
  334. echo " 1. Log into https://app.netmaker.io"
  335. echo " 2. follow instructions to get a license at: https://docs.netmaker.io/ee/ee-setup.html"
  336. echo " 3. Retrieve License and Tenant ID"
  337. echo " 4. note email address"
  338. echo "-----------------------------------------------------"
  339. unset LICENSE_KEY
  340. while [ -z "$LICENSE_KEY" ]; do
  341. read -p "License Key: " LICENSE_KEY
  342. done
  343. unset TENANT_ID
  344. while [ -z ${TENANT_ID} ]; do
  345. read -p "Tenant ID: " TENANT_ID
  346. done
  347. fi
  348. echo "using default username/random pass for MQ"
  349. MQ_USERNAME="netmaker"
  350. MQ_PASSWORD=$(
  351. tr -dc A-Za-z0-9 </dev/urandom | head -c 30
  352. echo ''
  353. )
  354. echo "using default username/random pass for TURN"
  355. TURN_USERNAME="netmaker"
  356. TURN_PASSWORD=$(
  357. tr -dc A-Za-z0-9 </dev/urandom | head -c 30
  358. echo ''
  359. )
  360. echo "-----------------------------------------------------------------"
  361. echo " SETUP ARGUMENTS"
  362. echo "-----------------------------------------------------------------"
  363. echo " domain: $NETMAKER_BASE_DOMAIN"
  364. echo " email: $EMAIL"
  365. echo " public ip: $SERVER_HOST"
  366. if [ "$INSTALL_TYPE" = "pro" ]; then
  367. echo " license: $LICENSE_KEY"
  368. echo " account id: $TENANT_ID"
  369. fi
  370. echo "-----------------------------------------------------------------"
  371. echo "Confirm Settings for Installation"
  372. echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
  373. confirm
  374. }
  375. # install_netmaker - sets the config files and starts docker-compose
  376. install_netmaker() {
  377. echo "-----------------------------------------------------------------"
  378. echo "Beginning installation..."
  379. echo "-----------------------------------------------------------------"
  380. wait_seconds 3
  381. echo "Pulling config files..."
  382. local BASE_URL="https://raw.githubusercontent.com/gravitl/netmaker/$LATEST"
  383. local COMPOSE_URL="$BASE_URL/compose/docker-compose.yml"
  384. local CADDY_URL="$BASE_URL/docker/Caddyfile"
  385. if [ "$INSTALL_TYPE" = "pro" ]; then
  386. local COMPOSE_OVERRIDE_URL="$BASE_URL/compose/docker-compose.pro.yml"
  387. local CADDY_URL="$BASE_URL/docker/Caddyfile-pro"
  388. fi
  389. wget -qO "$SCRIPT_DIR"/docker-compose.yml $COMPOSE_URL
  390. if test -n "$COMPOSE_OVERRIDE_URL"; then
  391. wget -qO "$SCRIPT_DIR"/docker-compose.override.yml $COMPOSE_OVERRIDE_URL
  392. fi
  393. wget -qO "$SCRIPT_DIR"/Caddyfile "$CADDY_URL"
  394. wget -qO "$SCRIPT_DIR"/netmaker.default.env "$BASE_URL/scripts/netmaker.default.env"
  395. wget -qO "$SCRIPT_DIR"/mosquitto.conf "$BASE_URL/docker/mosquitto.conf"
  396. wget -qO "$SCRIPT_DIR"/nm-certs.sh "$BASE_URL/scripts/nm-certs.sh"
  397. wget -qO "$SCRIPT_DIR"/wait.sh "$BASE_URL/docker/wait.sh"
  398. chmod +x "$SCRIPT_DIR"/wait.sh
  399. mkdir -p /etc/netmaker
  400. # link .env to the user config
  401. ln -fs "$SCRIPT_DIR/netmaker.env" "$SCRIPT_DIR/.env"
  402. save_config
  403. # Fetch / update certs using certbot
  404. chmod +x "$SCRIPT_DIR"/nm-certs.sh
  405. "$SCRIPT_DIR"/nm-certs.sh
  406. echo "Starting containers..."
  407. # increase the timeouts
  408. export DOCKER_CLIENT_TIMEOUT=120
  409. export COMPOSE_HTTP_TIMEOUT=120
  410. # start docker and rebuild containers / networks
  411. docker-compose -f "$SCRIPT_DIR"/docker-compose.yml up -d --force-recreate
  412. wait_seconds 2
  413. }
  414. # test_connection - tests to make sure Caddy has proper SSL certs
  415. test_connection() {
  416. echo "Testing Caddy setup (please be patient, this may take 1-2 minutes)"
  417. for i in 1 2 3 4 5 6 7 8; do
  418. curlresponse=$(curl -vIs https://api.${NETMAKER_BASE_DOMAIN} 2>&1)
  419. if [[ "$i" == 8 ]]; then
  420. echo " Caddy is having an issue setting up certificates, please investigate (docker logs caddy)"
  421. echo " Exiting..."
  422. exit 1
  423. elif [[ "$curlresponse" == *"failed to verify the legitimacy of the server"* ]]; then
  424. echo " Certificates not yet configured, retrying..."
  425. elif [[ "$curlresponse" == *"left intact"* ]]; then
  426. echo " Certificates ok"
  427. break
  428. else
  429. secs=$(($i * 5 + 10))
  430. echo " Issue establishing connection...retrying in $secs seconds..."
  431. fi
  432. sleep $secs
  433. done
  434. }
  435. # print_success - prints a success message upon completion
  436. print_success() {
  437. echo "-----------------------------------------------------------------"
  438. echo "-----------------------------------------------------------------"
  439. echo "Netmaker setup is now complete. You are ready to begin using Netmaker."
  440. echo "Visit dashboard.$NETMAKER_BASE_DOMAIN to log in"
  441. echo "-----------------------------------------------------------------"
  442. echo "-----------------------------------------------------------------"
  443. }
  444. cleanup() {
  445. echo "Stopping all containers..."
  446. local containers=("mq" "netmaker-ui" "coredns" "turn" "caddy" "netmaker" "netmaker-exporter" "prometheus" "grafana")
  447. for name in "${containers[@]}"; do
  448. local running=$(docker ps | grep -w "$name")
  449. local exists=$(docker ps -a | grep -w "$name")
  450. if test -n "$running"; then
  451. docker stop "$name" 1>/dev/null
  452. fi
  453. if test -n "$exists"; then
  454. docker rm "$name" 1>/dev/null
  455. fi
  456. done
  457. }
  458. # print netmaker logo
  459. print_logo
  460. # read the config
  461. if [ -f "$CONFIG_PATH" ]; then
  462. echo "Using config: $CONFIG_PATH"
  463. source "$CONFIG_PATH"
  464. if [ "$UPGRADE_FLAG" = "yes" ]; then
  465. INSTALL_TYPE="pro"
  466. fi
  467. fi
  468. # setup the build instructions
  469. set_buildinfo
  470. set +e
  471. # install necessary packages
  472. install_dependencies
  473. # install yq if necessary
  474. install_yq
  475. set -e
  476. # get user input for variables
  477. set_install_vars
  478. set +e
  479. cleanup
  480. set -e
  481. # get upgrade tool and run
  482. upgrade
  483. # get and set config files, startup docker-compose
  484. install_netmaker
  485. set +e
  486. # make sure Caddy certs are working
  487. test_connection
  488. set -e
  489. # install netclient
  490. setup_netclient
  491. # print success message
  492. print_success