From cac9d8f75ee2ffa668d402aecfbc74f038b34d45 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Wed, 30 Sep 2020 17:03:59 -0700 Subject: [PATCH] Deprecate certbot-auto outside of Debian and RHEL (#8324) Fixes https://github.com/certbot/certbot/issues/8292. This uses the same approach that worked well for us in https://github.com/certbot/certbot/pull/7926. I'm sure we could delete more code or refactor things here, but I think we should make the most conservative changes we can to certbot-auto until we can just delete the entire thing. I ran the full test suite on these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=2773&view=results and manually tested things on OpenSUSE and it worked as expected. certbot-auto refused to create new installations and refused to update old ones while continuing to allow the old version of Certbot to run. * Deprecate cb-auto outside of Debian and RHEL. * Don't deprecate Amazon Linux yet. --- certbot/CHANGELOG.md | 1 + letsencrypt-auto-source/letsencrypt-auto | 45 +++---------------- .../letsencrypt-auto.template | 45 +++---------------- 3 files changed, 13 insertions(+), 78 deletions(-) diff --git a/certbot/CHANGELOG.md b/certbot/CHANGELOG.md index 0ff09b5e2..68bfb64f3 100644 --- a/certbot/CHANGELOG.md +++ b/certbot/CHANGELOG.md @@ -11,6 +11,7 @@ Certbot adheres to [Semantic Versioning](https://semver.org/). ### Changed +* certbot-auto was deprecated on all systems except for those based on Debian or RHEL. * Update the packaging instructions to promote usage of `python -m pytest` to test Certbot instead of the deprecated `python setup.py test` setuptools approach. * Reduced CLI logging when reloading nginx, if it is not running. diff --git a/letsencrypt-auto-source/letsencrypt-auto b/letsencrypt-auto-source/letsencrypt-auto index 5c5434323..a70ed7364 100755 --- a/letsencrypt-auto-source/letsencrypt-auto +++ b/letsencrypt-auto-source/letsencrypt-auto @@ -806,10 +806,7 @@ if [ -f /etc/debian_version ]; then BOOTSTRAP_VERSION="BootstrapDebCommon $BOOTSTRAP_DEB_COMMON_VERSION" elif [ -f /etc/mageia-release ]; then # Mageia has both /etc/mageia-release and /etc/redhat-release - Bootstrap() { - ExperimentalBootstrap "Mageia" BootstrapMageiaCommon - } - BOOTSTRAP_VERSION="BootstrapMageiaCommon $BOOTSTRAP_MAGEIA_COMMON_VERSION" + DEPRECATED_OS=1 elif [ -f /etc/redhat-release ]; then # Run DeterminePythonVersion to decide on the basis of available Python versions # whether to use 2.x or 3.x on RedHat-like systems. @@ -884,31 +881,11 @@ elif [ -f /etc/redhat-release ]; then LE_PYTHON="$prev_le_python" elif [ -f /etc/os-release ] && `grep -q openSUSE /etc/os-release` ; then - Bootstrap() { - BootstrapMessage "openSUSE-based OSes" - BootstrapSuseCommon - } - BOOTSTRAP_VERSION="BootstrapSuseCommon $BOOTSTRAP_SUSE_COMMON_VERSION" + DEPRECATED_OS=1 elif [ -f /etc/arch-release ]; then - Bootstrap() { - if [ "$DEBUG" = 1 ]; then - BootstrapMessage "Archlinux" - BootstrapArchCommon - else - error "Please use pacman to install letsencrypt packages:" - error "# pacman -S certbot certbot-apache" - error - error "If you would like to use the virtualenv way, please run the script again with the" - error "--debug flag." - exit 1 - fi - } - BOOTSTRAP_VERSION="BootstrapArchCommon $BOOTSTRAP_ARCH_COMMON_VERSION" + DEPRECATED_OS=1 elif [ -f /etc/manjaro-release ]; then - Bootstrap() { - ExperimentalBootstrap "Manjaro Linux" BootstrapArchCommon - } - BOOTSTRAP_VERSION="BootstrapArchCommon $BOOTSTRAP_ARCH_COMMON_VERSION" + DEPRECATED_OS=1 elif [ -f /etc/gentoo-release ]; then DEPRECATED_OS=1 elif uname | grep -iq FreeBSD ; then @@ -921,19 +898,9 @@ elif [ -f /etc/issue ] && grep -iq "Amazon Linux" /etc/issue ; then } BOOTSTRAP_VERSION="BootstrapRpmCommon $BOOTSTRAP_RPM_COMMON_VERSION" elif [ -f /etc/product ] && grep -q "Joyent Instance" /etc/product ; then - Bootstrap() { - ExperimentalBootstrap "Joyent SmartOS Zone" BootstrapSmartOS - } - BOOTSTRAP_VERSION="BootstrapSmartOS $BOOTSTRAP_SMARTOS_VERSION" + DEPRECATED_OS=1 else - Bootstrap() { - error "Sorry, I don't know how to bootstrap Certbot on your operating system!" - error - error "You will need to install OS dependencies, configure virtualenv, and run pip install manually." - error "Please see https://certbot.eff.org/docs/contributing.html#prerequisites" - error "for more info." - exit 1 - } + DEPRECATED_OS=1 fi # We handle this case after determining the normal bootstrap version to allow diff --git a/letsencrypt-auto-source/letsencrypt-auto.template b/letsencrypt-auto-source/letsencrypt-auto.template index 3d7c95bb9..cd440fb59 100755 --- a/letsencrypt-auto-source/letsencrypt-auto.template +++ b/letsencrypt-auto-source/letsencrypt-auto.template @@ -328,10 +328,7 @@ if [ -f /etc/debian_version ]; then BOOTSTRAP_VERSION="BootstrapDebCommon $BOOTSTRAP_DEB_COMMON_VERSION" elif [ -f /etc/mageia-release ]; then # Mageia has both /etc/mageia-release and /etc/redhat-release - Bootstrap() { - ExperimentalBootstrap "Mageia" BootstrapMageiaCommon - } - BOOTSTRAP_VERSION="BootstrapMageiaCommon $BOOTSTRAP_MAGEIA_COMMON_VERSION" + DEPRECATED_OS=1 elif [ -f /etc/redhat-release ]; then # Run DeterminePythonVersion to decide on the basis of available Python versions # whether to use 2.x or 3.x on RedHat-like systems. @@ -406,31 +403,11 @@ elif [ -f /etc/redhat-release ]; then LE_PYTHON="$prev_le_python" elif [ -f /etc/os-release ] && `grep -q openSUSE /etc/os-release` ; then - Bootstrap() { - BootstrapMessage "openSUSE-based OSes" - BootstrapSuseCommon - } - BOOTSTRAP_VERSION="BootstrapSuseCommon $BOOTSTRAP_SUSE_COMMON_VERSION" + DEPRECATED_OS=1 elif [ -f /etc/arch-release ]; then - Bootstrap() { - if [ "$DEBUG" = 1 ]; then - BootstrapMessage "Archlinux" - BootstrapArchCommon - else - error "Please use pacman to install letsencrypt packages:" - error "# pacman -S certbot certbot-apache" - error - error "If you would like to use the virtualenv way, please run the script again with the" - error "--debug flag." - exit 1 - fi - } - BOOTSTRAP_VERSION="BootstrapArchCommon $BOOTSTRAP_ARCH_COMMON_VERSION" + DEPRECATED_OS=1 elif [ -f /etc/manjaro-release ]; then - Bootstrap() { - ExperimentalBootstrap "Manjaro Linux" BootstrapArchCommon - } - BOOTSTRAP_VERSION="BootstrapArchCommon $BOOTSTRAP_ARCH_COMMON_VERSION" + DEPRECATED_OS=1 elif [ -f /etc/gentoo-release ]; then DEPRECATED_OS=1 elif uname | grep -iq FreeBSD ; then @@ -443,19 +420,9 @@ elif [ -f /etc/issue ] && grep -iq "Amazon Linux" /etc/issue ; then } BOOTSTRAP_VERSION="BootstrapRpmCommon $BOOTSTRAP_RPM_COMMON_VERSION" elif [ -f /etc/product ] && grep -q "Joyent Instance" /etc/product ; then - Bootstrap() { - ExperimentalBootstrap "Joyent SmartOS Zone" BootstrapSmartOS - } - BOOTSTRAP_VERSION="BootstrapSmartOS $BOOTSTRAP_SMARTOS_VERSION" + DEPRECATED_OS=1 else - Bootstrap() { - error "Sorry, I don't know how to bootstrap Certbot on your operating system!" - error - error "You will need to install OS dependencies, configure virtualenv, and run pip install manually." - error "Please see https://certbot.eff.org/docs/contributing.html#prerequisites" - error "for more info." - exit 1 - } + DEPRECATED_OS=1 fi # We handle this case after determining the normal bootstrap version to allow