Skip to content

Commit ac89626

Browse files
authored
Enhance nginx proxy manager install script (#8400)
1 parent 72ecf11 commit ac89626

File tree

1 file changed

+17
-26
lines changed

1 file changed

+17
-26
lines changed

install/nginxproxymanager-install.sh

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ setting_up_container
1313
network_check
1414
update_os
1515

16+
setup_go
17+
1618
msg_info "Installing Dependencies"
1719
$STD apt update
1820
$STD apt -y install \
@@ -33,48 +35,38 @@ $STD apt install -y \
3335
python3-certbot \
3436
python3-certbot-dns-cloudflare
3537
$STD pip3 install --break-system-packages certbot-dns-multi
36-
$STD python3 -m venv /opt/certbot/
3738
msg_ok "Installed Python Dependencies"
3839

3940
VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)"
4041

4142
msg_info "Installing Openresty"
4243
curl -fsSL "https://openresty.org/package/pubkey.gpg" | gpg --dearmor -o /etc/apt/trusted.gpg.d/openresty-archive-keyring.gpg
43-
echo -e "deb http://openresty.org/package/debian bullseye openresty" >/etc/apt/sources.list.d/openresty.list
44+
case "$VERSION" in
45+
trixie)
46+
echo -e "deb http://openresty.org/package/debian bookworm openresty" >/etc/apt/sources.list.d/openresty.list
47+
;;
48+
*)
49+
echo -e "deb http://openresty.org/package/debian $VERSION openresty" >/etc/apt/sources.list.d/openresty.list
50+
;;
51+
esac
4452
$STD apt update
4553
$STD apt -y install openresty
4654
msg_ok "Installed Openresty"
4755

48-
msg_info "Installing Node.js"
49-
$STD bash <(curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh)
50-
source ~/.bashrc
51-
$STD nvm install 16.20.2
52-
ln -sf /root/.nvm/versions/node/v16.20.2/bin/node /usr/bin/node
53-
msg_ok "Installed Node.js"
54-
55-
msg_info "Installing pnpm"
56-
$STD npm install -g [email protected]
57-
msg_ok "Installed pnpm"
56+
NODE_VERSION="22" NODE_MODULE="pnpm@latest" setup_nodejs
5857

5958
RELEASE=$(curl -fsSL https://api.github.com/repos/NginxProxyManager/nginx-proxy-manager/releases/latest |
6059
grep "tag_name" |
6160
awk '{print substr($2, 3, length($2)-4) }')
6261

63-
read -r -p "${TAB3}Would you like to install an older version (v2.10.4)? <y/N> " prompt
64-
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
65-
msg_info "Downloading Nginx Proxy Manager v2.10.4"
66-
curl -fsSL "https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/v2.10.4" | tar -xz
67-
cd ./nginx-proxy-manager-2.10.4
68-
msg_ok "Downloaded Nginx Proxy Manager v2.10.4"
69-
else
70-
msg_info "Downloading Nginx Proxy Manager v${RELEASE}"
71-
curl -fsSL "https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/v${RELEASE}" | tar -xz
72-
cd ./nginx-proxy-manager-"${RELEASE}"
73-
msg_ok "Downloaded Nginx Proxy Manager v${RELEASE}"
74-
fi
62+
msg_info "Downloading Nginx Proxy Manager v${RELEASE}"
63+
curl -fsSL "https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/v${RELEASE}" | tar -xz
64+
cd ./nginx-proxy-manager-"${RELEASE}"
65+
msg_ok "Downloaded Nginx Proxy Manager v${RELEASE}"
66+
7567
msg_info "Setting up Environment"
7668
ln -sf /usr/bin/python3 /usr/bin/python
77-
ln -sf /usr/bin/certbot /opt/certbot/bin/certbot
69+
ln -sf /usr/bin/certbot /usr/local/bin/certbot
7870
ln -sf /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx
7971
ln -sf /usr/local/openresty/nginx/ /etc/nginx
8072
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
@@ -185,7 +177,6 @@ customize
185177
msg_info "Starting Services"
186178
sed -i 's/user npm/user root/g; s/^pid/#pid/g' /usr/local/openresty/nginx/conf/nginx.conf
187179
sed -r -i 's/^([[:space:]]*)su npm npm/\1#su npm npm/g;' /etc/logrotate.d/nginx-proxy-manager
188-
sed -i 's/include-system-site-packages = false/include-system-site-packages = true/g' /opt/certbot/pyvenv.cfg
189180
systemctl enable -q --now openresty
190181
systemctl enable -q --now npm
191182
msg_ok "Started Services"

0 commit comments

Comments
 (0)