mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-11-04 18:32:51 +00:00
Enhance nginx proxy manager install script (#8400)
This commit is contained in:
@@ -13,6 +13,8 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
|
setup_go
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt update
|
$STD apt update
|
||||||
$STD apt -y install \
|
$STD apt -y install \
|
||||||
@@ -33,48 +35,38 @@ $STD apt install -y \
|
|||||||
python3-certbot \
|
python3-certbot \
|
||||||
python3-certbot-dns-cloudflare
|
python3-certbot-dns-cloudflare
|
||||||
$STD pip3 install --break-system-packages certbot-dns-multi
|
$STD pip3 install --break-system-packages certbot-dns-multi
|
||||||
$STD python3 -m venv /opt/certbot/
|
|
||||||
msg_ok "Installed Python Dependencies"
|
msg_ok "Installed Python Dependencies"
|
||||||
|
|
||||||
VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)"
|
VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)"
|
||||||
|
|
||||||
msg_info "Installing Openresty"
|
msg_info "Installing Openresty"
|
||||||
curl -fsSL "https://openresty.org/package/pubkey.gpg" | gpg --dearmor -o /etc/apt/trusted.gpg.d/openresty-archive-keyring.gpg
|
curl -fsSL "https://openresty.org/package/pubkey.gpg" | gpg --dearmor -o /etc/apt/trusted.gpg.d/openresty-archive-keyring.gpg
|
||||||
echo -e "deb http://openresty.org/package/debian bullseye openresty" >/etc/apt/sources.list.d/openresty.list
|
case "$VERSION" in
|
||||||
|
trixie)
|
||||||
|
echo -e "deb http://openresty.org/package/debian bookworm openresty" >/etc/apt/sources.list.d/openresty.list
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo -e "deb http://openresty.org/package/debian $VERSION openresty" >/etc/apt/sources.list.d/openresty.list
|
||||||
|
;;
|
||||||
|
esac
|
||||||
$STD apt update
|
$STD apt update
|
||||||
$STD apt -y install openresty
|
$STD apt -y install openresty
|
||||||
msg_ok "Installed Openresty"
|
msg_ok "Installed Openresty"
|
||||||
|
|
||||||
msg_info "Installing Node.js"
|
NODE_VERSION="22" NODE_MODULE="pnpm@latest" setup_nodejs
|
||||||
$STD bash <(curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh)
|
|
||||||
source ~/.bashrc
|
|
||||||
$STD nvm install 16.20.2
|
|
||||||
ln -sf /root/.nvm/versions/node/v16.20.2/bin/node /usr/bin/node
|
|
||||||
msg_ok "Installed Node.js"
|
|
||||||
|
|
||||||
msg_info "Installing pnpm"
|
|
||||||
$STD npm install -g pnpm@8.15
|
|
||||||
msg_ok "Installed pnpm"
|
|
||||||
|
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/NginxProxyManager/nginx-proxy-manager/releases/latest |
|
RELEASE=$(curl -fsSL https://api.github.com/repos/NginxProxyManager/nginx-proxy-manager/releases/latest |
|
||||||
grep "tag_name" |
|
grep "tag_name" |
|
||||||
awk '{print substr($2, 3, length($2)-4) }')
|
awk '{print substr($2, 3, length($2)-4) }')
|
||||||
|
|
||||||
read -r -p "${TAB3}Would you like to install an older version (v2.10.4)? <y/N> " prompt
|
msg_info "Downloading Nginx Proxy Manager v${RELEASE}"
|
||||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
curl -fsSL "https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/v${RELEASE}" | tar -xz
|
||||||
msg_info "Downloading Nginx Proxy Manager v2.10.4"
|
cd ./nginx-proxy-manager-"${RELEASE}"
|
||||||
curl -fsSL "https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/v2.10.4" | tar -xz
|
msg_ok "Downloaded Nginx Proxy Manager v${RELEASE}"
|
||||||
cd ./nginx-proxy-manager-2.10.4
|
|
||||||
msg_ok "Downloaded Nginx Proxy Manager v2.10.4"
|
|
||||||
else
|
|
||||||
msg_info "Downloading Nginx Proxy Manager v${RELEASE}"
|
|
||||||
curl -fsSL "https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/v${RELEASE}" | tar -xz
|
|
||||||
cd ./nginx-proxy-manager-"${RELEASE}"
|
|
||||||
msg_ok "Downloaded Nginx Proxy Manager v${RELEASE}"
|
|
||||||
fi
|
|
||||||
msg_info "Setting up Environment"
|
msg_info "Setting up Environment"
|
||||||
ln -sf /usr/bin/python3 /usr/bin/python
|
ln -sf /usr/bin/python3 /usr/bin/python
|
||||||
ln -sf /usr/bin/certbot /opt/certbot/bin/certbot
|
ln -sf /usr/bin/certbot /usr/local/bin/certbot
|
||||||
ln -sf /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx
|
ln -sf /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx
|
||||||
ln -sf /usr/local/openresty/nginx/ /etc/nginx
|
ln -sf /usr/local/openresty/nginx/ /etc/nginx
|
||||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||||
@@ -185,7 +177,6 @@ customize
|
|||||||
msg_info "Starting Services"
|
msg_info "Starting Services"
|
||||||
sed -i 's/user npm/user root/g; s/^pid/#pid/g' /usr/local/openresty/nginx/conf/nginx.conf
|
sed -i 's/user npm/user root/g; s/^pid/#pid/g' /usr/local/openresty/nginx/conf/nginx.conf
|
||||||
sed -r -i 's/^([[:space:]]*)su npm npm/\1#su npm npm/g;' /etc/logrotate.d/nginx-proxy-manager
|
sed -r -i 's/^([[:space:]]*)su npm npm/\1#su npm npm/g;' /etc/logrotate.d/nginx-proxy-manager
|
||||||
sed -i 's/include-system-site-packages = false/include-system-site-packages = true/g' /opt/certbot/pyvenv.cfg
|
|
||||||
systemctl enable -q --now openresty
|
systemctl enable -q --now openresty
|
||||||
systemctl enable -q --now npm
|
systemctl enable -q --now npm
|
||||||
msg_ok "Started Services"
|
msg_ok "Started Services"
|
||||||
|
|||||||
Reference in New Issue
Block a user