From d0854c9fd16fb98e4373bfebec78f8721a751aff Mon Sep 17 00:00:00 2001 From: dovholuknf <46322585+dovholuknf@users.noreply.github.com> Date: Tue, 18 May 2021 08:47:27 -0400 Subject: [PATCH] merge all helper functions into one big script --- .../docker/image/create-controller-config.sh | 147 ---- .../docker/image/create-edge-router-config.sh | 69 -- .../image/create-edge-router-wss-config.sh | 69 -- .../docker/image/create-fabric-identity.sh | 8 - .../image/create-fabric-router-config.sh | 69 -- quickstart/docker/image/create-pki.sh | 28 - .../image/create-private-router-config.sh | 69 -- quickstart/docker/image/create-router-pki.sh | 5 - quickstart/docker/image/pki-functions.sh | 103 --- quickstart/local/create-controller-config.sh | 1 - quickstart/local/create-edge-router-config.sh | 1 - quickstart/local/create-pki.sh | 1 - quickstart/local/create-router-pki.sh | 1 - quickstart/local/express/README.md | 5 - quickstart/local/express/express-dev-env.sh | 194 ----- quickstart/local/pki-functions.sh | 1 - quickstart/ziti-cli-functions.sh | 802 +++++++++++++++++- 17 files changed, 801 insertions(+), 772 deletions(-) delete mode 100755 quickstart/docker/image/create-controller-config.sh delete mode 100755 quickstart/docker/image/create-edge-router-config.sh delete mode 100755 quickstart/docker/image/create-edge-router-wss-config.sh delete mode 100755 quickstart/docker/image/create-fabric-identity.sh delete mode 100755 quickstart/docker/image/create-fabric-router-config.sh delete mode 100755 quickstart/docker/image/create-pki.sh delete mode 100755 quickstart/docker/image/create-private-router-config.sh delete mode 100755 quickstart/docker/image/create-router-pki.sh delete mode 100644 quickstart/docker/image/pki-functions.sh delete mode 120000 quickstart/local/create-controller-config.sh delete mode 120000 quickstart/local/create-edge-router-config.sh delete mode 120000 quickstart/local/create-pki.sh delete mode 120000 quickstart/local/create-router-pki.sh delete mode 100644 quickstart/local/express/README.md delete mode 100755 quickstart/local/express/express-dev-env.sh delete mode 120000 quickstart/local/pki-functions.sh diff --git a/quickstart/docker/image/create-controller-config.sh b/quickstart/docker/image/create-controller-config.sh deleted file mode 100755 index f96bf3e91..000000000 --- a/quickstart/docker/image/create-controller-config.sh +++ /dev/null @@ -1,147 +0,0 @@ -#!/bin/bash -cat > ${ZITI_HOME}/controller.yaml < ${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.yaml < ${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.yaml < ${ZITI_HOME}/identities.yml < ${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.yaml < ${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.yaml </dev/null 2>&1 && pwd )" -ZITI_QUICKSTART_ENVROOT="${HOME}/.ziti/quickstart" -ZITI_QUICKSTART_SCRIPT_ROOT="$(realpath "${ZITI_SCRIPT_DIR}/../../")" -. "${ZITI_QUICKSTART_SCRIPT_ROOT}/ziti-cli-functions.sh" - -function issueGreeting { - #echo "-------------------------------------------------------------" - echo " " - echo " _ _ _" - echo " ____ (_) | |_ (_)" - echo " |_ / | | | __| | |" - echo " / / | | | |_ | |" - echo " /___| |_| \__| |_|" - echo "-------------------------------------------------------------" - echo " " - echo "This script will make it trivial to setup a very simple environment locally which will allow you to start" - echo "learning ziti. This environment is suitable for development work only and is not a decent representation of" - echo "a fully redundant production-caliber network." - echo "" - echo "Please note that this script will write files to your home directory into a directory named .ziti." - echo -n "For you this location will be: " - echo -e "$(BLUE "${ZITI_QUICKSTART_ENVROOT}")" - echo " " -} - -function setupZitiNetwork { - if [[ "$1" == "" ]]; then - echo " " - echo "Creating a controller is effectively creating a network. The name of the network will be used when writing" - echo "configuration files locally. Choose the name of your network now. The format of the network name should resemble" - echo -n "what a hostname looks like. A good choice is to actually use your system's hostname: " - echo -e "$(BLUE $(hostname))" - echo " " - read -p "$(echo -ne "Network Name [$(BLUE $(hostname))]: ")" ZITI_NETWORK - echo " " - if checkControllerName; then - : #clear to continue - if [[ "ZITI_NETWORK" == "" ]]; then - ZITI_NETWORK="$(hostname)" - fi - echo "name: ${ZITI_NETWORK}" - else - echo " " - echo "nah bro" - return 1 - fi - echo " " - else - ZITI_NETWORK="$1" - fi -} - -function setupZitiHome { - export ZITI_HOME="${HOME}/.ziti/quickstart/${ZITI_NETWORK}" -} - -function generateEnvFile { - - echo -e "Generating new network with name: $(BLUE "${ZITI_NETWORK}")" - - if [[ "${ZITI_CONTROLLER_RAWNAME}" == "" ]]; then export export ZITI_CONTROLLER_RAWNAME="${ZITI_NETWORK}-controller"; fi - if [[ "${ZITI_CONTROLLER_HOSTNAME}" == "" ]]; then export export ZITI_CONTROLLER_HOSTNAME="${ZITI_NETWORK}"; fi - if [[ "${ZITI_EDGE_CONTROLLER_RAWNAME}" == "" ]]; then export export ZITI_EDGE_CONTROLLER_RAWNAME="${ZITI_NETWORK}-edge-controller"; fi - if [[ "${ZITI_EDGE_CONTROLLER_HOSTNAME}" == "" ]]; then export export ZITI_EDGE_CONTROLLER_HOSTNAME="${ZITI_NETWORK}"; fi - if [[ "${ZITI_ZAC_RAWNAME}" == "" ]]; then export export ZITI_ZAC_RAWNAME="${ZITI_NETWORK}"; fi - if [[ "${ZITI_ZAC_HOSTNAME}" == "" ]]; then export export ZITI_ZAC_HOSTNAME="${ZITI_NETWORK}"; fi - if [[ "${ZITI_EDGE_ROUTER_RAWNAME}" == "" ]]; then export export ZITI_EDGE_ROUTER_RAWNAME="${ZITI_NETWORK}-edge-router"; fi - if [[ "${ZITI_EDGE_ROUTER_HOSTNAME}" == "" ]]; then export export ZITI_EDGE_ROUTER_HOSTNAME="${ZITI_NETWORK}"; fi - if [[ "${ZITI_EDGE_ROUTER_PORT}" == "" ]]; then export ZITI_EDGE_ROUTER_PORT="3022"; fi - - if [[ "${ZITI_BIN_ROOT}" == "" ]]; then - export ZITI_BIN_ROOT="${ZITI_HOME}/ziti-bin" - fi - - export ZITI_SCRIPTS="$(realpath "${ZITI_SCRIPT_DIR}/..")" - export ZITI_SHARED=${ZITI_HOME} - export ENV_FILE="${ZITI_HOME}/${ZITI_NETWORK}.env" - "${ZITI_QUICKSTART_SCRIPT_ROOT}/docker/image/env.sh" - echo -e "environment file created and sourced from: $(BLUE "${ENV_FILE}")" - source "${ENV_FILE}" -} - -function expressConfiguration { - echo " " - echo "___________ _______________________________________^__" - echo " ___ ___ ||| ___ ___ ___ ___ ___ | __ ,----\ " - echo "| | | |||| | | | | | | | | | | | | |_____\ " - echo "|___| |___|||| |___| |___| |___| | O | O | | | | \ " - echo " ||| ===== EXPRESS ==== |___|___| | |__| )" - echo "___________|||______________________________|______________/" - echo " ||| /--------" - echo "-----------'''---------------------------------------'" - echo "" - - if [[ "$1" == "" ]]; then - nw="$(hostname)" - else - nw="$1" - fi - - setupZitiNetwork "${nw}" - setupZitiHome - - getLatestZiti "no" - generateEnvFile - #checkHostsFile - - generatePki - generateControllerConfig - initializeController - startZitiController - echo "starting the ziti controller to enroll the edge router" - sleep 2 - - zitiLogin - - echo -e "---------- Creating an edge router policy allowing all identities to connect to routers with a $(GREEN "#public") attribute" - unused=$("${ZITI_BIN_DIR}/ziti" edge delete edge-router-policy allEdgeRouters) - unused=$("${ZITI_BIN_DIR}/ziti" edge create edge-router-policy allEdgeRouters --edge-router-roles '#public' --identity-roles '#all' ) - - echo -e "---------- Creating a service edge router policy allowing all services to use $(GREEN "#public") edge routers" - unused=$("${ZITI_BIN_DIR}/ziti" edge delete service-edge-router-policy allSvcPublicRouters) - unused=$("${ZITI_BIN_DIR}/ziti" edge create service-edge-router-policy allSvcPublicRouters --edge-router-roles '#public' --service-roles '#all') - - "${ZITI_SCRIPTS}/create-router-pki.sh" - generateEdgeRouterConfig - - echo "---------- Creating edge-router ${ZITI_EDGE_ROUTER_RAWNAME}...." - unused=$("${ZITI_BIN_DIR}/ziti" edge delete edge-router "${ZITI_EDGE_ROUTER_RAWNAME}") - unused=$("${ZITI_BIN_DIR}/ziti" edge create edge-router "${ZITI_EDGE_ROUTER_RAWNAME}" -o "${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.jwt" -t) - sleep 1 - echo "---------- Enrolling edge-router ${ZITI_EDGE_ROUTER_RAWNAME}...." - - unused=$("${ZITI_BIN_DIR}/ziti-router" enroll "${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.yaml" --jwt "${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.jwt" &> "${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.enrollment.log") - echo "" - sleep 1 - unused=$("${ZITI_BIN_DIR}/ziti-router" run "${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.yaml" > "${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.log" 2>&1 &) -} - -function decideOperation { - if [[ "$1" != "" ]]; then - yn=$1 - fi - while true - do - if [[ "${yn}" == "" ]]; then - echo "What sort of operation are you looking to perform?" - echo " 1.) Express configuration - a simple overlay will be spawned containing one controller and two edge routers" - echo " 2.) Create Controller configuration - answer a few questions and a controller config will be emitted" - echo " 3.) Create Edge Router configuration - answer a few questions and an edge router config will be emitted" - echo " 4.) Start a network with the provided name" - echo " " - read -p "Select an action: " yn - fi - case $yn in - [1]* ) - expressConfiguration "$2" - break;; - [2]* ) - generateEnvFile - - ;; - [3]* ) - echo "333 has been chosen" - echo " " - ;; - [4]* ) - echo "4444 has been chosen" - echo " " - ;; - [yYqQeE]* ) - break - ;; - [Nn]* ) - echo ""; echo "Ok - come back when you're ready." - exit;; - * ) echo "Please answer yes or no. (yes/NO)";; - esac - yn= - done - echo " " -} - -#greet the user with the banner and quick blurb about what to expect -issueGreeting - -#make sure the user has all the necessary commands to be successful -checkPrereqs - -#prompt the user for input and do what they want/need -decideOperation 1 "$1" - diff --git a/quickstart/local/pki-functions.sh b/quickstart/local/pki-functions.sh deleted file mode 120000 index 6d7173816..000000000 --- a/quickstart/local/pki-functions.sh +++ /dev/null @@ -1 +0,0 @@ -../docker/image/pki-functions.sh \ No newline at end of file diff --git a/quickstart/ziti-cli-functions.sh b/quickstart/ziti-cli-functions.sh index 01524790b..2162cafd4 100644 --- a/quickstart/ziti-cli-functions.sh +++ b/quickstart/ziti-cli-functions.sh @@ -194,4 +194,804 @@ function checkControllerName { function unsetZitiEnv { for zEnvVar in $(set -o posix ; set | grep -e "^ZITI_" | sort); do envvar="$(echo "${zEnvVar}" | cut -d '=' -f1)"; echo unsetting "[${envvar}]${zEnvVar}"; unset "${envvar}"; done -} \ No newline at end of file +} + +function issueGreeting { + #echo "-------------------------------------------------------------" + echo " " + echo " _ _ _" + echo " ____ (_) | |_ (_)" + echo " |_ / | | | __| | |" + echo " / / | | | |_ | |" + echo " /___| |_| \__| |_|" + echo "-------------------------------------------------------------" + echo " " + echo "This script will make it trivial to setup a very simple environment locally which will allow you to start" + echo "learning ziti. This environment is suitable for development work only and is not a decent representation of" + echo "a fully redundant production-caliber network." + echo "" + echo "Please note that this script will write files to your home directory into a directory named .ziti." + echo -n "For you this location will be: " + echo -e "$(BLUE "${ZITI_QUICKSTART_ENVROOT}")" + echo " " +} + +function setupZitiNetwork { + if [[ "$1" == "" ]]; then + echo " " + echo "Creating a controller is effectively creating a network. The name of the network will be used when writing" + echo "configuration files locally. Choose the name of your network now. The format of the network name should resemble" + echo -n "what a hostname looks like. A good choice is to actually use your system's hostname: " + echo -e "$(BLUE $(hostname))" + echo " " + read -p "$(echo -ne "Network Name [$(BLUE $(hostname))]: ")" ZITI_NETWORK + echo " " + if checkControllerName; then + : #clear to continue + if [[ "ZITI_NETWORK" == "" ]]; then + ZITI_NETWORK="$(hostname)" + fi + echo "name: ${ZITI_NETWORK}" + else + echo " " + echo "nah bro" + return 1 + fi + echo " " + else + ZITI_NETWORK="$1" + fi +} + +function setupZitiHome { + export ZITI_HOME="${HOME}/.ziti/quickstart/${ZITI_NETWORK}" +} + +function generateEnvFile { + + echo -e "Generating new network with name: $(BLUE "${ZITI_NETWORK}")" + + if [[ "${ZITI_CONTROLLER_RAWNAME}" == "" ]]; then export export ZITI_CONTROLLER_RAWNAME="${ZITI_NETWORK}-controller"; fi + if [[ "${ZITI_CONTROLLER_HOSTNAME}" == "" ]]; then export export ZITI_CONTROLLER_HOSTNAME="${ZITI_NETWORK}"; fi + if [[ "${ZITI_EDGE_CONTROLLER_RAWNAME}" == "" ]]; then export export ZITI_EDGE_CONTROLLER_RAWNAME="${ZITI_NETWORK}-edge-controller"; fi + if [[ "${ZITI_EDGE_CONTROLLER_HOSTNAME}" == "" ]]; then export export ZITI_EDGE_CONTROLLER_HOSTNAME="${ZITI_NETWORK}"; fi + if [[ "${ZITI_ZAC_RAWNAME}" == "" ]]; then export export ZITI_ZAC_RAWNAME="${ZITI_NETWORK}"; fi + if [[ "${ZITI_ZAC_HOSTNAME}" == "" ]]; then export export ZITI_ZAC_HOSTNAME="${ZITI_NETWORK}"; fi + if [[ "${ZITI_EDGE_ROUTER_RAWNAME}" == "" ]]; then export export ZITI_EDGE_ROUTER_RAWNAME="${ZITI_NETWORK}-edge-router"; fi + if [[ "${ZITI_EDGE_ROUTER_HOSTNAME}" == "" ]]; then export export ZITI_EDGE_ROUTER_HOSTNAME="${ZITI_NETWORK}"; fi + if [[ "${ZITI_EDGE_ROUTER_PORT}" == "" ]]; then export ZITI_EDGE_ROUTER_PORT="3022"; fi + + if [[ "${ZITI_BIN_ROOT}" == "" ]]; then + export ZITI_BIN_ROOT="${ZITI_HOME}/ziti-bin" + fi + + export ZITI_SCRIPTS="$(realpath "${ZITI_SCRIPT_DIR}/..")" + export ZITI_SHARED=${ZITI_HOME} + export ENV_FILE="${ZITI_HOME}/${ZITI_NETWORK}.env" + "${ZITI_QUICKSTART_SCRIPT_ROOT}/docker/image/env.sh" + echo -e "environment file created and sourced from: $(BLUE "${ENV_FILE}")" + source "${ENV_FILE}" +} + +function ziti_expressConfiguration { + echo " " + echo "___________ _______________________________________^__" + echo " ___ ___ ||| ___ ___ ___ ___ ___ | __ ,----\ " + echo "| | | |||| | | | | | | | | | | | | |_____\ " + echo "|___| |___|||| |___| |___| |___| | O | O | | | | \ " + echo " ||| ===== EXPRESS ==== |___|___| | |__| )" + echo "___________|||______________________________|______________/" + echo " ||| /--------" + echo "-----------'''---------------------------------------'" + echo "" + + if [[ "$1" == "" ]]; then + nw="$(hostname)" + else + nw="$1" + fi + + setupZitiNetwork "${nw}" + setupZitiHome + + getLatestZiti "no" + generateEnvFile + #checkHostsFile + + generatePki + generateControllerConfig + initializeController + startZitiController + echo "starting the ziti controller to enroll the edge router" + sleep 2 + + zitiLogin + + echo -e "---------- Creating an edge router policy allowing all identities to connect to routers with a $(GREEN "#public") attribute" + unused=$("${ZITI_BIN_DIR}/ziti" edge delete edge-router-policy allEdgeRouters) + unused=$("${ZITI_BIN_DIR}/ziti" edge create edge-router-policy allEdgeRouters --edge-router-roles '#public' --identity-roles '#all' ) + + echo -e "---------- Creating a service edge router policy allowing all services to use $(GREEN "#public") edge routers" + unused=$("${ZITI_BIN_DIR}/ziti" edge delete service-edge-router-policy allSvcPublicRouters) + unused=$("${ZITI_BIN_DIR}/ziti" edge create service-edge-router-policy allSvcPublicRouters --edge-router-roles '#public' --service-roles '#all') + + #"${ZITI_SCRIPTS}/create-router-pki.sh" + createRouterPki + generateEdgeRouterConfig + + echo "---------- Creating edge-router ${ZITI_EDGE_ROUTER_RAWNAME}...." + unused=$("${ZITI_BIN_DIR}/ziti" edge delete edge-router "${ZITI_EDGE_ROUTER_RAWNAME}") + unused=$("${ZITI_BIN_DIR}/ziti" edge create edge-router "${ZITI_EDGE_ROUTER_RAWNAME}" -o "${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.jwt" -t) + sleep 1 + echo "---------- Enrolling edge-router ${ZITI_EDGE_ROUTER_RAWNAME}...." + + unused=$("${ZITI_BIN_DIR}/ziti-router" enroll "${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.yaml" --jwt "${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.jwt" &> "${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.enrollment.log") + echo "" + sleep 1 + unused=$("${ZITI_BIN_DIR}/ziti-router" run "${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.yaml" > "${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.log" 2>&1 &) +} + +function decideOperation { + if [[ "$1" != "" ]]; then + yn=$1 + fi + while true + do + if [[ "${yn}" == "" ]]; then + echo "What sort of operation are you looking to perform?" + echo " 1.) Express configuration - a simple overlay will be spawned containing one controller and two edge routers" + echo " 2.) Create Controller configuration - answer a few questions and a controller config will be emitted" + echo " 3.) Create Edge Router configuration - answer a few questions and an edge router config will be emitted" + echo " 4.) Start a network with the provided name" + echo " " + read -p "Select an action: " yn + fi + case $yn in + [1]* ) + ziti_expressConfiguration "$2" + break;; + [2]* ) + generateEnvFile + + ;; + [3]* ) + echo "333 has been chosen" + echo " " + ;; + [4]* ) + echo "4444 has been chosen" + echo " " + ;; + [yYqQeE]* ) + break + ;; + [Nn]* ) + echo ""; echo "Ok - come back when you're ready." + exit;; + * ) echo "Please answer yes or no. (yes/NO)";; + esac + yn= + done + echo " " +} + +function expressInstall { + #greet the user with the banner and quick blurb about what to expect + issueGreeting + + #make sure the user has all the necessary commands to be successful + checkPrereqs + + #prompt the user for input and do what they want/need + decideOperation 1 "$1" +} + +function pki_client_server { + name_local=$1 + ZITI_CA_NAME_local=$2 + ip_local=$3 + + if [[ "${ip_local}" == "" ]]; then + ip_local="127.0.0.1" + fi + + if ! test -f "${ZITI_PKI}/${ZITI_CA_NAME_local}/keys/${name_local}-server.key"; then + echo "Creating server cert from ca: ${ZITI_CA_NAME_local} for ${name_local}" + "${ZITI_BIN_DIR}/ziti" pki create server --pki-root="${ZITI_PKI}" --ca-name "${ZITI_CA_NAME_local}" \ + --server-file "${name_local}-server" \ + --dns "${name_local},localhost" --ip "${ip_local}" \ + --server-name "${name_local} server certificate" + else + echo "Creating server cert from ca: ${ZITI_CA_NAME_local} for ${name_local}" + echo "key exists" + fi + + if ! test -f "${ZITI_PKI}/${ZITI_CA_NAME_local}/keys/${name_local}-client.key"; then + echo "Creating client cert from ca: ${ZITI_CA_NAME_local} for ${name_local}" + "${ZITI_BIN_DIR}/ziti" pki create client --pki-root="${ZITI_PKI}" --ca-name "${ZITI_CA_NAME_local}" \ + --client-file "${name_local}-client" \ + --key-file "${name_local}-server" \ + --client-name "${name_local}" + else + echo "Creating client cert from ca: ${ZITI_CA_NAME_local} for ${name_local}" + echo "key exists" + fi + echo " " +} + +function pki_create_ca { + if ! test -f "${ZITI_PKI}/${1}/keys/${1}.key"; then + echo "Creating CA: ${1}" + "${ZITI_BIN_DIR}/ziti" pki create ca --pki-root="${ZITI_PKI}" --ca-file="${1}" --ca-name="${1} Root CA" + else + echo "Creating CA: ${1}" + echo "key exists" + fi + echo " " +} + +function pki_create_intermediate { + if ! test -f "${ZITI_PKI}/${2}/keys/${2}.key"; then + echo "Creating intermediate: ${1} ${2} ${3}" + "${ZITI_BIN_DIR}/ziti" pki create intermediate --pki-root "${ZITI_PKI}" --ca-name "${1}" \ + --intermediate-name "${2}" \ + --intermediate-file "${2}" --max-path-len ${3} + else + echo "Creating intermediate: ${1} ${2} ${3}" + echo "key exists" + fi + echo " " +} +function yaml2json() +{ + ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' $* +} + +function printUsage() +{ + echo "Usage: $1 [cert to test] [ca pool to use]" +} + +function verifyCertAgainstPool() +{ + if [[ "" == "$1" ]] + then + printUsage "verifyCertAgainstPool" + return 1 + fi + + if [[ "" == "$2" ]] + then + printUsage "verifyCertAgainstPool" + return 1 + fi + + echo " Verifying that this certificate:" + echo " - $1" + echo " is valid for this ca pool:" + echo " - $2" + echo "" + openssl verify -partial_chain -CAfile "$2" "$1" + if [ $? -eq 0 ]; then + echo "" + echo "============ SUCCESS! ============" + else + echo "" + echo "============ FAILED TO VALIDATE ============" + fi +} + +function showIssuerAndSubjectForPEM() +{ + echo "Displaying Issuer and Subject for cert pool:" + echo " $1" + openssl crl2pkcs7 -nocrl -certfile $1 | openssl pkcs7 -print_certs -text -noout | grep -E "(Subject|Issuer)" +} + +function createRouterPki { +pki_client_server "${ZITI_EDGE_ROUTER_RAWNAME}" "${ZITI_CONTROLLER_INTERMEDIATE_NAME}" "${ZITI_EDGE_ROUTER_IP_OVERRIDE}" +} + +function createPrivateRouterConfig { +cat > ${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.yaml < ${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.yaml < ${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.yaml < ${ZITI_HOME}/${ZITI_EDGE_ROUTER_RAWNAME}.yaml < ${ZITI_HOME}/identities.yml < ${ZITI_HOME}/controller.yaml </dev/null 2>&1 && pwd )" +