Skip to content

Commit a426e80

Browse files
authored
NPMplus (NginxProxyManager-plus) (#3051)
1 parent ed93923 commit a426e80

File tree

3 files changed

+202
-0
lines changed

3 files changed

+202
-0
lines changed

ct/npmplus.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
6+
# Source: https://github.com/ZoeyVid/NPMplus
7+
8+
APP="NPMplus"
9+
var_tags="proxy;nginx"
10+
var_cpu="1"
11+
var_ram="512"
12+
var_disk="3"
13+
var_os="alpine"
14+
var_version="3.21"
15+
var_unprivileged="1"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
UPD=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SUPPORT" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 1 \
24+
"1" "Check for Alpine Updates" ON \
25+
3>&1 1>&2 2>&3)
26+
27+
header_info
28+
if [ "$UPD" == "1" ]; then
29+
apk update && apk upgrade
30+
exit
31+
fi
32+
}
33+
34+
start
35+
build_container
36+
description
37+
38+
msg_ok "Completed Successfully!\n"
39+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
40+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
41+
echo -e "${TAB}${GATEWAY}${BGN}https://${IP}:81${CL}"

install/npmplus-install.sh

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/ZoeyVid/NPMplus
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 apk add \
18+
newt \
19+
curl \
20+
openssh \
21+
tzdata \
22+
nano \
23+
gawk \
24+
yq \
25+
mc
26+
27+
msg_ok "Installed Dependencies"
28+
29+
msg_info "Installing Docker & Compose"
30+
$STD apk add docker
31+
$STD rc-service docker start
32+
$STD rc-update add docker default
33+
34+
get_latest_release() {
35+
curl -sL https://api.github.com/repos/$1/releases/latest | grep '"tag_name":' | cut -d'"' -f4
36+
}
37+
DOCKER_COMPOSE_LATEST_VERSION=$(get_latest_release "docker/compose")
38+
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
39+
mkdir -p $DOCKER_CONFIG/cli-plugins
40+
curl -sSL https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_LATEST_VERSION/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
41+
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
42+
msg_ok "Installed Docker & Compose"
43+
44+
msg_info "Fetching NPMplus"
45+
cd /opt
46+
wget -q https://raw.githubusercontent.com/ZoeyVid/NPMplus/refs/heads/develop/compose.yaml
47+
msg_ok "Fetched NPMplus"
48+
49+
attempts=0
50+
while true; do
51+
read -r -p "Enter your TZ Identifier (e.g., Europe/Berlin): " TZ_INPUT
52+
if validate_tz "$TZ_INPUT"; then
53+
break
54+
fi
55+
msg_error "Invalid timezone! Please enter a valid TZ identifier."
56+
57+
attempts=$((attempts + 1))
58+
if [[ "$attempts" -ge 3 ]]; then
59+
msg_error "Maximum attempts reached. Exiting."
60+
exit 1
61+
fi
62+
done
63+
64+
read -r -p "Enter your ACME Email: " ACME_EMAIL_INPUT
65+
66+
yq -i "
67+
.services.npmplus.environment |=
68+
(map(select(. != \"TZ=*\" and . != \"ACME_EMAIL=*\")) +
69+
[\"TZ=$TZ_INPUT\", \"ACME_EMAIL=$ACME_EMAIL_INPUT\"])
70+
" /opt/compose.yaml
71+
72+
msg_info "Building and Starting NPMplus (Patience)"
73+
$STD docker compose up -d
74+
CONTAINER_ID=""
75+
for i in {1..60}; do
76+
CONTAINER_ID=$(docker ps --filter "name=npmplus" --format "{{.ID}}")
77+
if [[ -n "$CONTAINER_ID" ]]; then
78+
STATUS=$(docker inspect --format '{{.State.Health.Status}}' "$CONTAINER_ID" 2>/dev/null || echo "starting")
79+
if [[ "$STATUS" == "healthy" ]]; then
80+
msg_ok "NPMplus is running and healthy"
81+
break
82+
elif [[ "$STATUS" == "unhealthy" ]]; then
83+
msg_error "NPMplus container is unhealthy! Check logs."
84+
docker logs "$CONTAINER_ID"
85+
exit 1
86+
fi
87+
fi
88+
sleep 2
89+
[[ $i -eq 60 ]] && msg_error "NPMplus container did not become healthy within 120s." && docker logs "$CONTAINER_ID" && exit 1
90+
done
91+
msg_ok "Builded and started NPMplus"
92+
93+
motd_ssh
94+
customize
95+
96+
msg_info "Retrieving Default Login (Patience)"
97+
for i in {1..60}; do
98+
PASSWORD_LINE=$(docker logs "$CONTAINER_ID" 2>&1 | awk '/Creating a new user:/ {print; exit}')
99+
if [[ -n "$PASSWORD_LINE" ]]; then
100+
PASSWORD=$(echo "$PASSWORD_LINE" | awk -F 'password: ' '{print $2}')
101+
echo -e "username: [email protected]\npassword: $PASSWORD" >/opt/.npm_pwd
102+
msg_ok "Saved default login to /opt/.npm_pwd"
103+
exit 0
104+
fi
105+
sleep 2
106+
[[ $i -eq 60 ]] && msg_error "Failed to retrieve default login credentials." && exit 1
107+
done

json/npmplus.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"name": "NPMplus",
3+
"slug": "npmplus",
4+
"categories": [
5+
21
6+
],
7+
"date_created": "2025-03-13",
8+
"type": "ct",
9+
"updateable": false,
10+
"privileged": false,
11+
"interface_port": 81,
12+
"documentation": null,
13+
"website": "https://github.com/ZoeyVid/NPMplus",
14+
"logo": "https://raw.githubusercontent.com/ZoeyVid/NPMplus/refs/heads/develop/frontend/app-images/logo-256.png",
15+
"description": "NPMplus is an enhanced version of Nginx Proxy Manager. It simplifies the process of setting up reverse proxies with TLS termination through a user-friendly web interface. Key features include HTTP/3 support, integration with CrowdSec IPS, inclusion of GoAccess for real-time log analysis, and support for ModSecurity with the Core Rule Set.",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/npmplus.sh",
20+
"resources": {
21+
"cpu": 1,
22+
"ram": 512,
23+
"hdd": 3,
24+
"os": "alpine",
25+
"version": "3.21"
26+
}
27+
},
28+
{
29+
"type": "alpine",
30+
"script": "ct/npmplus.sh",
31+
"resources": {
32+
"cpu": 1,
33+
"ram": 512,
34+
"hdd": 3,
35+
"os": "alpine",
36+
"version": "3.21"
37+
}
38+
}
39+
],
40+
"default_credentials": {
41+
"username": "root",
42+
"password": null
43+
},
44+
"notes": [
45+
{
46+
"text": "The initial starting process can be take 1-2min. ",
47+
"type": "info"
48+
},
49+
{
50+
"text": "Application credentials: ´cat /opt/.npm_pwd´",
51+
"type": "info"
52+
}
53+
]
54+
}

0 commit comments

Comments
 (0)