improve auto configuration

This commit is contained in:
Edward Moscardini 2025-03-27 13:41:28 -04:00
parent 2f81bce8a2
commit a74d61f8c9
No known key found for this signature in database
GPG Key ID: A00DAB80E4E936C9

View File

@ -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? <y/N>" 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