Skip to content

Commit a6f656e

Browse files
New Script: Zerotier Controller (#1928)
* add zerotier script * Update ct/zerotier-one.sh Co-authored-by: Michel Roegl-Brunner <[email protected]> * Update ct/zerotier-one.sh Co-authored-by: Michel Roegl-Brunner <[email protected]> * Update ct/zerotier-one.sh Co-authored-by: Michel Roegl-Brunner <[email protected]> * Update install/zerotier-one-install.sh Co-authored-by: Michel Roegl-Brunner <[email protected]> * Update install/zerotier-one-install.sh Co-authored-by: Michel Roegl-Brunner <[email protected]> * remove sleep * improvements to install procedure * fixes --------- Co-authored-by: Michel Roegl-Brunner <[email protected]>
1 parent 43646a8 commit a6f656e

File tree

3 files changed

+137
-0
lines changed

3 files changed

+137
-0
lines changed

ct/zerotier-one.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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: tremor021
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
7+
8+
# App Default Values
9+
APP="Zerotier-One"
10+
var_tags="networking"
11+
var_cpu="1"
12+
var_ram="512"
13+
var_disk="4"
14+
var_os="debian"
15+
var_version="12"
16+
var_unprivileged="1"
17+
18+
# App Output & Base Settings
19+
header_info "$APP"
20+
base_settings
21+
22+
# Core
23+
variables
24+
color
25+
catch_errors
26+
27+
function update_script() {
28+
header_info
29+
check_container_storage
30+
check_container_resources
31+
32+
if [[ ! -f /usr/sbin/zerotier-one ]]; then
33+
msg_error "No ${APP} Installation Found!"
34+
exit
35+
fi
36+
msg_info "Stopping Service"
37+
systemctl stop zerotier-one
38+
msg_ok "Stopping Service"
39+
msg_info "Updating ${APP}"
40+
apt-get update &>/dev/null
41+
apt-get -y upgrade
42+
msg_ok "Updated ${APP}"
43+
44+
msg_info "Starting Service"
45+
systemctl start zerotier-one
46+
msg_ok "Started Service"
47+
exit
48+
}
49+
50+
start
51+
build_container
52+
description
53+
54+
msg_ok "Completed Successfully!\n"
55+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
56+
echo -e "${INFO}${YW} Access it using the following IP:${CL}"
57+
echo -e "${TAB}${GATEWAY}${BGN}https://${IP}:3443${CL}"

install/zerotier-one-install.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env bash
2+
3+
#Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: tremor021
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
7+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
8+
color
9+
verb_ip6
10+
catch_errors
11+
setting_up_container
12+
network_check
13+
update_os
14+
15+
msg_info "Installing Dependencies"
16+
$STD apt-get install -y \
17+
curl \
18+
mc \
19+
sudo
20+
msg_ok "Installed Dependencies"
21+
22+
msg_info "Setting up Zerotier-One"
23+
curl -s 'https://raw.githubusercontent.com/zerotier/ZeroTierOne/main/doc/contact%40zerotier.com.gpg' | gpg --import && \
24+
if z="$(curl -s 'https://install.zerotier.com/' | gpg)"; then
25+
echo "$z" | sudo bash
26+
fi
27+
msg_ok "Setup Zerotier-One"
28+
29+
msg_info "Setting up UI"
30+
curl -O https://s3-us-west-1.amazonaws.com/key-networks/deb/ztncui/1/x86_64/ztncui_0.8.14_amd64.deb
31+
dpkg -i ztncui_0.8.14_amd64.deb
32+
sh -c "echo ZT_TOKEN=$(cat /var/lib/zerotier-one/authtoken.secret) > /opt/key-networks/ztncui/.env"
33+
echo HTTPS_PORT=3443 >> /opt/key-networks/ztncui/.env
34+
echo NODE_ENV=production >> /opt/key-networks/ztncui/.env
35+
chmod 400 /opt/key-networks/ztncui/.env
36+
chown ztncui:ztncui /opt/key-networks/ztncui/.env
37+
systemctl restart ztncui
38+
msg_ok "Done setting up UI."
39+
40+
motd_ssh
41+
customize
42+
43+
msg_info "Cleaning up"
44+
$STD apt-get -y autoremove
45+
$STD apt-get -y autoclean
46+
msg_ok "Cleaned"

json/zerotier-one.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "Zerotier-One",
3+
"slug": "zerotier-one",
4+
"categories": [
5+
4
6+
],
7+
"date_created": "2024-05-02",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 3443,
12+
"documentation": "https://https://docs.zerotier.com/",
13+
"website": "https://www.zerotier.com/",
14+
"logo": "https://www.zerotier.com/wp-content/uploads/2025/01/Logo-White.svg",
15+
"description": "ZeroTier is a secure network overlay that allows you to manage all of your network resources as if they were on the same LAN. The software-defined solution can be deployed in minutes from anywhere. No matter how many devices you need to connect, or where they are in the world, ZeroTier makes global networking simple.",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/debian.sh",
20+
"resources": {
21+
"cpu": 1,
22+
"ram": 512,
23+
"hdd": 4,
24+
"os": "debian",
25+
"version": "12"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": "admin",
31+
"password": "password"
32+
},
33+
"notes": []
34+
}

0 commit comments

Comments
 (0)