Skip to content

Commit b87871f

Browse files
openziti-controller (#3880)
* 'Add new script' * adjust date * change curl to harmonize --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: CanbiZ <[email protected]>
1 parent 4403635 commit b87871f

File tree

3 files changed

+143
-0
lines changed

3 files changed

+143
-0
lines changed

ct/openziti-controller.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: emoscardini
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/openziti/ziti
7+
8+
APP="openziti-controller"
9+
var_tags="network;openziti-controller"
10+
var_cpu="2"
11+
var_ram="1024"
12+
var_disk="8"
13+
var_os="debian"
14+
var_version="12"
15+
var_unprivileged="1"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
if [[ ! -d /opt/openziti ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
msg_info "Updating $APP LXC"
31+
$STD apt-get update
32+
$STD apt-get -y upgrade
33+
msg_ok "Updated $APP LXC"
34+
exit
35+
}
36+
37+
start
38+
build_container
39+
description
40+
41+
msg_ok "Completed Successfully!\n"
42+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
43+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
44+
echo -e "${TAB}${GATEWAY}${BGN}https://${IP}:<port>/zac${CL}"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "openziti-controller",
3+
"slug": "openziti-controller",
4+
"categories": [
5+
4
6+
],
7+
"date_created": "2025-04-14",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": null,
12+
"documentation": "https://openziti.io/docs/reference/tunnelers/docker/",
13+
"website": "https://www.openziti.io/",
14+
"logo": "https://raw.githubusercontent.com/openziti/ziti-doc/main/docusaurus/static/img/ziti-logo-dark.svg",
15+
"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.",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/openziti-controller.sh",
20+
"resources": {
21+
"cpu": 2,
22+
"ram": 1024,
23+
"hdd": 8,
24+
"os": "debian",
25+
"version": "12"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": null,
31+
"password": null
32+
},
33+
"notes": [
34+
{
35+
"text": "The Openziti Controller installation will prompt for configuration settings during installation.",
36+
"type": "info"
37+
}
38+
]
39+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: emoscardini
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/openziti/ziti
7+
8+
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y gpg
18+
msg_ok "Installed Dependencies"
19+
20+
msg_info "Installing openziti"
21+
mkdir -p --mode=0755 /usr/share/keyrings
22+
curl -fsSL https://get.openziti.io/tun/package-repos.gpg | gpg --dearmor -o /usr/share/keyrings/openziti.gpg
23+
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
24+
$STD apt-get update
25+
$STD apt-get install -y openziti-controller openziti-console
26+
msg_ok "Installed openziti"
27+
28+
read -r -p "Would you like to go through the auto configuration now? <y/N>" prompt
29+
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
30+
IPADDRESS=$(hostname -I | awk '{print $1}')
31+
GEN_FQDN="controller.${IPADDRESS}.sslip.io"
32+
read -r -p "Please enter the controller FQDN [${GEN_FQDN}]: " ZITI_CTRL_ADVERTISED_ADDRESS
33+
ZITI_CTRL_ADVERTISED_ADDRESS=${ZITI_CTRL_ADVERTISED_ADDRESS:-$GEN_FQDN}
34+
read -r -p "Please enter the controller port [1280]: " ZITI_CTRL_ADVERTISED_PORT
35+
ZITI_CTRL_ADVERTISED_PORT=${ZITI_CTRL_ADVERTISED_PORT:-1280}
36+
read -r -p "Please enter the controller admin user [admin]: " ZITI_USER
37+
ZITI_USER=${ZITI_USER:-admin}
38+
GEN_PWD=$(head -c128 /dev/urandom | LC_ALL=C tr -dc 'A-Za-z0-9!@#$%^*_+~' | cut -c 1-12)
39+
read -r -p "Please enter the controller admin password [${GEN_PWD}]:" ZITI_PWD
40+
ZITI_PWD=${ZITI_PWD:-$GEN_PWD}
41+
CONFIG_FILE="/opt/openziti/etc/controller/bootstrap.env"
42+
sed -i "s|^ZITI_CTRL_ADVERTISED_ADDRESS=.*|ZITI_CTRL_ADVERTISED_ADDRESS='${ZITI_CTRL_ADVERTISED_ADDRESS}'|" "$CONFIG_FILE"
43+
sed -i "s|^ZITI_CTRL_ADVERTISED_PORT=.*|ZITI_CTRL_ADVERTISED_PORT='${ZITI_CTRL_ADVERTISED_PORT}'|" "$CONFIG_FILE"
44+
sed -i "s|^ZITI_USER=.*|ZITI_USER='${ZITI_USER}'|" "$CONFIG_FILE"
45+
sed -i "s|^ZITI_PWD=.*|ZITI_PWD='${ZITI_PWD}'|" "$CONFIG_FILE"
46+
env VERBOSE=0 bash /opt/openziti/etc/controller/bootstrap.bash
47+
msg_ok "Configuration Completed"
48+
systemctl enable -q --now ziti-controller
49+
else
50+
systemctl enable -q ziti-controller
51+
msg_error "Configration not provided; Please run /opt/openziti/etc/controller/bootstrap.bash to configure the controller and restart the container"
52+
fi
53+
54+
motd_ssh
55+
customize
56+
57+
msg_info "Cleaning up"
58+
$STD apt-get -y autoremove
59+
$STD apt-get -y autoclean
60+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)