瀏覽代碼

Move SKIP_CERTBOT_OWNERSHIP check around the entire certbot code

Jamie Curnow 3 月之前
父節點
當前提交
9a0383bc73
共有 1 個文件被更改,包括 3 次插入5 次删除
  1. 3 5
      docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/30-ownership.sh

+ 3 - 5
docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/30-ownership.sh

@@ -26,12 +26,10 @@ chown -R "$PUID:$PGID" /etc/nginx/conf.d
 # Certbot directories - optimized approach
 CERT_INIT_FLAG="/opt/certbot/.ownership_initialized"
 
-if [ ! -f "$CERT_INIT_FLAG" ]; then
+if [ ! -f "$CERT_INIT_FLAG" ] || [ "$SKIP_CERTBOT_OWNERSHIP" != "true" ]; then
 	# Prevents errors when installing python certbot plugins when non-root
-	if [ "$SKIP_CERTBOT_OWNERSHIP" != "true" ]; then
-		log_info 'Changing ownership of /opt/certbot directories ...'
-		chown "$PUID:$PGID" /opt/certbot /opt/certbot/bin
-	fi
+	log_info 'Changing ownership of /opt/certbot directories ...'
+	chown "$PUID:$PGID" /opt/certbot /opt/certbot/bin
 
 	# Handle all site-packages directories efficiently
 	find /opt/certbot/lib -type d -name "site-packages" | while read -r SITE_PACKAGES_DIR; do