Skip to content

Commit f36c8d5

Browse files
Pangolin (#8809)
Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: Slaviša Arežina <[email protected]>
1 parent dab9200 commit f36c8d5

File tree

4 files changed

+274
-0
lines changed

4 files changed

+274
-0
lines changed

ct/headers/pangolin

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
____ ___
2+
/ __ \____ _____ ____ _____ / (_)___
3+
/ /_/ / __ `/ __ \/ __ `/ __ \/ / / __ \
4+
/ ____/ /_/ / / / / /_/ / /_/ / / / / / /
5+
/_/ \__,_/_/ /_/\__, /\____/_/_/_/ /_/
6+
/____/

ct/pangolin.sh

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Slaviša Arežina (tremor021)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://pangolin.net/
7+
8+
APP="Pangolin"
9+
var_tags="${var_tags:-proxy}"
10+
var_cpu="${var_cpu:-2}"
11+
var_ram="${var_ram:-4096}"
12+
var_disk="${var_disk:-5}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-13}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
var_tun="${var_tun:-1}"
17+
18+
header_info "$APP"
19+
variables
20+
color
21+
catch_errors
22+
23+
function update_script() {
24+
header_info
25+
check_container_storage
26+
check_container_resources
27+
if [[ ! -d /opt/pangolin ]]; then
28+
msg_error "No ${APP} Installation Found!"
29+
exit
30+
fi
31+
32+
if check_for_gh_release "pangolin" "fosrl/pangolin"; then
33+
msg_info "Stopping Service"
34+
systemctl stop pangolin
35+
msg_info "Service stopped"
36+
37+
msg_info "Creating backup"
38+
tar -czf /opt/pangolin_config_backup.tar.gz -C /opt/pangolin config
39+
msg_ok "Created backup"
40+
41+
fetch_and_deploy_gh_release "pangolin" "fosrl/pangolin" "tarball"
42+
fetch_and_deploy_gh_release "gerbil" "fosrl/gerbil" "singlefile" "latest" "/usr/bin" "gerbil_linux_amd64"
43+
44+
msg_info "Updating Pangolin"
45+
export BUILD=oss
46+
export DATABASE=sqlite
47+
cd /opt/pangolin
48+
$STD npm ci
49+
echo "export * from \"./$DATABASE\";" > server/db/index.ts
50+
echo "export const build = \"$BUILD\" as any;" > server/build.ts
51+
cp tsconfig.oss.json tsconfig.json
52+
$STD npm run next:build
53+
$STD node esbuild.mjs -e server/index.ts -o dist/server.mjs -b $BUILD
54+
$STD node esbuild.mjs -e server/setup/migrationsSqlite.ts -o dist/migrations.mjs
55+
$STD npm run build:cli
56+
cp -R .next/standalone ./
57+
58+
cat <<EOF >/usr/local/bin/pangctl
59+
#!/bin/sh
60+
cd /opt/pangolin
61+
./dist/cli.mjs "$@"
62+
EOF
63+
chmod +x /usr/local/bin/pangctl ./dist/cli.mjs
64+
cp server/db/names.json ./dist/names.json
65+
msg_ok "Updated Pangolin"
66+
67+
msg_info "Restoring config"
68+
tar -xzf /opt/pangolin_config_backup.tar.gz -C /opt/pangolin --overwrite
69+
rm -f /opt/pangolin_config_backup.tar.gz
70+
msg_ok "Restored config"
71+
msg_ok "Updated successfully!"
72+
fi
73+
exit
74+
}
75+
76+
start
77+
build_container
78+
description
79+
80+
msg_ok "Completed Successfully!\n"
81+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
82+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
83+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3002${CL}"

frontend/public/json/pangolin.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "Pangolin",
3+
"slug": "pangolin",
4+
"categories": [
5+
21
6+
],
7+
"date_created": "2025-11-01",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 3002,
12+
"documentation": "https://docs.pangolin.net/",
13+
"config_path": "/opt/pangolin/config/config.yml",
14+
"website": "https://pangolin.net/",
15+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/pangolin.webp",
16+
"description": "Pangolin securely routes traffic over WireGuard tunnels to any private network. It works like a reverse proxy that spans multiple networks — no public IPs, DNS setup, or certificates required.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/pangolin.sh",
21+
"resources": {
22+
"cpu": 2,
23+
"ram": 4096,
24+
"hdd": 5,
25+
"os": "Debian",
26+
"version": "13"
27+
}
28+
}
29+
],
30+
"default_credentials": {
31+
"username": null,
32+
"password": null
33+
},
34+
"notes": [
35+
{
36+
"text": "Type `journalctl -u pangolin | grep -oP 'Token:\\s*\\K\\w+'` into LXC console to get admin token which you will use to create admin account.",
37+
"type": "info"
38+
},
39+
{
40+
"text": "LXC has 4GB of RAM set initially for the build stage. After installation finishes, you can decrease the RAM allocated to 1024MB or 512MB even.",
41+
"type": "info"
42+
},
43+
{
44+
"text": "Make sure you edit `/opt/pangolin/config/config.yml` and change it to match your needs",
45+
"type": "warning"
46+
}
47+
]
48+
}

