diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index 0e1a98861..67fa34880 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -3,6 +3,8 @@ jobs: variables: - name: IMAGE_NAME value: ubuntu-18.04 + - name: PYTHON_VERSION + value: 3.8 - group: certbot-common strategy: matrix: diff --git a/.azure-pipelines/templates/jobs/packaging-jobs.yml b/.azure-pipelines/templates/jobs/packaging-jobs.yml index c5f3b3ac2..8da30b1f5 100644 --- a/.azure-pipelines/templates/jobs/packaging-jobs.yml +++ b/.azure-pipelines/templates/jobs/packaging-jobs.yml @@ -79,9 +79,16 @@ jobs: artifact: windows-installer path: $(Build.SourcesDirectory)/bin displayName: Retrieve Windows installer + # pip 9.0 provided by pipstrap is not able to resolve properly the pywin32 dependency + # required by certbot-ci: as a temporary workaround until pipstrap is updated, we install + # a recent version of pip, but we also to disable the isolated feature as described in + # https://github.com/certbot/certbot/issues/8256 - script: | py -3 -m venv venv + venv\Scripts\python -m pip install pip==20.2.3 setuptools==50.3.0 wheel==0.35.1 venv\Scripts\python tools\pip_install.py -e certbot-ci + env: + PIP_NO_BUILD_ISOLATION: no displayName: Prepare Certbot-CI - script: | set PATH=%ProgramFiles(x86)%\Certbot\bin;%PATH% @@ -139,11 +146,17 @@ jobs: pool: vmImage: ubuntu-18.04 steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: 3.8 + addToPath: true - script: | set -e sudo apt-get update sudo apt-get install -y --no-install-recommends nginx-light snapd - python tools/pip_install.py -U tox + python3 -m venv venv + venv/bin/python letsencrypt-auto-source/pieces/pipstrap.py + venv/bin/python tools/pip_install.py -U tox displayName: Install dependencies - task: DownloadPipelineArtifact@2 inputs: @@ -156,7 +169,7 @@ jobs: displayName: Install Certbot snap - script: | set -e - python -m tox -e integration-external,apacheconftest-external-with-pebble + venv/bin/python -m tox -e integration-external,apacheconftest-external-with-pebble displayName: Run tox - job: snap_dns_run dependsOn: snaps_build @@ -180,6 +193,7 @@ jobs: - script: | set -e python3 -m venv venv + venv/bin/python letsencrypt-auto-source/pieces/pipstrap.py venv/bin/python tools/pip_install.py -e certbot-ci displayName: Prepare Certbot-CI - script: | diff --git a/.azure-pipelines/templates/jobs/standard-tests-jobs.yml b/.azure-pipelines/templates/jobs/standard-tests-jobs.yml index 3bb73b67e..d5b3a0a16 100644 --- a/.azure-pipelines/templates/jobs/standard-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/standard-tests-jobs.yml @@ -1,5 +1,7 @@ jobs: - job: test + variables: + PYTHON_VERSION: 3.8 strategy: matrix: macos-py27: diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 970f2c340..14b27b08f 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -23,7 +23,6 @@ steps: inputs: versionSpec: $(PYTHON_VERSION) addToPath: true - condition: ne(variables['PYTHON_VERSION'], '') # tools/pip_install.py is used to pin packages to a known working version # except in tests where the environment variable CERTBOT_NO_PIN is set. # virtualenv is listed here explicitly to make sure it is upgraded when @@ -33,6 +32,7 @@ steps: # problems with its lack of real dependency resolution. - bash: | set -e + python letsencrypt-auto-source/pieces/pipstrap.py python tools/pip_install.py -I tox virtualenv displayName: Install runtime dependencies - task: DownloadSecureFile@1 diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..2fb012b14 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +# https://editorconfig.org/ + +root = true + +[*] +insert_final_newline = true +trim_trailing_whitespace = true +end_of_line = lf + +[*.py] +indent_style = space +indent_size = 4 +charset = utf-8 +max_line_length = 100 + +[*.yaml] +indent_style = space +indent_size = 2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 07187eb59..1bad9ec12 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,7 +11,7 @@ to the Sphinx generated docs is provided below. [1] https://github.com/blog/1184-contributing-guidelines -[2] http://docutils.sourceforge.net/docs/user/rst/quickref.html#hyperlink-targets +[2] https://docutils.sourceforge.io/docs/user/rst/quickref.html#hyperlink-targets --> diff --git a/acme/acme/client.py b/acme/acme/client.py index 19e444749..f66367c38 100644 --- a/acme/acme/client.py +++ b/acme/acme/client.py @@ -801,7 +801,7 @@ class ClientV2(ClientBase): """ # Can't use response.links directly because it drops multiple links # of the same relation type, which is possible in RFC8555 responses. - if not 'Link' in response.headers: + if 'Link' not in response.headers: return [] links = parse_header_links(response.headers['Link']) return [l['url'] for l in links diff --git a/acme/docs/Makefile b/acme/docs/Makefile index 79de9c0a3..aaf5f1572 100644 --- a/acme/docs/Makefile +++ b/acme/docs/Makefile @@ -9,7 +9,7 @@ BUILDDIR = _build # User-friendly check for sphinx-build ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) -$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from https://www.sphinx-doc.org/) endif # Internal variables. diff --git a/acme/docs/conf.py b/acme/docs/conf.py index ba1a3aa8b..d3e7be371 100644 --- a/acme/docs/conf.py +++ b/acme/docs/conf.py @@ -120,7 +120,7 @@ todo_include_todos = False # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs +# https://docs.readthedocs.io/en/stable/faq.html#i-want-to-use-the-read-the-docs-theme-locally # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally diff --git a/acme/docs/make.bat b/acme/docs/make.bat index 781185977..a61f43798 100644 --- a/acme/docs/make.bat +++ b/acme/docs/make.bat @@ -65,7 +65,7 @@ if errorlevel 9009 ( echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) diff --git a/acme/tests/client_test.py b/acme/tests/client_test.py index d433879e8..c84878c42 100644 --- a/acme/tests/client_test.py +++ b/acme/tests/client_test.py @@ -1342,7 +1342,7 @@ class ClientNetworkSourceAddressBindingTest(unittest.TestCase): # test should fail if the default adapter type is changed by requests net = ClientNetwork(key=None, alg=None) session = requests.Session() - for scheme in session.adapters.keys(): + for scheme in session.adapters: client_network_adapter = net.session.adapters.get(scheme) default_adapter = session.adapters.get(scheme) self.assertEqual(client_network_adapter.__class__, default_adapter.__class__) diff --git a/certbot-apache/certbot_apache/_internal/augeas_lens/httpd.aug b/certbot-apache/certbot_apache/_internal/augeas_lens/httpd.aug index 5600088cf..75573028e 100644 --- a/certbot-apache/certbot_apache/_internal/augeas_lens/httpd.aug +++ b/certbot-apache/certbot_apache/_internal/augeas_lens/httpd.aug @@ -6,7 +6,7 @@ Authors: Raphael Pinson About: Reference - Online Apache configuration manual: http://httpd.apache.org/docs/trunk/ + Online Apache configuration manual: https://httpd.apache.org/docs/trunk/ About: License This file is licensed under the LGPL v2+. diff --git a/certbot-apache/certbot_apache/_internal/configurator.py b/certbot-apache/certbot_apache/_internal/configurator.py index 501c7cad8..4e0a73ac1 100644 --- a/certbot-apache/certbot_apache/_internal/configurator.py +++ b/certbot-apache/certbot_apache/_internal/configurator.py @@ -1462,7 +1462,7 @@ class ApacheConfigurator(common.Installer): if not line.lower().lstrip().startswith("rewriterule"): return False - # According to: http://httpd.apache.org/docs/2.4/rewrite/flags.html + # According to: https://httpd.apache.org/docs/2.4/rewrite/flags.html # The syntax of a RewriteRule is: # RewriteRule pattern target [Flag1,Flag2,Flag3] # i.e. target is required, so it must exist. diff --git a/certbot-apache/certbot_apache/_internal/parser.py b/certbot-apache/certbot_apache/_internal/parser.py index c9aebae54..4d997545b 100644 --- a/certbot-apache/certbot_apache/_internal/parser.py +++ b/certbot-apache/certbot_apache/_internal/parser.py @@ -731,7 +731,6 @@ class ApacheParser(object): privileged users. https://apr.apache.org/docs/apr/2.0/apr__fnmatch_8h_source.html - http://apache2.sourcearchive.com/documentation/2.2.16-6/apr__fnmatch_8h_source.html :param str clean_fn_match: Apache style filename match, like globs @@ -799,7 +798,7 @@ class ApacheParser(object): def _parsed_by_parser_paths(self, filep, paths): """Helper function that searches through provided paths and returns True if file path is found in the set""" - for directory in paths.keys(): + for directory in paths: for filename in paths[directory]: if fnmatch.fnmatch(filep, os.path.join(directory, filename)): return True diff --git a/certbot-apache/tests/centos_test.py b/certbot-apache/tests/centos_test.py index 9dc6fa5a7..b7e9c1cb6 100644 --- a/certbot-apache/tests/centos_test.py +++ b/certbot-apache/tests/centos_test.py @@ -140,7 +140,7 @@ class MultipleVhostsTestCentOS(util.ApacheTest): self.assertEqual(mock_get.call_count, 3) self.assertEqual(len(self.config.parser.modules), 4) self.assertEqual(len(self.config.parser.variables), 2) - self.assertTrue("TEST2" in self.config.parser.variables.keys()) + self.assertTrue("TEST2" in self.config.parser.variables) self.assertTrue("mod_another.c" in self.config.parser.modules) def test_get_virtual_hosts(self): @@ -172,11 +172,11 @@ class MultipleVhostsTestCentOS(util.ApacheTest): mock_osi.return_value = ("centos", "7") self.config.parser.update_runtime_variables() - self.assertTrue("mock_define" in self.config.parser.variables.keys()) - self.assertTrue("mock_define_too" in self.config.parser.variables.keys()) - self.assertTrue("mock_value" in self.config.parser.variables.keys()) + self.assertTrue("mock_define" in self.config.parser.variables) + self.assertTrue("mock_define_too" in self.config.parser.variables) + self.assertTrue("mock_value" in self.config.parser.variables) self.assertEqual("TRUE", self.config.parser.variables["mock_value"]) - self.assertTrue("MOCK_NOSEP" in self.config.parser.variables.keys()) + self.assertTrue("MOCK_NOSEP" in self.config.parser.variables) self.assertEqual("NOSEP_VAL", self.config.parser.variables["NOSEP_TWO"]) @mock.patch("certbot_apache._internal.configurator.util.run_script") diff --git a/certbot-apache/tests/fedora_test.py b/certbot-apache/tests/fedora_test.py index e0ee603c3..50831802b 100644 --- a/certbot-apache/tests/fedora_test.py +++ b/certbot-apache/tests/fedora_test.py @@ -134,7 +134,7 @@ class MultipleVhostsTestFedora(util.ApacheTest): self.assertEqual(mock_get.call_count, 3) self.assertEqual(len(self.config.parser.modules), 4) self.assertEqual(len(self.config.parser.variables), 2) - self.assertTrue("TEST2" in self.config.parser.variables.keys()) + self.assertTrue("TEST2" in self.config.parser.variables) self.assertTrue("mod_another.c" in self.config.parser.modules) @mock.patch("certbot_apache._internal.configurator.util.run_script") @@ -172,11 +172,11 @@ class MultipleVhostsTestFedora(util.ApacheTest): mock_osi.return_value = ("fedora", "29") self.config.parser.update_runtime_variables() - self.assertTrue("mock_define" in self.config.parser.variables.keys()) - self.assertTrue("mock_define_too" in self.config.parser.variables.keys()) - self.assertTrue("mock_value" in self.config.parser.variables.keys()) + self.assertTrue("mock_define" in self.config.parser.variables) + self.assertTrue("mock_define_too" in self.config.parser.variables) + self.assertTrue("mock_value" in self.config.parser.variables) self.assertEqual("TRUE", self.config.parser.variables["mock_value"]) - self.assertTrue("MOCK_NOSEP" in self.config.parser.variables.keys()) + self.assertTrue("MOCK_NOSEP" in self.config.parser.variables) self.assertEqual("NOSEP_VAL", self.config.parser.variables["NOSEP_TWO"]) @mock.patch("certbot_apache._internal.configurator.util.run_script") diff --git a/certbot-apache/tests/gentoo_test.py b/certbot-apache/tests/gentoo_test.py index aa923c367..64f7d1062 100644 --- a/certbot-apache/tests/gentoo_test.py +++ b/certbot-apache/tests/gentoo_test.py @@ -91,7 +91,7 @@ class MultipleVhostsTestGentoo(util.ApacheTest): with mock.patch("certbot_apache._internal.override_gentoo.GentooParser.update_modules"): self.config.parser.update_runtime_variables() for define in defines: - self.assertTrue(define in self.config.parser.variables.keys()) + self.assertTrue(define in self.config.parser.variables) @mock.patch("certbot_apache._internal.apache_util.parse_from_subprocess") def test_no_binary_configdump(self, mock_subprocess): diff --git a/certbot-apache/tests/util.py b/certbot-apache/tests/util.py index f2a6a0263..18c7e5aca 100644 --- a/certbot-apache/tests/util.py +++ b/certbot-apache/tests/util.py @@ -26,8 +26,6 @@ class ApacheTest(unittest.TestCase): config_root="debian_apache_2_4/multiple_vhosts/apache2", vhost_root="debian_apache_2_4/multiple_vhosts/apache2/sites-available"): # pylint: disable=arguments-differ - super(ApacheTest, self).setUp() - self.temp_dir, self.config_dir, self.work_dir = common.dir_setup( test_dir=test_dir, pkg=__name__) diff --git a/certbot-compatibility-test/certbot_compatibility_test/configurators/apache/common.py b/certbot-compatibility-test/certbot_compatibility_test/configurators/apache/common.py index 5d5542ffd..b6fbe2817 100644 --- a/certbot-compatibility-test/certbot_compatibility_test/configurators/apache/common.py +++ b/certbot-compatibility-test/certbot_compatibility_test/configurators/apache/common.py @@ -57,7 +57,7 @@ class Proxy(configurators_common.Proxy): def _prepare_configurator(self): """Prepares the Apache plugin for testing""" - for k in entrypoint.ENTRYPOINT.OS_DEFAULTS.keys(): + for k in entrypoint.ENTRYPOINT.OS_DEFAULTS: setattr(self.le_config, "apache_" + k, entrypoint.ENTRYPOINT.OS_DEFAULTS[k]) diff --git a/certbot-dns-cloudflare/docs/conf.py b/certbot-dns-cloudflare/docs/conf.py index e280a14a6..21c1d9b72 100644 --- a/certbot-dns-cloudflare/docs/conf.py +++ b/certbot-dns-cloudflare/docs/conf.py @@ -93,7 +93,7 @@ todo_include_todos = False # a list of builtin themes. # -# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs +# https://docs.readthedocs.io/en/stable/faq.html#i-want-to-use-the-read-the-docs-theme-locally # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally diff --git a/certbot-dns-cloudflare/docs/make.bat b/certbot-dns-cloudflare/docs/make.bat index 88867c770..7f30cb1eb 100644 --- a/certbot-dns-cloudflare/docs/make.bat +++ b/certbot-dns-cloudflare/docs/make.bat @@ -22,7 +22,7 @@ if errorlevel 9009 ( echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) diff --git a/certbot-dns-cloudxns/docs/conf.py b/certbot-dns-cloudxns/docs/conf.py index 03c4204ee..de6f554da 100644 --- a/certbot-dns-cloudxns/docs/conf.py +++ b/certbot-dns-cloudxns/docs/conf.py @@ -93,7 +93,7 @@ todo_include_todos = False # a list of builtin themes. # -# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs +# https://docs.readthedocs.io/en/stable/faq.html#i-want-to-use-the-read-the-docs-theme-locally # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally diff --git a/certbot-dns-cloudxns/docs/make.bat b/certbot-dns-cloudxns/docs/make.bat index 12f4f0de6..dddd6db56 100644 --- a/certbot-dns-cloudxns/docs/make.bat +++ b/certbot-dns-cloudxns/docs/make.bat @@ -22,7 +22,7 @@ if errorlevel 9009 ( echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) diff --git a/certbot-dns-digitalocean/docs/conf.py b/certbot-dns-digitalocean/docs/conf.py index 73bceabcc..ab653a2b0 100644 --- a/certbot-dns-digitalocean/docs/conf.py +++ b/certbot-dns-digitalocean/docs/conf.py @@ -93,7 +93,7 @@ todo_include_todos = False # a list of builtin themes. # -# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs +# https://docs.readthedocs.io/en/stable/faq.html#i-want-to-use-the-read-the-docs-theme-locally # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally diff --git a/certbot-dns-digitalocean/docs/make.bat b/certbot-dns-digitalocean/docs/make.bat index e1bda5e27..559293fbe 100644 --- a/certbot-dns-digitalocean/docs/make.bat +++ b/certbot-dns-digitalocean/docs/make.bat @@ -22,7 +22,7 @@ if errorlevel 9009 ( echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) diff --git a/certbot-dns-dnsimple/docs/conf.py b/certbot-dns-dnsimple/docs/conf.py index c739ff6ee..4c6e6b52e 100644 --- a/certbot-dns-dnsimple/docs/conf.py +++ b/certbot-dns-dnsimple/docs/conf.py @@ -93,7 +93,7 @@ todo_include_todos = False # a list of builtin themes. # -# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs +# https://docs.readthedocs.io/en/stable/faq.html#i-want-to-use-the-read-the-docs-theme-locally # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally diff --git a/certbot-dns-dnsimple/docs/make.bat b/certbot-dns-dnsimple/docs/make.bat index 78e867256..997c0864e 100644 --- a/certbot-dns-dnsimple/docs/make.bat +++ b/certbot-dns-dnsimple/docs/make.bat @@ -22,7 +22,7 @@ if errorlevel 9009 ( echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) diff --git a/certbot-dns-dnsmadeeasy/docs/conf.py b/certbot-dns-dnsmadeeasy/docs/conf.py index bdb5faf11..1dfc1bd89 100644 --- a/certbot-dns-dnsmadeeasy/docs/conf.py +++ b/certbot-dns-dnsmadeeasy/docs/conf.py @@ -93,7 +93,7 @@ todo_include_todos = False # a list of builtin themes. # -# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs +# https://docs.readthedocs.io/en/stable/faq.html#i-want-to-use-the-read-the-docs-theme-locally # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally diff --git a/certbot-dns-dnsmadeeasy/docs/make.bat b/certbot-dns-dnsmadeeasy/docs/make.bat index f204c8393..dbaad7d4e 100644 --- a/certbot-dns-dnsmadeeasy/docs/make.bat +++ b/certbot-dns-dnsmadeeasy/docs/make.bat @@ -22,7 +22,7 @@ if errorlevel 9009 ( echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) diff --git a/certbot-dns-gehirn/docs/conf.py b/certbot-dns-gehirn/docs/conf.py index 8ec35d152..75e3705dd 100644 --- a/certbot-dns-gehirn/docs/conf.py +++ b/certbot-dns-gehirn/docs/conf.py @@ -93,7 +93,7 @@ todo_include_todos = False # a list of builtin themes. # -# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs +# https://docs.readthedocs.io/en/stable/faq.html#i-want-to-use-the-read-the-docs-theme-locally # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally diff --git a/certbot-dns-gehirn/docs/make.bat b/certbot-dns-gehirn/docs/make.bat index 905d4ee90..d8c636372 100644 --- a/certbot-dns-gehirn/docs/make.bat +++ b/certbot-dns-gehirn/docs/make.bat @@ -22,7 +22,7 @@ if errorlevel 9009 ( echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) diff --git a/certbot-dns-google/docs/conf.py b/certbot-dns-google/docs/conf.py index 7db48b837..8c4a800f7 100644 --- a/certbot-dns-google/docs/conf.py +++ b/certbot-dns-google/docs/conf.py @@ -94,7 +94,7 @@ todo_include_todos = False # a list of builtin themes. # -# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs +# https://docs.readthedocs.io/en/stable/faq.html#i-want-to-use-the-read-the-docs-theme-locally # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally diff --git a/certbot-dns-google/docs/make.bat b/certbot-dns-google/docs/make.bat index 181c12699..036df5499 100644 --- a/certbot-dns-google/docs/make.bat +++ b/certbot-dns-google/docs/make.bat @@ -22,7 +22,7 @@ if errorlevel 9009 ( echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) diff --git a/certbot-dns-linode/docs/conf.py b/certbot-dns-linode/docs/conf.py index 1c566571e..6305b694c 100644 --- a/certbot-dns-linode/docs/conf.py +++ b/certbot-dns-linode/docs/conf.py @@ -93,7 +93,7 @@ todo_include_todos = False # a list of builtin themes. # -# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs +# https://docs.readthedocs.io/en/stable/faq.html#i-want-to-use-the-read-the-docs-theme-locally # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally diff --git a/certbot-dns-linode/docs/make.bat b/certbot-dns-linode/docs/make.bat index 1f2a6867f..5352aaecf 100644 --- a/certbot-dns-linode/docs/make.bat +++ b/certbot-dns-linode/docs/make.bat @@ -22,7 +22,7 @@ if errorlevel 9009 ( echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) diff --git a/certbot-dns-luadns/docs/conf.py b/certbot-dns-luadns/docs/conf.py index ed318619d..6a11ce7aa 100644 --- a/certbot-dns-luadns/docs/conf.py +++ b/certbot-dns-luadns/docs/conf.py @@ -93,7 +93,7 @@ todo_include_todos = False # a list of builtin themes. # -# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs +# https://docs.readthedocs.io/en/stable/faq.html#i-want-to-use-the-read-the-docs-theme-locally # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally diff --git a/certbot-dns-luadns/docs/make.bat b/certbot-dns-luadns/docs/make.bat index 9cfe0400e..67ad88758 100644 --- a/certbot-dns-luadns/docs/make.bat +++ b/certbot-dns-luadns/docs/make.bat @@ -22,7 +22,7 @@ if errorlevel 9009 ( echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) diff --git a/certbot-dns-nsone/docs/conf.py b/certbot-dns-nsone/docs/conf.py index 2b9cf2d39..7e66a0613 100644 --- a/certbot-dns-nsone/docs/conf.py +++ b/certbot-dns-nsone/docs/conf.py @@ -93,7 +93,7 @@ todo_include_todos = False # a list of builtin themes. # -# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs +# https://docs.readthedocs.io/en/stable/faq.html#i-want-to-use-the-read-the-docs-theme-locally # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally diff --git a/certbot-dns-nsone/docs/make.bat b/certbot-dns-nsone/docs/make.bat index 0d19eff5d..c37cf5a85 100644 --- a/certbot-dns-nsone/docs/make.bat +++ b/certbot-dns-nsone/docs/make.bat @@ -22,7 +22,7 @@ if errorlevel 9009 ( echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) diff --git a/certbot-dns-ovh/docs/conf.py b/certbot-dns-ovh/docs/conf.py index 6015a700e..c8a1575c4 100644 --- a/certbot-dns-ovh/docs/conf.py +++ b/certbot-dns-ovh/docs/conf.py @@ -93,7 +93,7 @@ todo_include_todos = False # a list of builtin themes. # -# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs +# https://docs.readthedocs.io/en/stable/faq.html#i-want-to-use-the-read-the-docs-theme-locally # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally diff --git a/certbot-dns-ovh/docs/make.bat b/certbot-dns-ovh/docs/make.bat index 78f7dd669..fad760e2f 100644 --- a/certbot-dns-ovh/docs/make.bat +++ b/certbot-dns-ovh/docs/make.bat @@ -22,7 +22,7 @@ if errorlevel 9009 ( echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) diff --git a/certbot-dns-rfc2136/certbot_dns_rfc2136/__init__.py b/certbot-dns-rfc2136/certbot_dns_rfc2136/__init__.py index 12b360959..da8ef3419 100644 --- a/certbot-dns-rfc2136/certbot_dns_rfc2136/__init__.py +++ b/certbot-dns-rfc2136/certbot_dns_rfc2136/__init__.py @@ -99,11 +99,10 @@ AmKd7ak51vWKgSl12ib86oQRPkpDjg=="; This configuration limits the scope of the TSIG key to just be able to add and remove TXT records for one specific host for the purpose of completing the ``dns-01`` challenge. If your version of BIND doesn't - support the - `update-policy `_ - directive then you can use the less-secure - `allow-update `_ - directive instead. + support the ``update-policy`` directive, then you can use the less-secure + ``allow-update`` directive instead. `See the BIND documentation + `_ + for details. Examples -------- diff --git a/certbot-dns-rfc2136/docs/conf.py b/certbot-dns-rfc2136/docs/conf.py index 731b9cb1d..bc0e9c845 100644 --- a/certbot-dns-rfc2136/docs/conf.py +++ b/certbot-dns-rfc2136/docs/conf.py @@ -93,7 +93,7 @@ todo_include_todos = False # a list of builtin themes. # -# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs +# https://docs.readthedocs.io/en/stable/faq.html#i-want-to-use-the-read-the-docs-theme-locally # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally diff --git a/certbot-dns-rfc2136/docs/make.bat b/certbot-dns-rfc2136/docs/make.bat index 8d09ca8fd..a331545d9 100644 --- a/certbot-dns-rfc2136/docs/make.bat +++ b/certbot-dns-rfc2136/docs/make.bat @@ -22,7 +22,7 @@ if errorlevel 9009 ( echo.Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) diff --git a/certbot-dns-route53/docs/conf.py b/certbot-dns-route53/docs/conf.py index c9bdfd15d..f9c5fdf74 100644 --- a/certbot-dns-route53/docs/conf.py +++ b/certbot-dns-route53/docs/conf.py @@ -93,7 +93,7 @@ todo_include_todos = False # a list of builtin themes. # -# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs +# https://docs.readthedocs.io/en/stable/faq.html#i-want-to-use-the-read-the-docs-theme-locally # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally diff --git a/certbot-dns-route53/docs/make.bat b/certbot-dns-route53/docs/make.bat index e92b5909a..bbf80a5b1 100644 --- a/certbot-dns-route53/docs/make.bat +++ b/certbot-dns-route53/docs/make.bat @@ -22,7 +22,7 @@ if errorlevel 9009 ( echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) diff --git a/certbot-dns-route53/tests/dns_route53_test.py b/certbot-dns-route53/tests/dns_route53_test.py index a77495313..1fd191c69 100644 --- a/certbot-dns-route53/tests/dns_route53_test.py +++ b/certbot-dns-route53/tests/dns_route53_test.py @@ -35,7 +35,6 @@ class AuthenticatorTest(unittest.TestCase, dns_test_common.BaseAuthenticatorTest # Remove the dummy credentials from env vars del os.environ["AWS_ACCESS_KEY_ID"] del os.environ["AWS_SECRET_ACCESS_KEY"] - super(AuthenticatorTest, self).tearDown() def test_perform(self): self.auth._change_txt_record = mock.MagicMock() @@ -128,8 +127,6 @@ class ClientTest(unittest.TestCase): def setUp(self): from certbot_dns_route53._internal.dns_route53 import Authenticator - super(ClientTest, self).setUp() - self.config = mock.MagicMock() # Set up dummy credentials for testing @@ -142,7 +139,6 @@ class ClientTest(unittest.TestCase): # Remove the dummy credentials from env vars del os.environ["AWS_ACCESS_KEY_ID"] del os.environ["AWS_SECRET_ACCESS_KEY"] - super(ClientTest, self).tearDown() def test_find_zone_id_for_domain(self): self.client.r53.get_paginator = mock.MagicMock() diff --git a/certbot-dns-sakuracloud/docs/conf.py b/certbot-dns-sakuracloud/docs/conf.py index 5bc85f44e..9d6d3c871 100644 --- a/certbot-dns-sakuracloud/docs/conf.py +++ b/certbot-dns-sakuracloud/docs/conf.py @@ -93,7 +93,7 @@ todo_include_todos = False # a list of builtin themes. # -# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs +# https://docs.readthedocs.io/en/stable/faq.html#i-want-to-use-the-read-the-docs-theme-locally # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally diff --git a/certbot-dns-sakuracloud/docs/make.bat b/certbot-dns-sakuracloud/docs/make.bat index 0d7706bc7..b340a2a19 100644 --- a/certbot-dns-sakuracloud/docs/make.bat +++ b/certbot-dns-sakuracloud/docs/make.bat @@ -22,7 +22,7 @@ if errorlevel 9009 ( echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) diff --git a/certbot-nginx/certbot_nginx/_internal/obj.py b/certbot-nginx/certbot_nginx/_internal/obj.py index 1a92c8b37..4e0d8cf35 100644 --- a/certbot-nginx/certbot_nginx/_internal/obj.py +++ b/certbot-nginx/certbot_nginx/_internal/obj.py @@ -19,7 +19,7 @@ class Addr(common.Addr): 80. If no address is specified, listen on all addresses. .. _documentation: - http://nginx.org/en/docs/http/ngx_http_core_module.html#listen + https://nginx.org/en/docs/http/ngx_http_core_module.html#listen .. todo:: Old-style nginx configs define SSL vhosts in a separate block instead of using 'ssl' in the listen directive. diff --git a/certbot/CHANGELOG.md b/certbot/CHANGELOG.md index d4b7ac21b..0ff09b5e2 100644 --- a/certbot/CHANGELOG.md +++ b/certbot/CHANGELOG.md @@ -14,6 +14,7 @@ Certbot adheres to [Semantic Versioning](https://semver.org/). * 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. +* Reduced CLI logging when handling some kinds of errors. ### Fixed diff --git a/certbot/certbot/_internal/constants.py b/certbot/certbot/_internal/constants.py index 3131bad06..9e9373f13 100644 --- a/certbot/certbot/_internal/constants.py +++ b/certbot/certbot/_internal/constants.py @@ -16,7 +16,7 @@ OLD_SETUPTOOLS_PLUGINS_ENTRY_POINT = "letsencrypt.plugins" CLI_DEFAULTS = dict( config_files=[ os.path.join(misc.get_default_folder('config'), 'cli.ini'), - # http://freedesktop.org/wiki/Software/xdg-user-dirs/ + # https://freedesktop.org/wiki/Software/xdg-user-dirs/ os.path.join(os.environ.get("XDG_CONFIG_HOME", "~/.config"), "letsencrypt", "cli.ini"), ], diff --git a/certbot/certbot/_internal/error_handler.py b/certbot/certbot/_internal/error_handler.py index 41c12eafa..60fb287a6 100644 --- a/certbot/certbot/_internal/error_handler.py +++ b/certbot/certbot/_internal/error_handler.py @@ -123,8 +123,10 @@ class ErrorHandler(object): while self.funcs: try: self.funcs[-1]() - except Exception: # pylint: disable=broad-except - logger.error("Encountered exception during recovery: ", exc_info=True) + except Exception as exc: # pylint: disable=broad-except + output = traceback.format_exception_only(type(exc), exc) + logger.error("Encountered exception during recovery: %s", + ''.join(output).rstrip()) self.funcs.pop() def _set_signal_handlers(self): diff --git a/certbot/certbot/_internal/storage.py b/certbot/certbot/_internal/storage.py index 05d9e3a8d..84c103901 100644 --- a/certbot/certbot/_internal/storage.py +++ b/certbot/certbot/_internal/storage.py @@ -127,7 +127,7 @@ def write_renewal_config(o_filename, n_filename, archive_dir, target, relevant_d config["renewalparams"].update(relevant_data) - for k in config["renewalparams"].keys(): + for k in config["renewalparams"]: if k not in relevant_data: del config["renewalparams"][k] diff --git a/certbot/certbot/display/ops.py b/certbot/certbot/display/ops.py index fc369176b..7a72e336b 100644 --- a/certbot/certbot/display/ops.py +++ b/certbot/certbot/display/ops.py @@ -275,15 +275,6 @@ def success_revocation(cert_path): pause=False) -def _gen_ssl_lab_urls(domains): - """Returns a list of urls. - - :param list domains: Each domain is a 'str' - - """ - return ["https://www.ssllabs.com/ssltest/analyze.html?d=%s" % dom for dom in domains] - - def _gen_https_names(domains): """Returns a string of the https domains. diff --git a/certbot/certbot/plugins/storage.py b/certbot/certbot/plugins/storage.py index 9123087e7..f3ed14dce 100644 --- a/certbot/certbot/plugins/storage.py +++ b/certbot/certbot/plugins/storage.py @@ -106,7 +106,7 @@ class PluginStorage(object): if not self._initialized: self._initialize_storage() - if not self._classkey in self._data.keys(): + if self._classkey not in self._data: self._data[self._classkey] = {} self._data[self._classkey][key] = value diff --git a/certbot/certbot/reverter.py b/certbot/certbot/reverter.py index 80ba0f599..58e1216b7 100644 --- a/certbot/certbot/reverter.py +++ b/certbot/certbot/reverter.py @@ -180,7 +180,7 @@ class Reverter(object): shutil.copy2(filename, os.path.join( cp_dir, os.path.basename(filename) + "_" + str(idx))) op_fd.write('{0}\n'.format(filename)) - # http://stackoverflow.com/questions/4726260/effective-use-of-python-shutil-copy2 + # https://stackoverflow.com/questions/4726260/effective-use-of-python-shutil-copy2 except IOError: op_fd.close() logger.error( diff --git a/certbot/docs/Makefile b/certbot/docs/Makefile index 415eebca1..be4a93c18 100644 --- a/certbot/docs/Makefile +++ b/certbot/docs/Makefile @@ -9,7 +9,7 @@ BUILDDIR = _build # User-friendly check for sphinx-build ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) -$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from https://www.sphinx-doc.org/) endif # Internal variables. diff --git a/certbot/docs/_templates/footer.html b/certbot/docs/_templates/footer.html index 8fd0f127d..48be1294d 100644 --- a/certbot/docs/_templates/footer.html +++ b/certbot/docs/_templates/footer.html @@ -44,7 +44,7 @@ {%- if show_sphinx %} - {% trans %}Built with Sphinx using a theme provided by Read the Docs{% endtrans %}. + {% trans %}Built with Sphinx using a theme provided by Read the Docs{% endtrans %}. {%- endif %} {%- block extrafooter %} {% endblock %} diff --git a/certbot/docs/ciphers.rst b/certbot/docs/ciphers.rst index 1ddd17970..294e6a7fa 100644 --- a/certbot/docs/ciphers.rst +++ b/certbot/docs/ciphers.rst @@ -208,17 +208,17 @@ Keylength.com Damien Giry collects recommendations by academic researchers and standards organizations about keylengths for particular cryptoperiods, years, or security levels. The keylength recommendations of the various sources are summarized in a chart. This site has been updated over time and includes expert guidance from eight sources published between 2000 and 2017. -http://www.keylength.com/ +https://www.keylength.com/ NIST ~~~~ -NISA published its "NIST Special Publication 800-52 Revision 1: Guidelines for the Selection, Configuration, and Use of Transport Layer Security (TLS) Implementations" +NIST published its "NIST Special Publication 800-52 Revision 2: Guidelines for the Selection, Configuration, and Use of Transport Layer Security (TLS) Implementations" -http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-52r1.pdf +https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-52r2.pdf -and its "NIST Special Publication 800-57: Recommendation for Key Management – Part 1: General (Revision 3)" +and its "NIST Special Publication 800-57: Recommendation for Key Management – Part 1: General (Revision 5)" -http://csrc.nist.gov/publications/nistpubs/800-57/sp800-57_part1_rev3_general.pdf +https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-57pt1r5.pdf ENISA ~~~~~ diff --git a/certbot/docs/conf.py b/certbot/docs/conf.py index 53ddbeff7..dbd4067d5 100644 --- a/certbot/docs/conf.py +++ b/certbot/docs/conf.py @@ -131,7 +131,7 @@ suppress_warnings = ['image.nonlocal_uri'] # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs +# https://docs.readthedocs.io/en/stable/faq.html#i-want-to-use-the-read-the-docs-theme-locally # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally diff --git a/certbot/docs/contributing.rst b/certbot/docs/contributing.rst index ae93e37ac..b3e2e9bae 100644 --- a/certbot/docs/contributing.rst +++ b/certbot/docs/contributing.rst @@ -347,7 +347,7 @@ Certbot's DNS plugins and the README file in ``tools/snap/`` provide a starting reference for how to do this. .. _`setuptools entry points`: - http://setuptools.readthedocs.io/en/latest/pkg_resources.html#entry-points + https://setuptools.readthedocs.io/en/latest/pkg_resources.html#entry-points .. _coding-style: @@ -378,7 +378,7 @@ Please: .. _Google Python Style Guide: https://google.github.io/styleguide/pyguide.html -.. _Sphinx-style: http://sphinx-doc.org/ +.. _Sphinx-style: https://www.sphinx-doc.org/ .. _PEP 8 - Style Guide for Python Code: https://www.python.org/dev/peps/pep-0008 diff --git a/certbot/docs/make.bat b/certbot/docs/make.bat index 198e864c3..ac9e1d69f 100644 --- a/certbot/docs/make.bat +++ b/certbot/docs/make.bat @@ -65,7 +65,7 @@ if errorlevel 9009 ( echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ + echo.https://www.sphinx-doc.org/ exit /b 1 ) diff --git a/certbot/docs/packaging.rst b/certbot/docs/packaging.rst index 4bc63ac0d..1f98581e4 100644 --- a/certbot/docs/packaging.rst +++ b/certbot/docs/packaging.rst @@ -31,7 +31,7 @@ The following scripts are used in the process: We use git tags to identify releases, using `Semantic Versioning`_. For example: `v0.11.1`. -.. _`Semantic Versioning`: http://semver.org/ +.. _`Semantic Versioning`: https://semver.org/ Our packages are cryptographically signed and their signature can be verified using the PGP key ``A2CFB51FA275A7286234E7B24D17C995CD9775F2``. This key can be diff --git a/certbot/docs/using.rst b/certbot/docs/using.rst index cca6e2b2f..329fde71e 100644 --- a/certbot/docs/using.rst +++ b/certbot/docs/using.rst @@ -287,7 +287,7 @@ dns-inwx Y Y DNS Authentication for INWX through the XML API .. _haproxy: https://github.com/greenhost/certbot-haproxy .. _s3front: https://github.com/dlapiduz/letsencrypt-s3front .. _gandi: https://github.com/obynio/certbot-plugin-gandi -.. _varnish: http://git.sesse.net/?p=letsencrypt-varnish-plugin +.. _varnish: https://git.sesse.net/?p=letsencrypt-varnish-plugin .. _pritunl: https://github.com/kharkevich/letsencrypt-pritunl .. _proxmox: https://github.com/kharkevich/letsencrypt-proxmox .. _external-auth: https://github.com/EnigmaBridge/certbot-external-auth @@ -684,7 +684,7 @@ The following files are available: This is what Apache needs for `SSLCertificateKeyFile `_, and Nginx for `ssl_certificate_key - `_. + `_. ``fullchain.pem`` All certificates, **including** server certificate (aka leaf certificate or @@ -694,7 +694,7 @@ The following files are available: This is what Apache >= 2.4.8 needs for `SSLCertificateFile `_, and what Nginx needs for `ssl_certificate - `_. + `_. ``cert.pem`` and ``chain.pem`` (less common) ``cert.pem`` contains the server certificate by itself, and @@ -713,7 +713,7 @@ The following files are available: If you're using OCSP stapling with Nginx >= 1.3.7, ``chain.pem`` should be provided as the `ssl_trusted_certificate - `_ + `_ to validate OCSP responses. .. note:: All files are PEM-encoded. diff --git a/certbot/setup.py b/certbot/setup.py index 294fc10f2..742900402 100644 --- a/certbot/setup.py +++ b/certbot/setup.py @@ -8,8 +8,8 @@ from setuptools import __version__ as setuptools_version from setuptools import find_packages from setuptools import setup -# Workaround for http://bugs.python.org/issue8876, see -# http://bugs.python.org/issue8876#msg208792 +# Workaround for https://bugs.python.org/issue8876, see +# https://bugs.python.org/issue8876#msg208792 # This can be removed when using Python 2.7.9 or later: # https://hg.python.org/cpython/raw-file/v2.7.9/Misc/NEWS if os.path.abspath(__file__).split(os.path.sep)[1] == 'vagrant': diff --git a/certbot/tests/crypto_util_test.py b/certbot/tests/crypto_util_test.py index c323cd051..bbd484c91 100644 --- a/certbot/tests/crypto_util_test.py +++ b/certbot/tests/crypto_util_test.py @@ -185,8 +185,6 @@ class VerifyCertSetup(unittest.TestCase): """Refactoring for verification tests.""" def setUp(self): - super(VerifyCertSetup, self).setUp() - self.renewable_cert = mock.MagicMock() self.renewable_cert.cert_path = SS_CERT_PATH self.renewable_cert.chain_path = SS_CERT_PATH diff --git a/certbot/tests/display/ops_test.py b/certbot/tests/display/ops_test.py index a683e1d3d..bdc6472bf 100644 --- a/certbot/tests/display/ops_test.py +++ b/certbot/tests/display/ops_test.py @@ -131,26 +131,6 @@ class ChooseAccountTest(test_util.TempDirTestCase): self.assertTrue(self._call([self.acc1, self.acc2]) is None) -class GenSSLLabURLs(unittest.TestCase): - """Loose test of _gen_ssl_lab_urls. URL can change easily in the future.""" - def setUp(self): - zope.component.provideUtility(display_util.FileDisplay(sys.stdout, - False)) - - @classmethod - def _call(cls, domains): - from certbot.display.ops import _gen_ssl_lab_urls - return _gen_ssl_lab_urls(domains) - - def test_zero(self): - self.assertEqual(self._call([]), []) - - def test_two(self): - urls = self._call(["eff.org", "umich.edu"]) - self.assertTrue("eff.org" in urls[0]) - self.assertTrue("umich.edu" in urls[1]) - - class GenHttpsNamesTest(unittest.TestCase): """Test _gen_https_names.""" def setUp(self): diff --git a/certbot/tests/display/util_test.py b/certbot/tests/display/util_test.py index 3e492e9ab..6347fd367 100644 --- a/certbot/tests/display/util_test.py +++ b/certbot/tests/display/util_test.py @@ -326,7 +326,6 @@ class FileOutputDisplayTest(unittest.TestCase): class NoninteractiveDisplayTest(unittest.TestCase): """Test non-interactive display. These tests are pretty easy!""" def setUp(self): - super(NoninteractiveDisplayTest, self).setUp() self.mock_stdout = mock.MagicMock() self.displayer = display_util.NoninteractiveDisplay(self.mock_stdout) diff --git a/letsencrypt-auto-source/letsencrypt-auto b/letsencrypt-auto-source/letsencrypt-auto index 7168ee2d1..5c5434323 100755 --- a/letsencrypt-auto-source/letsencrypt-auto +++ b/letsencrypt-auto-source/letsencrypt-auto @@ -1615,6 +1615,11 @@ maybe_argparse = ( if sys.version_info < (2, 7, 0) else []) +# Be careful when updating the pinned versions here, in particular for pip. +# Indeed starting from 10.0, pip will build dependencies in isolation if the +# related projects are compliant with PEP 517. This is not something we want +# as of now, so the isolation build will need to be disabled wherever +# pipstrap is used (see https://github.com/certbot/certbot/issues/8256). PACKAGES = maybe_argparse + [ # Pip has no dependencies, as it vendors everything: ('11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/' diff --git a/letsencrypt-auto-source/pieces/pipstrap.py b/letsencrypt-auto-source/pieces/pipstrap.py index 346e23938..7610c2686 100755 --- a/letsencrypt-auto-source/pieces/pipstrap.py +++ b/letsencrypt-auto-source/pieces/pipstrap.py @@ -67,6 +67,11 @@ maybe_argparse = ( if sys.version_info < (2, 7, 0) else []) +# Be careful when updating the pinned versions here, in particular for pip. +# Indeed starting from 10.0, pip will build dependencies in isolation if the +# related projects are compliant with PEP 517. This is not something we want +# as of now, so the isolation build will need to be disabled wherever +# pipstrap is used (see https://github.com/certbot/certbot/issues/8256). PACKAGES = maybe_argparse + [ # Pip has no dependencies, as it vendors everything: ('11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/' diff --git a/linter_plugin.py b/linter_plugin.py index b6388e2c7..75879f73a 100644 --- a/linter_plugin.py +++ b/linter_plugin.py @@ -4,7 +4,7 @@ Certbot PyLint plugin. The built-in ImportChecker of Pylint does a similar job to ForbidStandardOsModule to detect deprecated modules. You can check its behavior as a reference to what is coded here. See https://github.com/PyCQA/pylint/blob/b20a2984c94e2946669d727dbda78735882bf50a/pylint/checkers/imports.py#L287 -See http://docs.pylint.org/plugins.html +See https://docs.pytest.org/en/latest/writing_plugins.html """ from pylint.checkers import BaseChecker from pylint.interfaces import IAstroidChecker diff --git a/tests/letstest/apache2_targets.yaml b/tests/letstest/apache2_targets.yaml index 2fa64568c..b91fcf0b9 100644 --- a/tests/letstest/apache2_targets.yaml +++ b/tests/letstest/apache2_targets.yaml @@ -8,11 +8,6 @@ targets: type: ubuntu virt: hvm user: ubuntu - - ami: ami-0545f7036167eb3aa - name: ubuntu19.10 - type: ubuntu - virt: hvm - user: ubuntu - ami: ami-095192256fe1477ad name: ubuntu18.04LTS type: ubuntu diff --git a/tests/letstest/auto_targets.yaml b/tests/letstest/auto_targets.yaml index 9daba3910..ce2a2ecbb 100644 --- a/tests/letstest/auto_targets.yaml +++ b/tests/letstest/auto_targets.yaml @@ -3,11 +3,6 @@ targets: #----------------------------------------------------------------------------- #Ubuntu - - ami: ami-0545f7036167eb3aa - name: ubuntu19.10 - type: ubuntu - virt: hvm - user: ubuntu - ami: ami-095192256fe1477ad name: ubuntu18.04LTS type: ubuntu diff --git a/tests/letstest/multitester.py b/tests/letstest/multitester.py index dc070b950..cf9f2899a 100644 --- a/tests/letstest/multitester.py +++ b/tests/letstest/multitester.py @@ -322,7 +322,7 @@ def create_client_instance(ec2_client, target, security_group_id, subnet_id): else: # 32 bit systems machine_type = 'c1.medium' - if 'userdata' in target.keys(): + if 'userdata' in target: userdata = target['userdata'] else: userdata = '' diff --git a/tests/letstest/targets.yaml b/tests/letstest/targets.yaml index f6d3dd42f..522cab558 100644 --- a/tests/letstest/targets.yaml +++ b/tests/letstest/targets.yaml @@ -8,11 +8,6 @@ targets: type: ubuntu virt: hvm user: ubuntu - - ami: ami-0545f7036167eb3aa - name: ubuntu19.10 - type: ubuntu - virt: hvm - user: ubuntu - ami: ami-095192256fe1477ad name: ubuntu18.04LTS type: ubuntu diff --git a/tools/sphinx-quickstart.sh b/tools/sphinx-quickstart.sh index f8b806b1c..8b177d7e1 100755 --- a/tools/sphinx-quickstart.sh +++ b/tools/sphinx-quickstart.sh @@ -13,7 +13,7 @@ cd $PROJECT/docs sed -i -e "s|\# import os|import os|" conf.py sed -i -e "s|\# needs_sphinx = '1.0'|needs_sphinx = '1.0'|" conf.py sed -i -e "s|intersphinx_mapping = {'https://docs.python.org/': None}|intersphinx_mapping = {\n 'python': ('https://docs.python.org/', None),\n 'acme': ('https://acme-python.readthedocs.org/en/latest/', None),\n 'certbot': ('https://certbot.eff.org/docs/', None),\n}|" conf.py -sed -i -e "s|html_theme = 'alabaster'|\n# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs\n# on_rtd is whether we are on readthedocs.org\non_rtd = os.environ.get('READTHEDOCS', None) == 'True'\nif not on_rtd: # only import and set the theme if we're building docs locally\n import sphinx_rtd_theme\n html_theme = 'sphinx_rtd_theme'\n html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]\n# otherwise, readthedocs.org uses their theme by default, so no need to specify it|" conf.py +sed -i -e "s|html_theme = 'alabaster'|\n# https://docs.readthedocs.io/en/stable/faq.html#i-want-to-use-the-read-the-docs-theme-locally\n# on_rtd is whether we are on readthedocs.org\non_rtd = os.environ.get('READTHEDOCS', None) == 'True'\nif not on_rtd: # only import and set the theme if we're building docs locally\n import sphinx_rtd_theme\n html_theme = 'sphinx_rtd_theme'\n html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]\n# otherwise, readthedocs.org uses their theme by default, so no need to specify it|" conf.py sed -i -e "s|# Add any paths that contain templates here, relative to this directory.|autodoc_member_order = 'bysource'\nautodoc_default_flags = ['show-inheritance']\n\n# Add any paths that contain templates here, relative to this directory.|" conf.py sed -i -e "s|# The name of the Pygments (syntax highlighting) style to use.|default_role = 'py:obj'\n\n# The name of the Pygments (syntax highlighting) style to use.|" conf.py # If the --ext-todo flag is removed from sphinx-quickstart, the line below can be removed. diff --git a/tox.ini b/tox.ini index 0336a57df..befdeba93 100644 --- a/tox.ini +++ b/tox.ini @@ -1,4 +1,4 @@ -# Tox (http://tox.testrun.org/) is a tool for running tests in +# Tox (https://tox.readthedocs.io/) is a tool for running tests in # multiple virtualenvs. To use it, "pip install tox" and then run # "tox" from this directory. @@ -62,6 +62,7 @@ source_paths = [testenv] passenv = CERTBOT_NO_PIN +commands_pre = python {toxinidir}/letsencrypt-auto-source/pieces/pipstrap.py commands = !cover: {[base]install_and_test} {[base]all_packages} !cover: python tests/lock_test.py