From 13724f59f1a113c4e11d8f44957e24e58a31cfba Mon Sep 17 00:00:00 2001 From: Edward Moscardini Date: Tue, 25 Mar 2025 12:34:54 -0400 Subject: [PATCH 01/14] initial version of openziti-controller install --- ct/openziti-controller.sh | 42 +++++++++++++++++ frontend/public/json/openziti-controller.json | 43 +++++++++++++++++ install/openziti-controller-install.sh | 46 +++++++++++++++++++ 3 files changed, 131 insertions(+) create mode 100644 ct/openziti-controller.sh create mode 100644 frontend/public/json/openziti-controller.json create mode 100644 install/openziti-controller-install.sh diff --git a/ct/openziti-controller.sh b/ct/openziti-controller.sh new file mode 100644 index 00000000..136071c3 --- /dev/null +++ b/ct/openziti-controller.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: emoscardini +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/openziti/ziti + +APP="openziti-controller" +var_tags="network;openziti-controller" +var_cpu="2" +var_ram="1024" +var_disk="8" +var_os="ubuntu" +var_version="24.04" +var_unprivileged="1" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /var ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Updating $APP LXC" + $STD apt-get update + $STD apt-get -y upgrade + msg_ok "Updated $APP LXC" + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" \ No newline at end of file diff --git a/frontend/public/json/openziti-controller.json b/frontend/public/json/openziti-controller.json new file mode 100644 index 00000000..005845c5 --- /dev/null +++ b/frontend/public/json/openziti-controller.json @@ -0,0 +1,43 @@ +{ + "name": "openziti-controller", + "slug": "openziti-controller", + "categories": [ + 4 + ], + "date_created": "2025-03-20", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": null, + "documentation": "https://openziti.io/docs/reference/tunnelers/docker/", + "website": "https://www.openziti.io/", + "logo": "https://raw.githubusercontent.com/openziti/ziti-doc/main/docusaurus/static/img/ziti-logo-dark.svg", + "description": "OpenZiti is an open-source, zero trust networking platform that enables secure connectivity between applications, services, and devices. It provides secure, encrypted connections between clients and services, and can be used to create secure, zero trust networks.", + "install_methods": [ + { + "type": "default", + "script": "ct/openziti-controller.sh", + "resources": { + "cpu": 2, + "ram": 1024, + "hdd": 8, + "os": "Ubuntu", + "version": "24.04" + } + } + ], + "default_credentials": { + "username": "created during installation", + "password": "created during installation" + }, + "notes": [ + { + "text": "The Openziti Controller installation will prompt for configuration settings during installation.", + "type": "info" + }, + { + "text": "Access the web interface at https://:/zac after installation and configuration are complete.", + "type": "info" + } + ] +} diff --git a/install/openziti-controller-install.sh b/install/openziti-controller-install.sh new file mode 100644 index 00000000..17b4e60a --- /dev/null +++ b/install/openziti-controller-install.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: emoscardini +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/openziti/ziti + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os +install_core_deps + +msg_info "Installing Dependencies" +$STD apt-get install -y gpg +msg_ok "Installed Dependencies" + +msg_info "Installing openziti" +mkdir -p --mode=0755 /usr/share/keyrings +curl -sSLf https://get.openziti.io/tun/package-repos.gpg | gpg --dearmor -o /usr/share/keyrings/openziti.gpg +echo "deb [signed-by=/usr/share/keyrings/openziti.gpg] https://packages.openziti.org/zitipax-openziti-deb-stable debian main" > /etc/apt/sources.list.d/openziti.list +$STD apt-get update +$STD apt-get install -y openziti-controller openziti-console +msg_ok "Installed openziti" + +read -r -p "Would you like to go through the auto configuration now? " prompt +if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then + msg_info "Starting Configuration" + bash /opt/openziti/etc/controller/bootstrap.bash + msg_ok "Configuration Completed" + systemctl enable -q --now ziti-controller +else + systemctl enable -q ziti-controller + msg_err "Configration not provided; Please run /opt/openziti/etc/controller/bootstrap.bash to configure the controller and restart the service" +fi + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" From 716bda24e2f51881537f61a1b78764f93b8500d3 Mon Sep 17 00:00:00 2001 From: Edward Moscardini Date: Tue, 25 Mar 2025 16:16:22 -0400 Subject: [PATCH 02/14] make search for install more specific --- ct/openziti-controller.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/openziti-controller.sh b/ct/openziti-controller.sh index 136071c3..332be013 100644 --- a/ct/openziti-controller.sh +++ b/ct/openziti-controller.sh @@ -23,7 +23,7 @@ function update_script() { header_info check_container_storage check_container_resources - if [[ ! -d /var ]]; then + if [[ ! -d /opt/openziti ]]; then msg_error "No ${APP} Installation Found!" exit fi From 9089a5b7c20032f11f583638d5e03c9e4d0e3ec4 Mon Sep 17 00:00:00 2001 From: Edward Moscardini Date: Tue, 25 Mar 2025 16:25:34 -0400 Subject: [PATCH 03/14] move access info to .sh file; update credentials to null/null --- ct/openziti-controller.sh | 3 ++- frontend/public/json/openziti-controller.json | 8 ++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ct/openziti-controller.sh b/ct/openziti-controller.sh index 332be013..86cb04c5 100644 --- a/ct/openziti-controller.sh +++ b/ct/openziti-controller.sh @@ -39,4 +39,5 @@ build_container description msg_ok "Completed Successfully!\n" -echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" \ No newline at end of file +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "Access the web interface at https://${IP}:/zac" \ No newline at end of file diff --git a/frontend/public/json/openziti-controller.json b/frontend/public/json/openziti-controller.json index 005845c5..c91ea0cc 100644 --- a/frontend/public/json/openziti-controller.json +++ b/frontend/public/json/openziti-controller.json @@ -27,17 +27,13 @@ } ], "default_credentials": { - "username": "created during installation", - "password": "created during installation" + "username": null, + "password": null }, "notes": [ { "text": "The Openziti Controller installation will prompt for configuration settings during installation.", "type": "info" - }, - { - "text": "Access the web interface at https://:/zac after installation and configuration are complete.", - "type": "info" } ] } From 0492f76d0d869f716d197f68e74b8b7d4d9bed34 Mon Sep 17 00:00:00 2001 From: Edward Moscardini Date: Wed, 26 Mar 2025 13:59:19 -0400 Subject: [PATCH 04/14] changed error message to say restart container --- install/openziti-controller-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/openziti-controller-install.sh b/install/openziti-controller-install.sh index 17b4e60a..2e00c211 100644 --- a/install/openziti-controller-install.sh +++ b/install/openziti-controller-install.sh @@ -34,7 +34,7 @@ if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then systemctl enable -q --now ziti-controller else systemctl enable -q ziti-controller - msg_err "Configration not provided; Please run /opt/openziti/etc/controller/bootstrap.bash to configure the controller and restart the service" + msg_err "Configration not provided; Please run /opt/openziti/etc/controller/bootstrap.bash to configure the controller and restart the container" fi motd_ssh From 788b62dbf3c3728bba2ea77ae789d196e80b73b5 Mon Sep 17 00:00:00 2001 From: Edward Moscardini Date: Wed, 26 Mar 2025 15:27:46 -0400 Subject: [PATCH 05/14] remove install_core_deps --- install/openziti-controller-install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install/openziti-controller-install.sh b/install/openziti-controller-install.sh index 2e00c211..8dcf8137 100644 --- a/install/openziti-controller-install.sh +++ b/install/openziti-controller-install.sh @@ -12,7 +12,6 @@ catch_errors setting_up_container network_check update_os -install_core_deps msg_info "Installing Dependencies" $STD apt-get install -y gpg From 2045927f8821698c23ea4a29fcb9fad896988808 Mon Sep 17 00:00:00 2001 From: Edward Moscardini Date: Wed, 26 Mar 2025 15:47:26 -0400 Subject: [PATCH 06/14] fix msg_err to msg_error --- install/openziti-controller-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/openziti-controller-install.sh b/install/openziti-controller-install.sh index 8dcf8137..1d8b4a28 100644 --- a/install/openziti-controller-install.sh +++ b/install/openziti-controller-install.sh @@ -33,7 +33,7 @@ if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then systemctl enable -q --now ziti-controller else systemctl enable -q ziti-controller - msg_err "Configration not provided; Please run /opt/openziti/etc/controller/bootstrap.bash to configure the controller and restart the container" + msg_error "Configration not provided; Please run /opt/openziti/etc/controller/bootstrap.bash to configure the controller and restart the container" fi motd_ssh From f942d17845a060ffaeaa907943e27fd4ca34b5cd Mon Sep 17 00:00:00 2001 From: Edward Moscardini Date: Wed, 26 Mar 2025 16:50:25 -0400 Subject: [PATCH 07/14] update end of scritp echo --- ct/openziti-controller.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ct/openziti-controller.sh b/ct/openziti-controller.sh index 86cb04c5..b4f68231 100644 --- a/ct/openziti-controller.sh +++ b/ct/openziti-controller.sh @@ -40,4 +40,5 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" -echo -e "Access the web interface at https://${IP}:/zac" \ No newline at end of file +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:/zac${CL}" \ No newline at end of file From 7bf98d007d38c5037b5356137f35f89d3ec61fe6 Mon Sep 17 00:00:00 2001 From: Edward Moscardini Date: Wed, 26 Mar 2025 16:59:44 -0400 Subject: [PATCH 08/14] conflict in VERBOSE usage between build.func & bootstrap script, so forcing vebosity to 0 --- install/openziti-controller-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/openziti-controller-install.sh b/install/openziti-controller-install.sh index 1d8b4a28..3a9b66c6 100644 --- a/install/openziti-controller-install.sh +++ b/install/openziti-controller-install.sh @@ -28,7 +28,7 @@ msg_ok "Installed openziti" read -r -p "Would you like to go through the auto configuration now? " prompt if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then msg_info "Starting Configuration" - bash /opt/openziti/etc/controller/bootstrap.bash + env VERBOSE=0 bash /opt/openziti/etc/controller/bootstrap.bash msg_ok "Configuration Completed" systemctl enable -q --now ziti-controller else From 4c63e28470d4feb97c3cb4c59c0547cd0cd9b78f Mon Sep 17 00:00:00 2001 From: Edward Moscardini Date: Wed, 26 Mar 2025 17:05:33 -0400 Subject: [PATCH 09/14] fix protocol in end if script output --- ct/openziti-controller.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/openziti-controller.sh b/ct/openziti-controller.sh index b4f68231..0ccc2ea8 100644 --- a/ct/openziti-controller.sh +++ b/ct/openziti-controller.sh @@ -41,4 +41,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:/zac${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}https://${IP}:/zac${CL}" \ No newline at end of file From 2f81bce8a2e309ecbc2380c633e9435437789203 Mon Sep 17 00:00:00 2001 From: Edward Moscardini Date: Thu, 27 Mar 2025 12:36:14 -0400 Subject: [PATCH 10/14] switched to debian --- ct/openziti-controller.sh | 4 ++-- frontend/public/json/openziti-controller.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ct/openziti-controller.sh b/ct/openziti-controller.sh index 0ccc2ea8..1a6aa253 100644 --- a/ct/openziti-controller.sh +++ b/ct/openziti-controller.sh @@ -10,8 +10,8 @@ var_tags="network;openziti-controller" var_cpu="2" var_ram="1024" var_disk="8" -var_os="ubuntu" -var_version="24.04" +var_os="debian" +var_version="12" var_unprivileged="1" header_info "$APP" diff --git a/frontend/public/json/openziti-controller.json b/frontend/public/json/openziti-controller.json index c91ea0cc..cfe49bf7 100644 --- a/frontend/public/json/openziti-controller.json +++ b/frontend/public/json/openziti-controller.json @@ -21,8 +21,8 @@ "cpu": 2, "ram": 1024, "hdd": 8, - "os": "Ubuntu", - "version": "24.04" + "os": "Debian", + "version": "12" } } ], From a74d61f8c9dcb913245a356aad27af0c612f0fa5 Mon Sep 17 00:00:00 2001 From: Edward Moscardini Date: Thu, 27 Mar 2025 13:41:28 -0400 Subject: [PATCH 11/14] 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 3a9b66c6..4d06ecfe 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 From 973bd62fd9e0ebaa591e8509e2cc3d1ebe76dff9 Mon Sep 17 00:00:00 2001 From: Edward Moscardini Date: Thu, 27 Mar 2025 15:01:43 -0400 Subject: [PATCH 12/14] switch to writing env file --- install/openziti-controller-install.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/install/openziti-controller-install.sh b/install/openziti-controller-install.sh index 4d06ecfe..767ba381 100644 --- a/install/openziti-controller-install.sh +++ b/install/openziti-controller-install.sh @@ -25,7 +25,6 @@ $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 IPADDRESS=$(hostname -I | awk '{print $1}') @@ -39,12 +38,12 @@ if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then 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 + CONFIG_FILE="/opt/openziti/etc/controller/bootstrap.env" + sed -i "s|^ZITI_CTRL_ADVERTISED_ADDRESS=.*|ZITI_CTRL_ADVERTISED_ADDRESS='${ZITI_CTRL_ADVERTISED_ADDRESS}'|" "$CONFIG_FILE" + sed -i "s|^ZITI_CTRL_ADVERTISED_PORT=.*|ZITI_CTRL_ADVERTISED_PORT='${ZITI_CTRL_ADVERTISED_PORT}'|" "$CONFIG_FILE" + sed -i "s|^ZITI_USER=.*|ZITI_USER='${ZITI_USER}'|" "$CONFIG_FILE" + sed -i "s|^ZITI_PWD=.*|ZITI_PWD='${ZITI_PWD}'|" "$CONFIG_FILE" + env VERBOSE=0 bash /opt/openziti/etc/controller/bootstrap.bash msg_ok "Configuration Completed" systemctl enable -q --now ziti-controller else From b0dedc8a71a95e28840a8f100b2329c3e5eb7785 Mon Sep 17 00:00:00 2001 From: Edward Moscardini <57814088+emoscardini@users.noreply.github.com> Date: Thu, 27 Mar 2025 15:37:29 -0400 Subject: [PATCH 13/14] Update frontend/public/json/openziti-controller.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit switch to lowercase Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com> --- frontend/public/json/openziti-controller.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/public/json/openziti-controller.json b/frontend/public/json/openziti-controller.json index cfe49bf7..2089e675 100644 --- a/frontend/public/json/openziti-controller.json +++ b/frontend/public/json/openziti-controller.json @@ -21,7 +21,7 @@ "cpu": 2, "ram": 1024, "hdd": 8, - "os": "Debian", + "os": "debian", "version": "12" } } From 0a3178b29fedaf30cfdab4ba3d405becc80a8870 Mon Sep 17 00:00:00 2001 From: Edward Moscardini <57814088+emoscardini@users.noreply.github.com> Date: Thu, 27 Mar 2025 15:37:59 -0400 Subject: [PATCH 14/14] Update install/openziti-controller-install.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit remove space from redirect Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com> --- install/openziti-controller-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/openziti-controller-install.sh b/install/openziti-controller-install.sh index 767ba381..2df0d318 100644 --- a/install/openziti-controller-install.sh +++ b/install/openziti-controller-install.sh @@ -20,7 +20,7 @@ msg_ok "Installed Dependencies" msg_info "Installing openziti" mkdir -p --mode=0755 /usr/share/keyrings curl -sSLf https://get.openziti.io/tun/package-repos.gpg | gpg --dearmor -o /usr/share/keyrings/openziti.gpg -echo "deb [signed-by=/usr/share/keyrings/openziti.gpg] https://packages.openziti.org/zitipax-openziti-deb-stable debian main" > /etc/apt/sources.list.d/openziti.list +echo "deb [signed-by=/usr/share/keyrings/openziti.gpg] https://packages.openziti.org/zitipax-openziti-deb-stable debian main" >/etc/apt/sources.list.d/openziti.list $STD apt-get update $STD apt-get install -y openziti-controller openziti-console msg_ok "Installed openziti"