fix(nginxproxymanager): repair broken certbot pip before update (#15224)

Use ensurepip when the certbot venv pip module is missing, then upgrade via python -m pip.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
CanbiZ (MickLesk)
2026-06-20 05:23:25 +02:00
committed by GitHub
parent 8d635c210a
commit 7789f1c58c
+7 -2
View File
@@ -108,8 +108,13 @@ EOF
cd /root
if [ -d /opt/certbot ]; then
msg_info "Updating Certbot"
$STD /opt/certbot/bin/pip install --upgrade pip setuptools wheel
$STD /opt/certbot/bin/pip install --upgrade certbot certbot-dns-cloudflare
CERTBOT_PYTHON="/opt/certbot/bin/python"
if ! "$CERTBOT_PYTHON" -m pip --version &>/dev/null; then
msg_info "Repairing Certbot pip"
$STD "$CERTBOT_PYTHON" -m ensurepip --upgrade
fi
$STD "$CERTBOT_PYTHON" -m pip install --upgrade pip setuptools wheel
$STD "$CERTBOT_PYTHON" -m pip install --upgrade certbot certbot-dns-cloudflare
msg_ok "Updated Certbot"
fi