Skip to content

Commit bb6e947

Browse files
'Add new script' (#3610)
1 parent 7cb2320 commit bb6e947

File tree

3 files changed

+135
-0
lines changed

3 files changed

+135
-0
lines changed

ct/openziti-tunnel.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-tunnel"
9+
var_tags="${var_tags:-network;openziti-tunnel}"
10+
var_cpu="${var_cpu:-1}"
11+
var_ram="${var_ram:-512}"
12+
var_disk="${var_disk:-2}"
13+
var_os="${var_os:-ubuntu}"
14+
var_version="${var_version:-24.04}"
15+
var_unprivileged="${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} Application was assigned the following IP:${CL}"
44+
echo -e "${TAB}${GATEWAY}${BGN}Address: ${IP}${CL}"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "openziti-tunnel",
3+
"slug": "openziti-tunnel",
4+
"categories": [
5+
4
6+
],
7+
"date_created": "2025-03-20",
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-tunnel.sh",
20+
"resources": {
21+
"cpu": 1,
22+
"ram": 512,
23+
"hdd": 2,
24+
"os": "Ubuntu",
25+
"version": "24.04"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": null,
31+
"password": null
32+
},
33+
"notes": [
34+
{
35+
"text": "The Openziti tunnel is installed in host mode; please see documentation for more information",
36+
"type": "info"
37+
},
38+
{
39+
"text": "Openziti tunnel prompts for identity enrollment token during installation",
40+
"type": "info"
41+
}
42+
]
43+
}

install/openziti-tunnel-install.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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 -sSLf 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 jammy main" >/etc/apt/sources.list.d/openziti.list
24+
$STD apt-get update
25+
$STD apt-get install -y ziti-edge-tunnel
26+
sed -i '0,/^ExecStart/ { /^ExecStart/ { n; s|^ExecStart.*|ExecStart=/opt/openziti/bin/ziti-edge-tunnel run-host --verbose=${ZITI_VERBOSE} --identity-dir=${ZITI_IDENTITY_DIR}| } }' /usr/lib/systemd/system/ziti-edge-tunnel.service
27+
systemctl daemon-reload
28+
msg_ok "Installed openziti"
29+
30+
read -r -p "Please paste an identity enrollment token(JTW)" prompt
31+
if [[ ${prompt} ]]; then
32+
msg_info "Adding identity"
33+
echo "${prompt}" >/opt/openziti/etc/identities/identity.jwt
34+
chown ziti:ziti /opt/openziti/etc/identities/identity.jwt
35+
systemctl enable -q --now ziti-edge-tunnel
36+
msg_ok "Service Started"
37+
else
38+
systemctl enable -q ziti-edge-tunnel
39+
msg_error "No identity provided; please place an identity file in /opt/openziti/etc/identities/ and restart the service"
40+
fi
41+
42+
motd_ssh
43+
customize
44+
45+
msg_info "Cleaning up"
46+
$STD apt-get -y autoremove
47+
$STD apt-get -y autoclean
48+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)