mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-09-27 04:28:05 +00:00
Generate the NPM admin config and repair certbot's venv on update
2.16.0 ships production.conf only as a template that its s6 prepare step renders, so installs outside Docker never listened on 81; render it on install, on update while keeping a custom admin port, and on update for containers already stuck on 2.16.0. Certbot's upgrade died on a dist-info without RECORD, which pip's own --ignore-installed hint does not clear, so drop such records before upgrading.
This commit is contained in:
@@ -118,10 +118,18 @@ EOF
|
||||
$STD "$CERTBOT_PYTHON" -m ensurepip --upgrade
|
||||
fi
|
||||
$STD "$CERTBOT_PYTHON" -m pip install --upgrade pip setuptools wheel
|
||||
find /opt/certbot/lib/python3*/site-packages -maxdepth 1 -name '*.dist-info' -type d ! -exec test -e '{}/RECORD' ';' -exec rm -rf '{}' + 2>/dev/null || true
|
||||
$STD "$CERTBOT_PYTHON" -m pip install --upgrade certbot certbot-dns-cloudflare
|
||||
msg_ok "Updated Certbot"
|
||||
fi
|
||||
|
||||
if [[ -f /etc/nginx/conf.d/production.conf.template && ! -f /etc/nginx/conf.d/production.conf ]]; then
|
||||
msg_info "Restoring Admin Interface"
|
||||
sed 's/{{NPM_ADMIN_PORT}}/81/g' /etc/nginx/conf.d/production.conf.template >/etc/nginx/conf.d/production.conf
|
||||
systemctl restart openresty
|
||||
msg_ok "Restored Admin Interface"
|
||||
fi
|
||||
|
||||
if check_for_gh_release "nginxproxymanager" "NginxProxyManager/nginx-proxy-manager"; then
|
||||
msg_info "Stopping Services"
|
||||
systemctl stop openresty
|
||||
@@ -159,6 +167,10 @@ EOF
|
||||
cp /opt/nginxproxymanager/docker/rootfs/etc/logrotate.d/nginx-proxy-manager /etc/logrotate.d/nginx-proxy-manager
|
||||
ln -sf /etc/nginx/nginx.conf /etc/nginx/conf/nginx.conf
|
||||
rm -f /etc/nginx/conf.d/dev.conf
|
||||
if [[ -f /etc/nginx/conf.d/production.conf.template ]]; then
|
||||
ADMIN_PORT=$(grep -oP '^\s*listen\s+\K[0-9]+(?=\s+default)' /etc/nginx/conf.d/production.conf 2>/dev/null | head -n1 || true)
|
||||
sed "s/{{NPM_ADMIN_PORT}}/${ADMIN_PORT:-81}/g" /etc/nginx/conf.d/production.conf.template >/etc/nginx/conf.d/production.conf
|
||||
fi
|
||||
|
||||
mkdir -p /tmp/nginx/body \
|
||||
/run/nginx \
|
||||
|
||||
@@ -96,6 +96,9 @@ cp /opt/nginxproxymanager/docker/rootfs/etc/letsencrypt.ini /etc/letsencrypt.ini
|
||||
cp /opt/nginxproxymanager/docker/rootfs/etc/logrotate.d/nginx-proxy-manager /etc/logrotate.d/nginx-proxy-manager
|
||||
ln -sf /etc/nginx/nginx.conf /etc/nginx/conf/nginx.conf
|
||||
rm -f /etc/nginx/conf.d/dev.conf
|
||||
if [[ -f /etc/nginx/conf.d/production.conf.template ]]; then
|
||||
sed 's/{{NPM_ADMIN_PORT}}/81/g' /etc/nginx/conf.d/production.conf.template >/etc/nginx/conf.d/production.conf
|
||||
fi
|
||||
|
||||
mkdir -p /tmp/nginx/body \
|
||||
/run/nginx \
|
||||
|
||||
Reference in New Issue
Block a user