From 41776eb78ad660916975541cdc8cdfa1ad450590 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Sat, 18 Oct 2025 12:38:39 +0200 Subject: [PATCH] fix certbot --- ct/nginxproxymanager.sh | 6 +++++- install/nginxproxymanager-install.sh | 12 ++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ct/nginxproxymanager.sh b/ct/nginxproxymanager.sh index 073bd0a5..6992c527 100644 --- a/ct/nginxproxymanager.sh +++ b/ct/nginxproxymanager.sh @@ -115,7 +115,11 @@ function update_script() { cp -r frontend/app-images/* /app/frontend/images cp -r backend/* /app cp -r global/* /app/global - $STD python3 -m pip install --no-cache-dir --break-system-packages certbot-dns-cloudflare + + # Update Certbot and plugins in virtual environment + if [ -d /opt/certbot ]; then + $STD /opt/certbot/bin/pip install --upgrade certbot certbot-dns-cloudflare + fi msg_ok "Setup Environment" msg_info "Initializing Backend" diff --git a/install/nginxproxymanager-install.sh b/install/nginxproxymanager-install.sh index 91060eb4..50f5a031 100644 --- a/install/nginxproxymanager-install.sh +++ b/install/nginxproxymanager-install.sh @@ -29,11 +29,16 @@ $STD apt install -y \ python3-dev \ python3-pip \ python3-venv \ - python3-cffi \ - python3-certbot \ - python3-certbot-dns-cloudflare + python3-cffi msg_ok "Installed Python Dependencies" +msg_info "Setting up Certbot" +$STD python3 -m venv /opt/certbot +$STD /opt/certbot/bin/pip install --upgrade pip +$STD /opt/certbot/bin/pip install certbot certbot-dns-cloudflare +ln -sf /opt/certbot/bin/certbot /usr/local/bin/certbot +msg_ok "Set up Certbot" + VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)" msg_info "Installing Openresty" @@ -63,7 +68,6 @@ msg_ok "Downloaded Nginx Proxy Manager v${RELEASE}" msg_info "Setting up Environment" ln -sf /usr/bin/python3 /usr/bin/python -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/ /etc/nginx sed -i "s|\"version\": \"0.0.0\"|\"version\": \"$RELEASE\"|" backend/package.json