From a74d61f8c9dcb913245a356aad27af0c612f0fa5 Mon Sep 17 00:00:00 2001 From: Edward Moscardini Date: Thu, 27 Mar 2025 13:41:28 -0400 Subject: [PATCH] improve auto configuration --- install/openziti-controller-install.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/install/openziti-controller-install.sh b/install/openziti-controller-install.sh index 3a9b66c..4d06ecf 100644 --- a/install/openziti-controller-install.sh +++ b/install/openziti-controller-install.sh @@ -25,10 +25,26 @@ $STD apt-get update $STD apt-get install -y openziti-controller openziti-console msg_ok "Installed openziti" +msg_info "Starting configuration" read -r -p "Would you like to go through the auto configuration now? " prompt if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then - msg_info "Starting Configuration" - env VERBOSE=0 bash /opt/openziti/etc/controller/bootstrap.bash + IPADDRESS=$(hostname -I | awk '{print $1}') + GEN_FQDN="controller.${IPADDRESS}.sslip.io" + read -r -p "Please enter the controller FQDN [${GEN_FQDN}]: " ZITI_CTRL_ADVERTISED_ADDRESS + ZITI_CTRL_ADVERTISED_ADDRESS=${ZITI_CTRL_ADVERTISED_ADDRESS:-$GEN_FQDN} + read -r -p "Please enter the controller port [1280]: " ZITI_CTRL_ADVERTISED_PORT + ZITI_CTRL_ADVERTISED_PORT=${ZITI_CTRL_ADVERTISED_PORT:-1280} + read -r -p "Please enter the controller admin user [admin]: " ZITI_USER + ZITI_USER=${ZITI_USER:-admin} + GEN_PWD=$(head -c128 /dev/urandom | LC_ALL=C tr -dc 'A-Za-z0-9!@#$%^*_+~' | cut -c 1-12) + read -r -p "Please enter the controller admin password [${GEN_PWD}]:" ZITI_PWD + ZITI_PWD=${ZITI_PWD:-$GEN_PWD} + env VERBOSE=0 \ + ZITI_CTRL_ADVERTISED_ADDRESS="$ZITI_CTRL_ADVERTISED_ADDRESS" \ + ZITI_CTRL_ADVERTISED_PORT="$ZITI_CTRL_ADVERTISED_PORT" \ + ZITI_USER="$ZITI_USER" \ + ZITI_PWD="$ZITI_PWD" \ + bash /opt/openziti/etc/controller/bootstrap.bash msg_ok "Configuration Completed" systemctl enable -q --now ziti-controller else