install/pangolin-install.sh

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Slaviša Arežina (tremor021)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://pangolin.net/
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 install -y \
18+
sqlite3 \
19+
iptables
20+
msg_ok "Installed Dependencies"
21+
22+
NODE_VERSION="22" setup_nodejs
23+
fetch_and_deploy_gh_release "pangolin" "fosrl/pangolin" "tarball"
24+
fetch_and_deploy_gh_release "gerbil" "fosrl/gerbil" "singlefile" "latest" "/usr/bin" "gerbil_linux_amd64"
25+
26+
msg_info "Setup Pangolin"
27+
IP_ADDR=$(hostname -I | awk '{print $1}')
28+
SECRET_KEY=$(openssl rand -base64 48 | tr -dc 'A-Za-z0-9' | head -c 32)
29+
export BUILD=oss
30+
export DATABASE=sqlite
31+
cd /opt/pangolin
32+
$STD npm ci
33+
echo "export * from \"./$DATABASE\";" > server/db/index.ts
34+
echo "export const build = \"$BUILD\" as any;" > server/build.ts
35+
cp tsconfig.oss.json tsconfig.json
36+
mkdir -p dist
37+
$STD npm run next:build
38+
$STD node esbuild.mjs -e server/index.ts -o dist/server.mjs -b $BUILD
39+
$STD node esbuild.mjs -e server/setup/migrationsSqlite.ts -o dist/migrations.mjs
40+
$STD npm run build:cli
41+
cp -R .next/standalone ./
42+
43+
cat <<EOF >/usr/local/bin/pangctl
44+
#!/bin/sh
45+
cd /opt/pangolin
46+
./dist/cli.mjs "$@"
47+
EOF
48+
chmod +x /usr/local/bin/pangctl ./dist/cli.mjs
49+
cp server/db/names.json ./dist/names.json
50+
mkdir -p /var/config
51+
52+
cat <<EOF >/opt/pangolin/config/config.yml
53+
app:
54+
dashboard_url: http://$IP_ADDR:3002
55+
log_level: debug
56+
57+
domains:
58+
domain1:
59+
base_domain: example.com
60+
61+
server:
62+
secret: $SECRET_KEY
63+
64+
gerbil:
65+
base_endpoint: example.com
66+
67+
orgs:
68+
block_size: 24
69+
subnet_group: 100.90.137.0/20
70+
71+
flags:
72+
require_email_verification: false
73+
disable_signup_without_invite: true
74+
disable_user_create_org: true
75+
allow_raw_resources: true
76+
enable_integration_api: true
77+
enable_clients: true
78+
EOF
79+
$STD npm run db:sqlite:generate
80+
$STD npm run db:sqlite:push
81+
82+
. /etc/os-release
83+
if [ "$VERSION_CODENAME" = "trixie" ]; then
84+
echo "net.ipv4.ip_forward=1" >>/etc/sysctl.d/sysctl.conf
85+
$STD sysctl -p /etc/sysctl.d/sysctl.conf
86+
else
87+
echo "net.ipv4.ip_forward=1" >>/etc/sysctl.conf
88+
$STD sysctl -p /etc/sysctl.conf
89+
fi
90+
msg_ok "Setup Pangolin"
91+
92+
msg_info "Creating Services"
93+
cat <<EOF >/etc/systemd/system/pangolin.service
94+
[Unit]
95+
Description=Pangolin Service
96+
After=network.target
97+
98+
[Service]
99+
Type=simple
100+
User=root
101+
WorkingDirectory=/opt/pangolin
102+
ExecStart=/usr/bin/npm start
103+
Restart=always
104+
RestartSec=10
105+
106+
[Install]
107+
WantedBy=multi-user.target
108+
EOF
109+
systemctl enable -q --now pangolin
110+
111+
cat <<EOF >/etc/systemd/system/gerbil.service
112+
[Unit]
113+
Description=Gerbil Service
114+
After=network.target
115+
Requires=pangolin.service
116+
117+
[Service]
118+
Type=simple
119+
User=root
120+
ExecStart=/usr/bin/gerbil --reachableAt=http://$IP_ADDR:3004 --generateAndSaveKeyTo=/var/config/key --remoteConfig=http://$IP_ADDR:3001/api/v1/
121+
Restart=always
122+
RestartSec=10
123+
124+
[Install]
125+
WantedBy=multi-user.target
126+
EOF
127+
systemctl enable -q --now gerbil
128+
msg_ok "Created Services"
129+
130+
motd_ssh
131+
customize
132+
133+
msg_info "Cleaning up"
134+
$STD apt -y autoremove
135+
$STD apt -y autoclean
136+
$STD apt -y clean
137+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)