mirror of
https://github.com/certbot/certbot.git
synced 2026-06-05 06:42:10 -04:00
Merge branch 'master' into no-py3-mock
This commit is contained in:
commit
9ebeb9f668
42 changed files with 400 additions and 419 deletions
|
|
@ -21,6 +21,8 @@ jobs:
|
|||
PYTHON_VERSION: 3.7
|
||||
TOXENV: py37
|
||||
CERTBOT_NO_PIN: 1
|
||||
linux-external-mock:
|
||||
TOXENV: external-mock
|
||||
linux-boulder-v1-integration-certbot-oldest:
|
||||
PYTHON_VERSION: 3.6
|
||||
TOXENV: integration-certbot-oldest
|
||||
|
|
|
|||
|
|
@ -8,5 +8,4 @@
|
|||
.git
|
||||
.tox
|
||||
venv
|
||||
venv3
|
||||
docs
|
||||
|
|
|
|||
2
.envrc
2
.envrc
|
|
@ -3,7 +3,7 @@
|
|||
# activated and then deactivated when you cd elsewhere. Developers have to have
|
||||
# direnv set up and run `direnv allow` to allow this file to execute on their
|
||||
# system. You can find more information at https://direnv.net/.
|
||||
. venv3/bin/activate
|
||||
. venv/bin/activate
|
||||
# direnv doesn't support modifying PS1 so we unset it to squelch the error
|
||||
# it'll otherwise print about this being done in the activate script. See
|
||||
# https://github.com/direnv/direnv/wiki/PS1. If you would like your shell
|
||||
|
|
|
|||
|
|
@ -15,6 +15,6 @@ RUN apt-get update && \
|
|||
/tmp/* \
|
||||
/var/tmp/*
|
||||
|
||||
RUN VENV_NAME="../venv3" python3 tools/venv3.py
|
||||
RUN VENV_NAME="../venv" python3 tools/venv.py
|
||||
|
||||
ENV PATH /opt/certbot/venv3/bin:$PATH
|
||||
ENV PATH /opt/certbot/venv/bin:$PATH
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import sys
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
# Please update tox.ini when modifying dependency version requirements
|
||||
install_requires = [
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
# Remember to update local-oldest-requirements.txt when changing the minimum
|
||||
# acme/certbot version.
|
||||
|
|
|
|||
40
certbot-auto
40
certbot-auto
|
|
@ -31,7 +31,7 @@ if [ -z "$VENV_PATH" ]; then
|
|||
fi
|
||||
VENV_BIN="$VENV_PATH/bin"
|
||||
BOOTSTRAP_VERSION_PATH="$VENV_PATH/certbot-auto-bootstrap-version.txt"
|
||||
LE_AUTO_VERSION="1.11.0"
|
||||
LE_AUTO_VERSION="1.12.0"
|
||||
BASENAME=$(basename $0)
|
||||
USAGE="Usage: $BASENAME [OPTIONS]
|
||||
A self-updating wrapper script for the Certbot ACME client. When run, updates
|
||||
|
|
@ -803,6 +803,7 @@ if [ -f /etc/debian_version ]; then
|
|||
elif [ -f /etc/mageia-release ]; then
|
||||
# Mageia has both /etc/mageia-release and /etc/redhat-release
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
elif [ -f /etc/redhat-release ]; then
|
||||
DEPRECATED_OS=1
|
||||
# Run DeterminePythonVersion to decide on the basis of available Python versions
|
||||
|
|
@ -863,22 +864,31 @@ elif [ -f /etc/redhat-release ]; then
|
|||
LE_PYTHON="$prev_le_python"
|
||||
elif [ -f /etc/os-release ] && `grep -q openSUSE /etc/os-release` ; then
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
elif [ -f /etc/arch-release ]; then
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
elif [ -f /etc/manjaro-release ]; then
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
elif [ -f /etc/gentoo-release ]; then
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
elif uname | grep -iq FreeBSD ; then
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
elif uname | grep -iq Darwin ; then
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
elif [ -f /etc/issue ] && grep -iq "Amazon Linux" /etc/issue ; then
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
elif [ -f /etc/product ] && grep -q "Joyent Instance" /etc/product ; then
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
else
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
fi
|
||||
|
||||
# We handle this case after determining the normal bootstrap version to allow
|
||||
|
|
@ -1107,7 +1117,9 @@ if [ "$1" = "--le-auto-phase2" ]; then
|
|||
fi
|
||||
|
||||
if [ -f "$VENV_BIN/letsencrypt" -a "$INSTALL_ONLY" != 1 ]; then
|
||||
error "Certbot will no longer receive updates."
|
||||
error "certbot-auto and its Certbot installation will no longer receive updates."
|
||||
error "You will not receive any bug fixes including those fixing server compatibility"
|
||||
error "or security problems."
|
||||
error "Please visit https://certbot.eff.org/ to check for other alternatives."
|
||||
"$VENV_BIN/letsencrypt" "$@"
|
||||
exit 0
|
||||
|
|
@ -1475,18 +1487,18 @@ letsencrypt==0.7.0 \
|
|||
--hash=sha256:105a5fb107e45bcd0722eb89696986dcf5f08a86a321d6aef25a0c7c63375ade \
|
||||
--hash=sha256:c36e532c486a7e92155ee09da54b436a3c420813ec1c590b98f635d924720de9
|
||||
|
||||
certbot==1.11.0 \
|
||||
--hash=sha256:b7faa66c40a1ce5a31bfc8668d8feb5d2db6f7af9e791079a6d95c77b6593bf4 \
|
||||
--hash=sha256:6b0ce04e55379aff0a47f873fa05c084538ad0f4a9b79f33108dbb0a7a668b43
|
||||
acme==1.11.0 \
|
||||
--hash=sha256:77d6ce61b155315d7d7031489bbd245c0ea42c0453a04d4304393414e741a56d \
|
||||
--hash=sha256:092eb09a074a935da4c10f66cb8634ffb2cc2d2cc1035d2998d608996efab924
|
||||
certbot-apache==1.11.0 \
|
||||
--hash=sha256:ea7ac88733aad91a89c700289effda2a0c0658778da1ae2c54a0aefaee351285 \
|
||||
--hash=sha256:3ed001427ec0b49324f2b9af7170fa6e6e88948fa51c3678b07bf17f8138863d
|
||||
certbot-nginx==1.11.0 \
|
||||
--hash=sha256:79de69782a1199e577787ff9790dee02a44aac17dbecd6a7287593030842a306 \
|
||||
--hash=sha256:9afe611f99a78b8898941b8ad7bdcf7f3c2b6e0fce27125268f7c713e64b34ee
|
||||
certbot==1.12.0 \
|
||||
--hash=sha256:f4bb3da5391e4a28e9a2e52ab54986171c0864feff17eaaaca6729a1d4c433a6 \
|
||||
--hash=sha256:5ee738773479bcb7794e43fedd2415acc0969b75bdd2a21f451e3bff9d99df59
|
||||
acme==1.12.0 \
|
||||
--hash=sha256:ca4ad044429f1b8b670b958e5c7ea38159def9d601f4af2359355993918c3317 \
|
||||
--hash=sha256:aa363474d50e9fdda27acb8b1aa7efb26fecc5650e02039a0de3a3f0e696c2f2
|
||||
certbot-apache==1.12.0 \
|
||||
--hash=sha256:38899f6fa08799de9535795d919acf968f288d7208909baf7733f9a763c15227 \
|
||||
--hash=sha256:e5679b40d99bd241f4fcd9fe44b73e6e25ccc969a617131ff6ebc90d562a49f2
|
||||
certbot-nginx==1.12.0 \
|
||||
--hash=sha256:332cd70067bbcf6db52a002650ffa4844d0bd9780279d662aa6725b43f776c14 \
|
||||
--hash=sha256:3fb6a55290d37ad466681a89a85ceca4c4026fdd8702f3010b87a74266a6fe7b
|
||||
|
||||
UNLIKELY_EOF
|
||||
# -------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ RUN apt-get update && \
|
|||
WORKDIR /opt/certbot/src
|
||||
|
||||
# We copy all contents of the build directory to allow us to easily use
|
||||
# things like tools/venv3.py which expects all of our packages to be available.
|
||||
# things like tools/venv.py which expects all of our packages to be available.
|
||||
COPY . .
|
||||
|
||||
RUN tools/venv3.py
|
||||
ENV PATH /opt/certbot/src/venv3/bin:$PATH
|
||||
RUN tools/venv.py
|
||||
ENV PATH /opt/certbot/src/venv/bin:$PATH
|
||||
|
||||
# install in editable mode (-e) to save space: it's not possible to
|
||||
# "rm -rf /opt/certbot/src" (it's stays in the underlaying image);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import sys
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
install_requires = [
|
||||
'certbot',
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import sys
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
# Remember to update local-oldest-requirements.txt when changing the minimum
|
||||
# acme/certbot version.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import sys
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
# Remember to update local-oldest-requirements.txt when changing the minimum
|
||||
# acme/certbot version.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import sys
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
# Remember to update local-oldest-requirements.txt when changing the minimum
|
||||
# acme/certbot version.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import sys
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
# Remember to update local-oldest-requirements.txt when changing the minimum
|
||||
# acme/certbot version.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import sys
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
# Remember to update local-oldest-requirements.txt when changing the minimum
|
||||
# acme/certbot version.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import sys
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
# Please update tox.ini when modifying dependency version requirements
|
||||
install_requires = [
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import sys
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
# Remember to update local-oldest-requirements.txt when changing the minimum
|
||||
# acme/certbot version.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import sys
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
# Please update tox.ini when modifying dependency version requirements
|
||||
install_requires = [
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import sys
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
# Remember to update local-oldest-requirements.txt when changing the minimum
|
||||
# acme/certbot version.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import sys
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
# Remember to update local-oldest-requirements.txt when changing the minimum
|
||||
# acme/certbot version.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import sys
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
# Remember to update local-oldest-requirements.txt when changing the minimum
|
||||
# acme/certbot version.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import sys
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
# Remember to update local-oldest-requirements.txt when changing the minimum
|
||||
# acme/certbot version.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import sys
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
# Remember to update local-oldest-requirements.txt when changing the minimum
|
||||
# acme/certbot version.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import sys
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
# Please update tox.ini when modifying dependency version requirements
|
||||
install_requires = [
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
version = '1.12.0.dev0'
|
||||
version = '1.13.0.dev0'
|
||||
|
||||
# Remember to update local-oldest-requirements.txt when changing the minimum
|
||||
# acme/certbot version.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,23 @@
|
|||
|
||||
Certbot adheres to [Semantic Versioning](https://semver.org/).
|
||||
|
||||
## 1.12.0 - master
|
||||
## 1.13.0 - master
|
||||
|
||||
### Added
|
||||
|
||||
*
|
||||
|
||||
### Changed
|
||||
|
||||
*
|
||||
|
||||
### Fixed
|
||||
|
||||
*
|
||||
|
||||
More details about these changes can be found on our GitHub repo.
|
||||
|
||||
## 1.12.0 - 2021-02-02
|
||||
|
||||
### Added
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
"""Certbot client."""
|
||||
# version number like 1.2.3a0, must have at least 2 parts, like 1.2
|
||||
__version__ = '1.12.0.dev0'
|
||||
__version__ = '1.13.0.dev0'
|
||||
|
|
|
|||
|
|
@ -99,9 +99,9 @@ optional arguments:
|
|||
before submitting to CA (default: False)
|
||||
--preferred-chain PREFERRED_CHAIN
|
||||
If the CA offers multiple certificate chains, prefer
|
||||
the chain with an issuer matching this Subject Common
|
||||
Name. If no match, the default offered chain will be
|
||||
used. (default: None)
|
||||
the chain whose topmost certificate was issued from
|
||||
this Subject Common Name. If no match, the default
|
||||
offered chain will be used. (default: None)
|
||||
--preferred-challenges PREF_CHALLS
|
||||
A sorted, comma delimited list of the preferred
|
||||
challenge to use during authorization with the most
|
||||
|
|
@ -118,7 +118,7 @@ optional arguments:
|
|||
case, and to know when to deprecate support for past
|
||||
Python versions and flags. If you wish to hide this
|
||||
information from the Let's Encrypt server, set this to
|
||||
"". (default: CertbotACMEClient/1.11.0
|
||||
"". (default: CertbotACMEClient/1.12.0
|
||||
(certbot(-auto); OS_NAME OS_VERSION) Authenticator/XXX
|
||||
Installer/YYY (SUBCOMMAND; flags: FLAGS)
|
||||
Py/major.minor.patchlevel). The flags encoded in the
|
||||
|
|
|
|||
|
|
@ -56,18 +56,18 @@ Set up the Python virtual environment that will host your Certbot local instance
|
|||
.. code-block:: shell
|
||||
|
||||
cd certbot
|
||||
python tools/venv3.py
|
||||
python tools/venv.py
|
||||
|
||||
.. note:: You may need to repeat this when
|
||||
Certbot's dependencies change or when a new plugin is introduced.
|
||||
|
||||
You can now run the copy of Certbot from git either by executing
|
||||
``venv3/bin/certbot``, or by activating the virtual environment. You can do the
|
||||
``venv/bin/certbot``, or by activating the virtual environment. You can do the
|
||||
latter by running:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
source venv3/bin/activate
|
||||
source venv/bin/activate
|
||||
|
||||
After running this command, ``certbot`` and development tools like ``ipdb``,
|
||||
``ipython``, ``pytest``, and ``tox`` are available in the shell where you ran
|
||||
|
|
@ -169,7 +169,7 @@ To do so you need:
|
|||
- Docker installed, and a user with access to the Docker client,
|
||||
- an available `local copy`_ of Certbot.
|
||||
|
||||
The virtual environment set up with `python tools/venv3.py` contains two CLI tools
|
||||
The virtual environment set up with `python tools/venv.py` contains two CLI tools
|
||||
that can be used once the virtual environment is activated:
|
||||
|
||||
.. code-block:: shell
|
||||
|
|
@ -197,8 +197,8 @@ using an HTTP-01 challenge on a machine with Python 3:
|
|||
|
||||
.. code-block:: shell
|
||||
|
||||
python tools/venv3.py
|
||||
source venv3/bin/activate
|
||||
python tools/venv.py
|
||||
source venv/bin/activate
|
||||
run_acme_server &
|
||||
certbot_test certonly --standalone -d test.example.com
|
||||
# To stop Pebble, launch `fg` to get back the background job, then press CTRL+C
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ if [ -z "$VENV_PATH" ]; then
|
|||
fi
|
||||
VENV_BIN="$VENV_PATH/bin"
|
||||
BOOTSTRAP_VERSION_PATH="$VENV_PATH/certbot-auto-bootstrap-version.txt"
|
||||
LE_AUTO_VERSION="1.11.0"
|
||||
LE_AUTO_VERSION="1.12.0"
|
||||
BASENAME=$(basename $0)
|
||||
USAGE="Usage: $BASENAME [OPTIONS]
|
||||
A self-updating wrapper script for the Certbot ACME client. When run, updates
|
||||
|
|
@ -803,6 +803,7 @@ if [ -f /etc/debian_version ]; then
|
|||
elif [ -f /etc/mageia-release ]; then
|
||||
# Mageia has both /etc/mageia-release and /etc/redhat-release
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
elif [ -f /etc/redhat-release ]; then
|
||||
DEPRECATED_OS=1
|
||||
# Run DeterminePythonVersion to decide on the basis of available Python versions
|
||||
|
|
@ -863,22 +864,31 @@ elif [ -f /etc/redhat-release ]; then
|
|||
LE_PYTHON="$prev_le_python"
|
||||
elif [ -f /etc/os-release ] && `grep -q openSUSE /etc/os-release` ; then
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
elif [ -f /etc/arch-release ]; then
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
elif [ -f /etc/manjaro-release ]; then
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
elif [ -f /etc/gentoo-release ]; then
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
elif uname | grep -iq FreeBSD ; then
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
elif uname | grep -iq Darwin ; then
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
elif [ -f /etc/issue ] && grep -iq "Amazon Linux" /etc/issue ; then
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
elif [ -f /etc/product ] && grep -q "Joyent Instance" /etc/product ; then
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
else
|
||||
DEPRECATED_OS=1
|
||||
NO_SELF_UPGRADE=1
|
||||
fi
|
||||
|
||||
# We handle this case after determining the normal bootstrap version to allow
|
||||
|
|
@ -1107,7 +1117,9 @@ if [ "$1" = "--le-auto-phase2" ]; then
|
|||
fi
|
||||
|
||||
if [ -f "$VENV_BIN/letsencrypt" -a "$INSTALL_ONLY" != 1 ]; then
|
||||
error "Certbot will no longer receive updates."
|
||||
error "certbot-auto and its Certbot installation will no longer receive updates."
|
||||
error "You will not receive any bug fixes including those fixing server compatibility"
|
||||
error "or security problems."
|
||||
error "Please visit https://certbot.eff.org/ to check for other alternatives."
|
||||
"$VENV_BIN/letsencrypt" "$@"
|
||||
exit 0
|
||||
|
|
@ -1475,18 +1487,18 @@ letsencrypt==0.7.0 \
|
|||
--hash=sha256:105a5fb107e45bcd0722eb89696986dcf5f08a86a321d6aef25a0c7c63375ade \
|
||||
--hash=sha256:c36e532c486a7e92155ee09da54b436a3c420813ec1c590b98f635d924720de9
|
||||
|
||||
certbot==1.11.0 \
|
||||
--hash=sha256:b7faa66c40a1ce5a31bfc8668d8feb5d2db6f7af9e791079a6d95c77b6593bf4 \
|
||||
--hash=sha256:6b0ce04e55379aff0a47f873fa05c084538ad0f4a9b79f33108dbb0a7a668b43
|
||||
acme==1.11.0 \
|
||||
--hash=sha256:77d6ce61b155315d7d7031489bbd245c0ea42c0453a04d4304393414e741a56d \
|
||||
--hash=sha256:092eb09a074a935da4c10f66cb8634ffb2cc2d2cc1035d2998d608996efab924
|
||||
certbot-apache==1.11.0 \
|
||||
--hash=sha256:ea7ac88733aad91a89c700289effda2a0c0658778da1ae2c54a0aefaee351285 \
|
||||
--hash=sha256:3ed001427ec0b49324f2b9af7170fa6e6e88948fa51c3678b07bf17f8138863d
|
||||
certbot-nginx==1.11.0 \
|
||||
--hash=sha256:79de69782a1199e577787ff9790dee02a44aac17dbecd6a7287593030842a306 \
|
||||
--hash=sha256:9afe611f99a78b8898941b8ad7bdcf7f3c2b6e0fce27125268f7c713e64b34ee
|
||||
certbot==1.12.0 \
|
||||
--hash=sha256:f4bb3da5391e4a28e9a2e52ab54986171c0864feff17eaaaca6729a1d4c433a6 \
|
||||
--hash=sha256:5ee738773479bcb7794e43fedd2415acc0969b75bdd2a21f451e3bff9d99df59
|
||||
acme==1.12.0 \
|
||||
--hash=sha256:ca4ad044429f1b8b670b958e5c7ea38159def9d601f4af2359355993918c3317 \
|
||||
--hash=sha256:aa363474d50e9fdda27acb8b1aa7efb26fecc5650e02039a0de3a3f0e696c2f2
|
||||
certbot-apache==1.12.0 \
|
||||
--hash=sha256:38899f6fa08799de9535795d919acf968f288d7208909baf7733f9a763c15227 \
|
||||
--hash=sha256:e5679b40d99bd241f4fcd9fe44b73e6e25ccc969a617131ff6ebc90d562a49f2
|
||||
certbot-nginx==1.12.0 \
|
||||
--hash=sha256:332cd70067bbcf6db52a002650ffa4844d0bd9780279d662aa6725b43f776c14 \
|
||||
--hash=sha256:3fb6a55290d37ad466681a89a85ceca4c4026fdd8702f3010b87a74266a6fe7b
|
||||
|
||||
UNLIKELY_EOF
|
||||
# -------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQEzBAABCAAdFiEEos+1H6J1pyhiNOeyTRfJlc2XdfIFAl/0pwwACgkQTRfJlc2X
|
||||
dfL4eQf+MyI6XGuG9jKbfRRfYWNjc3B4nxjvpeaOys6ZNIFoI5sElR/8siv6lexc
|
||||
iDZ0h6PkIfh4NkIOQJQqgGP885P4aPZBg1mOTnssa6u3+1R3QRb/L/QcppysQZnf
|
||||
Jve+94Zpkz1r2pF8KI4mZYDl5iN01TrMlQLddEeWOzY1tzoEVBq19KBEUwnk8awt
|
||||
WOxKfhITFPbU2jyR5O4przDJLGsqG6WC6etCbmWYnb/he3pWa70ITsv2a1RCoTDf
|
||||
EsBb5QVa3SEw+NT3jyE9P3FothSQZyvsYojd6/B4/bwZarWwqh1mTMz55U2rJl87
|
||||
XpjglPXfhrv/s5oWNWthXTpz+11xvA==
|
||||
=nhC8
|
||||
iQEzBAABCAAdFiEEos+1H6J1pyhiNOeyTRfJlc2XdfIFAmAZorcACgkQTRfJlc2X
|
||||
dfI6Ogf+LFASyH9sgTV1k9hs1zbmO3CxyE9QQs1JLXpoKOQ1tKv+v+kpt+lJ005g
|
||||
rielyRSssXtZSyfLchCSBh6qaEBodoOcz8RS2z7rDnR9jKOJv252Buh2oSa3KPmn
|
||||
WPjRmB3zVXnhq/XmPKQTnoflUlBg+MtZuZXt0Fvu8rvQB+RY3AUfB5Xs83nxJNj4
|
||||
W9qNpZYl0sJWWiydr23bEk35MJSt62sKDvyqIVjUfgDfXHmauOpg0foz2xS6XP8i
|
||||
Ke66GUKaQ1ap2BTucwVT0hieXiQZpxx1PitUeEOjOH9PUfrAxyFlQ0XQaVlqoBhc
|
||||
YM3nzJw9yf12b+XCUvMzHyQmDA5vdQ==
|
||||
=AUGt
|
||||
-----END PGP SIGNATURE-----
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ if [ -z "$VENV_PATH" ]; then
|
|||
fi
|
||||
VENV_BIN="$VENV_PATH/bin"
|
||||
BOOTSTRAP_VERSION_PATH="$VENV_PATH/certbot-auto-bootstrap-version.txt"
|
||||
LE_AUTO_VERSION="1.12.0.dev0"
|
||||
LE_AUTO_VERSION="1.13.0.dev0"
|
||||
BASENAME=$(basename $0)
|
||||
USAGE="Usage: $BASENAME [OPTIONS]
|
||||
A self-updating wrapper script for the Certbot ACME client. When run, updates
|
||||
|
|
@ -1487,18 +1487,18 @@ letsencrypt==0.7.0 \
|
|||
--hash=sha256:105a5fb107e45bcd0722eb89696986dcf5f08a86a321d6aef25a0c7c63375ade \
|
||||
--hash=sha256:c36e532c486a7e92155ee09da54b436a3c420813ec1c590b98f635d924720de9
|
||||
|
||||
certbot==1.11.0 \
|
||||
--hash=sha256:b7faa66c40a1ce5a31bfc8668d8feb5d2db6f7af9e791079a6d95c77b6593bf4 \
|
||||
--hash=sha256:6b0ce04e55379aff0a47f873fa05c084538ad0f4a9b79f33108dbb0a7a668b43
|
||||
acme==1.11.0 \
|
||||
--hash=sha256:77d6ce61b155315d7d7031489bbd245c0ea42c0453a04d4304393414e741a56d \
|
||||
--hash=sha256:092eb09a074a935da4c10f66cb8634ffb2cc2d2cc1035d2998d608996efab924
|
||||
certbot-apache==1.11.0 \
|
||||
--hash=sha256:ea7ac88733aad91a89c700289effda2a0c0658778da1ae2c54a0aefaee351285 \
|
||||
--hash=sha256:3ed001427ec0b49324f2b9af7170fa6e6e88948fa51c3678b07bf17f8138863d
|
||||
certbot-nginx==1.11.0 \
|
||||
--hash=sha256:79de69782a1199e577787ff9790dee02a44aac17dbecd6a7287593030842a306 \
|
||||
--hash=sha256:9afe611f99a78b8898941b8ad7bdcf7f3c2b6e0fce27125268f7c713e64b34ee
|
||||
certbot==1.12.0 \
|
||||
--hash=sha256:f4bb3da5391e4a28e9a2e52ab54986171c0864feff17eaaaca6729a1d4c433a6 \
|
||||
--hash=sha256:5ee738773479bcb7794e43fedd2415acc0969b75bdd2a21f451e3bff9d99df59
|
||||
acme==1.12.0 \
|
||||
--hash=sha256:ca4ad044429f1b8b670b958e5c7ea38159def9d601f4af2359355993918c3317 \
|
||||
--hash=sha256:aa363474d50e9fdda27acb8b1aa7efb26fecc5650e02039a0de3a3f0e696c2f2
|
||||
certbot-apache==1.12.0 \
|
||||
--hash=sha256:38899f6fa08799de9535795d919acf968f288d7208909baf7733f9a763c15227 \
|
||||
--hash=sha256:e5679b40d99bd241f4fcd9fe44b73e6e25ccc969a617131ff6ebc90d562a49f2
|
||||
certbot-nginx==1.12.0 \
|
||||
--hash=sha256:332cd70067bbcf6db52a002650ffa4844d0bd9780279d662aa6725b43f776c14 \
|
||||
--hash=sha256:3fb6a55290d37ad466681a89a85ceca4c4026fdd8702f3010b87a74266a6fe7b
|
||||
|
||||
UNLIKELY_EOF
|
||||
# -------------------------------------------------------------------------
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,12 +1,12 @@
|
|||
certbot==1.11.0 \
|
||||
--hash=sha256:b7faa66c40a1ce5a31bfc8668d8feb5d2db6f7af9e791079a6d95c77b6593bf4 \
|
||||
--hash=sha256:6b0ce04e55379aff0a47f873fa05c084538ad0f4a9b79f33108dbb0a7a668b43
|
||||
acme==1.11.0 \
|
||||
--hash=sha256:77d6ce61b155315d7d7031489bbd245c0ea42c0453a04d4304393414e741a56d \
|
||||
--hash=sha256:092eb09a074a935da4c10f66cb8634ffb2cc2d2cc1035d2998d608996efab924
|
||||
certbot-apache==1.11.0 \
|
||||
--hash=sha256:ea7ac88733aad91a89c700289effda2a0c0658778da1ae2c54a0aefaee351285 \
|
||||
--hash=sha256:3ed001427ec0b49324f2b9af7170fa6e6e88948fa51c3678b07bf17f8138863d
|
||||
certbot-nginx==1.11.0 \
|
||||
--hash=sha256:79de69782a1199e577787ff9790dee02a44aac17dbecd6a7287593030842a306 \
|
||||
--hash=sha256:9afe611f99a78b8898941b8ad7bdcf7f3c2b6e0fce27125268f7c713e64b34ee
|
||||
certbot==1.12.0 \
|
||||
--hash=sha256:f4bb3da5391e4a28e9a2e52ab54986171c0864feff17eaaaca6729a1d4c433a6 \
|
||||
--hash=sha256:5ee738773479bcb7794e43fedd2415acc0969b75bdd2a21f451e3bff9d99df59
|
||||
acme==1.12.0 \
|
||||
--hash=sha256:ca4ad044429f1b8b670b958e5c7ea38159def9d601f4af2359355993918c3317 \
|
||||
--hash=sha256:aa363474d50e9fdda27acb8b1aa7efb26fecc5650e02039a0de3a3f0e696c2f2
|
||||
certbot-apache==1.12.0 \
|
||||
--hash=sha256:38899f6fa08799de9535795d919acf968f288d7208909baf7733f9a763c15227 \
|
||||
--hash=sha256:e5679b40d99bd241f4fcd9fe44b73e6e25ccc969a617131ff6ebc90d562a49f2
|
||||
certbot-nginx==1.12.0 \
|
||||
--hash=sha256:332cd70067bbcf6db52a002650ffa4844d0bd9780279d662aa6725b43f776c14 \
|
||||
--hash=sha256:3fb6a55290d37ad466681a89a85ceca4c4026fdd8702f3010b87a74266a6fe7b
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
#!/bin/sh
|
||||
# This is a simple script that can be sourced to set Python environment
|
||||
# variables for use in Certbot's letstest test farm tests.
|
||||
|
||||
# Some distros like Fedora may only have an executable named python3 installed.
|
||||
if command -v python; then
|
||||
PYTHON_NAME="python"
|
||||
VENV_SCRIPT="tools/venv.py"
|
||||
VENV_PATH="venv"
|
||||
else
|
||||
# We could check for "python2" here, however, the addition of "python3"
|
||||
# only systems is what necessitated this change so checking for "python2"
|
||||
# isn't necessary.
|
||||
PYTHON_NAME="python3"
|
||||
VENV_PATH="venv3"
|
||||
VENV_SCRIPT="tools/venv3.py"
|
||||
fi
|
||||
|
|
@ -64,7 +64,7 @@ if [ $? -ne 0 ] ; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
tools/venv3.py -e acme[dev] -e certbot[dev,docs] -e certbot-apache -e certbot-ci
|
||||
tools/venv.py -e acme[dev] -e certbot[dev,docs] -e certbot-apache -e certbot-ci
|
||||
PEBBLE_LOGS="acme_server.log"
|
||||
PEBBLE_URL="https://localhost:14000/dir"
|
||||
# We configure Pebble to use port 80 for http-01 validation rather than an
|
||||
|
|
@ -73,7 +73,7 @@ PEBBLE_URL="https://localhost:14000/dir"
|
|||
# and closer to the default configuration on various OSes.
|
||||
# 2) As of writing this, Certbot's Apache plugin requires there to be an
|
||||
# existing virtual host for the port used for http-01 validation.
|
||||
venv3/bin/run_acme_server --http-01-port 80 > "${PEBBLE_LOGS}" 2>&1 &
|
||||
venv/bin/run_acme_server --http-01-port 80 > "${PEBBLE_LOGS}" 2>&1 &
|
||||
|
||||
DumpPebbleLogs() {
|
||||
if [ -f "${PEBBLE_LOGS}" ] ; then
|
||||
|
|
@ -96,7 +96,7 @@ if ! curl --insecure "${PEBBLE_URL}" 2>/dev/null; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
sudo "venv3/bin/certbot" -v --debug --text --agree-tos --no-verify-ssl \
|
||||
sudo "venv/bin/certbot" -v --debug --text --agree-tos --no-verify-ssl \
|
||||
--renew-by-default --redirect --register-unsafely-without-email \
|
||||
--domain "${PUBLIC_HOSTNAME}" --server "${PEBBLE_URL}"
|
||||
if [ $? -ne 0 ] ; then
|
||||
|
|
@ -113,7 +113,7 @@ elif [ "$OS_TYPE" = "centos" ]; then
|
|||
fi
|
||||
OPENSSL_VERSION=$(strings "$MOD_SSL_LOCATION" | egrep -o -m1 '^OpenSSL ([0-9]\.[^ ]+) ' | tail -c +9)
|
||||
APACHE_VERSION=$(sudo $APACHE_NAME -v | egrep -o 'Apache/([0-9]\.[^ ]+)' | tail -c +8)
|
||||
"venv3/bin/python" tests/letstest/scripts/test_openssl_version.py "$OPENSSL_VERSION" "$APACHE_VERSION"
|
||||
"venv/bin/python" tests/letstest/scripts/test_openssl_version.py "$OPENSSL_VERSION" "$APACHE_VERSION"
|
||||
if [ $? -ne 0 ] ; then
|
||||
FAIL=1
|
||||
fi
|
||||
|
|
@ -121,7 +121,7 @@ fi
|
|||
|
||||
if [ "$OS_TYPE" = "ubuntu" ] ; then
|
||||
export SERVER="${PEBBLE_URL}"
|
||||
"venv3/bin/tox" -e apacheconftest
|
||||
"venv/bin/tox" -e apacheconftest
|
||||
else
|
||||
echo Not running hackish apache tests on $OS_TYPE
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -33,10 +33,11 @@ if ! ./letsencrypt-auto -v --debug --version --no-self-upgrade 2>&1 | tail -n1 |
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# This script sets the environment variables PYTHON_NAME, VENV_PATH, and
|
||||
# VENV_SCRIPT based on the version of Python available on the system. For
|
||||
# instance, Fedora uses Python 3 and Python 2 is not installed.
|
||||
. tests/letstest/scripts/set_python_envvars.sh
|
||||
if command -v python; then
|
||||
PYTHON_NAME="python"
|
||||
else
|
||||
PYTHON_NAME="python3"
|
||||
fi
|
||||
|
||||
# Now that python and openssl have been installed, we can set up a fake server
|
||||
# to provide a new version of letsencrypt-auto. First, we start the server and
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
cd letsencrypt
|
||||
|
||||
BOOTSTRAP_SCRIPT="tests/letstest/scripts/bootstrap_os_packages.sh"
|
||||
VENV_PATH=venv3
|
||||
VENV_PATH=venv
|
||||
|
||||
# install OS packages
|
||||
sudo $BOOTSTRAP_SCRIPT
|
||||
|
|
@ -18,7 +18,7 @@ python3 tools/strip_hashes.py letsencrypt-auto-source/pieces/dependency-requirem
|
|||
# marker that'd normally prevent it from being installed, and this package is
|
||||
# not needed for any OS tested here.
|
||||
sed -i '/enum34/d' requirements.txt
|
||||
CERTBOT_PIP_NO_BINARY=:all: tools/venv3.py --requirement requirements.txt
|
||||
CERTBOT_PIP_NO_BINARY=:all: tools/venv.py --requirement requirements.txt
|
||||
. "$VENV_PATH/bin/activate"
|
||||
# pytest is needed to run tests on some of our packages so we install a pinned version here.
|
||||
tools/pip_install.py pytest
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ LE_AUTO="$REPO_ROOT/letsencrypt-auto-source/letsencrypt-auto"
|
|||
LE_AUTO="$LE_AUTO --debug --no-self-upgrade --non-interactive"
|
||||
MODULES="acme certbot certbot-apache certbot-nginx"
|
||||
PIP_INSTALL="tools/pip_install.py"
|
||||
VENV_NAME=venv3
|
||||
VENV_NAME=venv
|
||||
BOOTSTRAP_SCRIPT="$REPO_ROOT/tests/letstest/scripts/bootstrap_os_packages.sh"
|
||||
VENV_SCRIPT="tools/venv3.py"
|
||||
VENV_SCRIPT="tools/venv.py"
|
||||
|
||||
sudo $BOOTSTRAP_SCRIPT
|
||||
|
||||
|
|
|
|||
|
|
@ -1,244 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
"""Aids in creating a developer virtual environment for Certbot.
|
||||
|
||||
When this module is run as a script, it takes the arguments that should
|
||||
be passed to pip to install the Certbot packages as command line
|
||||
arguments. The virtual environment will be created with the name "venv"
|
||||
in the current working directory and will use the default version of
|
||||
Python for the virtualenv executable in your PATH. You can change the
|
||||
name of the virtual environment by setting the environment variable
|
||||
VENV_NAME.
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
from distutils.version import LooseVersion
|
||||
import glob
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
REQUIREMENTS = [
|
||||
'-e acme[dev]',
|
||||
'-e certbot[dev,docs]',
|
||||
'-e certbot-apache',
|
||||
'-e certbot-dns-cloudflare',
|
||||
'-e certbot-dns-cloudxns',
|
||||
'-e certbot-dns-digitalocean',
|
||||
'-e certbot-dns-dnsimple',
|
||||
'-e certbot-dns-dnsmadeeasy',
|
||||
'-e certbot-dns-gehirn',
|
||||
'-e certbot-dns-google',
|
||||
'-e certbot-dns-linode',
|
||||
'-e certbot-dns-luadns',
|
||||
'-e certbot-dns-nsone',
|
||||
'-e certbot-dns-ovh',
|
||||
'-e certbot-dns-rfc2136',
|
||||
'-e certbot-dns-route53',
|
||||
'-e certbot-dns-sakuracloud',
|
||||
'-e certbot-nginx',
|
||||
'-e certbot-compatibility-test',
|
||||
'-e certbot-ci',
|
||||
]
|
||||
|
||||
VERSION_PATTERN = re.compile(r'^(\d+)\.(\d+).*$')
|
||||
|
||||
|
||||
class PythonExecutableNotFoundError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def find_python_executable(python_major):
|
||||
# type: (int) -> str
|
||||
"""
|
||||
Find the relevant python executable that is of the given python major version.
|
||||
Will test, in decreasing priority order:
|
||||
|
||||
* the current Python interpreter
|
||||
* 'pythonX' executable in PATH (with X the given major version) if available
|
||||
* 'python' executable in PATH if available
|
||||
* Windows Python launcher 'py' executable in PATH if available
|
||||
|
||||
Incompatible python versions for Certbot will be evicted (e.g. Python 3
|
||||
versions less than 3.6).
|
||||
|
||||
:param int python_major: the Python major version to target (2 or 3)
|
||||
:rtype: str
|
||||
:return: the relevant python executable path
|
||||
:raise RuntimeError: if no relevant python executable path could be found
|
||||
"""
|
||||
python_executable_path = None
|
||||
|
||||
# First try, current python executable
|
||||
if _check_version('{0}.{1}.{2}'.format(
|
||||
sys.version_info[0], sys.version_info[1], sys.version_info[2]), python_major):
|
||||
return sys.executable
|
||||
|
||||
# Second try, with python executables in path
|
||||
versions_to_test = ['2.7', '2', ''] if python_major == 2 else ['3', '']
|
||||
for one_version in versions_to_test:
|
||||
try:
|
||||
one_python = 'python{0}'.format(one_version)
|
||||
output = subprocess.check_output([one_python, '--version'],
|
||||
universal_newlines=True, stderr=subprocess.STDOUT)
|
||||
if _check_version(output.strip().split()[1], python_major):
|
||||
return subprocess.check_output([one_python, '-c',
|
||||
'import sys; sys.stdout.write(sys.executable);'],
|
||||
universal_newlines=True)
|
||||
except (subprocess.CalledProcessError, OSError):
|
||||
pass
|
||||
|
||||
# Last try, with Windows Python launcher
|
||||
try:
|
||||
env_arg = '-{0}'.format(python_major)
|
||||
output_version = subprocess.check_output(['py', env_arg, '--version'],
|
||||
universal_newlines=True, stderr=subprocess.STDOUT)
|
||||
if _check_version(output_version.strip().split()[1], python_major):
|
||||
return subprocess.check_output(['py', env_arg, '-c',
|
||||
'import sys; sys.stdout.write(sys.executable);'],
|
||||
universal_newlines=True)
|
||||
except (subprocess.CalledProcessError, OSError):
|
||||
pass
|
||||
|
||||
if not python_executable_path:
|
||||
raise RuntimeError('Error, no compatible Python {0} executable for Certbot could be found.'
|
||||
.format(python_major))
|
||||
|
||||
|
||||
def _check_version(version_str, major_version):
|
||||
search = VERSION_PATTERN.search(version_str)
|
||||
|
||||
if not search:
|
||||
return False
|
||||
|
||||
version = (int(search.group(1)), int(search.group(2)))
|
||||
|
||||
minimal_version_supported = (2, 7)
|
||||
if major_version == 3:
|
||||
minimal_version_supported = (3, 6)
|
||||
|
||||
if version >= minimal_version_supported:
|
||||
return True
|
||||
|
||||
print('Incompatible python version for Certbot found: {0}'.format(version_str))
|
||||
return False
|
||||
|
||||
|
||||
def subprocess_with_print(cmd, env=None, shell=False):
|
||||
if env is None:
|
||||
env = os.environ
|
||||
print('+ {0}'.format(subprocess.list2cmdline(cmd)) if isinstance(cmd, list) else cmd)
|
||||
subprocess.check_call(cmd, env=env, shell=shell)
|
||||
|
||||
|
||||
def subprocess_output_with_print(cmd, env=None, shell=False):
|
||||
if env is None:
|
||||
env = os.environ
|
||||
print('+ {0}'.format(subprocess.list2cmdline(cmd)) if isinstance(cmd, list) else cmd)
|
||||
return subprocess.check_output(cmd, env=env, shell=shell)
|
||||
|
||||
|
||||
def get_venv_python_path(venv_path):
|
||||
python_linux = os.path.join(venv_path, 'bin/python')
|
||||
if os.path.isfile(python_linux):
|
||||
return os.path.abspath(python_linux)
|
||||
python_windows = os.path.join(venv_path, 'Scripts\\python.exe')
|
||||
if os.path.isfile(python_windows):
|
||||
return os.path.abspath(python_windows)
|
||||
|
||||
raise ValueError((
|
||||
'Error, could not find python executable in venv path {0}: is it a valid venv ?'
|
||||
.format(venv_path)))
|
||||
|
||||
|
||||
def prepare_venv_path(venv_name):
|
||||
"""Determines the venv path and prepares it for use.
|
||||
|
||||
This function cleans up any Python eggs in the current working directory
|
||||
and ensures the venv path is available for use. The path used is the
|
||||
VENV_NAME environment variable if it is set and venv_name otherwise. If
|
||||
there is already a directory at the desired path, the existing directory is
|
||||
renamed by appending a timestamp to the directory name.
|
||||
|
||||
:param str venv_name: The name or path at where the virtual
|
||||
environment should be created if VENV_NAME isn't set.
|
||||
|
||||
:returns: path where the virtual environment should be created
|
||||
:rtype: str
|
||||
|
||||
"""
|
||||
for path in glob.glob('*.egg-info'):
|
||||
if os.path.isdir(path):
|
||||
shutil.rmtree(path)
|
||||
else:
|
||||
os.remove(path)
|
||||
|
||||
env_venv_name = os.environ.get('VENV_NAME')
|
||||
if env_venv_name:
|
||||
print('Creating venv at {0}'
|
||||
' as specified in VENV_NAME'.format(env_venv_name))
|
||||
venv_name = env_venv_name
|
||||
|
||||
if os.path.isdir(venv_name):
|
||||
os.rename(venv_name, '{0}.{1}.bak'.format(venv_name, int(time.time())))
|
||||
|
||||
return venv_name
|
||||
|
||||
|
||||
def install_packages(venv_name, pip_args):
|
||||
"""Installs packages in the given venv.
|
||||
|
||||
:param str venv_name: The name or path at where the virtual
|
||||
environment should be created.
|
||||
:param pip_args: Command line arguments that should be given to
|
||||
pip to install packages
|
||||
:type pip_args: `list` of `str`
|
||||
|
||||
"""
|
||||
# Using the python executable from venv, we ensure to execute following commands in this venv.
|
||||
py_venv = get_venv_python_path(venv_name)
|
||||
subprocess_with_print([py_venv, os.path.abspath('tools/pipstrap.py')])
|
||||
# We only use this value during pip install because:
|
||||
# 1) We're really only adding it for installing cryptography, which happens here, and
|
||||
# 2) There are issues with calling it along with VIRTUALENV_NO_DOWNLOAD, which applies at the
|
||||
# steps above, not during pip install.
|
||||
env_pip_no_binary = os.environ.get('CERTBOT_PIP_NO_BINARY')
|
||||
if env_pip_no_binary:
|
||||
# Check OpenSSL version. If it's too low, don't apply the env variable.
|
||||
openssl_version_string = str(subprocess_output_with_print(['openssl', 'version']))
|
||||
matches = re.findall(r'OpenSSL ([^ ]+) ', openssl_version_string)
|
||||
if not matches:
|
||||
print('Could not find OpenSSL version, not setting PIP_NO_BINARY.')
|
||||
else:
|
||||
openssl_version = matches[0]
|
||||
|
||||
if LooseVersion(openssl_version) >= LooseVersion('1.0.2'):
|
||||
print('Setting PIP_NO_BINARY to {0}'
|
||||
' as specified in CERTBOT_PIP_NO_BINARY'.format(env_pip_no_binary))
|
||||
os.environ['PIP_NO_BINARY'] = env_pip_no_binary
|
||||
else:
|
||||
print('Not setting PIP_NO_BINARY, as OpenSSL version is too old.')
|
||||
command = [py_venv, os.path.abspath('tools/pip_install.py')]
|
||||
command.extend(pip_args)
|
||||
subprocess_with_print(command)
|
||||
if 'PIP_NO_BINARY' in os.environ:
|
||||
del os.environ['PIP_NO_BINARY']
|
||||
|
||||
if os.path.isdir(os.path.join(venv_name, 'bin')):
|
||||
# Linux/OSX specific
|
||||
print('-------------------------------------------------------------------')
|
||||
print('Please run the following command to activate developer environment:')
|
||||
print('source {0}/bin/activate'.format(venv_name))
|
||||
print('-------------------------------------------------------------------')
|
||||
elif os.path.isdir(os.path.join(venv_name, 'Scripts')):
|
||||
# Windows specific
|
||||
print('---------------------------------------------------------------------------')
|
||||
print('Please run one of the following commands to activate developer environment:')
|
||||
print('{0}\\Scripts\\activate.bat (for Batch)'.format(venv_name))
|
||||
print('.\\{0}\\Scripts\\Activate.ps1 (for Powershell)'.format(venv_name))
|
||||
print('---------------------------------------------------------------------------')
|
||||
else:
|
||||
raise ValueError('Error, directory {0} is not a valid venv.'.format(venv_name))
|
||||
259
tools/venv.py
259
tools/venv.py
|
|
@ -1,36 +1,261 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
# Developer virtualenv setup for Certbot client
|
||||
import os
|
||||
import sys
|
||||
"""Aids in creating a developer virtual environment for Certbot.
|
||||
|
||||
import _venv_common
|
||||
When this module is run as a script, it takes the arguments that should
|
||||
be passed to pip to install the Certbot packages as command line
|
||||
arguments. If no arguments are provided, all Certbot packages and their
|
||||
development dependencies are installed. The virtual environment will be
|
||||
created with the name "venv" in the current working directory. You can
|
||||
change the name of the virtual environment by setting the environment
|
||||
variable VENV_NAME.
|
||||
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
from distutils.version import LooseVersion
|
||||
import glob
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
REQUIREMENTS = [
|
||||
'-e acme[dev]',
|
||||
'-e certbot[dev,dev3,docs]',
|
||||
'-e certbot-apache',
|
||||
'-e certbot-dns-cloudflare',
|
||||
'-e certbot-dns-cloudxns',
|
||||
'-e certbot-dns-digitalocean',
|
||||
'-e certbot-dns-dnsimple',
|
||||
'-e certbot-dns-dnsmadeeasy',
|
||||
'-e certbot-dns-gehirn',
|
||||
'-e certbot-dns-google',
|
||||
'-e certbot-dns-linode',
|
||||
'-e certbot-dns-luadns',
|
||||
'-e certbot-dns-nsone',
|
||||
'-e certbot-dns-ovh',
|
||||
'-e certbot-dns-rfc2136',
|
||||
'-e certbot-dns-route53',
|
||||
'-e certbot-dns-sakuracloud',
|
||||
'-e certbot-nginx',
|
||||
'-e certbot-compatibility-test',
|
||||
'-e certbot-ci',
|
||||
]
|
||||
|
||||
VERSION_PATTERN = re.compile(r'^(\d+)\.(\d+).*$')
|
||||
|
||||
|
||||
class PythonExecutableNotFoundError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def find_python_executable() -> str:
|
||||
"""
|
||||
Find the relevant python executable that is of the given python major version.
|
||||
Will test, in decreasing priority order:
|
||||
|
||||
* the current Python interpreter
|
||||
* 'pythonX' executable in PATH (with X the given major version) if available
|
||||
* 'python' executable in PATH if available
|
||||
* Windows Python launcher 'py' executable in PATH if available
|
||||
|
||||
Incompatible python versions for Certbot will be evicted (e.g. Python 3
|
||||
versions less than 3.6).
|
||||
|
||||
:rtype: str
|
||||
:return: the relevant python executable path
|
||||
:raise RuntimeError: if no relevant python executable path could be found
|
||||
"""
|
||||
python_executable_path = None
|
||||
|
||||
# First try, current python executable
|
||||
if _check_version('{0}.{1}.{2}'.format(
|
||||
sys.version_info[0], sys.version_info[1], sys.version_info[2])):
|
||||
return sys.executable
|
||||
|
||||
# Second try, with python executables in path
|
||||
for one_version in ('3', '',):
|
||||
try:
|
||||
one_python = 'python{0}'.format(one_version)
|
||||
output = subprocess.check_output([one_python, '--version'],
|
||||
universal_newlines=True, stderr=subprocess.STDOUT)
|
||||
if _check_version(output.strip().split()[1]):
|
||||
return subprocess.check_output([one_python, '-c',
|
||||
'import sys; sys.stdout.write(sys.executable);'],
|
||||
universal_newlines=True)
|
||||
except (subprocess.CalledProcessError, OSError):
|
||||
pass
|
||||
|
||||
# Last try, with Windows Python launcher
|
||||
try:
|
||||
output_version = subprocess.check_output(['py', '-3', '--version'],
|
||||
universal_newlines=True, stderr=subprocess.STDOUT)
|
||||
if _check_version(output_version.strip().split()[1]):
|
||||
return subprocess.check_output(['py', env_arg, '-c',
|
||||
'import sys; sys.stdout.write(sys.executable);'],
|
||||
universal_newlines=True)
|
||||
except (subprocess.CalledProcessError, OSError):
|
||||
pass
|
||||
|
||||
if not python_executable_path:
|
||||
raise RuntimeError('Error, no compatible Python executable for Certbot could be found.')
|
||||
|
||||
|
||||
def _check_version(version_str):
|
||||
search = VERSION_PATTERN.search(version_str)
|
||||
|
||||
if not search:
|
||||
return False
|
||||
|
||||
version = (int(search.group(1)), int(search.group(2)))
|
||||
|
||||
if version >= (3, 6):
|
||||
return True
|
||||
|
||||
print('Incompatible python version for Certbot found: {0}'.format(version_str))
|
||||
return False
|
||||
|
||||
|
||||
def subprocess_with_print(cmd, env=None, shell=False):
|
||||
if env is None:
|
||||
env = os.environ
|
||||
print('+ {0}'.format(subprocess.list2cmdline(cmd)) if isinstance(cmd, list) else cmd)
|
||||
subprocess.check_call(cmd, env=env, shell=shell)
|
||||
|
||||
|
||||
def subprocess_output_with_print(cmd, env=None, shell=False):
|
||||
if env is None:
|
||||
env = os.environ
|
||||
print('+ {0}'.format(subprocess.list2cmdline(cmd)) if isinstance(cmd, list) else cmd)
|
||||
return subprocess.check_output(cmd, env=env, shell=shell)
|
||||
|
||||
|
||||
def get_venv_python_path(venv_path):
|
||||
python_linux = os.path.join(venv_path, 'bin/python')
|
||||
if os.path.isfile(python_linux):
|
||||
return os.path.abspath(python_linux)
|
||||
python_windows = os.path.join(venv_path, 'Scripts\\python.exe')
|
||||
if os.path.isfile(python_windows):
|
||||
return os.path.abspath(python_windows)
|
||||
|
||||
raise ValueError((
|
||||
'Error, could not find python executable in venv path {0}: is it a valid venv ?'
|
||||
.format(venv_path)))
|
||||
|
||||
|
||||
def prepare_venv_path(venv_name):
|
||||
"""Determines the venv path and prepares it for use.
|
||||
|
||||
This function cleans up any Python eggs in the current working directory
|
||||
and ensures the venv path is available for use. The path used is the
|
||||
VENV_NAME environment variable if it is set and venv_name otherwise. If
|
||||
there is already a directory at the desired path, the existing directory is
|
||||
renamed by appending a timestamp to the directory name.
|
||||
|
||||
:param str venv_name: The name or path at where the virtual
|
||||
environment should be created if VENV_NAME isn't set.
|
||||
|
||||
:returns: path where the virtual environment should be created
|
||||
:rtype: str
|
||||
|
||||
"""
|
||||
for path in glob.glob('*.egg-info'):
|
||||
if os.path.isdir(path):
|
||||
shutil.rmtree(path)
|
||||
else:
|
||||
os.remove(path)
|
||||
|
||||
env_venv_name = os.environ.get('VENV_NAME')
|
||||
if env_venv_name:
|
||||
print('Creating venv at {0}'
|
||||
' as specified in VENV_NAME'.format(env_venv_name))
|
||||
venv_name = env_venv_name
|
||||
|
||||
if os.path.isdir(venv_name):
|
||||
os.rename(venv_name, '{0}.{1}.bak'.format(venv_name, int(time.time())))
|
||||
|
||||
return venv_name
|
||||
|
||||
|
||||
def install_packages(venv_name, pip_args):
|
||||
"""Installs packages in the given venv.
|
||||
|
||||
:param str venv_name: The name or path at where the virtual
|
||||
environment should be created.
|
||||
:param pip_args: Command line arguments that should be given to
|
||||
pip to install packages
|
||||
:type pip_args: `list` of `str`
|
||||
|
||||
"""
|
||||
# Using the python executable from venv, we ensure to execute following commands in this venv.
|
||||
py_venv = get_venv_python_path(venv_name)
|
||||
subprocess_with_print([py_venv, os.path.abspath('tools/pipstrap.py')])
|
||||
# We only use this value during pip install because:
|
||||
# 1) We're really only adding it for installing cryptography, which happens here, and
|
||||
# 2) There are issues with calling it along with VIRTUALENV_NO_DOWNLOAD, which applies at the
|
||||
# steps above, not during pip install.
|
||||
env_pip_no_binary = os.environ.get('CERTBOT_PIP_NO_BINARY')
|
||||
if env_pip_no_binary:
|
||||
# Check OpenSSL version. If it's too low, don't apply the env variable.
|
||||
openssl_version_string = str(subprocess_output_with_print(['openssl', 'version']))
|
||||
matches = re.findall(r'OpenSSL ([^ ]+) ', openssl_version_string)
|
||||
if not matches:
|
||||
print('Could not find OpenSSL version, not setting PIP_NO_BINARY.')
|
||||
else:
|
||||
openssl_version = matches[0]
|
||||
|
||||
if LooseVersion(openssl_version) >= LooseVersion('1.0.2'):
|
||||
print('Setting PIP_NO_BINARY to {0}'
|
||||
' as specified in CERTBOT_PIP_NO_BINARY'.format(env_pip_no_binary))
|
||||
os.environ['PIP_NO_BINARY'] = env_pip_no_binary
|
||||
else:
|
||||
print('Not setting PIP_NO_BINARY, as OpenSSL version is too old.')
|
||||
command = [py_venv, os.path.abspath('tools/pip_install.py')]
|
||||
command.extend(pip_args)
|
||||
subprocess_with_print(command)
|
||||
if 'PIP_NO_BINARY' in os.environ:
|
||||
del os.environ['PIP_NO_BINARY']
|
||||
|
||||
if os.path.isdir(os.path.join(venv_name, 'bin')):
|
||||
# Linux/OSX specific
|
||||
print('-------------------------------------------------------------------')
|
||||
print('Please run the following command to activate developer environment:')
|
||||
print('source {0}/bin/activate'.format(venv_name))
|
||||
print('-------------------------------------------------------------------')
|
||||
elif os.path.isdir(os.path.join(venv_name, 'Scripts')):
|
||||
# Windows specific
|
||||
print('---------------------------------------------------------------------------')
|
||||
print('Please run one of the following commands to activate developer environment:')
|
||||
print('{0}\\Scripts\\activate.bat (for Batch)'.format(venv_name))
|
||||
print('.\\{0}\\Scripts\\Activate.ps1 (for Powershell)'.format(venv_name))
|
||||
print('---------------------------------------------------------------------------')
|
||||
else:
|
||||
raise ValueError('Error, directory {0} is not a valid venv.'.format(venv_name))
|
||||
|
||||
|
||||
def create_venv(venv_path):
|
||||
"""Create a Python 2 virtual environment at venv_path.
|
||||
"""Create a Python virtual environment at venv_path.
|
||||
|
||||
:param str venv_path: path where the venv should be created
|
||||
|
||||
"""
|
||||
python2 = _venv_common.find_python_executable(2)
|
||||
command = [sys.executable, '-m', 'virtualenv', '--python', python2, venv_path]
|
||||
|
||||
environ = os.environ.copy()
|
||||
environ['VIRTUALENV_NO_DOWNLOAD'] = '1'
|
||||
_venv_common.subprocess_with_print(command, environ)
|
||||
python = find_python_executable()
|
||||
command = [python, '-m', 'venv', venv_path]
|
||||
subprocess_with_print(command)
|
||||
|
||||
|
||||
def main(pip_args=None):
|
||||
if os.name == 'nt':
|
||||
raise ValueError('Certbot for Windows is not supported on Python 2.x.')
|
||||
|
||||
venv_path = _venv_common.prepare_venv_path('venv')
|
||||
venv_path = prepare_venv_path('venv')
|
||||
create_venv(venv_path)
|
||||
|
||||
if not pip_args:
|
||||
pip_args = _venv_common.REQUIREMENTS
|
||||
pip_args = REQUIREMENTS
|
||||
|
||||
_venv_common.install_packages(venv_path, pip_args)
|
||||
install_packages(venv_path, pip_args)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
# Developer virtualenv setup for Certbot client
|
||||
import sys
|
||||
|
||||
import _venv_common
|
||||
|
||||
|
||||
def create_venv(venv_path):
|
||||
"""Create a Python 3 virtual environment at venv_path.
|
||||
|
||||
:param str venv_path: path where the venv should be created
|
||||
|
||||
"""
|
||||
python3 = _venv_common.find_python_executable(3)
|
||||
command = [python3, '-m', 'venv', venv_path]
|
||||
_venv_common.subprocess_with_print(command)
|
||||
|
||||
|
||||
def main(pip_args=None):
|
||||
venv_path = _venv_common.prepare_venv_path('venv3')
|
||||
create_venv(venv_path)
|
||||
|
||||
if not pip_args:
|
||||
pip_args = _venv_common.REQUIREMENTS + ['-e certbot[dev3]']
|
||||
|
||||
_venv_common.install_packages(venv_path, pip_args)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(sys.argv[1:])
|
||||
5
tox.ini
5
tox.ini
|
|
@ -137,6 +137,11 @@ commands =
|
|||
setenv =
|
||||
{[testenv:oldest]setenv}
|
||||
|
||||
[testenv:external-mock]
|
||||
commands =
|
||||
python {toxinidir}/tools/pip_install.py mock
|
||||
{[base]install_and_test} {[base]all_packages}
|
||||
|
||||
[testenv:lint]
|
||||
basepython = python3
|
||||
# separating into multiple invocations disables cross package
|
||||
|
|
|
|||
Loading…
Reference in a new issue