diff --git a/.azure-pipelines/release.yml b/.azure-pipelines/release.yml index 9253c3501..9e28382d9 100644 --- a/.azure-pipelines/release.yml +++ b/.azure-pipelines/release.yml @@ -14,3 +14,4 @@ stages: - template: templates/stages/test-and-package-stage.yml - template: templates/stages/changelog-stage.yml - template: templates/stages/release-deploy-stage.yml + - template: templates/stages/notify-stage.yml diff --git a/.azure-pipelines/templates/stages/notify-stage.yml b/.azure-pipelines/templates/stages/notify-stage.yml new file mode 100644 index 000000000..e1ea4871f --- /dev/null +++ b/.azure-pipelines/templates/stages/notify-stage.yml @@ -0,0 +1,20 @@ +stages: + - stage: Notify + condition: succeededOrFailed() + jobs: + - job: notify_release_finished + pool: + vmImage: ubuntu-latest + steps: + - task: DownloadSecureFile@1 + name: webhook_url + inputs: + secureFile: mattermost_webhook_url_release_notify + - bash: | + set -e + python -m venv venv + source venv/bin/activate + tools/pip_install.py requests + AUTHOR_NAME="$(git log -1 --pretty=format:'%an')" + tools/notify_mattermost.py "${AUTHOR_NAME}" $(webhook_url.secureFilePath) + displayName: Send mattermost message diff --git a/.azure-pipelines/templates/stages/release-deploy-stage.yml b/.azure-pipelines/templates/stages/release-deploy-stage.yml index 8bf259446..866d6994d 100644 --- a/.azure-pipelines/templates/stages/release-deploy-stage.yml +++ b/.azure-pipelines/templates/stages/release-deploy-stage.yml @@ -1,4 +1,6 @@ stages: + # tools/notify_mattermost.py depends on this stage being named 'Deploy' + # If you change the name here, please remember to update that script as well - stage: Deploy jobs: - template: ../jobs/common-deploy-jobs.yml diff --git a/acme/setup.py b/acme/setup.py index ac63492d4..053b082ff 100644 --- a/acme/setup.py +++ b/acme/setup.py @@ -1,6 +1,6 @@ from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' setup( version=version, diff --git a/certbot-apache/MANIFEST.in b/certbot-apache/MANIFEST.in index c3f62235c..0cbb1083d 100644 --- a/certbot-apache/MANIFEST.in +++ b/certbot-apache/MANIFEST.in @@ -1,8 +1,5 @@ include LICENSE.txt include README.rst -recursive-include src/certbot_apache/_internal/augeas_lens *.aug -recursive-include src/certbot_apache/_internal/tls_configs *.conf -recursive-include src/certbot_apache/_internal/tests/testdata * include src/certbot_apache/py.typed global-exclude __pycache__ global-exclude *.py[cod] diff --git a/certbot-apache/pyproject.toml b/certbot-apache/pyproject.toml index 266032685..1500400d7 100644 --- a/certbot-apache/pyproject.toml +++ b/certbot-apache/pyproject.toml @@ -32,14 +32,6 @@ classifiers = [ "Topic :: Utilities", ] -[project.optional-dependencies] -dev = [ - "apacheconfig>=0.3.2", -] -test = [ - "pytest", -] - [project.entry-points."certbot.plugins"] apache = "certbot_apache._internal.entrypoint:ENTRYPOINT" diff --git a/certbot-apache/setup.py b/certbot-apache/setup.py index 8bdb9c824..b33218bc9 100644 --- a/certbot-apache/setup.py +++ b/certbot-apache/setup.py @@ -1,14 +1,12 @@ from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' install_requires = [ - # We specify the minimum acme and certbot version as the current plugin + # We specify the minimum certbot version as the current plugin # version for simplicity. See # https://github.com/certbot/certbot/issues/8761 for more info. - f'acme>={version}', - f'certbot>={version}', - 'python-augeas', + f'certbot[apache]>={version}', ] setup( diff --git a/certbot-apache/src/certbot_apache/_internal/entrypoint.py b/certbot-apache/src/certbot_apache/_internal/entrypoint.py index 6099c9276..44c08874f 100644 --- a/certbot-apache/src/certbot_apache/_internal/entrypoint.py +++ b/certbot-apache/src/certbot_apache/_internal/entrypoint.py @@ -1,69 +1,6 @@ """ Entry point for Apache Plugin """ -from certbot import util -from certbot_apache._internal import configurator -from certbot_apache._internal import override_alpine -from certbot_apache._internal import override_arch -from certbot_apache._internal import override_centos -from certbot_apache._internal import override_darwin -from certbot_apache._internal import override_debian -from certbot_apache._internal import override_fedora -from certbot_apache._internal import override_gentoo -from certbot_apache._internal import override_suse -from certbot_apache._internal import override_void - -OVERRIDE_CLASSES: dict[str, type[configurator.ApacheConfigurator]] = { - "alpine": override_alpine.AlpineConfigurator, - "arch": override_arch.ArchConfigurator, - "cloudlinux": override_centos.CentOSConfigurator, - "darwin": override_darwin.DarwinConfigurator, - "debian": override_debian.DebianConfigurator, - "ubuntu": override_debian.DebianConfigurator, - "centos": override_centos.CentOSConfigurator, - "centos linux": override_centos.CentOSConfigurator, - "fedora_old": override_centos.CentOSConfigurator, - "fedora": override_fedora.FedoraConfigurator, - "linuxmint": override_debian.DebianConfigurator, - "ol": override_centos.CentOSConfigurator, - "oracle": override_centos.CentOSConfigurator, - "redhatenterpriseserver": override_centos.CentOSConfigurator, - "red hat enterprise linux server": override_centos.CentOSConfigurator, - "rhel": override_centos.CentOSConfigurator, - "amazon": override_centos.CentOSConfigurator, - "gentoo": override_gentoo.GentooConfigurator, - "gentoo base system": override_gentoo.GentooConfigurator, - "opensuse": override_suse.OpenSUSEConfigurator, - "suse": override_suse.OpenSUSEConfigurator, - "sles": override_suse.OpenSUSEConfigurator, - "scientific": override_centos.CentOSConfigurator, - "scientific linux": override_centos.CentOSConfigurator, - "void": override_void.VoidConfigurator, -} +import certbot.plugins.apache -def get_configurator() -> type[configurator.ApacheConfigurator]: - """ Get correct configurator class based on the OS fingerprint """ - os_name, os_version = util.get_os_info() - os_name = os_name.lower() - override_class = None - - # Special case for older Fedora versions - min_version = util.parse_loose_version('29') - if os_name == 'fedora' and util.parse_loose_version(os_version) < min_version: - os_name = 'fedora_old' - - try: - override_class = OVERRIDE_CLASSES[os_name] - except KeyError: - # OS not found in the list - os_like = util.get_systemd_os_like() - if os_like: - for os_name in os_like: - override_class = OVERRIDE_CLASSES.get(os_name) - if not override_class: - # No override class found, return the generic configurator - override_class = configurator.ApacheConfigurator - return override_class - - -ENTRYPOINT = get_configurator() +ENTRYPOINT = certbot.plugins.apache.ENTRYPOINT diff --git a/certbot-apache/src/certbot_apache/_internal/tests/__init__.py b/certbot-apache/src/certbot_apache/_internal/tests/__init__.py deleted file mode 100644 index 1dae412f2..000000000 --- a/certbot-apache/src/certbot_apache/_internal/tests/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""certbot-apache tests""" diff --git a/certbot-ci/setup.py b/certbot-ci/setup.py index ac63492d4..053b082ff 100644 --- a/certbot-ci/setup.py +++ b/certbot-ci/setup.py @@ -1,6 +1,6 @@ from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' setup( version=version, diff --git a/certbot-ci/src/certbot_integration_tests/.coveragerc b/certbot-ci/src/certbot_integration_tests/.coveragerc index 2916b8597..90de5023e 100644 --- a/certbot-ci/src/certbot_integration_tests/.coveragerc +++ b/certbot-ci/src/certbot_integration_tests/.coveragerc @@ -2,10 +2,10 @@ # Avoid false warnings because certbot packages are not installed in the thread that executes # the coverage: indeed, certbot is launched as a CLI from a subprocess. disable_warnings = module-not-imported,no-data-collected -omit = **/*_test.py,**/tests/*,**/dns_common*,**/certbot_nginx/_internal/parser_obj.py +omit = **/*_test.py,**/tests/*,**/dns_common*,**/certbot/_internal/plugins/nginx/parser_obj.py patch = subprocess parallel = True [report] # Exclude unit tests in coverage during integration tests. -omit = **/*_test.py,**/tests/*,**/dns_common*,**/certbot_nginx/_internal/parser_obj.py +omit = **/*_test.py,**/tests/*,**/dns_common*,**/certbot/_internal/plugins/nginx/parser_obj.py diff --git a/certbot-compatibility-test/nginx/README b/certbot-compatibility-test/nginx/README index f32de2148..648faace4 100644 --- a/certbot-compatibility-test/nginx/README +++ b/certbot-compatibility-test/nginx/README @@ -4,7 +4,7 @@ Right now, this is data for the roundtrip test (checking that the parser can parse each file and that the reserialized config file it generates is identical to the original). -If run in a virtualenv or otherwise so that certbot_nginx can be imported, +If run in a virtualenv or otherwise so that certbot can be imported, the roundtrip test can run as python roundtrip.py nginx-roundtrip-testdata diff --git a/certbot-compatibility-test/nginx/roundtrip.py b/certbot-compatibility-test/nginx/roundtrip.py index afc68647d..a8ee236f5 100644 --- a/certbot-compatibility-test/nginx/roundtrip.py +++ b/certbot-compatibility-test/nginx/roundtrip.py @@ -3,7 +3,7 @@ import os import sys -from certbot_nginx._internal import nginxparser +from certbot._internal.plugins.nginx import nginxparser def roundtrip(stuff): diff --git a/certbot-compatibility-test/setup.py b/certbot-compatibility-test/setup.py index ac63492d4..053b082ff 100644 --- a/certbot-compatibility-test/setup.py +++ b/certbot-compatibility-test/setup.py @@ -1,6 +1,6 @@ from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' setup( version=version, diff --git a/certbot-compatibility-test/src/certbot_compatibility_test/configurators/apache/common.py b/certbot-compatibility-test/src/certbot_compatibility_test/configurators/apache/common.py index ff7115571..d6339e22c 100644 --- a/certbot-compatibility-test/src/certbot_compatibility_test/configurators/apache/common.py +++ b/certbot-compatibility-test/src/certbot_compatibility_test/configurators/apache/common.py @@ -24,7 +24,7 @@ class Proxy(configurators_common.Proxy): self.modules = self.server_root = self.test_conf = self.version = None patch = mock.patch( - "certbot_apache._internal.configurator.display_ops.select_vhost") + "certbot._internal.plugins.apache.configurator.display_ops.select_vhost") mock_display = patch.start() mock_display.side_effect = le_errors.PluginError( "Unable to determine vhost") diff --git a/certbot-compatibility-test/src/certbot_compatibility_test/configurators/nginx/common.py b/certbot-compatibility-test/src/certbot_compatibility_test/configurators/nginx/common.py index ddfc82c77..e0110920f 100644 --- a/certbot-compatibility-test/src/certbot_compatibility_test/configurators/nginx/common.py +++ b/certbot-compatibility-test/src/certbot_compatibility_test/configurators/nginx/common.py @@ -4,11 +4,11 @@ import shutil import subprocess from certbot import configuration +from certbot._internal.plugins.nginx import configurator +from certbot._internal.plugins.nginx import constants from certbot_compatibility_test import errors from certbot_compatibility_test import util from certbot_compatibility_test.configurators import common as configurators_common -from certbot_nginx._internal import configurator -from certbot_nginx._internal import constants class Proxy(configurators_common.Proxy): diff --git a/certbot-dns-cloudflare/setup.py b/certbot-dns-cloudflare/setup.py index 4146cb9c8..2f3516357 100644 --- a/certbot-dns-cloudflare/setup.py +++ b/certbot-dns-cloudflare/setup.py @@ -2,7 +2,7 @@ import os from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' install_requires = [ # for now, do not upgrade to cloudflare>=2.20 to avoid deprecation warnings and the breaking diff --git a/certbot-dns-digitalocean/setup.py b/certbot-dns-digitalocean/setup.py index 3d766d1ac..12ba99ade 100644 --- a/certbot-dns-digitalocean/setup.py +++ b/certbot-dns-digitalocean/setup.py @@ -2,7 +2,7 @@ import os from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' install_requires = [ 'python-digitalocean>=1.15.0', # 1.15.0 or newer is recommended for TTL support diff --git a/certbot-dns-dnsimple/setup.py b/certbot-dns-dnsimple/setup.py index 0384ec46c..470013340 100644 --- a/certbot-dns-dnsimple/setup.py +++ b/certbot-dns-dnsimple/setup.py @@ -2,7 +2,7 @@ import os from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' install_requires = [ # This version of lexicon is required to address the problem described in diff --git a/certbot-dns-dnsmadeeasy/setup.py b/certbot-dns-dnsmadeeasy/setup.py index 8a14c5396..091901356 100644 --- a/certbot-dns-dnsmadeeasy/setup.py +++ b/certbot-dns-dnsmadeeasy/setup.py @@ -2,7 +2,7 @@ import os from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' install_requires = [ 'dns-lexicon>=3.14.1', diff --git a/certbot-dns-gehirn/setup.py b/certbot-dns-gehirn/setup.py index 8a14c5396..091901356 100644 --- a/certbot-dns-gehirn/setup.py +++ b/certbot-dns-gehirn/setup.py @@ -2,7 +2,7 @@ import os from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' install_requires = [ 'dns-lexicon>=3.14.1', diff --git a/certbot-dns-google/setup.py b/certbot-dns-google/setup.py index 21e7ae3ca..a789269e7 100644 --- a/certbot-dns-google/setup.py +++ b/certbot-dns-google/setup.py @@ -2,7 +2,7 @@ import os from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' install_requires = [ 'google-api-python-client>=1.6.5', diff --git a/certbot-dns-linode/setup.py b/certbot-dns-linode/setup.py index 8a14c5396..091901356 100644 --- a/certbot-dns-linode/setup.py +++ b/certbot-dns-linode/setup.py @@ -2,7 +2,7 @@ import os from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' install_requires = [ 'dns-lexicon>=3.14.1', diff --git a/certbot-dns-luadns/setup.py b/certbot-dns-luadns/setup.py index 8a14c5396..091901356 100644 --- a/certbot-dns-luadns/setup.py +++ b/certbot-dns-luadns/setup.py @@ -2,7 +2,7 @@ import os from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' install_requires = [ 'dns-lexicon>=3.14.1', diff --git a/certbot-dns-nsone/setup.py b/certbot-dns-nsone/setup.py index 8a14c5396..091901356 100644 --- a/certbot-dns-nsone/setup.py +++ b/certbot-dns-nsone/setup.py @@ -2,7 +2,7 @@ import os from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' install_requires = [ 'dns-lexicon>=3.14.1', diff --git a/certbot-dns-ovh/setup.py b/certbot-dns-ovh/setup.py index 6c8a4ed0e..f5f5cf3dc 100644 --- a/certbot-dns-ovh/setup.py +++ b/certbot-dns-ovh/setup.py @@ -2,7 +2,7 @@ import os from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' install_requires = [ 'dns-lexicon>=3.15.1', diff --git a/certbot-dns-rfc2136/setup.py b/certbot-dns-rfc2136/setup.py index a03008a76..bbc417b7a 100644 --- a/certbot-dns-rfc2136/setup.py +++ b/certbot-dns-rfc2136/setup.py @@ -2,7 +2,7 @@ import os from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' install_requires = [ # This version was chosen because it is the version packaged in RHEL 9 and Debian unstable. It diff --git a/certbot-dns-route53/setup.py b/certbot-dns-route53/setup.py index 8383e4f8e..1fec3716d 100644 --- a/certbot-dns-route53/setup.py +++ b/certbot-dns-route53/setup.py @@ -2,7 +2,7 @@ import os from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' install_requires = [ 'boto3>=1.20.34', diff --git a/certbot-dns-sakuracloud/setup.py b/certbot-dns-sakuracloud/setup.py index 8a14c5396..091901356 100644 --- a/certbot-dns-sakuracloud/setup.py +++ b/certbot-dns-sakuracloud/setup.py @@ -2,7 +2,7 @@ import os from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' install_requires = [ 'dns-lexicon>=3.14.1', diff --git a/certbot-nginx/MANIFEST.in b/certbot-nginx/MANIFEST.in index 46694e82f..7c473a9b1 100644 --- a/certbot-nginx/MANIFEST.in +++ b/certbot-nginx/MANIFEST.in @@ -1,7 +1,5 @@ include LICENSE.txt include README.rst -recursive-include src/certbot_nginx/_internal/tls_configs *.conf -recursive-include src/certbot_nginx/_internal/tests/testdata * include src/certbot_nginx/py.typed global-exclude __pycache__ global-exclude *.py[cod] diff --git a/certbot-nginx/pyproject.toml b/certbot-nginx/pyproject.toml index f3129ba38..917891019 100644 --- a/certbot-nginx/pyproject.toml +++ b/certbot-nginx/pyproject.toml @@ -38,7 +38,7 @@ test = [ ] [project.entry-points."certbot.plugins"] -nginx = "certbot_nginx._internal.configurator:NginxConfigurator" +nginx = "certbot_nginx._internal.entrypoint:ENTRYPOINT" [project.urls] Homepage = "https://github.com/certbot/certbot" diff --git a/certbot-nginx/setup.py b/certbot-nginx/setup.py index 74d7822cd..bf96e9944 100644 --- a/certbot-nginx/setup.py +++ b/certbot-nginx/setup.py @@ -1,17 +1,12 @@ from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' install_requires = [ - # We specify the minimum acme and certbot version as the current plugin + # We specify the minimum certbot version as the current plugin # version for simplicity. See # https://github.com/certbot/certbot/issues/8761 for more info. - f'acme>={version}', - f'certbot>={version}', - # PyOpenSSL>=25.0.0 is just needed to satisfy mypy right now so this dependency can probably be - # relaxed to >=24.0.0 if needed. - 'PyOpenSSL>=25.0.0', - 'pyparsing>=3.0.0', + f'certbot[nginx]>={version}', ] setup( diff --git a/certbot-nginx/src/certbot_nginx/_internal/entrypoint.py b/certbot-nginx/src/certbot_nginx/_internal/entrypoint.py new file mode 100644 index 000000000..5ef2508e5 --- /dev/null +++ b/certbot-nginx/src/certbot_nginx/_internal/entrypoint.py @@ -0,0 +1,6 @@ +""" Entry point for Nginx Plugin """ + +import certbot.plugins.nginx + + +ENTRYPOINT = certbot.plugins.nginx.ENTRYPOINT diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/__init__.py b/certbot-nginx/src/certbot_nginx/_internal/tests/__init__.py deleted file mode 100644 index 7ddcf58b0..000000000 --- a/certbot-nginx/src/certbot_nginx/_internal/tests/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""certbot-nginx tests""" diff --git a/certbot/CHANGELOG.md b/certbot/CHANGELOG.md index fa5b409be..ca9d0f1af 100644 --- a/certbot/CHANGELOG.md +++ b/certbot/CHANGELOG.md @@ -4,6 +4,14 @@ Certbot adheres to [Semantic Versioning](https://semver.org/). +## 5.5.0 - 2026-04-07 + +### Changed + +- Moved nearly all code for the certbot-nginx and certbot-apache plugins into private modules in the certbot package which now offers "apache" and "nginx" [extras](https://packaging.python.org/en/latest/specifications/dependency-specifiers/#extras). Users should notice no major changes. certbot-apache and certbot-nginx will continue to exist as simple packages that depend on certbot and also help register the plugin with certbot so it knows the functionality is available. Unit tests for these plugins are now also part of the certbot package. ([#10484](https://github.com/certbot/certbot/issues/10484)) +- The certbot.ocsp module has been deprecated and will be removed in the next major release. This is not a change to Certbot's OCSP functionality. The code is just being removed from Certbot's public API. ([#10584](https://github.com/certbot/certbot/issues/10584)) + + ## 5.4.0 - 2026-03-10 ### Added diff --git a/certbot/MANIFEST.in b/certbot/MANIFEST.in index 1e397fb3d..8fd2a7bc9 100644 --- a/certbot/MANIFEST.in +++ b/certbot/MANIFEST.in @@ -4,6 +4,11 @@ include LICENSE.txt recursive-include docs * recursive-include examples * recursive-include src/certbot/tests/testdata * +recursive-include src/certbot/_internal/plugins/nginx/tls_configs *.conf +recursive-include src/certbot/_internal/tests/plugins/nginx/testdata * +recursive-include src/certbot/_internal/plugins/apache/augeas_lens *.aug +recursive-include src/certbot/_internal/plugins/apache/tls_configs *.conf +recursive-include src/certbot/_internal/tests/plugins/apache/testdata * include src/certbot/ssl-dhparams.pem include src/certbot/py.typed global-exclude __pycache__ diff --git a/certbot/docs/cli-help.txt b/certbot/docs/cli-help.txt index d5a7387fd..1c57f649d 100644 --- a/certbot/docs/cli-help.txt +++ b/certbot/docs/cli-help.txt @@ -38,7 +38,7 @@ manage your account: options: -h, --help show this help message and exit - -c CONFIG_FILE, --config CONFIG_FILE + -c, --config CONFIG_FILE path to config file (default: /etc/letsencrypt/cli.ini and ~/.config/letsencrypt/cli.ini) -v, --verbose This flag can be used multiple times to incrementally @@ -58,7 +58,7 @@ options: --force-interactive Force Certbot to be interactive even if it detects it's not being run in a terminal. This flag cannot be used with the renew subcommand. (default: False) - -d DOMAIN, --domains DOMAIN, --domain DOMAIN + -d, --domains, --domain DOMAIN Domain names to include. For multiple domains you can use multiple -d flags or enter a comma separated list of domains as a parameter. All domains will be @@ -147,7 +147,7 @@ options: 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/5.4.0 (certbot; + "". (default: CertbotACMEClient/5.5.0 (certbot; OS_NAME OS_VERSION) Authenticator/XXX Installer/YYY (SUBCOMMAND; flags: FLAGS) Py/major.minor.patchlevel). The flags encoded in the user agent are: --duplicate, @@ -424,8 +424,7 @@ revoke: register: Options for account registration - -m EMAIL, --email EMAIL - Email used for registration and recovery contact. Use + -m, --email EMAIL Email used for registration and recovery contact. Use comma to register multiple emails, ex: u1@example.com,u2@example.com. (default: Ask). --eff-email Share your e-mail address with EFF (default: Ask) @@ -478,9 +477,9 @@ plugins: Name of the plugin that is both an authenticator and an installer. Should not be used together with --authenticator or --installer. (default: Ask) - -a AUTHENTICATOR, --authenticator AUTHENTICATOR + -a, --authenticator AUTHENTICATOR Authenticator plugin name. (default: None) - -i INSTALLER, --installer INSTALLER + -i, --installer INSTALLER Installer plugin name (also used to find domains). (default: None) --apache Obtain and install certificates using Apache (default: @@ -757,7 +756,7 @@ webroot: be running and serving files from the webroot path. HTTP challenge only (wildcards not supported). - --webroot-path WEBROOT_PATH, -w WEBROOT_PATH + --webroot-path, -w WEBROOT_PATH public_html / webroot path. This can be specified multiple times to handle different identifiers; each identifier will have the webroot path that preceded diff --git a/certbot/docs/using.rst b/certbot/docs/using.rst index 042bfe5de..e64fcf9cb 100644 --- a/certbot/docs/using.rst +++ b/certbot/docs/using.rst @@ -99,7 +99,7 @@ Apache ------ The Apache plugin currently `supports -`_ +`_ modern OSes based on Debian, Fedora, SUSE, Gentoo, CentOS and Darwin. This automates both obtaining *and* installing certificates on an Apache webserver. To specify this plugin on the command line, simply include @@ -1248,7 +1248,7 @@ Configuration file Certbot accepts a global configuration file that applies its options to all invocations of Certbot. Certificate-specific configuration choices are stored in the ``.conf`` -files that can be found in ``/etc/letsencrypt/renewal``. See +files that can be found in ``/etc/letsencrypt/renewal``. See `Modifying the Renewal Configuration of Existing Certificates`_ for more information about modifying certificate-specific options. Note that it is not recommended to modify these certificate-specific renewal configuration files manually. diff --git a/certbot/pyproject.toml b/certbot/pyproject.toml index 91a9c12bf..03226ae82 100644 --- a/certbot/pyproject.toml +++ b/certbot/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "certbot" -dynamic = ["version", "dependencies"] +dynamic = ["version", "dependencies", "optional-dependencies"] description = "ACME client" readme = "README.rst" license = "Apache-2.0" @@ -32,51 +32,6 @@ classifiers = [ "Topic :: Utilities", ] - -[project.optional-dependencies] -dev = [ - "azure-devops", - "build", - "ipdb", - # allows us to use newer urllib3 https://github.com/python-poetry/poetry-plugin-export/issues/183 - "poetry-plugin-export>=1.9.0", - # poetry 1.2.0+ is required for it to pin pip, setuptools, and wheel. See - # https://github.com/python-poetry/poetry/issues/1584. - "poetry>=1.2.0", - "towncrier", - "twine", -] -docs = [ - # If you have Sphinx<1.5.1, you need docutils<0.13.1 - # https://github.com/sphinx-doc/sphinx/issues/3212 - "Sphinx>=1.2", # Annotation support - "sphinx_rtd_theme", -] -# Tools like pip, wheel, and tox are listed here to ensure they are properly -# pinned and installed during automated testing. -test = [ - "coverage", - "mypy", - "pip", - "pylint", - "pytest", - "pytest-cov>=4.1.0", # https://github.com/pytest-dev/pytest-cov/pull/558 - "pytest-xdist", - "ruff", - "setuptools", - "tox", - "types-httplib2", - "types-pyRFC3339", - "types-pywin32", - "types-requests", - "types-setuptools", - "uv", - "wheel", -] -all = [ - "certbot[dev,docs,test]" -] - [project.scripts] certbot = "certbot.main:main" diff --git a/certbot/setup.py b/certbot/setup.py index 39d869db6..1c4c194f1 100644 --- a/certbot/setup.py +++ b/certbot/setup.py @@ -40,7 +40,67 @@ install_requires = [ 'pywin32>=300 ; sys_platform == "win32"', ] +extras_require = { + "dev": [ + "apacheconfig>=0.3.2", + "azure-devops", + "build", + "ipdb", + # allows us to use newer urllib3 https://github.com/python-poetry/poetry-plugin-export/issues/183 + "poetry-plugin-export>=1.9.0", + # poetry 1.2.0+ is required for it to pin pip, setuptools, and wheel. See + # https://github.com/python-poetry/poetry/issues/1584. + "poetry>=1.2.0", + "towncrier", + "twine", + ], + "docs": [ + # If you have Sphinx<1.5.1, you need docutils<0.13.1 + # https://github.com/sphinx-doc/sphinx/issues/3212 + "Sphinx>=1.2", # Annotation support + "sphinx_rtd_theme", + ], + # Tools like pip, wheel, and tox are listed here to ensure they are properly + # pinned and installed during automated testing. + "test": [ + "coverage", + "mypy", + "pip", + "pylint", + "pytest", + "pytest-cov>=4.1.0", # https://github.com/pytest-dev/pytest-cov/pull/558 + "pytest-xdist", + "ruff", + "setuptools", + "tox", + "types-httplib2", + "types-pyRFC3339", + "types-pywin32", + "types-requests", + "types-setuptools", + "uv", + "wheel", + ], + "apache": [ + # If a user installs `certbot[apache]`, we want to include the shim + f'certbot-apache>={version}', + 'python-augeas', + ], + "nginx": [ + # If a user installs `certbot[nginx]`, we want to include the shim + f'certbot-nginx>={version}', + # PyOpenSSL>=25.0.0 is just needed to satisfy mypy right now so this dependency can probably be + # relaxed to >=24.0.0 if needed. + 'PyOpenSSL>=25.0.0', + 'pyparsing>=3.0.0', + ], + "all": [ + "certbot[dev,docs,test,apache,nginx]" + ], +} + setup( install_requires=install_requires, + extras_require=extras_require, ) diff --git a/certbot/src/certbot/__init__.py b/certbot/src/certbot/__init__.py index 8d27b69d8..eb168026c 100644 --- a/certbot/src/certbot/__init__.py +++ b/certbot/src/certbot/__init__.py @@ -1,4 +1,4 @@ """Certbot client.""" # version number like 1.2.3a0, must have at least 2 parts, like 1.2 -__version__ = '5.5.0.dev0' +__version__ = '5.6.0.dev0' diff --git a/certbot-apache/src/certbot_apache/_internal/__init__.py b/certbot/src/certbot/_internal/plugins/apache/__init__.py similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/__init__.py rename to certbot/src/certbot/_internal/plugins/apache/__init__.py diff --git a/certbot-apache/src/certbot_apache/_internal/apache_util.py b/certbot/src/certbot/_internal/plugins/apache/apache_util.py similarity index 97% rename from certbot-apache/src/certbot_apache/_internal/apache_util.py rename to certbot/src/certbot/_internal/plugins/apache/apache_util.py index 1264269ab..9ad8db84c 100644 --- a/certbot-apache/src/certbot_apache/_internal/apache_util.py +++ b/certbot/src/certbot/_internal/plugins/apache/apache_util.py @@ -248,6 +248,7 @@ def find_ssl_apache_conf(prefix: str) -> str: """ file_manager = ExitStack() atexit.register(file_manager.close) - ref = (importlib.resources.files("certbot_apache").joinpath("_internal") - .joinpath("tls_configs").joinpath("{0}-options-ssl-apache.conf".format(prefix))) + ref = (importlib.resources.files("certbot").joinpath("_internal") + .joinpath("plugins").joinpath("apache").joinpath("tls_configs") + .joinpath("{0}-options-ssl-apache.conf".format(prefix))) return str(file_manager.enter_context(importlib.resources.as_file(ref))) diff --git a/certbot-apache/src/certbot_apache/_internal/apacheparser.py b/certbot/src/certbot/_internal/plugins/apache/apacheparser.py similarity index 96% rename from certbot-apache/src/certbot_apache/_internal/apacheparser.py rename to certbot/src/certbot/_internal/plugins/apache/apacheparser.py index 2d0ce7485..4c41d9c41 100644 --- a/certbot-apache/src/certbot_apache/_internal/apacheparser.py +++ b/certbot/src/certbot/_internal/plugins/apache/apacheparser.py @@ -3,10 +3,10 @@ from typing import Any from typing import Iterable from typing import Optional -from certbot_apache._internal import assertions -from certbot_apache._internal import interfaces -from certbot_apache._internal import parsernode_util as util -from certbot_apache._internal.interfaces import ParserNode +from certbot._internal.plugins.apache import assertions +from certbot._internal.plugins.apache import interfaces +from certbot._internal.plugins.apache import parsernode_util as util +from certbot._internal.plugins.apache.interfaces import ParserNode class ApacheParserNode(interfaces.ParserNode): diff --git a/certbot-apache/src/certbot_apache/_internal/assertions.py b/certbot/src/certbot/_internal/plugins/apache/assertions.py similarity index 94% rename from certbot-apache/src/certbot_apache/_internal/assertions.py rename to certbot/src/certbot/_internal/plugins/apache/assertions.py index 1d6c5da27..32ffa1988 100644 --- a/certbot-apache/src/certbot_apache/_internal/assertions.py +++ b/certbot/src/certbot/_internal/plugins/apache/assertions.py @@ -5,11 +5,11 @@ from typing import Iterable from typing import Optional from typing import Union -from certbot_apache._internal import interfaces -from certbot_apache._internal.interfaces import CommentNode -from certbot_apache._internal.interfaces import DirectiveNode -from certbot_apache._internal.interfaces import ParserNode -from certbot_apache._internal.obj import VirtualHost +from certbot._internal.plugins.apache import interfaces +from certbot._internal.plugins.apache.interfaces import CommentNode +from certbot._internal.plugins.apache.interfaces import DirectiveNode +from certbot._internal.plugins.apache.interfaces import ParserNode +from certbot._internal.plugins.apache.obj import VirtualHost PASS = "CERTBOT_PASS_ASSERT" diff --git a/certbot-apache/src/certbot_apache/_internal/augeas_lens/README b/certbot/src/certbot/_internal/plugins/apache/augeas_lens/README similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/augeas_lens/README rename to certbot/src/certbot/_internal/plugins/apache/augeas_lens/README diff --git a/certbot-apache/src/certbot_apache/_internal/augeas_lens/httpd.aug b/certbot/src/certbot/_internal/plugins/apache/augeas_lens/httpd.aug similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/augeas_lens/httpd.aug rename to certbot/src/certbot/_internal/plugins/apache/augeas_lens/httpd.aug diff --git a/certbot-apache/src/certbot_apache/_internal/augeasparser.py b/certbot/src/certbot/_internal/plugins/apache/augeasparser.py similarity index 98% rename from certbot-apache/src/certbot_apache/_internal/augeasparser.py rename to certbot/src/certbot/_internal/plugins/apache/augeasparser.py index 9f031af5d..48c971765 100644 --- a/certbot-apache/src/certbot_apache/_internal/augeasparser.py +++ b/certbot/src/certbot/_internal/plugins/apache/augeasparser.py @@ -72,11 +72,11 @@ from typing import Union from certbot import errors from certbot.compat import os -from certbot_apache._internal import apache_util -from certbot_apache._internal import assertions -from certbot_apache._internal import interfaces -from certbot_apache._internal import parser -from certbot_apache._internal import parsernode_util as util +from certbot._internal.plugins.apache import apache_util +from certbot._internal.plugins.apache import assertions +from certbot._internal.plugins.apache import interfaces +from certbot._internal.plugins.apache import parser +from certbot._internal.plugins.apache import parsernode_util as util class AugeasParserNode(interfaces.ParserNode): diff --git a/certbot-apache/src/certbot_apache/_internal/configurator.py b/certbot/src/certbot/_internal/plugins/apache/configurator.py similarity index 97% rename from certbot-apache/src/certbot_apache/_internal/configurator.py rename to certbot/src/certbot/_internal/plugins/apache/configurator.py index c82b6b3c9..2e10e9b56 100644 --- a/certbot-apache/src/certbot_apache/_internal/configurator.py +++ b/certbot/src/certbot/_internal/plugins/apache/configurator.py @@ -26,15 +26,15 @@ from certbot.interfaces import RenewableCert from certbot.plugins import common from certbot.plugins.enhancements import AutoHSTSEnhancement from certbot.plugins.util import path_surgery -from certbot_apache._internal import apache_util -from certbot_apache._internal import assertions -from certbot_apache._internal import constants -from certbot_apache._internal import display_ops -from certbot_apache._internal import dualparser -from certbot_apache._internal import http_01 -from certbot_apache._internal import obj -from certbot_apache._internal import parser -from certbot_apache._internal.apacheparser import ApacheBlockNode +from certbot._internal.plugins.apache import apache_util +from certbot._internal.plugins.apache import assertions +from certbot._internal.plugins.apache import constants +from certbot._internal.plugins.apache import display_ops +from certbot._internal.plugins.apache import dualparser +from certbot._internal.plugins.apache import http_01 +from certbot._internal.plugins.apache import obj +from certbot._internal.plugins.apache import parser +from certbot._internal.plugins.apache.apacheparser import ApacheBlockNode try: import apacheconfig @@ -126,11 +126,11 @@ class ApacheConfigurator(common.Configurator): :type config: certbot.configuration.NamespaceConfig :ivar parser: Handles low level parsing - :type parser: :class:`~certbot_apache._internal.parser` + :type parser: :class:`~certbot._internal.plugins.apache.parser` :ivar tup version: version of Apache :ivar list vhosts: All vhosts found in the configuration - (:class:`list` of :class:`~certbot_apache._internal.obj.VirtualHost`) + (:class:`list` of :class:`~certbot._internal.plugins.apache.obj.VirtualHost`) :ivar dict assoc: Mapping between domains and vhosts @@ -542,7 +542,7 @@ class ApacheConfigurator(common.Configurator): counterpart, should one get created :returns: List of VirtualHosts or None - :rtype: `list` of :class:`~certbot_apache._internal.obj.VirtualHost` + :rtype: `list` of :class:`~certbot._internal.plugins.apache.obj.VirtualHost` """ if util.is_wildcard_domain(domain): @@ -720,7 +720,7 @@ class ApacheConfigurator(common.Configurator): counterpart, should one get created :returns: vhost associated with name - :rtype: :class:`~certbot_apache._internal.obj.VirtualHost` + :rtype: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` :raises .errors.PluginError: If no vhost is available or chosen @@ -823,7 +823,8 @@ class ApacheConfigurator(common.Configurator): :param str target_name: domain handled by the desired vhost :param vhosts: vhosts to consider - :type vhosts: `collections.Iterable` of :class:`~certbot_apache._internal.obj.VirtualHost` + :type vhosts: `collections.Iterable` of + :class:`~certbot._internal.plugins.apache.obj.VirtualHost` :param bool filter_defaults: whether a vhost with a _default_ addr is acceptable @@ -965,7 +966,7 @@ class ApacheConfigurator(common.Configurator): """Helper function for get_virtual_hosts(). :param host: In progress vhost whose names will be added - :type host: :class:`~certbot_apache._internal.obj.VirtualHost` + :type host: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` """ @@ -984,7 +985,7 @@ class ApacheConfigurator(common.Configurator): :param str path: Augeas path to virtual host :returns: newly created vhost - :rtype: :class:`~certbot_apache._internal.obj.VirtualHost` + :rtype: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` """ addrs: set[obj.Addr] = set() @@ -1050,7 +1051,7 @@ class ApacheConfigurator(common.Configurator): def get_virtual_hosts_v1(self) -> list[obj.VirtualHost]: """Returns list of virtual hosts found in the Apache configuration. - :returns: List of :class:`~certbot_apache._internal.obj.VirtualHost` + :returns: List of :class:`~certbot._internal.plugins.apache.obj.VirtualHost` objects found in configuration :rtype: list @@ -1103,7 +1104,7 @@ class ApacheConfigurator(common.Configurator): def get_virtual_hosts_v2(self) -> list[obj.VirtualHost]: """Returns list of virtual hosts found in the Apache configuration using ParserNode interface. - :returns: List of :class:`~certbot_apache.obj.VirtualHost` + :returns: List of :class:`~certbot._internal.plugins.apache.obj.VirtualHost` objects found in configuration :rtype: list """ @@ -1122,7 +1123,7 @@ class ApacheConfigurator(common.Configurator): interfaces. :param ApacheBlockNode node: The BlockNode object of VirtualHost block :returns: newly created vhost - :rtype: :class:`~certbot_apache.obj.VirtualHost` + :rtype: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` """ addrs = set() for param in node.parameters: @@ -1164,7 +1165,7 @@ class ApacheConfigurator(common.Configurator): def _populate_vhost_names_v2(self, vhost: obj.VirtualHost) -> None: """Helper function that populates the VirtualHost names. :param host: In progress vhost whose names will be added - :type host: :class:`~certbot_apache.obj.VirtualHost` + :type host: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` """ if not vhost.node: raise errors.PluginError("Current VirtualHost has no node.") # pragma: no cover @@ -1352,10 +1353,10 @@ class ApacheConfigurator(common.Configurator): .. note:: This function saves the configuration :param nonssl_vhost: Valid VH that doesn't have SSLEngine on - :type nonssl_vhost: :class:`~certbot_apache._internal.obj.VirtualHost` + :type nonssl_vhost: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` :returns: SSL vhost - :rtype: :class:`~certbot_apache._internal.obj.VirtualHost` + :rtype: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` :raises .errors.PluginError: If more than one virtual host is in the file or if plugin is unable to write/read vhost files. @@ -1720,7 +1721,7 @@ class ApacheConfigurator(common.Configurator): :param str id_str: Id string for matching :returns: The matched VirtualHost - :rtype: :class:`~certbot_apache._internal.obj.VirtualHost` + :rtype: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` :raises .errors.PluginError: If no VirtualHost is found """ @@ -1737,7 +1738,7 @@ class ApacheConfigurator(common.Configurator): used for keeping track of VirtualHost directive over time. :param vhost: Virtual host to add the id - :type vhost: :class:`~certbot_apache._internal.obj.VirtualHost` + :type vhost: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` :returns: The unique ID or None :rtype: str or None @@ -1759,7 +1760,7 @@ class ApacheConfigurator(common.Configurator): If ID already exists, returns that instead. :param vhost: Virtual host to add or find the id - :type vhost: :class:`~certbot_apache._internal.obj.VirtualHost` + :type vhost: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` :returns: The unique ID for vhost :rtype: str or None @@ -1840,7 +1841,7 @@ class ApacheConfigurator(common.Configurator): """Increase the AutoHSTS max-age value :param vhost: Virtual host object to modify - :type vhost: :class:`~certbot_apache._internal.obj.VirtualHost` + :type vhost: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` :param str id_str: The unique ID string of VirtualHost @@ -1923,7 +1924,7 @@ class ApacheConfigurator(common.Configurator): .. note:: This function saves the configuration :param ssl_vhost: Destination of traffic, an ssl enabled vhost - :type ssl_vhost: :class:`~certbot_apache._internal.obj.VirtualHost` + :type ssl_vhost: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` :param unused_options: Not currently used :type unused_options: Not Available @@ -1969,7 +1970,7 @@ class ApacheConfigurator(common.Configurator): .. note:: This function saves the configuration :param ssl_vhost: Destination of traffic, an ssl enabled vhost - :type ssl_vhost: :class:`~certbot_apache._internal.obj.VirtualHost` + :type ssl_vhost: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` :param header_substring: string that uniquely identifies a header. e.g: Strict-Transport-Security, Upgrade-Insecure-Requests. @@ -2003,7 +2004,7 @@ class ApacheConfigurator(common.Configurator): contains the string header_substring. :param ssl_vhost: vhost to check - :type vhost: :class:`~certbot_apache._internal.obj.VirtualHost` + :type vhost: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` :param header_substring: string that uniquely identifies a header. e.g: Strict-Transport-Security, Upgrade-Insecure-Requests. @@ -2040,7 +2041,7 @@ class ApacheConfigurator(common.Configurator): .. note:: This function saves the configuration :param ssl_vhost: Destination of traffic, an ssl enabled vhost - :type ssl_vhost: :class:`~certbot_apache._internal.obj.VirtualHost` + :type ssl_vhost: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` :param unused_options: Not currently used :type unused_options: Not Available @@ -2120,7 +2121,7 @@ class ApacheConfigurator(common.Configurator): delete certbot's old rewrite rules and set the new one instead. :param vhost: vhost to check - :type vhost: :class:`~certbot_apache._internal.obj.VirtualHost` + :type vhost: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` :raises errors.PluginEnhancementAlreadyPresent: When the exact certbot redirection WriteRule exists in virtual host. @@ -2159,7 +2160,7 @@ class ApacheConfigurator(common.Configurator): """Checks if there exists a RewriteRule directive in vhost :param vhost: vhost to check - :type vhost: :class:`~certbot_apache._internal.obj.VirtualHost` + :type vhost: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` :returns: True if a RewriteRule directive exists. :rtype: bool @@ -2173,7 +2174,7 @@ class ApacheConfigurator(common.Configurator): """Checks if a RewriteEngine directive is on :param vhost: vhost to check - :type vhost: :class:`~certbot_apache._internal.obj.VirtualHost` + :type vhost: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` """ rewrite_engine_path_list = self.parser.find_dir("RewriteEngine", "on", start=vhost.path) @@ -2189,7 +2190,7 @@ class ApacheConfigurator(common.Configurator): """Creates an http_vhost specifically to redirect for the ssl_vhost. :param ssl_vhost: ssl vhost - :type ssl_vhost: :class:`~certbot_apache._internal.obj.VirtualHost` + :type ssl_vhost: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` """ text = self._get_redirect_config_str(ssl_vhost) @@ -2308,7 +2309,7 @@ class ApacheConfigurator(common.Configurator): of this method where available. :param vhost: vhost to enable - :type vhost: :class:`~certbot_apache._internal.obj.VirtualHost` + :type vhost: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` :raises .errors.NotSupportedError: If filesystem layout is not supported. @@ -2569,7 +2570,7 @@ class ApacheConfigurator(common.Configurator): """Do the initial AutoHSTS deployment to a vhost :param ssl_vhost: The VirtualHost object to deploy the AutoHSTS - :type ssl_vhost: :class:`~certbot_apache._internal.obj.VirtualHost` or None + :type ssl_vhost: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` or None :raises errors.PluginEnhancementAlreadyPresent: When already enhanced diff --git a/certbot-apache/src/certbot_apache/_internal/constants.py b/certbot/src/certbot/_internal/plugins/apache/constants.py similarity index 96% rename from certbot-apache/src/certbot_apache/_internal/constants.py rename to certbot/src/certbot/_internal/plugins/apache/constants.py index 2e3b7a56f..b37a943b3 100644 --- a/certbot-apache/src/certbot_apache/_internal/constants.py +++ b/certbot/src/certbot/_internal/plugins/apache/constants.py @@ -44,7 +44,8 @@ def _generate_augeas_lens_dir_static() -> str: # Python process, and will be automatically cleaned up on exit. file_manager = ExitStack() atexit.register(file_manager.close) - augeas_lens_dir_ref = importlib.resources.files("certbot_apache") / "_internal" / "augeas_lens" + augeas_lens_dir_ref = importlib.resources.files("certbot") / "_internal" \ + / "plugins" / "apache" / "augeas_lens" return str(file_manager.enter_context(importlib.resources.as_file(augeas_lens_dir_ref))) AUGEAS_LENS_DIR = _generate_augeas_lens_dir_static() diff --git a/certbot-apache/src/certbot_apache/_internal/display_ops.py b/certbot/src/certbot/_internal/plugins/apache/display_ops.py similarity index 96% rename from certbot-apache/src/certbot_apache/_internal/display_ops.py rename to certbot/src/certbot/_internal/plugins/apache/display_ops.py index 2a01bccfe..1b9c2b126 100644 --- a/certbot-apache/src/certbot_apache/_internal/display_ops.py +++ b/certbot/src/certbot/_internal/plugins/apache/display_ops.py @@ -7,7 +7,7 @@ from typing import Sequence from certbot import errors from certbot.compat import os from certbot.display import util as display_util -from certbot_apache._internal.obj import VirtualHost +from certbot._internal.plugins.apache.obj import VirtualHost logger = logging.getLogger(__name__) @@ -83,7 +83,7 @@ def _vhost_menu(domain: str, vhosts: Iterable[VirtualHost]) -> tuple[str, int]: if free_chars < 2: logger.debug("Display size is too small for " - "certbot_apache._internal.display_ops._vhost_menu()") + "certbot._internal.plugins.apache.display_ops._vhost_menu()") # This runs the edge off the screen, but it doesn't cause an "error" filename_size = 1 disp_name_size = 1 diff --git a/certbot-apache/src/certbot_apache/_internal/dualparser.py b/certbot/src/certbot/_internal/plugins/apache/dualparser.py similarity index 97% rename from certbot-apache/src/certbot_apache/_internal/dualparser.py rename to certbot/src/certbot/_internal/plugins/apache/dualparser.py index ab78b367b..65d71bab8 100644 --- a/certbot-apache/src/certbot_apache/_internal/dualparser.py +++ b/certbot/src/certbot/_internal/plugins/apache/dualparser.py @@ -6,14 +6,14 @@ from typing import Optional from typing import TYPE_CHECKING from typing import TypeVar -from certbot_apache._internal import apacheparser -from certbot_apache._internal import assertions -from certbot_apache._internal import augeasparser -from certbot_apache._internal import interfaces +from certbot._internal.plugins.apache import apacheparser +from certbot._internal.plugins.apache import assertions +from certbot._internal.plugins.apache import augeasparser +from certbot._internal.plugins.apache import interfaces if TYPE_CHECKING: - from certbot_apache._internal.apacheparser import ApacheParserNode # pragma: no cover - from certbot_apache._internal.augeasparser import AugeasParserNode # pragma: no cover + from certbot._internal.plugins.apache.apacheparser import ApacheParserNode # pragma: no cover + from certbot._internal.plugins.apache.augeasparser import AugeasParserNode # pragma: no cover GenericAugeasParserNode = TypeVar("GenericAugeasParserNode", bound="AugeasParserNode") GenericApacheParserNode = TypeVar("GenericApacheParserNode", bound="ApacheParserNode") diff --git a/certbot/src/certbot/_internal/plugins/apache/entrypoint.py b/certbot/src/certbot/_internal/plugins/apache/entrypoint.py new file mode 100644 index 000000000..089b29298 --- /dev/null +++ b/certbot/src/certbot/_internal/plugins/apache/entrypoint.py @@ -0,0 +1,66 @@ +""" Entry point for Apache Plugin """ + +from certbot import util +from certbot._internal.plugins.apache import configurator +from certbot._internal.plugins.apache import override_alpine +from certbot._internal.plugins.apache import override_arch +from certbot._internal.plugins.apache import override_centos +from certbot._internal.plugins.apache import override_darwin +from certbot._internal.plugins.apache import override_debian +from certbot._internal.plugins.apache import override_fedora +from certbot._internal.plugins.apache import override_gentoo +from certbot._internal.plugins.apache import override_suse +from certbot._internal.plugins.apache import override_void + +OVERRIDE_CLASSES: dict[str, type[configurator.ApacheConfigurator]] = { + "alpine": override_alpine.AlpineConfigurator, + "arch": override_arch.ArchConfigurator, + "cloudlinux": override_centos.CentOSConfigurator, + "darwin": override_darwin.DarwinConfigurator, + "debian": override_debian.DebianConfigurator, + "ubuntu": override_debian.DebianConfigurator, + "centos": override_centos.CentOSConfigurator, + "centos linux": override_centos.CentOSConfigurator, + "fedora_old": override_centos.CentOSConfigurator, + "fedora": override_fedora.FedoraConfigurator, + "linuxmint": override_debian.DebianConfigurator, + "ol": override_centos.CentOSConfigurator, + "oracle": override_centos.CentOSConfigurator, + "redhatenterpriseserver": override_centos.CentOSConfigurator, + "red hat enterprise linux server": override_centos.CentOSConfigurator, + "rhel": override_centos.CentOSConfigurator, + "amazon": override_centos.CentOSConfigurator, + "gentoo": override_gentoo.GentooConfigurator, + "gentoo base system": override_gentoo.GentooConfigurator, + "opensuse": override_suse.OpenSUSEConfigurator, + "suse": override_suse.OpenSUSEConfigurator, + "sles": override_suse.OpenSUSEConfigurator, + "scientific": override_centos.CentOSConfigurator, + "scientific linux": override_centos.CentOSConfigurator, + "void": override_void.VoidConfigurator, +} + + +def get_configurator() -> type[configurator.ApacheConfigurator]: + """ Get correct configurator class based on the OS fingerprint """ + os_name, os_version = util.get_os_info() + os_name = os_name.lower() + override_class = None + + # Special case for older Fedora versions + min_version = util.parse_loose_version('29') + if os_name == 'fedora' and util.parse_loose_version(os_version) < min_version: + os_name = 'fedora_old' + + try: + override_class = OVERRIDE_CLASSES[os_name] + except KeyError: + # OS not found in the list + os_like = util.get_systemd_os_like() + if os_like: + for os_name in os_like: + override_class = OVERRIDE_CLASSES.get(os_name) + if not override_class: + # No override class found, return the generic configurator + override_class = configurator.ApacheConfigurator + return override_class diff --git a/certbot-apache/src/certbot_apache/_internal/http_01.py b/certbot/src/certbot/_internal/plugins/apache/http_01.py similarity index 97% rename from certbot-apache/src/certbot_apache/_internal/http_01.py rename to certbot/src/certbot/_internal/plugins/apache/http_01.py index 51788fb23..72220a509 100644 --- a/certbot-apache/src/certbot_apache/_internal/http_01.py +++ b/certbot/src/certbot/_internal/plugins/apache/http_01.py @@ -10,11 +10,11 @@ from certbot.achallenges import KeyAuthorizationAnnotatedChallenge from certbot.compat import filesystem from certbot.compat import os from certbot.plugins import common -from certbot_apache._internal.obj import VirtualHost -from certbot_apache._internal.parser import get_aug_path +from certbot._internal.plugins.apache.obj import VirtualHost +from certbot._internal.plugins.apache.parser import get_aug_path if TYPE_CHECKING: - from certbot_apache._internal.configurator import ApacheConfigurator # pragma: no cover + from certbot._internal.plugins.apache.configurator import ApacheConfigurator # pragma: no cover logger = logging.getLogger(__name__) diff --git a/certbot-apache/src/certbot_apache/_internal/interfaces.py b/certbot/src/certbot/_internal/plugins/apache/interfaces.py similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/interfaces.py rename to certbot/src/certbot/_internal/plugins/apache/interfaces.py diff --git a/certbot-apache/src/certbot_apache/_internal/obj.py b/certbot/src/certbot/_internal/plugins/apache/obj.py similarity index 96% rename from certbot-apache/src/certbot_apache/_internal/obj.py rename to certbot/src/certbot/_internal/plugins/apache/obj.py index 1f3796db6..6c5a8f0a6 100644 --- a/certbot-apache/src/certbot_apache/_internal/obj.py +++ b/certbot/src/certbot/_internal/plugins/apache/obj.py @@ -6,9 +6,9 @@ from typing import Optional from typing import Union from certbot.plugins import common -from certbot_apache._internal.apacheparser import ApacheBlockNode -from certbot_apache._internal.augeasparser import AugeasBlockNode -from certbot_apache._internal.dualparser import DualBlockNode +from certbot._internal.plugins.apache.apacheparser import ApacheBlockNode +from certbot._internal.plugins.apache.augeasparser import AugeasBlockNode +from certbot._internal.plugins.apache.dualparser import DualBlockNode class Addr(common.Addr): @@ -27,7 +27,7 @@ class Addr(common.Addr): return False def __repr__(self) -> str: - return f"certbot_apache._internal.obj.Addr({repr(self.tup)})" + return f"certbot._internal.plugins.apache.obj.Addr({repr(self.tup)})" def __hash__(self) -> int: # pylint: disable=useless-super-delegation # Python 3 requires explicit overridden for __hash__ if __eq__ or diff --git a/certbot-apache/src/certbot_apache/_internal/override_alpine.py b/certbot/src/certbot/_internal/plugins/apache/override_alpine.py similarity index 82% rename from certbot-apache/src/certbot_apache/_internal/override_alpine.py rename to certbot/src/certbot/_internal/plugins/apache/override_alpine.py index b3ea041df..5a184a9da 100644 --- a/certbot-apache/src/certbot_apache/_internal/override_alpine.py +++ b/certbot/src/certbot/_internal/plugins/apache/override_alpine.py @@ -1,6 +1,6 @@ """ Distribution specific override class for Alpine Linux """ -from certbot_apache._internal import configurator -from certbot_apache._internal.configurator import OsOptions +from certbot._internal.plugins.apache import configurator +from certbot._internal.plugins.apache.configurator import OsOptions class AlpineConfigurator(configurator.ApacheConfigurator): diff --git a/certbot-apache/src/certbot_apache/_internal/override_arch.py b/certbot/src/certbot/_internal/plugins/apache/override_arch.py similarity index 81% rename from certbot-apache/src/certbot_apache/_internal/override_arch.py rename to certbot/src/certbot/_internal/plugins/apache/override_arch.py index 007f677b5..73f169ff5 100644 --- a/certbot-apache/src/certbot_apache/_internal/override_arch.py +++ b/certbot/src/certbot/_internal/plugins/apache/override_arch.py @@ -1,6 +1,6 @@ """ Distribution specific override class for Arch Linux """ -from certbot_apache._internal import configurator -from certbot_apache._internal.configurator import OsOptions +from certbot._internal.plugins.apache import configurator +from certbot._internal.plugins.apache.configurator import OsOptions class ArchConfigurator(configurator.ApacheConfigurator): diff --git a/certbot-apache/src/certbot_apache/_internal/override_centos.py b/certbot/src/certbot/_internal/plugins/apache/override_centos.py similarity index 95% rename from certbot-apache/src/certbot_apache/_internal/override_centos.py rename to certbot/src/certbot/_internal/plugins/apache/override_centos.py index 59044769b..e250bfcdf 100644 --- a/certbot-apache/src/certbot_apache/_internal/override_centos.py +++ b/certbot/src/certbot/_internal/plugins/apache/override_centos.py @@ -4,10 +4,10 @@ from typing import Any from certbot import errors from certbot import util -from certbot_apache._internal import apache_util -from certbot_apache._internal import configurator -from certbot_apache._internal import parser -from certbot_apache._internal.configurator import OsOptions +from certbot._internal.plugins.apache import apache_util +from certbot._internal.plugins.apache import configurator +from certbot._internal.plugins.apache import parser +from certbot._internal.plugins.apache.configurator import OsOptions logger = logging.getLogger(__name__) diff --git a/certbot-apache/src/certbot_apache/_internal/override_darwin.py b/certbot/src/certbot/_internal/plugins/apache/override_darwin.py similarity index 79% rename from certbot-apache/src/certbot_apache/_internal/override_darwin.py rename to certbot/src/certbot/_internal/plugins/apache/override_darwin.py index 4dfc8dc38..cc2b65496 100644 --- a/certbot-apache/src/certbot_apache/_internal/override_darwin.py +++ b/certbot/src/certbot/_internal/plugins/apache/override_darwin.py @@ -1,6 +1,6 @@ """ Distribution specific override class for macOS """ -from certbot_apache._internal import configurator -from certbot_apache._internal.configurator import OsOptions +from certbot._internal.plugins.apache import configurator +from certbot._internal.plugins.apache.configurator import OsOptions class DarwinConfigurator(configurator.ApacheConfigurator): diff --git a/certbot-apache/src/certbot_apache/_internal/override_debian.py b/certbot/src/certbot/_internal/plugins/apache/override_debian.py similarity index 93% rename from certbot-apache/src/certbot_apache/_internal/override_debian.py rename to certbot/src/certbot/_internal/plugins/apache/override_debian.py index 0d138ee9d..417596d33 100644 --- a/certbot-apache/src/certbot_apache/_internal/override_debian.py +++ b/certbot/src/certbot/_internal/plugins/apache/override_debian.py @@ -5,10 +5,10 @@ from certbot import errors from certbot import util from certbot.compat import filesystem from certbot.compat import os -from certbot_apache._internal import apache_util -from certbot_apache._internal import configurator -from certbot_apache._internal.configurator import OsOptions -from certbot_apache._internal.obj import VirtualHost +from certbot._internal.plugins.apache import apache_util +from certbot._internal.plugins.apache import configurator +from certbot._internal.plugins.apache.configurator import OsOptions +from certbot._internal.plugins.apache.obj import VirtualHost logger = logging.getLogger(__name__) @@ -30,7 +30,7 @@ class DebianConfigurator(configurator.ApacheConfigurator): modules are enabled appropriately. :param vhost: vhost to enable - :type vhost: :class:`~certbot_apache._internal.obj.VirtualHost` + :type vhost: :class:`~certbot._internal.plugins.apache.obj.VirtualHost` :raises .errors.NotSupportedError: If filesystem layout is not supported. diff --git a/certbot-apache/src/certbot_apache/_internal/override_fedora.py b/certbot/src/certbot/_internal/plugins/apache/override_fedora.py similarity index 93% rename from certbot-apache/src/certbot_apache/_internal/override_fedora.py rename to certbot/src/certbot/_internal/plugins/apache/override_fedora.py index a93f103b1..67b3056cc 100644 --- a/certbot-apache/src/certbot_apache/_internal/override_fedora.py +++ b/certbot/src/certbot/_internal/plugins/apache/override_fedora.py @@ -3,10 +3,10 @@ from typing import Any from certbot import errors from certbot import util -from certbot_apache._internal import apache_util -from certbot_apache._internal import configurator -from certbot_apache._internal import parser -from certbot_apache._internal.configurator import OsOptions +from certbot._internal.plugins.apache import apache_util +from certbot._internal.plugins.apache import configurator +from certbot._internal.plugins.apache import parser +from certbot._internal.plugins.apache.configurator import OsOptions class FedoraConfigurator(configurator.ApacheConfigurator): diff --git a/certbot-apache/src/certbot_apache/_internal/override_gentoo.py b/certbot/src/certbot/_internal/plugins/apache/override_gentoo.py similarity index 90% rename from certbot-apache/src/certbot_apache/_internal/override_gentoo.py rename to certbot/src/certbot/_internal/plugins/apache/override_gentoo.py index 15368bf21..2955afaf7 100644 --- a/certbot-apache/src/certbot_apache/_internal/override_gentoo.py +++ b/certbot/src/certbot/_internal/plugins/apache/override_gentoo.py @@ -1,10 +1,10 @@ """ Distribution specific override class for Gentoo Linux """ from typing import Any -from certbot_apache._internal import apache_util -from certbot_apache._internal import configurator -from certbot_apache._internal import parser -from certbot_apache._internal.configurator import OsOptions +from certbot._internal.plugins.apache import apache_util +from certbot._internal.plugins.apache import configurator +from certbot._internal.plugins.apache import parser +from certbot._internal.plugins.apache.configurator import OsOptions class GentooConfigurator(configurator.ApacheConfigurator): diff --git a/certbot-apache/src/certbot_apache/_internal/override_suse.py b/certbot/src/certbot/_internal/plugins/apache/override_suse.py similarity index 81% rename from certbot-apache/src/certbot_apache/_internal/override_suse.py rename to certbot/src/certbot/_internal/plugins/apache/override_suse.py index f0bbb5b42..1fa495142 100644 --- a/certbot-apache/src/certbot_apache/_internal/override_suse.py +++ b/certbot/src/certbot/_internal/plugins/apache/override_suse.py @@ -1,6 +1,6 @@ """ Distribution specific override class for OpenSUSE """ -from certbot_apache._internal import configurator -from certbot_apache._internal.configurator import OsOptions +from certbot._internal.plugins.apache import configurator +from certbot._internal.plugins.apache.configurator import OsOptions class OpenSUSEConfigurator(configurator.ApacheConfigurator): diff --git a/certbot-apache/src/certbot_apache/_internal/override_void.py b/certbot/src/certbot/_internal/plugins/apache/override_void.py similarity index 81% rename from certbot-apache/src/certbot_apache/_internal/override_void.py rename to certbot/src/certbot/_internal/plugins/apache/override_void.py index 011637ac3..0c49ee960 100644 --- a/certbot-apache/src/certbot_apache/_internal/override_void.py +++ b/certbot/src/certbot/_internal/plugins/apache/override_void.py @@ -1,6 +1,6 @@ """ Distribution specific override class for Void Linux """ -from certbot_apache._internal import configurator -from certbot_apache._internal.configurator import OsOptions +from certbot._internal.plugins.apache import configurator +from certbot._internal.plugins.apache.configurator import OsOptions class VoidConfigurator(configurator.ApacheConfigurator): diff --git a/certbot-apache/src/certbot_apache/_internal/parser.py b/certbot/src/certbot/_internal/plugins/apache/parser.py similarity index 99% rename from certbot-apache/src/certbot_apache/_internal/parser.py rename to certbot/src/certbot/_internal/plugins/apache/parser.py index a5a5d3f65..e87f6467c 100644 --- a/certbot-apache/src/certbot_apache/_internal/parser.py +++ b/certbot/src/certbot/_internal/plugins/apache/parser.py @@ -12,11 +12,11 @@ from typing import Union from certbot import errors from certbot.compat import os -from certbot_apache._internal import apache_util -from certbot_apache._internal import constants +from certbot._internal.plugins.apache import apache_util +from certbot._internal.plugins.apache import constants if TYPE_CHECKING: - from certbot_apache._internal.configurator import ApacheConfigurator # pragma: no cover + from certbot._internal.plugins.apache.configurator import ApacheConfigurator # pragma: no cover try: from augeas import Augeas diff --git a/certbot-apache/src/certbot_apache/_internal/parsernode_util.py b/certbot/src/certbot/_internal/plugins/apache/parsernode_util.py similarity index 98% rename from certbot-apache/src/certbot_apache/_internal/parsernode_util.py rename to certbot/src/certbot/_internal/plugins/apache/parsernode_util.py index 9ae09491e..5d475580a 100644 --- a/certbot-apache/src/certbot_apache/_internal/parsernode_util.py +++ b/certbot/src/certbot/_internal/plugins/apache/parsernode_util.py @@ -3,7 +3,7 @@ from typing import Any from typing import Iterable from typing import Optional -from certbot_apache._internal.interfaces import ParserNode +from certbot._internal.plugins.apache.interfaces import ParserNode def validate_kwargs(kwargs: dict[str, Any], required_names: Iterable[str]) -> dict[str, Any]: diff --git a/certbot-apache/src/certbot_apache/_internal/tls_configs/current-options-ssl-apache.conf b/certbot/src/certbot/_internal/plugins/apache/tls_configs/current-options-ssl-apache.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tls_configs/current-options-ssl-apache.conf rename to certbot/src/certbot/_internal/plugins/apache/tls_configs/current-options-ssl-apache.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tls_configs/old-options-ssl-apache.conf b/certbot/src/certbot/_internal/plugins/apache/tls_configs/old-options-ssl-apache.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tls_configs/old-options-ssl-apache.conf rename to certbot/src/certbot/_internal/plugins/apache/tls_configs/old-options-ssl-apache.conf diff --git a/certbot-nginx/src/certbot_nginx/_internal/__init__.py b/certbot/src/certbot/_internal/plugins/nginx/__init__.py similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/__init__.py rename to certbot/src/certbot/_internal/plugins/nginx/__init__.py diff --git a/certbot-nginx/src/certbot_nginx/_internal/configurator.py b/certbot/src/certbot/_internal/plugins/nginx/configurator.py similarity index 97% rename from certbot-nginx/src/certbot_nginx/_internal/configurator.py rename to certbot/src/certbot/_internal/plugins/nginx/configurator.py index 185ed0280..a53610219 100644 --- a/certbot-nginx/src/certbot_nginx/_internal/configurator.py +++ b/certbot/src/certbot/_internal/plugins/nginx/configurator.py @@ -25,12 +25,12 @@ from certbot import util from certbot.compat import os from certbot.display import util as display_util from certbot.plugins import common -from certbot_nginx._internal import constants -from certbot_nginx._internal import display_ops -from certbot_nginx._internal import http_01 -from certbot_nginx._internal import nginxparser -from certbot_nginx._internal import obj -from certbot_nginx._internal import parser +from certbot._internal.plugins.nginx import constants +from certbot._internal.plugins.nginx import display_ops +from certbot._internal.plugins.nginx import http_01 +from certbot._internal.plugins.nginx import nginxparser +from certbot._internal.plugins.nginx import obj +from certbot._internal.plugins.nginx import parser NAME_RANK = 0 START_WILDCARD_RANK = 1 @@ -52,7 +52,7 @@ class NginxConfigurator(common.Configurator): :type config: certbot.configuration.NamespaceConfig :ivar parser: Handles low level parsing - :type parser: :class:`~certbot_nginx._internal.parser` + :type parser: :class:`~certbot._internal.plugins.nginx.parser` :ivar str save_notes: Human-readable config change notes @@ -173,8 +173,9 @@ class NginxConfigurator(common.Configurator): file_manager = ExitStack() atexit.register(file_manager.close) - ref = (importlib.resources.files("certbot_nginx").joinpath("_internal") - .joinpath("tls_configs").joinpath(config_filename)) + ref = (importlib.resources.files("certbot").joinpath("_internal") + .joinpath("plugins").joinpath("nginx").joinpath("tls_configs") + .joinpath(config_filename)) return str(file_manager.enter_context(importlib.resources.as_file(ref))) @@ -348,7 +349,7 @@ class NginxConfigurator(common.Configurator): :param str target_name: domain name :returns: ssl vhosts associated with name - :rtype: list of :class:`~certbot_nginx._internal.obj.VirtualHost` + :rtype: list of :class:`~certbot._internal.plugins.nginx.obj.VirtualHost` """ return [vhost for vhost in self._choose_vhosts_common(target_name) if vhost.ssl] @@ -369,7 +370,7 @@ class NginxConfigurator(common.Configurator): :param str fullchain_path: certificates to use when creating SSL vhosts :returns: ssl vhosts associated with name - :rtype: list of :class:`~certbot_nginx._internal.obj.VirtualHost` + :rtype: list of :class:`~certbot._internal.plugins.nginx.obj.VirtualHost` """ vhosts = self._choose_vhosts_common(target_name) @@ -478,7 +479,7 @@ class NginxConfigurator(common.Configurator): :param list matches: list of dicts containing the vhost, the matching name, and the numerical rank :returns: the most matching vhost - :rtype: :class:`~certbot_nginx._internal.obj.VirtualHost` + :rtype: :class:`~certbot._internal.plugins.nginx.obj.VirtualHost` """ if not matches: @@ -564,7 +565,7 @@ class NginxConfigurator(common.Configurator): :param str port: port number :returns: vhosts associated with name - :rtype: list of :class:`~certbot_nginx._internal.obj.VirtualHost` + :rtype: list of :class:`~certbot._internal.plugins.nginx.obj.VirtualHost` """ if util.is_wildcard_domain(target_name): @@ -586,7 +587,7 @@ class NginxConfigurator(common.Configurator): :param str target_name: non-wildcard domain name :returns: tuple of HTTP and HTTPS virtualhosts - :rtype: tuple of :class:`~certbot_nginx._internal.obj.VirtualHost` + :rtype: tuple of :class:`~certbot._internal.plugins.nginx.obj.VirtualHost` """ vhosts = [m['vhost'] for m in self._get_ranked_matches(target_name) if m and 'vhost' in m] @@ -712,7 +713,7 @@ class NginxConfigurator(common.Configurator): Make a server SSL by adding new listen and SSL directives. :param vhost: The vhost to add SSL to. - :type vhost: :class:`~certbot_nginx._internal.obj.VirtualHost` + :type vhost: :class:`~certbot._internal.plugins.nginx.obj.VirtualHost` :param str key_path: key to use for SSL :param str fullchain_path: certificates to use for SSL @@ -868,9 +869,9 @@ class NginxConfigurator(common.Configurator): :param vhost: The server block to break up into two. :param list only_directives: If this exists, only duplicate these directives when splitting the block. - :type vhost: :class:`~certbot_nginx._internal.obj.VirtualHost` + :type vhost: :class:`~certbot._internal.plugins.nginx.obj.VirtualHost` :returns: tuple (http_vhost, https_vhost) - :rtype: tuple of type :class:`~certbot_nginx._internal.obj.VirtualHost` + :rtype: tuple of type :class:`~certbot._internal.plugins.nginx.obj.VirtualHost` """ http_vhost = self.parser.duplicate_vhost(vhost, only_directives=only_directives) diff --git a/certbot-nginx/src/certbot_nginx/_internal/constants.py b/certbot/src/certbot/_internal/plugins/nginx/constants.py similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/constants.py rename to certbot/src/certbot/_internal/plugins/nginx/constants.py diff --git a/certbot-nginx/src/certbot_nginx/_internal/display_ops.py b/certbot/src/certbot/_internal/plugins/nginx/display_ops.py similarity index 96% rename from certbot-nginx/src/certbot_nginx/_internal/display_ops.py rename to certbot/src/certbot/_internal/plugins/nginx/display_ops.py index 1efb75e7f..fbd97d9f1 100644 --- a/certbot-nginx/src/certbot_nginx/_internal/display_ops.py +++ b/certbot/src/certbot/_internal/plugins/nginx/display_ops.py @@ -4,7 +4,7 @@ from typing import Iterable from typing import Optional from certbot.display import util as display_util -from certbot_nginx._internal.obj import VirtualHost +from certbot._internal.plugins.nginx.obj import VirtualHost logger = logging.getLogger(__name__) diff --git a/certbot-nginx/src/certbot_nginx/_internal/http_01.py b/certbot/src/certbot/_internal/plugins/nginx/http_01.py similarity index 97% rename from certbot-nginx/src/certbot_nginx/_internal/http_01.py rename to certbot/src/certbot/_internal/plugins/nginx/http_01.py index ce2ee3a17..7ff737a19 100644 --- a/certbot-nginx/src/certbot_nginx/_internal/http_01.py +++ b/certbot/src/certbot/_internal/plugins/nginx/http_01.py @@ -11,11 +11,11 @@ from certbot import errors from certbot.achallenges import KeyAuthorizationAnnotatedChallenge from certbot.compat import os from certbot.plugins import common -from certbot_nginx._internal import nginxparser -from certbot_nginx._internal.obj import Addr +from certbot._internal.plugins.nginx import nginxparser +from certbot._internal.plugins.nginx.obj import Addr if TYPE_CHECKING: - from certbot_nginx._internal.configurator import NginxConfigurator + from certbot._internal.plugins.nginx.configurator import NginxConfigurator logger = logging.getLogger(__name__) @@ -146,7 +146,7 @@ class NginxHttp01(common.ChallengePerformer): def _default_listen_addresses(self) -> list[Addr]: """Finds addresses for a challenge block to listen on. - :returns: list of :class:`certbot_nginx._internal.obj.Addr` to apply + :returns: list of :class:`certbot._internal.plugins.nginx.obj.Addr` to apply :rtype: list """ addresses: list[Addr] = [] diff --git a/certbot-nginx/src/certbot_nginx/_internal/nginxparser.py b/certbot/src/certbot/_internal/plugins/nginx/nginxparser.py similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/nginxparser.py rename to certbot/src/certbot/_internal/plugins/nginx/nginxparser.py diff --git a/certbot-nginx/src/certbot_nginx/_internal/obj.py b/certbot/src/certbot/_internal/plugins/nginx/obj.py similarity index 99% rename from certbot-nginx/src/certbot_nginx/_internal/obj.py rename to certbot/src/certbot/_internal/plugins/nginx/obj.py index a80a531e7..ee6a8a776 100644 --- a/certbot-nginx/src/certbot_nginx/_internal/obj.py +++ b/certbot/src/certbot/_internal/plugins/nginx/obj.py @@ -136,7 +136,7 @@ class Addr(common.Addr): def __hash__(self) -> int: # pylint: disable=useless-super-delegation # Python 3 requires explicit overridden for __hash__ - # See certbot-apache/src/certbot_apache/_internal/obj.py for more information + # See certbot-apache/src/certbot._internal.plugins.apache/obj.py for more information return super().__hash__() def super_eq(self, other: "Addr") -> bool: diff --git a/certbot-nginx/src/certbot_nginx/_internal/parser.py b/certbot/src/certbot/_internal/plugins/nginx/parser.py similarity index 97% rename from certbot-nginx/src/certbot_nginx/_internal/parser.py rename to certbot/src/certbot/_internal/plugins/nginx/parser.py index eb5b67636..5c9e7e6ac 100644 --- a/certbot-nginx/src/certbot_nginx/_internal/parser.py +++ b/certbot/src/certbot/_internal/plugins/nginx/parser.py @@ -18,9 +18,9 @@ import pyparsing from certbot import errors from certbot.compat import os -from certbot_nginx._internal import nginxparser -from certbot_nginx._internal import obj -from certbot_nginx._internal.nginxparser import UnspacedList +from certbot._internal.plugins.nginx import nginxparser +from certbot._internal.plugins.nginx import obj +from certbot._internal.plugins.nginx.nginxparser import UnspacedList logger = logging.getLogger(__name__) @@ -145,7 +145,7 @@ class NginxParser: Technically this is a misnomer because Nginx does not have virtual hosts, it has 'server blocks'. - :returns: List of :class:`~certbot_nginx._internal.obj.VirtualHost` + :returns: List of :class:`~certbot._internal.plugins.nginx.obj.VirtualHost` objects found in configuration :rtype: list @@ -286,7 +286,8 @@ class NginxParser: def has_ssl_on_directive(self, vhost: obj.VirtualHost) -> bool: """Does vhost have ssl on for all ports? - :param :class:`~certbot_nginx._internal.obj.VirtualHost` vhost: The vhost in question + :param :class:`~certbot._internal.plugins.nginx.obj.VirtualHost` + vhost: The vhost in question :returns: True if 'ssl on' directive is included :rtype: bool @@ -313,7 +314,7 @@ class NginxParser: ..todo :: Doesn't match server blocks whose server_name directives are split across multiple conf files. - :param :class:`~certbot_nginx._internal.obj.VirtualHost` vhost: The vhost + :param :class:`~certbot._internal.plugins.nginx.obj.VirtualHost` vhost: The vhost whose information we use to match on :param list directives: The directives to add :param bool insert_at_top: True if the directives need to be inserted at the top @@ -336,7 +337,7 @@ class NginxParser: ..todo :: Doesn't match server blocks whose server_name directives are split across multiple conf files. - :param :class:`~certbot_nginx._internal.obj.VirtualHost` vhost: The vhost + :param :class:`~certbot._internal.plugins.nginx.obj.VirtualHost` vhost: The vhost whose information we use to match on :param list directives: The directives to add :param bool insert_at_top: True if the directives need to be inserted at the top @@ -350,7 +351,7 @@ class NginxParser: match_func: Optional[Callable[[Any], bool]] = None) -> None: """Remove all directives of type directive_name. - :param :class:`~certbot_nginx._internal.obj.VirtualHost` vhost: The vhost + :param :class:`~certbot._internal.plugins.nginx.obj.VirtualHost` vhost: The vhost to remove directives from :param string directive_name: The directive type to remove :param callable match_func: Function of the directive that returns true for directives @@ -389,7 +390,7 @@ class NginxParser: only_directives: Optional[list[Any]] = None) -> obj.VirtualHost: """Duplicate the vhost in the configuration files. - :param :class:`~certbot_nginx._internal.obj.VirtualHost` vhost_template: The vhost + :param :class:`~certbot._internal.plugins.nginx.obj.VirtualHost` vhost_template: The vhost whose information we copy :param bool remove_singleton_listen_params: If we should remove parameters from listen directives in the block that can only be used once per address @@ -397,7 +398,7 @@ class NginxParser: looks at first level of depth; does not expand includes. :returns: A vhost object for the newly created vhost - :rtype: :class:`~certbot_nginx._internal.obj.VirtualHost` + :rtype: :class:`~certbot._internal.plugins.nginx.obj.VirtualHost` """ # TODO: https://github.com/certbot/certbot/issues/5185 # put it in the same file as the template, at the same level diff --git a/certbot-nginx/src/certbot_nginx/_internal/parser_obj.py b/certbot/src/certbot/_internal/plugins/nginx/parser_obj.py similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/parser_obj.py rename to certbot/src/certbot/_internal/plugins/nginx/parser_obj.py diff --git a/certbot-nginx/src/certbot_nginx/_internal/tls_configs/options-ssl-nginx-old.conf b/certbot/src/certbot/_internal/plugins/nginx/tls_configs/options-ssl-nginx-old.conf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tls_configs/options-ssl-nginx-old.conf rename to certbot/src/certbot/_internal/plugins/nginx/tls_configs/options-ssl-nginx-old.conf diff --git a/certbot-nginx/src/certbot_nginx/_internal/tls_configs/options-ssl-nginx-tls12-only.conf b/certbot/src/certbot/_internal/plugins/nginx/tls_configs/options-ssl-nginx-tls12-only.conf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tls_configs/options-ssl-nginx-tls12-only.conf rename to certbot/src/certbot/_internal/plugins/nginx/tls_configs/options-ssl-nginx-tls12-only.conf diff --git a/certbot-nginx/src/certbot_nginx/_internal/tls_configs/options-ssl-nginx-tls13-session-tix-on.conf b/certbot/src/certbot/_internal/plugins/nginx/tls_configs/options-ssl-nginx-tls13-session-tix-on.conf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tls_configs/options-ssl-nginx-tls13-session-tix-on.conf rename to certbot/src/certbot/_internal/plugins/nginx/tls_configs/options-ssl-nginx-tls13-session-tix-on.conf diff --git a/certbot-nginx/src/certbot_nginx/_internal/tls_configs/options-ssl-nginx.conf b/certbot/src/certbot/_internal/plugins/nginx/tls_configs/options-ssl-nginx.conf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tls_configs/options-ssl-nginx.conf rename to certbot/src/certbot/_internal/plugins/nginx/tls_configs/options-ssl-nginx.conf diff --git a/certbot/src/certbot/_internal/tests/plugins/apache/__init__.py b/certbot/src/certbot/_internal/tests/plugins/apache/__init__.py new file mode 100644 index 000000000..97c96aaa3 --- /dev/null +++ b/certbot/src/certbot/_internal/tests/plugins/apache/__init__.py @@ -0,0 +1,7 @@ +"""certbot-apache tests""" + +import pytest + + +# Make sure we're only running these tests if our apache plugin dependencies are installed +pytest.importorskip("augeas") diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/NEEDED.txt b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/NEEDED.txt similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/NEEDED.txt rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/NEEDED.txt diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/apache-conf-test similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/apache-conf-test diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test-pebble.py b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/apache-conf-test-pebble.py similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test-pebble.py rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/apache-conf-test-pebble.py diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/failing/missing-double-quote-1724.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/failing/missing-double-quote-1724.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/failing/missing-double-quote-1724.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/failing/missing-double-quote-1724.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/failing/multivhost-1093.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/failing/multivhost-1093.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/failing/multivhost-1093.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/failing/multivhost-1093.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/failing/multivhost-1093b.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/failing/multivhost-1093b.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/failing/multivhost-1093b.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/failing/multivhost-1093b.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/1626-1531.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/1626-1531.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/1626-1531.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/1626-1531.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/README.modules b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/README.modules similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/README.modules rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/README.modules diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/anarcat-1531.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/anarcat-1531.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/anarcat-1531.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/anarcat-1531.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/comment-continuations-2050.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/comment-continuations-2050.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/comment-continuations-2050.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/comment-continuations-2050.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/drupal-errordocument-arg-1724.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/drupal-errordocument-arg-1724.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/drupal-errordocument-arg-1724.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/drupal-errordocument-arg-1724.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/drupal-htaccess-1531.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/drupal-htaccess-1531.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/drupal-htaccess-1531.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/drupal-htaccess-1531.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/escaped-space-arguments-2735.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/escaped-space-arguments-2735.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/escaped-space-arguments-2735.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/escaped-space-arguments-2735.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/example-1755.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/example-1755.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/example-1755.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/example-1755.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/example-ssl.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/example-ssl.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/example-ssl.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/example-ssl.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/example.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/example.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/example.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/example.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/finalize-1243.apache2.conf.txt b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/finalize-1243.apache2.conf.txt similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/finalize-1243.apache2.conf.txt rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/finalize-1243.apache2.conf.txt diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/finalize-1243.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/finalize-1243.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/finalize-1243.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/finalize-1243.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/graphite-quote-1934.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/graphite-quote-1934.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/graphite-quote-1934.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/graphite-quote-1934.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/ipv6-1143.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/ipv6-1143.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/ipv6-1143.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/ipv6-1143.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/ipv6-1143b.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/ipv6-1143b.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/ipv6-1143b.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/ipv6-1143b.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/ipv6-1143c.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/ipv6-1143c.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/ipv6-1143c.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/ipv6-1143c.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/ipv6-1143d.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/ipv6-1143d.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/ipv6-1143d.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/ipv6-1143d.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/missing-quote-1724.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/missing-quote-1724.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/missing-quote-1724.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/missing-quote-1724.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/modmacro-1385.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/modmacro-1385.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/modmacro-1385.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/modmacro-1385.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/owncloud-1264.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/owncloud-1264.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/owncloud-1264.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/owncloud-1264.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/rewrite-quote-1960.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/rewrite-quote-1960.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/rewrite-quote-1960.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/rewrite-quote-1960.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/roundcube-1222.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/roundcube-1222.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/roundcube-1222.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/roundcube-1222.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/section-continuations-2525.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/section-continuations-2525.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/section-continuations-2525.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/section-continuations-2525.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/section-empty-continuations-2731.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/section-empty-continuations-2731.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/section-empty-continuations-2731.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/section-empty-continuations-2731.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/semacode-1598.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/semacode-1598.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/semacode-1598.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/semacode-1598.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/sslrequire-wordlist-1827.htaccess b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/sslrequire-wordlist-1827.htaccess similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/sslrequire-wordlist-1827.htaccess rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/sslrequire-wordlist-1827.htaccess diff --git a/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/two-blocks-one-line-1693.conf b/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/two-blocks-one-line-1693.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/passing/two-blocks-one-line-1693.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/passing/two-blocks-one-line-1693.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/augeasnode_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/augeasnode_test.py similarity index 93% rename from certbot-apache/src/certbot_apache/_internal/tests/augeasnode_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/augeasnode_test.py index c16ef5871..c4600d995 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/augeasnode_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/augeasnode_test.py @@ -5,9 +5,9 @@ from unittest import mock import pytest from certbot import errors -from certbot_apache._internal import assertions -from certbot_apache._internal import augeasparser -from certbot_apache._internal.tests import util +from certbot._internal.plugins.apache import assertions +from certbot._internal.plugins.apache import augeasparser +from certbot._internal.tests.plugins.apache import util def _get_augeasnode_mock(filepath): @@ -28,7 +28,7 @@ class AugeasParserNodeTest(util.ApacheTest): # pylint: disable=too-many-public- super().setUp() with mock.patch( - "certbot_apache._internal.configurator.ApacheConfigurator.get_parsernode_root" + "certbot._internal.plugins.apache.configurator.ApacheConfigurator.get_parsernode_root" ) as mock_parsernode: mock_parsernode.side_effect = _get_augeasnode_mock( os.path.join(self.config_path, "apache2.conf")) @@ -40,19 +40,19 @@ class AugeasParserNodeTest(util.ApacheTest): # pylint: disable=too-many-public- self.temp_dir, "debian_apache_2_4/multiple_vhosts") def test_save(self): - with mock.patch('certbot_apache._internal.parser.ApacheParser.save') as mock_save: + with mock.patch('certbot._internal.plugins.apache.parser.ApacheParser.save') as mock_save: self.config.parser_root.save("A save message") assert mock_save.called is True assert mock_save.call_args[0][0] == "A save message" def test_unsaved_files(self): - with mock.patch('certbot_apache._internal.parser.ApacheParser.unsaved_files') as mock_uf: + with mock.patch('certbot._internal.plugins.apache.parser.ApacheParser.unsaved_files') as mock_uf: mock_uf.return_value = ["first", "second"] files = self.config.parser_root.unsaved_files() assert files == ["first", "second"] def test_get_block_node_name(self): - from certbot_apache._internal.augeasparser import AugeasBlockNode + from certbot._internal.plugins.apache.augeasparser import AugeasBlockNode block = AugeasBlockNode( name=assertions.PASS, ancestor=None, @@ -122,9 +122,9 @@ class AugeasParserNodeTest(util.ApacheTest): # pylint: disable=too-many-public- assert "going_to_set_this" in names def test_set_parameters_atinit(self): - from certbot_apache._internal.augeasparser import AugeasDirectiveNode + from certbot._internal.plugins.apache.augeasparser import AugeasDirectiveNode servernames = self.config.parser_root.find_directives("servername") - setparam = "certbot_apache._internal.augeasparser.AugeasDirectiveNode.set_parameters" + setparam = "certbot._internal.plugins.apache.augeasparser.AugeasDirectiveNode.set_parameters" with mock.patch(setparam) as mock_set: AugeasDirectiveNode( name=servernames[0].name, @@ -252,7 +252,7 @@ class AugeasParserNodeTest(util.ApacheTest): # pylint: disable=too-many-public- assert vh.metadata["augeaspath"].endswith("VirtualHost[2]") is True def test_node_init_error_bad_augeaspath(self): - from certbot_apache._internal.augeasparser import AugeasBlockNode + from certbot._internal.plugins.apache.augeasparser import AugeasBlockNode parameters = { "name": assertions.PASS, "ancestor": None, @@ -266,7 +266,7 @@ class AugeasParserNodeTest(util.ApacheTest): # pylint: disable=too-many-public- AugeasBlockNode(**parameters) def test_node_init_error_missing_augeaspath(self): - from certbot_apache._internal.augeasparser import AugeasBlockNode + from certbot._internal.plugins.apache.augeasparser import AugeasBlockNode parameters = { "name": assertions.PASS, "ancestor": None, diff --git a/certbot-apache/src/certbot_apache/_internal/tests/autohsts_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/autohsts_test.py similarity index 79% rename from certbot-apache/src/certbot_apache/_internal/tests/autohsts_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/autohsts_test.py index 073029fc8..acb84d092 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/autohsts_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/autohsts_test.py @@ -1,5 +1,5 @@ # pylint: disable=too-many-lines -"""Test for certbot_apache._internal.configurator AutoHSTS functionality""" +"""Test for certbot._internal.plugins.apache.configurator AutoHSTS functionality""" import re import sys from unittest import mock @@ -7,8 +7,8 @@ from unittest import mock import pytest from certbot import errors -from certbot_apache._internal import constants -from certbot_apache._internal.tests import util +from certbot._internal.plugins.apache import constants +from certbot._internal.tests.plugins.apache import util class AutoHSTSTest(util.ApacheTest): @@ -39,23 +39,23 @@ class AutoHSTSTest(util.ApacheTest): head.replace("arg[3]", "arg[4]")) return None # pragma: no cover - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.restart") - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.enable_mod") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator.restart") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator.enable_mod") def test_autohsts_enable_headers_mod(self, mock_enable, _restart): self.config.parser.modules.pop("headers_module", None) self.config.parser.modules.pop("mod_header.c", None) self.config.enable_autohsts(mock.MagicMock(), ["ocspvhost.com"]) assert mock_enable.called is True - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.restart") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator.restart") def test_autohsts_deploy_already_exists(self, _restart): self.config.enable_autohsts(mock.MagicMock(), ["ocspvhost.com"]) with pytest.raises(errors.PluginEnhancementAlreadyPresent): self.config.enable_autohsts(mock.MagicMock(), ["ocspvhost.com"]) - @mock.patch("certbot_apache._internal.constants.AUTOHSTS_FREQ", 0) - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.restart") - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.prepare") + @mock.patch("certbot._internal.plugins.apache.constants.AUTOHSTS_FREQ", 0) + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator.restart") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator.prepare") def test_autohsts_increase(self, mock_prepare, _mock_restart): self.config._prepared = False maxage = "\"max-age={0}\"" @@ -73,8 +73,8 @@ class AutoHSTSTest(util.ApacheTest): inc_val assert mock_prepare.called is True - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.restart") - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator._autohsts_increase") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator.restart") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator._autohsts_increase") def test_autohsts_increase_noop(self, mock_increase, _restart): maxage = "\"max-age={0}\"" initial_val = maxage.format(constants.AUTOHSTS_STEPS[0]) @@ -88,8 +88,8 @@ class AutoHSTSTest(util.ApacheTest): assert mock_increase.called is False - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.restart") - @mock.patch("certbot_apache._internal.constants.AUTOHSTS_FREQ", 0) + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator.restart") + @mock.patch("certbot._internal.plugins.apache.constants.AUTOHSTS_FREQ", 0) def test_autohsts_increase_no_header(self, _restart): self.config.enable_autohsts(mock.MagicMock(), ["ocspvhost.com"]) # Remove the header @@ -100,8 +100,8 @@ class AutoHSTSTest(util.ApacheTest): with pytest.raises(errors.PluginError): self.config.update_autohsts(mock.MagicMock()) - @mock.patch("certbot_apache._internal.constants.AUTOHSTS_FREQ", 0) - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.restart") + @mock.patch("certbot._internal.plugins.apache.constants.AUTOHSTS_FREQ", 0) + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator.restart") def test_autohsts_increase_and_make_permanent(self, _mock_restart): maxage = "\"max-age={0}\"" max_val = maxage.format(constants.AUTOHSTS_PERMANENT) @@ -127,7 +127,7 @@ class AutoHSTSTest(util.ApacheTest): max_val def test_autohsts_update_noop(self): - with mock.patch("certbot_apache._internal.configurator.time") as mock_time_module: + with mock.patch("certbot._internal.plugins.apache.configurator.time") as mock_time_module: # Time mock is used to make sure that the execution does not # continue when no autohsts entries exist in pluginstorage self.config.update_autohsts(mock.MagicMock()) @@ -139,16 +139,16 @@ class AutoHSTSTest(util.ApacheTest): # Make sure that the execution does not continue when no entries in store assert self.config.storage.put.called is False - @mock.patch("certbot_apache._internal.display_ops.select_vhost") + @mock.patch("certbot._internal.plugins.apache.display_ops.select_vhost") def test_autohsts_no_ssl_vhost(self, mock_select): mock_select.return_value = self.vh_truth[0] - with mock.patch("certbot_apache._internal.configurator.logger.error") as mock_log: + with mock.patch("certbot._internal.plugins.apache.configurator.logger.error") as mock_log: with pytest.raises(errors.PluginError): self.config.enable_autohsts(mock.MagicMock(), "invalid.example.com") assert "Certbot was not able to find SSL" in mock_log.call_args[0][0] - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.restart") - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.add_vhost_id") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator.restart") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator.add_vhost_id") def test_autohsts_dont_enhance_twice(self, mock_id, _restart): mock_id.return_value = "1234567" self.config.enable_autohsts(mock.MagicMock(), ["ocspvhost.com", "ocspvhost.com"]) @@ -172,7 +172,7 @@ class AutoHSTSTest(util.ApacheTest): self.config._autohsts_fetch_state() self.config._autohsts["orphan_id"] = {"laststep": 999, "timestamp": 0} self.config._autohsts_save_state() - with mock.patch("certbot_apache._internal.configurator.logger.error") as mock_log: + with mock.patch("certbot._internal.plugins.apache.configurator.logger.error") as mock_log: self.config.deploy_autohsts(mock.MagicMock()) assert mock_log.called is True assert "VirtualHost with id orphan_id was not" in mock_log.call_args[0][0] diff --git a/certbot-apache/src/certbot_apache/_internal/tests/centos_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/centos_test.py similarity index 92% rename from certbot-apache/src/certbot_apache/_internal/tests/centos_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/centos_test.py index 7ca77c6dd..87fc09fef 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/centos_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/centos_test.py @@ -1,4 +1,4 @@ -"""Test for certbot_apache._internal.configurator for Centos overrides""" +"""Test for certbot._internal.plugins.apache.configurator for Centos overrides""" import sys from unittest import mock @@ -7,9 +7,9 @@ import pytest from certbot import errors from certbot.compat import filesystem from certbot.compat import os -from certbot_apache._internal import obj -from certbot_apache._internal import override_centos -from certbot_apache._internal.tests import util +from certbot._internal.plugins.apache import obj +from certbot._internal.plugins.apache import override_centos +from certbot._internal.tests.plugins.apache import util def get_vh_truth(temp_dir, config_name): @@ -56,7 +56,7 @@ class FedoraRestartTest(util.ApacheTest): self.config.config_test() def test_non_fedora_error(self): - c_test = "certbot_apache._internal.configurator.ApacheConfigurator.config_test" + c_test = "certbot._internal.plugins.apache.configurator.ApacheConfigurator.config_test" with mock.patch(c_test) as mock_test: mock_test.side_effect = errors.MisconfigurationError with mock.patch("certbot.util.get_os_info") as mock_info: @@ -65,7 +65,7 @@ class FedoraRestartTest(util.ApacheTest): self.config.config_test() def test_fedora_restart_error(self): - c_test = "certbot_apache._internal.configurator.ApacheConfigurator.config_test" + c_test = "certbot._internal.plugins.apache.configurator.ApacheConfigurator.config_test" with mock.patch(c_test) as mock_test: # First call raises error, second doesn't mock_test.side_effect = [errors.MisconfigurationError, ''] @@ -75,7 +75,7 @@ class FedoraRestartTest(util.ApacheTest): self._run_fedora_test() def test_fedora_restart(self): - c_test = "certbot_apache._internal.configurator.ApacheConfigurator.config_test" + c_test = "certbot._internal.plugins.apache.configurator.ApacheConfigurator.config_test" with mock.patch(c_test) as mock_test: with mock.patch("certbot.util.run_script") as mock_run: # First call raises error, second doesn't @@ -153,7 +153,7 @@ class MultipleVhostsTestCentOS(util.ApacheTest): def test_get_parser(self): assert isinstance(self.config.parser, override_centos.CentOSParser) - @mock.patch("certbot_apache._internal.apache_util._get_runtime_cfg") + @mock.patch("certbot._internal.plugins.apache.apache_util._get_runtime_cfg") def test_opportunistic_httpd_runtime_parsing(self, mock_get): define_val = ( 'Define: TEST1\n' @@ -202,7 +202,7 @@ class MultipleVhostsTestCentOS(util.ApacheTest): raise Exception("Missed: %s" % vhost) # pragma: no cover assert found == 2 - @mock.patch("certbot_apache._internal.apache_util._get_runtime_cfg") + @mock.patch("certbot._internal.plugins.apache.apache_util._get_runtime_cfg") def test_get_sysconfig_vars(self, mock_cfg): """Make sure we read the sysconfig OPTIONS variable correctly""" # Return nothing for the process calls @@ -223,13 +223,13 @@ class MultipleVhostsTestCentOS(util.ApacheTest): assert "MOCK_NOSEP" in self.config.parser.variables assert "NOSEP_VAL" == self.config.parser.variables["NOSEP_TWO"] - @mock.patch("certbot_apache._internal.configurator.util.run_script") + @mock.patch("certbot._internal.plugins.apache.configurator.util.run_script") def test_alt_restart_works(self, mock_run_script): mock_run_script.side_effect = [None, errors.SubprocessError, None] self.config.restart() assert mock_run_script.call_count == 3 - @mock.patch("certbot_apache._internal.configurator.util.run_script") + @mock.patch("certbot._internal.plugins.apache.configurator.util.run_script") def test_alt_restart_errors(self, mock_run_script): mock_run_script.side_effect = [None, errors.SubprocessError, diff --git a/certbot-apache/src/certbot_apache/_internal/tests/complex_parsing_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/complex_parsing_test.py similarity index 95% rename from certbot-apache/src/certbot_apache/_internal/tests/complex_parsing_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/complex_parsing_test.py index 16ab367c4..1e796ed0e 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/complex_parsing_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/complex_parsing_test.py @@ -1,11 +1,11 @@ -"""Tests for certbot_apache._internal.parser.""" +"""Tests for certbot._internal.plugins.apache.parser.""" import sys import pytest from certbot import errors from certbot.compat import os -from certbot_apache._internal.tests import util +from certbot._internal.tests.plugins.apache import util class ComplexParserTest(util.ParserTest): @@ -80,7 +80,7 @@ class ComplexParserTest(util.ParserTest): def verify_fnmatch(self, arg, hit=True): """Test if Include was correctly parsed.""" - from certbot_apache._internal import parser + from certbot._internal.plugins.apache import parser self.parser.add_dir(parser.get_aug_path(self.parser.loc["default"]), "Include", [arg]) if hit: diff --git a/certbot-apache/src/certbot_apache/_internal/tests/configurator_reverter_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/configurator_reverter_test.py similarity index 94% rename from certbot-apache/src/certbot_apache/_internal/tests/configurator_reverter_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/configurator_reverter_test.py index 1c69334bf..96e980d2f 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/configurator_reverter_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/configurator_reverter_test.py @@ -1,11 +1,11 @@ -"""Test for certbot_apache._internal.configurator implementations of reverter""" +"""Test for certbot._internal.plugins.apache.configurator implementations of reverter""" import sys from unittest import mock import pytest from certbot import errors -from certbot_apache._internal.tests import util +from certbot._internal.tests.plugins.apache import util class ConfiguratorReverterTest(util.ApacheTest): diff --git a/certbot-apache/src/certbot_apache/_internal/tests/configurator_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/configurator_test.py similarity index 91% rename from certbot-apache/src/certbot_apache/_internal/tests/configurator_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/configurator_test.py index c7b9a35c3..07888dbe7 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/configurator_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/configurator_test.py @@ -1,5 +1,5 @@ # pylint: disable=too-many-lines -"""Test for certbot_apache._internal.configurator.""" +"""Test for certbot._internal.plugins.apache.configurator.""" import copy import shutil import socket @@ -17,11 +17,11 @@ from certbot.compat import filesystem from certbot.compat import os from certbot.tests import acme_util from certbot.tests import util as certbot_util -from certbot_apache._internal import apache_util -from certbot_apache._internal import constants -from certbot_apache._internal import obj -from certbot_apache._internal import parser -from certbot_apache._internal.tests import util +from certbot._internal.plugins.apache import apache_util +from certbot._internal.plugins.apache import constants +from certbot._internal.plugins.apache import obj +from certbot._internal.plugins.apache import parser +from certbot._internal.tests.plugins.apache import util class MultipleVhostsTest(util.ApacheTest): @@ -42,13 +42,13 @@ class MultipleVhostsTest(util.ApacheTest): def mocked_deploy_cert(*args, **kwargs): """a helper to mock a deployed cert""" - g_mod = "certbot_apache._internal.configurator.ApacheConfigurator.enable_mod" + g_mod = "certbot._internal.plugins.apache.configurator.ApacheConfigurator.enable_mod" with mock.patch(g_mod): config.real_deploy_cert(*args, **kwargs) self.config.deploy_cert = mocked_deploy_cert return self.config - @mock.patch("certbot_apache._internal.configurator.path_surgery") + @mock.patch("certbot._internal.plugins.apache.configurator.path_surgery") def test_prepare_no_install(self, mock_surgery): silly_path = {"PATH": "/tmp/nothingness2342"} mock_surgery.return_value = False @@ -57,8 +57,8 @@ class MultipleVhostsTest(util.ApacheTest): self.config.prepare() assert mock_surgery.call_count == 1 - @mock.patch("certbot_apache._internal.parser.ApacheParser") - @mock.patch("certbot_apache._internal.configurator.util.exe_exists") + @mock.patch("certbot._internal.plugins.apache.parser.ApacheParser") + @mock.patch("certbot._internal.plugins.apache.configurator.util.exe_exists") def test_prepare_version(self, mock_exe_exists, _): mock_exe_exists.return_value = True self.config.version = None @@ -81,9 +81,9 @@ class MultipleVhostsTest(util.ApacheTest): os.remove(os.path.join(server_root, ".certbot.lock")) certbot_util.lock_and_call(self._test_prepare_locked, server_root) - @mock.patch("certbot_apache._internal.parser.ApacheParser") - @mock.patch("certbot_apache._internal.configurator.util.exe_exists") - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.get_parsernode_root") + @mock.patch("certbot._internal.plugins.apache.parser.ApacheParser") + @mock.patch("certbot._internal.plugins.apache.configurator.util.exe_exists") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator.get_parsernode_root") def _test_prepare_locked(self, _node, _exists, _parser): try: self.config.prepare() @@ -95,14 +95,14 @@ class MultipleVhostsTest(util.ApacheTest): self.fail("Exception wasn't raised!") def test_add_parser_arguments(self): # pylint: disable=no-self-use - from certbot_apache._internal.configurator import ApacheConfigurator + from certbot._internal.plugins.apache.configurator import ApacheConfigurator # Weak test.. ApacheConfigurator.add_parser_arguments(mock.MagicMock()) def test_docs_parser_arguments(self): os.environ["CERTBOT_DOCS"] = "1" - from certbot_apache._internal.configurator import ApacheConfigurator + from certbot._internal.plugins.apache.configurator import ApacheConfigurator mock_add = mock.MagicMock() ApacheConfigurator.add_parser_arguments(mock_add) parserargs = ["server_root", "enmod", "dismod", "le_vhost_ext", @@ -129,13 +129,13 @@ class MultipleVhostsTest(util.ApacheTest): del os.environ["CERTBOT_DOCS"] def test_add_parser_arguments_all_configurators(self): # pylint: disable=no-self-use - from certbot_apache._internal.entrypoint import OVERRIDE_CLASSES + from certbot._internal.plugins.apache.entrypoint import OVERRIDE_CLASSES for cls in OVERRIDE_CLASSES.values(): cls.add_parser_arguments(mock.MagicMock()) def test_all_configurators_defaults_defined(self): - from certbot_apache._internal.configurator import ApacheConfigurator - from certbot_apache._internal.entrypoint import OVERRIDE_CLASSES + from certbot._internal.plugins.apache.configurator import ApacheConfigurator + from certbot._internal.plugins.apache.entrypoint import OVERRIDE_CLASSES parameters = set(ApacheConfigurator.OS_DEFAULTS.__dict__.keys()) for cls in OVERRIDE_CLASSES.values(): assert parameters.issubset(set(cls.OS_DEFAULTS.__dict__.keys())) is True @@ -153,7 +153,7 @@ class MultipleVhostsTest(util.ApacheTest): "duplicate.example.com"} @certbot_util.patch_display_util() - @mock.patch("certbot_apache._internal.configurator.socket.gethostbyaddr") + @mock.patch("certbot._internal.plugins.apache.configurator.socket.gethostbyaddr") def test_get_all_names_addrs(self, mock_gethost, mock_getutility): mock_gethost.side_effect = [("google.com", "", ""), socket.error] mock_utility = mock_getutility() @@ -179,7 +179,7 @@ class MultipleVhostsTest(util.ApacheTest): assert self.config._create_vhost("nonexistent") is None # pylint: disable=protected-access def test_get_aug_internal_path(self): - from certbot_apache._internal.apache_util import get_internal_aug_path + from certbot._internal.plugins.apache.apache_util import get_internal_aug_path internal_paths = [ "Virtualhost", "IfModule/VirtualHost", "VirtualHost", "VirtualHost", "Macro/VirtualHost", "IfModule/VirtualHost", "VirtualHost", @@ -221,25 +221,25 @@ class MultipleVhostsTest(util.ApacheTest): # Handle case of non-debian layout get_virtual_hosts with mock.patch( - "certbot_apache._internal.configurator.ApacheConfigurator.conf" + "certbot._internal.plugins.apache.configurator.ApacheConfigurator.conf" ) as mock_conf: mock_conf.return_value = False vhs = self.config.get_virtual_hosts() assert len(vhs) == 12 - @mock.patch("certbot_apache._internal.display_ops.select_vhost") + @mock.patch("certbot._internal.plugins.apache.display_ops.select_vhost") def test_choose_vhost_none_avail(self, mock_select): mock_select.return_value = None with pytest.raises(errors.PluginError): self.config.choose_vhost("none.com") - @mock.patch("certbot_apache._internal.display_ops.select_vhost") + @mock.patch("certbot._internal.plugins.apache.display_ops.select_vhost") def test_choose_vhost_select_vhost_ssl(self, mock_select): mock_select.return_value = self.vh_truth[1] assert self.vh_truth[1] == self.config.choose_vhost("none.com") - @mock.patch("certbot_apache._internal.display_ops.select_vhost") - @mock.patch("certbot_apache._internal.obj.VirtualHost.conflicts") + @mock.patch("certbot._internal.plugins.apache.display_ops.select_vhost") + @mock.patch("certbot._internal.plugins.apache.obj.VirtualHost.conflicts") def test_choose_vhost_select_vhost_non_ssl(self, mock_conf, mock_select): mock_select.return_value = self.vh_truth[0] mock_conf.return_value = False @@ -251,8 +251,8 @@ class MultipleVhostsTest(util.ApacheTest): assert self.vh_truth[0].ssl is False assert chosen_vhost.ssl is True - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator._find_best_vhost") - @mock.patch("certbot_apache._internal.parser.ApacheParser.add_dir") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator._find_best_vhost") + @mock.patch("certbot._internal.plugins.apache.parser.ApacheParser.add_dir") def test_choose_vhost_and_servername_addition(self, mock_add, mock_find): ret_vh = self.vh_truth[8] ret_vh.enabled = False @@ -260,13 +260,13 @@ class MultipleVhostsTest(util.ApacheTest): self.config.choose_vhost("whatever.com") assert mock_add.called is True - @mock.patch("certbot_apache._internal.display_ops.select_vhost") + @mock.patch("certbot._internal.plugins.apache.display_ops.select_vhost") def test_choose_vhost_select_vhost_with_temp(self, mock_select): mock_select.return_value = self.vh_truth[0] chosen_vhost = self.config.choose_vhost("none.com", create_if_no_ssl=False) assert self.vh_truth[0] == chosen_vhost - @mock.patch("certbot_apache._internal.display_ops.select_vhost") + @mock.patch("certbot._internal.plugins.apache.display_ops.select_vhost") def test_choose_vhost_select_vhost_conflicting_non_ssl(self, mock_select): mock_select.return_value = self.vh_truth[3] conflicting_vhost = obj.VirtualHost( @@ -332,7 +332,7 @@ class MultipleVhostsTest(util.ApacheTest): vhosts = self.config._non_default_vhosts(self.config.vhosts) assert len(vhosts) == 10 - @mock.patch('certbot_apache._internal.configurator.display_util.notify') + @mock.patch('certbot._internal.plugins.apache.configurator.display_util.notify') def test_deploy_cert_enable_new_vhost(self, unused_mock_notify): # Create ssl_vhost = self.config.make_vhost_ssl(self.vh_truth[0]) @@ -371,7 +371,7 @@ class MultipleVhostsTest(util.ApacheTest): self.fail("Include shouldn't be added, as patched find_dir 'finds' existing one") \ # pragma: no cover - @mock.patch('certbot_apache._internal.configurator.display_util.notify') + @mock.patch('certbot._internal.plugins.apache.configurator.display_util.notify') def test_deploy_cert(self, unused_mock_notify): self.config.parser.modules["ssl_module"] = None self.config.parser.modules["mod_ssl.c"] = None @@ -480,7 +480,7 @@ class MultipleVhostsTest(util.ApacheTest): call_found = True assert call_found is True - @mock.patch("certbot_apache._internal.parser.ApacheParser.reset_modules") + @mock.patch("certbot._internal.plugins.apache.parser.ApacheParser.reset_modules") def test_prepare_server_https(self, mock_reset): mock_enable = mock.Mock() self.config.enable_mod = mock_enable @@ -507,7 +507,7 @@ class MultipleVhostsTest(util.ApacheTest): assert mock_add_dir.call_count == 2 - @mock.patch("certbot_apache._internal.parser.ApacheParser.reset_modules") + @mock.patch("certbot._internal.plugins.apache.parser.ApacheParser.reset_modules") def test_prepare_server_https_named_listen(self, mock_reset): mock_find = mock.Mock() mock_find.return_value = ["test1", "test2", "test3"] @@ -545,7 +545,7 @@ class MultipleVhostsTest(util.ApacheTest): # self.config.prepare_server_https("8080", temp=True) # self.assertEqual(self.listens, 0) - @mock.patch("certbot_apache._internal.parser.ApacheParser.reset_modules") + @mock.patch("certbot._internal.plugins.apache.parser.ApacheParser.reset_modules") def test_prepare_server_https_needed_listen(self, mock_reset): mock_find = mock.Mock() mock_find.return_value = ["test1", "test2"] @@ -562,7 +562,7 @@ class MultipleVhostsTest(util.ApacheTest): self.config.prepare_server_https("443") assert mock_add_dir.call_count == 1 - @mock.patch("certbot_apache._internal.parser.ApacheParser.reset_modules") + @mock.patch("certbot._internal.plugins.apache.parser.ApacheParser.reset_modules") def test_prepare_server_https_mixed_listen(self, mock_reset): mock_find = mock.Mock() mock_find.return_value = ["test1", "test2"] @@ -697,8 +697,8 @@ class MultipleVhostsTest(util.ApacheTest): # pylint: disable=protected-access assert self.config._get_ssl_vhost_path("example_path").endswith(".conf") is True - @mock.patch("certbot_apache._internal.configurator.http_01.ApacheHttp01.perform") - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.restart") + @mock.patch("certbot._internal.plugins.apache.configurator.http_01.ApacheHttp01.perform") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator.restart") def test_perform(self, mock_restart, mock_http_perform): # Only tests functionality specific to configurator.perform # Note: As more challenges are offered this will have to be expanded @@ -714,8 +714,8 @@ class MultipleVhostsTest(util.ApacheTest): assert mock_restart.call_count == 1 - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.restart") - @mock.patch("certbot_apache._internal.apache_util._get_runtime_cfg") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator.restart") + @mock.patch("certbot._internal.plugins.apache.apache_util._get_runtime_cfg") def test_cleanup(self, mock_cfg, mock_restart): mock_cfg.return_value = "" _, achalls = self.get_key_and_achalls() @@ -730,8 +730,8 @@ class MultipleVhostsTest(util.ApacheTest): else: assert mock_restart.called is False - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.restart") - @mock.patch("certbot_apache._internal.apache_util._get_runtime_cfg") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator.restart") + @mock.patch("certbot._internal.plugins.apache.apache_util._get_runtime_cfg") def test_cleanup_no_errors(self, mock_cfg, mock_restart): mock_cfg.return_value = "" _, achalls = self.get_key_and_achalls() @@ -771,11 +771,11 @@ class MultipleVhostsTest(util.ApacheTest): with pytest.raises(errors.PluginError): self.config.get_version() - @mock.patch("certbot_apache._internal.configurator.util.run_script") + @mock.patch("certbot._internal.plugins.apache.configurator.util.run_script") def test_restart(self, _): self.config.restart() - @mock.patch("certbot_apache._internal.configurator.util.run_script") + @mock.patch("certbot._internal.plugins.apache.configurator.util.run_script") def test_restart_bad_process(self, mock_run_script): mock_run_script.side_effect = [None, errors.SubprocessError] @@ -819,8 +819,8 @@ class MultipleVhostsTest(util.ApacheTest): assert self.vh_truth[0].name == res.name assert self.vh_truth[0].aliases == res.aliases - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator._get_http_vhost") - @mock.patch("certbot_apache._internal.display_ops.select_vhost") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator._get_http_vhost") + @mock.patch("certbot._internal.plugins.apache.display_ops.select_vhost") @mock.patch("certbot.util.exe_exists") def test_enhance_unknown_vhost(self, mock_exe, mock_sel_vhost, mock_get): self.config.parser.modules["rewrite_module"] = None @@ -841,7 +841,7 @@ class MultipleVhostsTest(util.ApacheTest): self.config.enhance("certbot.demo", "unknown_enhancement") def test_enhance_no_ssl_vhost(self): - with mock.patch("certbot_apache._internal.configurator.logger.error") as mock_log: + with mock.patch("certbot._internal.plugins.apache.configurator.logger.error") as mock_log: with pytest.raises(errors.PluginError): self.config.enhance("certbot.demo", "redirect") # Check that correct logger.warning was printed @@ -1130,7 +1130,7 @@ class MultipleVhostsTest(util.ApacheTest): self.config.choose_vhost("red.blue.purple.com") self.config.enhance("red.blue.purple.com", "redirect") - verify_no_redirect = ("certbot_apache._internal.configurator." + verify_no_redirect = ("certbot._internal.plugins.apache.configurator." "ApacheConfigurator._verify_no_certbot_redirect") with mock.patch(verify_no_redirect) as mock_verify: self.config.enhance("green.blue.purple.com", "redirect") @@ -1223,7 +1223,7 @@ class MultipleVhostsTest(util.ApacheTest): assert os.path.basename(inc_path) in self.config.parser.existing_paths[ os.path.dirname(inc_path)] - @mock.patch('certbot_apache._internal.configurator.display_util.notify') + @mock.patch('certbot._internal.plugins.apache.configurator.display_util.notify') def test_deploy_cert_not_parsed_path(self, unused_mock_notify): # Make sure that we add include to root config for vhosts when # handle-sites is false @@ -1232,8 +1232,8 @@ class MultipleVhostsTest(util.ApacheTest): self.config.parser.modules["socache_shmcb_module"] = None tmp_path = filesystem.realpath(tempfile.mkdtemp("vhostroot")) filesystem.chmod(tmp_path, 0o755) - mock_p = "certbot_apache._internal.configurator.ApacheConfigurator._get_ssl_vhost_path" - mock_a = "certbot_apache._internal.parser.ApacheParser.add_include" + mock_p = "certbot._internal.plugins.apache.configurator.ApacheConfigurator._get_ssl_vhost_path" + mock_a = "certbot._internal.plugins.apache.parser.ApacheParser.add_include" with mock.patch(mock_p) as mock_path: mock_path.return_value = os.path.join(tmp_path, "whatever.conf") @@ -1256,7 +1256,7 @@ class MultipleVhostsTest(util.ApacheTest): self.config.deploy_cert("encryption-example.demo", "example/cert.pem", "example/key.pem", "example/cert_chain.pem", "example/fullchain.pem") - @mock.patch("certbot_apache._internal.parser.ApacheParser.parsed_in_original") + @mock.patch("certbot._internal.plugins.apache.parser.ApacheParser.parsed_in_original") def test_choose_vhost_and_servername_addition_parsed(self, mock_parsed): ret_vh = self.vh_truth[8] ret_vh.enabled = True @@ -1270,7 +1270,7 @@ class MultipleVhostsTest(util.ApacheTest): def test_choose_vhosts_wildcard(self): # pylint: disable=protected-access - mock_path = "certbot_apache._internal.display_ops.select_vhost_multiple" + mock_path = "certbot._internal.plugins.apache.display_ops.select_vhost_multiple" with mock.patch(mock_path) as mock_select_vhs: mock_select_vhs.return_value = [self.vh_truth[3]] vhs = self.config._choose_vhosts_wildcard("*.certbot.demo", @@ -1286,10 +1286,10 @@ class MultipleVhostsTest(util.ApacheTest): assert vhs[0] != self.vh_truth[3] - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.make_vhost_ssl") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator.make_vhost_ssl") def test_choose_vhosts_wildcard_no_ssl(self, mock_makessl): # pylint: disable=protected-access - mock_path = "certbot_apache._internal.display_ops.select_vhost_multiple" + mock_path = "certbot._internal.plugins.apache.display_ops.select_vhost_multiple" with mock.patch(mock_path) as mock_select_vhs: mock_select_vhs.return_value = [self.vh_truth[1]] vhs = self.config._choose_vhosts_wildcard("*.certbot.demo", @@ -1297,13 +1297,13 @@ class MultipleVhostsTest(util.ApacheTest): assert mock_makessl.called is False assert vhs[0] == self.vh_truth[1] - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator._vhosts_for_wildcard") - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.make_vhost_ssl") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator._vhosts_for_wildcard") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator.make_vhost_ssl") def test_choose_vhosts_wildcard_already_ssl(self, mock_makessl, mock_vh_for_w): # pylint: disable=protected-access # Already SSL vhost mock_vh_for_w.return_value = [self.vh_truth[7]] - mock_path = "certbot_apache._internal.display_ops.select_vhost_multiple" + mock_path = "certbot._internal.plugins.apache.display_ops.select_vhost_multiple" with mock.patch(mock_path) as mock_select_vhs: mock_select_vhs.return_value = [self.vh_truth[7]] vhs = self.config._choose_vhosts_wildcard("whatever", @@ -1318,13 +1318,13 @@ class MultipleVhostsTest(util.ApacheTest): assert vhs[0].ssl is True assert vhs[0] == self.vh_truth[7] - @mock.patch('certbot_apache._internal.configurator.display_util.notify') + @mock.patch('certbot._internal.plugins.apache.configurator.display_util.notify') def test_deploy_cert_wildcard(self, unused_mock_notify): # pylint: disable=protected-access mock_choose_vhosts = mock.MagicMock() mock_choose_vhosts.return_value = [self.vh_truth[7]] self.config._choose_vhosts_wildcard = mock_choose_vhosts - mock_d = "certbot_apache._internal.configurator.ApacheConfigurator._deploy_cert" + mock_d = "certbot._internal.plugins.apache.configurator.ApacheConfigurator._deploy_cert" with mock.patch(mock_d) as mock_dep: self.config.deploy_cert("*.wildcard.example.org", "/tmp/path", "/tmp/path", "/tmp/path", "/tmp/path") @@ -1332,7 +1332,7 @@ class MultipleVhostsTest(util.ApacheTest): assert len(mock_dep.call_args_list) == 1 assert self.vh_truth[7] == mock_dep.call_args_list[0][0][0] - @mock.patch("certbot_apache._internal.display_ops.select_vhost_multiple") + @mock.patch("certbot._internal.plugins.apache.display_ops.select_vhost_multiple") def test_deploy_cert_wildcard_no_vhosts(self, mock_dialog): # pylint: disable=protected-access mock_dialog.return_value = [] @@ -1340,7 +1340,7 @@ class MultipleVhostsTest(util.ApacheTest): self.config.deploy_cert("*.wild.cat", "/tmp/path", "/tmp/path", "/tmp/path", "/tmp/path") - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator._choose_vhosts_wildcard") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator._choose_vhosts_wildcard") def test_enhance_wildcard_after_install(self, mock_choose): # pylint: disable=protected-access self.config.parser.modules["mod_ssl.c"] = None @@ -1351,7 +1351,7 @@ class MultipleVhostsTest(util.ApacheTest): "Upgrade-Insecure-Requests") assert mock_choose.called is False - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator._choose_vhosts_wildcard") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator._choose_vhosts_wildcard") def test_enhance_wildcard_no_install(self, mock_choose): self.vh_truth[3].ssl = True mock_choose.return_value = [self.vh_truth[3]] @@ -1427,7 +1427,7 @@ class AugeasVhostsTest(util.ApacheTest): chosen_vhost = self.config._create_vhost(path) assert chosen_vhost is None or chosen_vhost.path == path - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator._create_vhost") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator._create_vhost") def test_get_vhost_continue(self, mock_vhost): mock_vhost.return_value = None vhs = self.config.get_virtual_hosts() @@ -1440,18 +1440,18 @@ class AugeasVhostsTest(util.ApacheTest): with self.subTest(name=name): assert name not in self.config.choose_vhost(name).aliases - @mock.patch("certbot_apache._internal.obj.VirtualHost.conflicts") + @mock.patch("certbot._internal.plugins.apache.obj.VirtualHost.conflicts") def test_choose_vhost_without_matching_wildcard(self, mock_conflicts): mock_conflicts.return_value = False - mock_path = "certbot_apache._internal.display_ops.select_vhost" + mock_path = "certbot._internal.plugins.apache.display_ops.select_vhost" with mock.patch(mock_path, lambda _, vhosts: vhosts[0]): for name in ("a.example.net", "other.example.net"): assert name in self.config.choose_vhost(name).aliases - @mock.patch("certbot_apache._internal.obj.VirtualHost.conflicts") + @mock.patch("certbot._internal.plugins.apache.obj.VirtualHost.conflicts") def test_choose_vhost_wildcard_not_found(self, mock_conflicts): mock_conflicts.return_value = False - mock_path = "certbot_apache._internal.display_ops.select_vhost" + mock_path = "certbot._internal.plugins.apache.display_ops.select_vhost" names = ( "abc.example.net", "not.there.tld", "aa.wildcard.tld" ) @@ -1463,7 +1463,7 @@ class AugeasVhostsTest(util.ApacheTest): assert mock_select.call_count - orig_cc == 1 def test_choose_vhost_wildcard_found(self): - mock_path = "certbot_apache._internal.display_ops.select_vhost" + mock_path = "certbot._internal.plugins.apache.display_ops.select_vhost" names = ( "ab.example.net", "a.wildcard.tld", "yetanother.example.net" ) @@ -1511,7 +1511,7 @@ class MultiVhostsTest(util.ApacheTest): assert ssl_vhost.ssl is True assert ssl_vhost.enabled is False - mock_path = "certbot_apache._internal.configurator.ApacheConfigurator._get_new_vh_path" + mock_path = "certbot._internal.plugins.apache.configurator.ApacheConfigurator._get_new_vh_path" with mock.patch(mock_path) as mock_getpath: mock_getpath.return_value = None with pytest.raises(errors.PluginError): @@ -1527,7 +1527,7 @@ class MultiVhostsTest(util.ApacheTest): both = with_index_1 + with_index_2 assert self.config._get_new_vh_path(without_index, both) == with_index_2[0] - @mock.patch("certbot_apache._internal.configurator.display_util.notify") + @mock.patch("certbot._internal.plugins.apache.configurator.display_util.notify") def test_make_vhost_ssl_with_existing_rewrite_rule(self, mock_notify): self.config.parser.modules["rewrite_module"] = None @@ -1546,7 +1546,7 @@ class MultiVhostsTest(util.ApacheTest): assert mock_notify.call_count == 1 assert "Some rewrite rules" in mock_notify.call_args[0][0] - @mock.patch("certbot_apache._internal.configurator.display_util.notify") + @mock.patch("certbot._internal.plugins.apache.configurator.display_util.notify") def test_make_vhost_ssl_with_existing_rewrite_conds(self, mock_notify): self.config.parser.modules["rewrite_module"] = None @@ -1611,7 +1611,7 @@ class InstallSslOptionsConfTest(util.ApacheTest): self._assert_current_file() def test_prev_file_updates_to_current(self): - from certbot_apache._internal.constants import ALL_SSL_OPTIONS_HASHES + from certbot._internal.plugins.apache.constants import ALL_SSL_OPTIONS_HASHES ALL_SSL_OPTIONS_HASHES.insert(0, "test_hash_does_not_match") with mock.patch('certbot.crypto_util.sha256sum') as mock_sha256: mock_sha256.return_value = ALL_SSL_OPTIONS_HASHES[0] @@ -1649,8 +1649,8 @@ class InstallSslOptionsConfTest(util.ApacheTest): self._call() assert mock_logger.warning.called is False - @mock.patch('certbot_apache._internal.configurator.logger.warning') - @mock.patch('certbot_apache._internal.configurator.ApacheConfigurator.openssl_version') + @mock.patch('certbot._internal.plugins.apache.configurator.logger.warning') + @mock.patch('certbot._internal.plugins.apache.configurator.ApacheConfigurator.openssl_version') def test_pick_apache_config_versions_and_warnings(self, mock_openssl_version, mock_warning): def has_logged_warning(): """Returns True if a warning was logged about updating Apache.""" @@ -1702,9 +1702,9 @@ class InstallSslOptionsConfTest(util.ApacheTest): """ import importlib.resources - from certbot_apache._internal.constants import ALL_SSL_OPTIONS_HASHES + from certbot._internal.plugins.apache.constants import ALL_SSL_OPTIONS_HASHES - ref = importlib.resources.files("certbot_apache") / "_internal" / "tls_configs" + ref = importlib.resources.files("certbot") / "_internal" / "plugins" /"apache" / "tls_configs" with importlib.resources.as_file(ref) as tls_configs_dir: all_files = [os.path.join(tls_configs_dir, name) for name in os.listdir(tls_configs_dir) if name.endswith('options-ssl-apache.conf')] @@ -1730,7 +1730,7 @@ class InstallSslOptionsConfTest(util.ApacheTest): """ # ssl_module as a DSO self.config.parser.modules['ssl_module'] = '/fake/path' - with mock.patch("certbot_apache._internal.configurator." + with mock.patch("certbot._internal.plugins.apache.configurator." "ApacheConfigurator._open_module_file") as mock_omf: mock_omf.return_value = some_string_contents assert self.config.openssl_version() == "1.0.2g" @@ -1739,7 +1739,7 @@ class InstallSslOptionsConfTest(util.ApacheTest): self.config._openssl_version = None self.config.parser.modules['ssl_module'] = None self.config.options.bin = '/fake/path/to/httpd' - with mock.patch("certbot_apache._internal.configurator." + with mock.patch("certbot._internal.plugins.apache.configurator." "ApacheConfigurator._open_module_file") as mock_omf: mock_omf.return_value = some_string_contents assert self.config.openssl_version() == "1.0.2g" @@ -1749,14 +1749,14 @@ class InstallSslOptionsConfTest(util.ApacheTest): assert self.config.openssl_version() == '1.0.2a' self.config._openssl_version = None - with mock.patch("certbot_apache._internal.configurator.logger.warning") as mock_log: + with mock.patch("certbot._internal.plugins.apache.configurator.logger.warning") as mock_log: assert self.config.openssl_version() is None assert "Could not find ssl_module" in mock_log.call_args[0][0] # When no ssl_module is present at all self.config._openssl_version = None assert "ssl_module" not in self.config.parser.modules - with mock.patch("certbot_apache._internal.configurator.logger.warning") as mock_log: + with mock.patch("certbot._internal.plugins.apache.configurator.logger.warning") as mock_log: assert self.config.openssl_version() is None assert "Could not find ssl_module" in mock_log.call_args[0][0] @@ -1764,21 +1764,21 @@ class InstallSslOptionsConfTest(util.ApacheTest): self.config._openssl_version = None self.config.options.bin = None self.config.parser.modules['ssl_module'] = None - with mock.patch("certbot_apache._internal.configurator.logger.warning") as mock_log: + with mock.patch("certbot._internal.plugins.apache.configurator.logger.warning") as mock_log: assert self.config.openssl_version() is None assert "ssl_module is statically linked but" in mock_log.call_args[0][0] self.config.parser.modules['ssl_module'] = "/fake/path" - with mock.patch("certbot_apache._internal.configurator.logger.warning") as mock_log: + with mock.patch("certbot._internal.plugins.apache.configurator.logger.warning") as mock_log: # Check that correct logger.warning was printed assert self.config.openssl_version() is None assert "Unable to read" in mock_log.call_args[0][0] contents_missing_openssl = b"these contents won't match the regex" - with mock.patch("certbot_apache._internal.configurator." + with mock.patch("certbot._internal.plugins.apache.configurator." "ApacheConfigurator._open_module_file") as mock_omf: mock_omf.return_value = contents_missing_openssl - with mock.patch("certbot_apache._internal.configurator.logger.warning") as mock_log: + with mock.patch("certbot._internal.plugins.apache.configurator.logger.warning") as mock_log: # Check that correct logger.warning was printed assert self.config.openssl_version() is None assert "Could not find OpenSSL" in mock_log.call_args[0][0] diff --git a/certbot-apache/src/certbot_apache/_internal/tests/conftest.py b/certbot/src/certbot/_internal/tests/plugins/apache/conftest.py similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/conftest.py rename to certbot/src/certbot/_internal/tests/plugins/apache/conftest.py diff --git a/certbot/src/certbot/_internal/tests/plugins/apache/constants_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/constants_test.py new file mode 100644 index 000000000..d155b85be --- /dev/null +++ b/certbot/src/certbot/_internal/tests/plugins/apache/constants_test.py @@ -0,0 +1,15 @@ +"""Tests for certbot._internal.plugins.apache.constants""" +import sys +import os.path + +import pytest + +from certbot._internal.plugins.apache import constants + + +def test_augeas_lens_dir_exists(): + assert os.path.exists(constants.AUGEAS_LENS_DIR) + + +if __name__ == "__main__": + sys.exit(pytest.main(sys.argv[1:] + [__file__])) # pragma: no cover diff --git a/certbot-apache/src/certbot_apache/_internal/tests/debian_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/debian_test.py similarity index 93% rename from certbot-apache/src/certbot_apache/_internal/tests/debian_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/debian_test.py index e97524417..06563b9de 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/debian_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/debian_test.py @@ -1,4 +1,4 @@ -"""Test for certbot_apache._internal.configurator for Debian overrides""" +"""Test for certbot._internal.plugins.apache.configurator for Debian overrides""" import shutil import sys from unittest import mock @@ -8,9 +8,9 @@ import pytest from certbot import errors from certbot.compat import os from certbot.tests import util as certbot_util -from certbot_apache._internal import apache_util -from certbot_apache._internal import obj -from certbot_apache._internal.tests import util +from certbot._internal.plugins.apache import apache_util +from certbot._internal.plugins.apache import obj +from certbot._internal.tests.plugins.apache import util class MultipleVhostsTestDebian(util.ApacheTest): @@ -31,8 +31,8 @@ class MultipleVhostsTestDebian(util.ApacheTest): def mocked_deploy_cert(*args, **kwargs): """a helper to mock a deployed cert""" - g_mod = "certbot_apache._internal.configurator.ApacheConfigurator.enable_mod" - d_mod = "certbot_apache._internal.override_debian.DebianConfigurator.enable_mod" + g_mod = "certbot._internal.plugins.apache.configurator.ApacheConfigurator.enable_mod" + d_mod = "certbot._internal.plugins.apache.override_debian.DebianConfigurator.enable_mod" with mock.patch(g_mod): with mock.patch(d_mod): config.real_deploy_cert(*args, **kwargs) @@ -46,7 +46,7 @@ class MultipleVhostsTestDebian(util.ApacheTest): @mock.patch("certbot.util.run_script") @mock.patch("certbot.util.exe_exists") - @mock.patch("certbot_apache._internal.apache_util.subprocess.run") + @mock.patch("certbot._internal.plugins.apache.apache_util.subprocess.run") def test_enable_mod(self, mock_run, mock_exe_exists, mock_run_script): mock_run.return_value.stdout = "Define: DUMP_RUN_CFG" mock_run.return_value.stderr = "" @@ -194,7 +194,7 @@ class MultipleVhostsTestDebian(util.ApacheTest): def test_enable_site_call_parent(self): with mock.patch( - "certbot_apache._internal.configurator.ApacheConfigurator.enable_site") as e_s: + "certbot._internal.plugins.apache.configurator.ApacheConfigurator.enable_site") as e_s: self.config.parser.root = "/tmp/nonexistent" vh = self.vh_truth[0] vh.enabled = False diff --git a/certbot-apache/src/certbot_apache/_internal/tests/display_ops_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/display_ops_test.py similarity index 83% rename from certbot-apache/src/certbot_apache/_internal/tests/display_ops_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/display_ops_test.py index d08508d3d..925b86968 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/display_ops_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/display_ops_test.py @@ -1,4 +1,4 @@ -"""Test certbot_apache._internal.display_ops.""" +"""Test certbot._internal.plugins.apache.display_ops.""" import sys import unittest from unittest import mock @@ -8,13 +8,13 @@ import pytest from certbot import errors from certbot.display import util as display_util from certbot.tests import util as certbot_util -from certbot_apache._internal import obj -from certbot_apache._internal.display_ops import select_vhost_multiple -from certbot_apache._internal.tests import util +from certbot._internal.plugins.apache import obj +from certbot._internal.plugins.apache.display_ops import select_vhost_multiple +from certbot._internal.tests.plugins.apache import util class SelectVhostMultiTest(unittest.TestCase): - """Tests for certbot_apache._internal.display_ops.select_vhost_multiple.""" + """Tests for certbot._internal.plugins.apache.display_ops.select_vhost_multiple.""" def setUp(self): self.base_dir = "/example_path" @@ -44,7 +44,7 @@ class SelectVhostMultiTest(unittest.TestCase): class SelectVhostTest(unittest.TestCase): - """Tests for certbot_apache._internal.display_ops.select_vhost.""" + """Tests for certbot._internal.plugins.apache.display_ops.select_vhost.""" def setUp(self): self.base_dir = "/example_path" @@ -53,7 +53,7 @@ class SelectVhostTest(unittest.TestCase): @classmethod def _call(cls, vhosts): - from certbot_apache._internal.display_ops import select_vhost + from certbot._internal.plugins.apache.display_ops import select_vhost return select_vhost("example.com", vhosts) @certbot_util.patch_display_util() @@ -80,8 +80,8 @@ class SelectVhostTest(unittest.TestCase): def test_no_vhosts(self): assert self._call([]) is None - @mock.patch("certbot_apache._internal.display_ops.display_util") - @mock.patch("certbot_apache._internal.display_ops.logger") + @mock.patch("certbot._internal.plugins.apache.display_ops.display_util") + @mock.patch("certbot._internal.plugins.apache.display_ops.logger") def test_small_display(self, mock_logger, mock_display_util): mock_display_util.WIDTH = 20 mock_display_util.menu.return_value = (display_util.OK, 0) diff --git a/certbot-apache/src/certbot_apache/_internal/tests/dualnode_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/dualnode_test.py similarity index 99% rename from certbot-apache/src/certbot_apache/_internal/tests/dualnode_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/dualnode_test.py index e0be5b4bb..4778a324d 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/dualnode_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/dualnode_test.py @@ -2,9 +2,9 @@ import unittest from unittest import mock -from certbot_apache._internal import assertions -from certbot_apache._internal import augeasparser -from certbot_apache._internal import dualparser +from certbot._internal.plugins.apache import assertions +from certbot._internal.plugins.apache import augeasparser +from certbot._internal.plugins.apache import dualparser import pytest diff --git a/certbot-apache/src/certbot_apache/_internal/tests/entrypoint_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/entrypoint_test.py similarity index 88% rename from certbot-apache/src/certbot_apache/_internal/tests/entrypoint_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/entrypoint_test.py index ca4a22400..23d7acd55 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/entrypoint_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/entrypoint_test.py @@ -1,11 +1,11 @@ -"""Test for certbot_apache._internal.entrypoint for override class resolution""" +"""Test for certbot._internal.plugins.apache.entrypoint for override class resolution""" import sys from unittest import mock import pytest -from certbot_apache._internal import configurator -from certbot_apache._internal import entrypoint +from certbot._internal.plugins.apache import configurator +from certbot._internal.plugins.apache import entrypoint def test_get_configurator(): diff --git a/certbot-apache/src/certbot_apache/_internal/tests/fedora_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/fedora_test.py similarity index 89% rename from certbot-apache/src/certbot_apache/_internal/tests/fedora_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/fedora_test.py index dde7e063a..8e515a02d 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/fedora_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/fedora_test.py @@ -1,4 +1,4 @@ -"""Test for certbot_apache._internal.configurator for Fedora 29+ overrides""" +"""Test for certbot._internal.plugins.apache.configurator for Fedora 29+ overrides""" import sys from unittest import mock @@ -7,9 +7,9 @@ import pytest from certbot import errors from certbot.compat import filesystem from certbot.compat import os -from certbot_apache._internal import obj -from certbot_apache._internal import override_fedora -from certbot_apache._internal.tests import util +from certbot._internal.plugins.apache import obj +from certbot._internal.plugins.apache import override_fedora +from certbot._internal.tests.plugins.apache import util def get_vh_truth(temp_dir, config_name): @@ -58,7 +58,7 @@ class FedoraRestartTest(util.ApacheTest): self.config.config_test() def test_fedora_restart_error(self): - c_test = "certbot_apache._internal.configurator.ApacheConfigurator.config_test" + c_test = "certbot._internal.plugins.apache.configurator.ApacheConfigurator.config_test" with mock.patch(c_test) as mock_test: # First call raises error, second doesn't mock_test.side_effect = [errors.MisconfigurationError, ''] @@ -68,7 +68,7 @@ class FedoraRestartTest(util.ApacheTest): self._run_fedora_test() def test_fedora_restart(self): - c_test = "certbot_apache._internal.configurator.ApacheConfigurator.config_test" + c_test = "certbot._internal.plugins.apache.configurator.ApacheConfigurator.config_test" with mock.patch(c_test) as mock_test: with mock.patch("certbot.util.run_script") as mock_run: # First call raises error, second doesn't @@ -99,7 +99,7 @@ class MultipleVhostsTestFedora(util.ApacheTest): def test_get_parser(self): assert isinstance(self.config.parser, override_fedora.FedoraParser) - @mock.patch("certbot_apache._internal.apache_util._get_runtime_cfg") + @mock.patch("certbot._internal.plugins.apache.apache_util._get_runtime_cfg") def test_opportunistic_httpd_runtime_parsing(self, mock_get): define_val = ( 'Define: TEST1\n' @@ -133,7 +133,7 @@ class MultipleVhostsTestFedora(util.ApacheTest): assert "TEST2" in self.config.parser.variables assert "mod_another.c" in self.config.parser.modules - @mock.patch("certbot_apache._internal.configurator.util.run_script") + @mock.patch("certbot._internal.plugins.apache.configurator.util.run_script") def test_get_version(self, mock_run_script): mock_run_script.return_value = ('', None) with pytest.raises(errors.PluginError): @@ -155,7 +155,7 @@ class MultipleVhostsTestFedora(util.ApacheTest): raise Exception("Missed: %s" % vhost) # pragma: no cover assert found == 2 - @mock.patch("certbot_apache._internal.apache_util._get_runtime_cfg") + @mock.patch("certbot._internal.plugins.apache.apache_util._get_runtime_cfg") def test_get_sysconfig_vars(self, mock_cfg): """Make sure we read the sysconfig OPTIONS variable correctly""" # Return nothing for the process calls @@ -176,13 +176,13 @@ class MultipleVhostsTestFedora(util.ApacheTest): assert "MOCK_NOSEP" in self.config.parser.variables assert "NOSEP_VAL" == self.config.parser.variables["NOSEP_TWO"] - @mock.patch("certbot_apache._internal.configurator.util.run_script") + @mock.patch("certbot._internal.plugins.apache.configurator.util.run_script") def test_alt_restart_works(self, mock_run_script): mock_run_script.side_effect = [None, errors.SubprocessError, None] self.config.restart() assert mock_run_script.call_count == 3 - @mock.patch("certbot_apache._internal.configurator.util.run_script") + @mock.patch("certbot._internal.plugins.apache.configurator.util.run_script") def test_alt_restart_errors(self, mock_run_script): mock_run_script.side_effect = [None, errors.SubprocessError, diff --git a/certbot-apache/src/certbot_apache/_internal/tests/gentoo_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/gentoo_test.py similarity index 85% rename from certbot-apache/src/certbot_apache/_internal/tests/gentoo_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/gentoo_test.py index 087535e2c..5baa13443 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/gentoo_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/gentoo_test.py @@ -1,4 +1,4 @@ -"""Test for certbot_apache._internal.configurator for Gentoo overrides""" +"""Test for certbot._internal.plugins.apache.configurator for Gentoo overrides""" import sys from unittest import mock @@ -7,9 +7,9 @@ import pytest from certbot import errors from certbot.compat import filesystem from certbot.compat import os -from certbot_apache._internal import obj -from certbot_apache._internal import override_gentoo -from certbot_apache._internal.tests import util +from certbot._internal.plugins.apache import obj +from certbot._internal.plugins.apache import override_gentoo +from certbot._internal.tests.plugins.apache import util def get_vh_truth(temp_dir, config_name): @@ -51,7 +51,7 @@ class MultipleVhostsTestGentoo(util.ApacheTest): vhost_root=vhost_root) # pylint: disable=line-too-long - with mock.patch("certbot_apache._internal.override_gentoo.GentooParser.update_runtime_variables"): + with mock.patch("certbot._internal.plugins.apache.override_gentoo.GentooParser.update_runtime_variables"): self.config = util.get_apache_configurator( self.config_path, self.vhost_path, self.config_dir, self.work_dir, os_info="gentoo") @@ -83,17 +83,17 @@ class MultipleVhostsTestGentoo(util.ApacheTest): self.config.parser.apacheconfig_filep = filesystem.realpath( os.path.join(self.config.parser.root, "../conf.d/apache2")) self.config.parser.variables = {} - with mock.patch("certbot_apache._internal.override_gentoo.GentooParser.update_modules"): + with mock.patch("certbot._internal.plugins.apache.override_gentoo.GentooParser.update_modules"): self.config.parser.update_runtime_variables() for define in defines: assert define in self.config.parser.variables - @mock.patch("certbot_apache._internal.apache_util.parse_from_subprocess") + @mock.patch("certbot._internal.plugins.apache.apache_util.parse_from_subprocess") def test_no_binary_configdump(self, mock_subprocess): """Make sure we don't call binary dumps other than modules from Apache as this is not supported in Gentoo currently""" - with mock.patch("certbot_apache._internal.override_gentoo.GentooParser.update_modules"): + with mock.patch("certbot._internal.plugins.apache.override_gentoo.GentooParser.update_modules"): self.config.parser.update_runtime_variables() self.config.parser.reset_modules() assert mock_subprocess.called is False @@ -102,7 +102,7 @@ class MultipleVhostsTestGentoo(util.ApacheTest): self.config.parser.reset_modules() assert mock_subprocess.called is True - @mock.patch("certbot_apache._internal.apache_util._get_runtime_cfg") + @mock.patch("certbot._internal.plugins.apache.apache_util._get_runtime_cfg") def test_opportunistic_httpd_runtime_parsing(self, mock_get): mod_val = ( 'Loaded Modules:\n' @@ -126,7 +126,7 @@ class MultipleVhostsTestGentoo(util.ApacheTest): assert len(self.config.parser.modules) == 4 assert "mod_another.c" in self.config.parser.modules - @mock.patch("certbot_apache._internal.configurator.util.run_script") + @mock.patch("certbot._internal.plugins.apache.configurator.util.run_script") def test_alt_restart_works(self, mock_run_script): mock_run_script.side_effect = [None, errors.SubprocessError, None] self.config.restart() diff --git a/certbot-apache/src/certbot_apache/_internal/tests/http_01_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/http_01_test.py similarity index 95% rename from certbot-apache/src/certbot_apache/_internal/tests/http_01_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/http_01_test.py index 6e3a9adb3..25f835fcc 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/http_01_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/http_01_test.py @@ -1,4 +1,4 @@ -"""Test for certbot_apache._internal.http_01.""" +"""Test for certbot._internal.plugins.apache.http_01.""" import errno import sys from unittest import mock @@ -11,14 +11,14 @@ from certbot import errors from certbot.compat import filesystem from certbot.compat import os from certbot.tests import acme_util -from certbot_apache._internal.parser import get_aug_path -from certbot_apache._internal.tests import util +from certbot._internal.plugins.apache.parser import get_aug_path +from certbot._internal.tests.plugins.apache import util NUM_ACHALLS = 3 class ApacheHttp01Test(util.ApacheTest): - """Test for certbot_apache._internal.http_01.ApacheHttp01.""" + """Test for certbot._internal.plugins.apache.http_01.ApacheHttp01.""" def setUp(self, *args, **kwargs): # pylint: disable=arguments-differ super().setUp(*args, **kwargs) @@ -45,7 +45,7 @@ class ApacheHttp01Test(util.ApacheTest): self.config.parser.modules["mod_{0}.c".format(mod)] = None self.config.parser.modules[mod + "_module"] = None - from certbot_apache._internal.http_01 import ApacheHttp01 + from certbot._internal.plugins.apache.http_01 import ApacheHttp01 self.http = ApacheHttp01(self.config) def test_empty_perform(self): @@ -61,7 +61,7 @@ class ApacheHttp01Test(util.ApacheTest): with pytest.raises(errors.ConfigurationError): self.http.perform() - @mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.enable_mod") + @mock.patch("certbot._internal.plugins.apache.configurator.ApacheConfigurator.enable_mod") def test_enable_modules_apache_2_4(self, mock_enmod): del self.config.parser.modules["authz_core_module"] del self.config.parser.modules["mod_authz_host.c"] @@ -210,7 +210,7 @@ class ApacheHttp01Test(util.ApacheTest): assert os.path.exists(challenge_dir) is True - @mock.patch("certbot_apache._internal.http_01.filesystem.makedirs") + @mock.patch("certbot._internal.plugins.apache.http_01.filesystem.makedirs") def test_failed_makedirs(self, mock_makedirs): mock_makedirs.side_effect = OSError(errno.EACCES, "msg") self.http.add_chall(self.achalls[0]) diff --git a/certbot-apache/src/certbot_apache/_internal/tests/obj_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/obj_test.py similarity index 88% rename from certbot-apache/src/certbot_apache/_internal/tests/obj_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/obj_test.py index 16a71ba62..8ca2b6ce0 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/obj_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/obj_test.py @@ -1,4 +1,4 @@ -"""Tests for certbot_apache._internal.obj.""" +"""Tests for certbot._internal.plugins.apache.obj.""" import sys import unittest @@ -9,8 +9,8 @@ class VirtualHostTest(unittest.TestCase): """Test the VirtualHost class.""" def setUp(self): - from certbot_apache._internal.obj import Addr - from certbot_apache._internal.obj import VirtualHost + from certbot._internal.plugins.apache.obj import Addr + from certbot._internal.plugins.apache.obj import VirtualHost self.addr1 = Addr.fromstring("127.0.0.1") self.addr2 = Addr.fromstring("127.0.0.1:443") @@ -27,7 +27,7 @@ class VirtualHostTest(unittest.TestCase): def test_repr(self): assert repr(self.addr2) == \ - "certbot_apache._internal.obj.Addr(('127.0.0.1', '443'))" + "certbot._internal.plugins.apache.obj.Addr(('127.0.0.1', '443'))" def test_eq(self): assert self.vhost1b == self.vhost1 @@ -40,8 +40,8 @@ class VirtualHostTest(unittest.TestCase): assert self.vhost1 == self.vhost1b def test_conflicts(self): - from certbot_apache._internal.obj import Addr - from certbot_apache._internal.obj import VirtualHost + from certbot._internal.plugins.apache.obj import Addr + from certbot._internal.plugins.apache.obj import VirtualHost complex_vh = VirtualHost( "fp", "vhp", @@ -57,7 +57,7 @@ class VirtualHostTest(unittest.TestCase): assert self.vhost2.conflicts([self.addr1, self.addr_default]) is False def test_same_server(self): - from certbot_apache._internal.obj import VirtualHost + from certbot._internal.plugins.apache.obj import VirtualHost no_name1 = VirtualHost( "fp", "vhp", {self.addr1}, False, False, None) no_name2 = VirtualHost( @@ -80,7 +80,7 @@ class VirtualHostTest(unittest.TestCase): class AddrTest(unittest.TestCase): """Test obj.Addr.""" def setUp(self): - from certbot_apache._internal.obj import Addr + from certbot._internal.plugins.apache.obj import Addr self.addr = Addr.fromstring("*:443") self.addr1 = Addr.fromstring("127.0.0.1") @@ -95,7 +95,7 @@ class AddrTest(unittest.TestCase): assert self.addr2.is_wildcard() is True def test_get_sni_addr(self): - from certbot_apache._internal.obj import Addr + from certbot._internal.plugins.apache.obj import Addr assert self.addr.get_sni_addr("443") == Addr.fromstring("*:443") assert self.addr.get_sni_addr("225") == Addr.fromstring("*:225") assert self.addr1.get_sni_addr("443") == Addr.fromstring("127.0.0.1") diff --git a/certbot-apache/src/certbot_apache/_internal/tests/parser_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/parser_test.py similarity index 86% rename from certbot-apache/src/certbot_apache/_internal/tests/parser_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/parser_test.py index 20cbd50aa..327bc864f 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/parser_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/parser_test.py @@ -1,4 +1,4 @@ -"""Tests for certbot_apache._internal.parser.""" +"""Tests for certbot._internal.plugins.apache.parser.""" import sys from unittest import mock @@ -6,7 +6,7 @@ import pytest from certbot import errors from certbot.compat import os -from certbot_apache._internal.tests import util +from certbot._internal.tests.plugins.apache import util class BasicParserTest(util.ParserTest): @@ -25,7 +25,7 @@ class BasicParserTest(util.ParserTest): with pytest.raises(errors.PluginError): self.parser.unsaved_files() - @mock.patch("certbot_apache._internal.parser.logger") + @mock.patch("certbot._internal.plugins.apache.parser.logger") def test_bad_save_errors(self, mock_logger): nx_path = "/non/existent/path.conf" self.parser.aug.set("/augeas/load/Httpd/incl[last()]", nx_path) @@ -120,7 +120,7 @@ class BasicParserTest(util.ParserTest): Path must be valid before attempting to add to augeas """ - from certbot_apache._internal.parser import get_aug_path + from certbot._internal.plugins.apache.parser import get_aug_path # This makes sure that find_dir will work self.parser.modules["mod_ssl.c"] = "/fake/path" @@ -135,7 +135,7 @@ class BasicParserTest(util.ParserTest): assert "IfModule" in matches[0] def test_add_dir_to_ifmodssl_multiple(self): - from certbot_apache._internal.parser import get_aug_path + from certbot._internal.plugins.apache.parser import get_aug_path # This makes sure that find_dir will work self.parser.modules["mod_ssl.c"] = "/fake/path" @@ -150,11 +150,11 @@ class BasicParserTest(util.ParserTest): assert "IfModule" in matches[0] def test_get_aug_path(self): - from certbot_apache._internal.parser import get_aug_path + from certbot._internal.plugins.apache.parser import get_aug_path assert "/files/etc/apache" == get_aug_path("/etc/apache") def test_set_locations(self): - with mock.patch("certbot_apache._internal.parser.os.path") as mock_path: + with mock.patch("certbot._internal.plugins.apache.parser.os.path") as mock_path: mock_path.isfile.side_effect = [False, False] @@ -164,18 +164,18 @@ class BasicParserTest(util.ParserTest): assert results["default"] == results["listen"] assert results["default"] == results["name"] - @mock.patch("certbot_apache._internal.parser.ApacheParser.find_dir") - @mock.patch("certbot_apache._internal.parser.ApacheParser.get_arg") + @mock.patch("certbot._internal.plugins.apache.parser.ApacheParser.find_dir") + @mock.patch("certbot._internal.plugins.apache.parser.ApacheParser.get_arg") def test_parse_modules_bad_syntax(self, mock_arg, mock_find): mock_find.return_value = ["1", "2", "3", "4", "5", "6", "7", "8"] mock_arg.return_value = None - with mock.patch("certbot_apache._internal.parser.logger") as mock_logger: + with mock.patch("certbot._internal.plugins.apache.parser.logger") as mock_logger: self.parser.parse_modules() # Make sure that we got None return value and logged the file assert mock_logger.debug.called is True - @mock.patch("certbot_apache._internal.parser.ApacheParser.find_dir") - @mock.patch("certbot_apache._internal.apache_util._get_runtime_cfg") + @mock.patch("certbot._internal.plugins.apache.parser.ApacheParser.find_dir") + @mock.patch("certbot._internal.plugins.apache.apache_util._get_runtime_cfg") def test_update_runtime_variables(self, mock_cfg, _): define_val = ( 'ServerRoot: "/etc/apache2"\n' @@ -277,7 +277,7 @@ class BasicParserTest(util.ParserTest): self.parser.modules = {} with mock.patch( - "certbot_apache._internal.parser.ApacheParser.parse_file") as mock_parse: + "certbot._internal.plugins.apache.parser.ApacheParser.parse_file") as mock_parse: self.parser.update_runtime_variables() assert self.parser.variables == expected_vars assert len(self.parser.modules) == 58 @@ -285,8 +285,8 @@ class BasicParserTest(util.ParserTest): # Make sure we tried to include them all. assert mock_parse.call_count == 25 - @mock.patch("certbot_apache._internal.parser.ApacheParser.find_dir") - @mock.patch("certbot_apache._internal.apache_util._get_runtime_cfg") + @mock.patch("certbot._internal.plugins.apache.parser.ApacheParser.find_dir") + @mock.patch("certbot._internal.plugins.apache.apache_util._get_runtime_cfg") def test_update_runtime_variables_alt_values(self, mock_cfg, _): inc_val = ( 'Included configuration files:\n' @@ -300,7 +300,7 @@ class BasicParserTest(util.ParserTest): self.parser.modules = {} with mock.patch( - "certbot_apache._internal.parser.ApacheParser.parse_file") as mock_parse: + "certbot._internal.plugins.apache.parser.ApacheParser.parse_file") as mock_parse: self.parser.update_runtime_variables() # No matching modules should have been found assert len(self.parser.modules) == 0 @@ -308,13 +308,13 @@ class BasicParserTest(util.ParserTest): # path derived from root configuration Include statements assert mock_parse.call_count == 1 - @mock.patch("certbot_apache._internal.apache_util.subprocess.run") + @mock.patch("certbot._internal.plugins.apache.apache_util.subprocess.run") def test_update_runtime_vars_bad_ctl(self, mock_run): mock_run.side_effect = OSError with pytest.raises(errors.MisconfigurationError): self.parser.update_runtime_variables() - @mock.patch("certbot_apache._internal.apache_util.subprocess.run") + @mock.patch("certbot._internal.plugins.apache.apache_util.subprocess.run") def test_update_runtime_vars_bad_exit(self, mock_run): mock_proc = mock_run.return_value mock_proc.stdout = "" @@ -324,7 +324,7 @@ class BasicParserTest(util.ParserTest): self.parser.update_runtime_variables() def test_add_comment(self): - from certbot_apache._internal.parser import get_aug_path + from certbot._internal.plugins.apache.parser import get_aug_path self.parser.add_comment(get_aug_path(self.parser.loc["name"]), "123456") comm = self.parser.find_comments("123456") assert len(comm) == 1 @@ -333,9 +333,9 @@ class BasicParserTest(util.ParserTest): class ParserInitTest(util.ApacheTest): - @mock.patch("certbot_apache._internal.parser.init_augeas") + @mock.patch("certbot._internal.plugins.apache.parser.init_augeas") def test_prepare_no_augeas(self, mock_init_augeas): - from certbot_apache._internal.parser import ApacheParser + from certbot._internal.plugins.apache.parser import ApacheParser mock_init_augeas.side_effect = errors.NoInstallationError self.config.config_test = mock.Mock() with pytest.raises(errors.NoInstallationError): @@ -343,17 +343,17 @@ class ParserInitTest(util.ApacheTest): "/dummy/vhostpath", version=(2, 4, 22)) def test_init_old_aug(self): - from certbot_apache._internal.parser import ApacheParser - with mock.patch("certbot_apache._internal.parser.ApacheParser.check_aug_version") as mock_c: + from certbot._internal.plugins.apache.parser import ApacheParser + with mock.patch("certbot._internal.plugins.apache.parser.ApacheParser.check_aug_version") as mock_c: mock_c.return_value = False with pytest.raises(errors.NotSupportedError): ApacheParser(os.path.relpath(self.config_path), self.config, "/dummy/vhostpath", version=(2, 4, 22)) def test_root_normalized(self): - from certbot_apache._internal.parser import ApacheParser + from certbot._internal.plugins.apache.parser import ApacheParser - with mock.patch("certbot_apache._internal.parser.ApacheParser." + with mock.patch("certbot._internal.plugins.apache.parser.ApacheParser." "update_runtime_variables"): path = os.path.join( self.temp_dir, @@ -364,8 +364,8 @@ class ParserInitTest(util.ApacheTest): assert parser.root == self.config_path def test_root_absolute(self): - from certbot_apache._internal.parser import ApacheParser - with mock.patch("certbot_apache._internal.parser.ApacheParser." + from certbot._internal.plugins.apache.parser import ApacheParser + with mock.patch("certbot._internal.plugins.apache.parser.ApacheParser." "update_runtime_variables"): parser = ApacheParser( os.path.relpath(self.config_path), self.config, "/dummy/vhostpath") @@ -373,8 +373,8 @@ class ParserInitTest(util.ApacheTest): assert parser.root == self.config_path def test_root_no_trailing_slash(self): - from certbot_apache._internal.parser import ApacheParser - with mock.patch("certbot_apache._internal.parser.ApacheParser." + from certbot._internal.plugins.apache.parser import ApacheParser + with mock.patch("certbot._internal.plugins.apache.parser.ApacheParser." "update_runtime_variables"): parser = ApacheParser( self.config_path + os.path.sep, self.config, "/dummy/vhostpath") diff --git a/certbot-apache/src/certbot_apache/_internal/tests/parsernode_configurator_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/parsernode_configurator_test.py similarity index 96% rename from certbot-apache/src/certbot_apache/_internal/tests/parsernode_configurator_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/parsernode_configurator_test.py index f6eaccd38..162d2b08d 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/parsernode_configurator_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/parsernode_configurator_test.py @@ -6,7 +6,7 @@ from unittest import mock import pytest -from certbot_apache._internal.tests import util +from certbot._internal.tests.plugins.apache import util if importlib.util.find_spec('apacheconfig'): diff --git a/certbot-apache/src/certbot_apache/_internal/tests/parsernode_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/parsernode_test.py similarity index 96% rename from certbot-apache/src/certbot_apache/_internal/tests/parsernode_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/parsernode_test.py index d9e20ee64..7d441673f 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/parsernode_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/parsernode_test.py @@ -4,8 +4,8 @@ import sys import pytest -from certbot_apache._internal import interfaces -from certbot_apache._internal import parsernode_util as util +from certbot._internal.plugins.apache import interfaces +from certbot._internal.plugins.apache import parsernode_util as util class DummyParserNode(interfaces.ParserNode): diff --git a/certbot-apache/src/certbot_apache/_internal/tests/parsernode_util_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/parsernode_util_test.py similarity index 97% rename from certbot-apache/src/certbot_apache/_internal/tests/parsernode_util_test.py rename to certbot/src/certbot/_internal/tests/plugins/apache/parsernode_util_test.py index c046b1ec7..e228b20a3 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/parsernode_util_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/parsernode_util_test.py @@ -3,7 +3,7 @@ import sys import pytest -from certbot_apache._internal import parsernode_util as util +from certbot._internal.plugins.apache import parsernode_util as util def _setup_parsernode(): diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.d/README b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.d/README similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.d/README rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.d/README diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.d/autoindex.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.d/autoindex.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.d/autoindex.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.d/autoindex.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.d/centos.example.com.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.d/centos.example.com.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.d/centos.example.com.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.d/centos.example.com.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.d/ssl.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.d/ssl.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.d/ssl.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.d/ssl.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.d/userdir.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.d/userdir.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.d/userdir.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.d/userdir.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.d/welcome.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.d/welcome.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.d/welcome.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.d/welcome.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.modules.d/00-base.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.modules.d/00-base.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.modules.d/00-base.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.modules.d/00-base.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.modules.d/00-dav.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.modules.d/00-dav.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.modules.d/00-dav.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.modules.d/00-dav.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.modules.d/00-lua.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.modules.d/00-lua.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.modules.d/00-lua.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.modules.d/00-lua.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.modules.d/00-mpm.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.modules.d/00-mpm.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.modules.d/00-mpm.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.modules.d/00-mpm.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.modules.d/00-proxy.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.modules.d/00-proxy.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.modules.d/00-proxy.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.modules.d/00-proxy.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.modules.d/00-ssl.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.modules.d/00-ssl.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.modules.d/00-ssl.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.modules.d/00-ssl.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.modules.d/00-systemd.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.modules.d/00-systemd.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.modules.d/00-systemd.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.modules.d/00-systemd.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.modules.d/01-cgi.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.modules.d/01-cgi.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf.modules.d/01-cgi.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf.modules.d/01-cgi.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf/httpd.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf/httpd.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf/httpd.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf/httpd.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf/magic b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf/magic similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/httpd/conf/magic rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/httpd/conf/magic diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/sites b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/sites similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/sites rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/sites diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/sysconfig/httpd b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/sysconfig/httpd similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/centos7_apache/apache/sysconfig/httpd rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/centos7_apache/apache/sysconfig/httpd diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/complex_parsing/apache2.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/complex_parsing/apache2.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/complex_parsing/apache2.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/complex_parsing/apache2.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/complex_parsing/conf-enabled/dummy.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/complex_parsing/conf-enabled/dummy.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/complex_parsing/conf-enabled/dummy.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/complex_parsing/conf-enabled/dummy.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/complex_parsing/test_fnmatch.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/complex_parsing/test_fnmatch.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/complex_parsing/test_fnmatch.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/complex_parsing/test_fnmatch.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/complex_parsing/test_variables.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/complex_parsing/test_variables.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/complex_parsing/test_variables.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/complex_parsing/test_variables.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/apache2.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/apache2.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/apache2.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/apache2.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-available/bad_conf_file.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-available/bad_conf_file.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-available/bad_conf_file.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-available/bad_conf_file.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-available/other-vhosts-access-log.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-available/other-vhosts-access-log.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-available/other-vhosts-access-log.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-available/other-vhosts-access-log.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-available/security.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-available/security.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-available/security.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-available/security.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-available/serve-cgi-bin.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-available/serve-cgi-bin.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-available/serve-cgi-bin.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-available/serve-cgi-bin.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-enabled/other-vhosts-access-log.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-enabled/other-vhosts-access-log.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-enabled/other-vhosts-access-log.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-enabled/other-vhosts-access-log.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-enabled/security.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-enabled/security.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-enabled/security.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-enabled/security.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-enabled/serve-cgi-bin.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-enabled/serve-cgi-bin.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-enabled/serve-cgi-bin.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/conf-enabled/serve-cgi-bin.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/envvars b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/envvars similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/envvars rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/envvars diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/authz_svn.load b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/authz_svn.load similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/authz_svn.load rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/authz_svn.load diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/dav.load b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/dav.load similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/dav.load rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/dav.load diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/dav_svn.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/dav_svn.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/dav_svn.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/dav_svn.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/dav_svn.load b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/dav_svn.load similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/dav_svn.load rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/dav_svn.load diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/rewrite.load b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/rewrite.load similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/rewrite.load rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/rewrite.load diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/ssl.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/ssl.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/ssl.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/ssl.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/ssl.load b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/ssl.load similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/ssl.load rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-available/ssl.load diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-enabled/authz_svn.load b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-enabled/authz_svn.load similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-enabled/authz_svn.load rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-enabled/authz_svn.load diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-enabled/dav.load b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-enabled/dav.load similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-enabled/dav.load rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-enabled/dav.load diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-enabled/dav_svn.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-enabled/dav_svn.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-enabled/dav_svn.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-enabled/dav_svn.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-enabled/dav_svn.load b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-enabled/dav_svn.load similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-enabled/dav_svn.load rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/mods-enabled/dav_svn.load diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/ports.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/ports.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/ports.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/ports.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-available/another_wildcard.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-available/another_wildcard.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-available/another_wildcard.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-available/another_wildcard.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-available/old-and-default.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-available/old-and-default.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-available/old-and-default.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-available/old-and-default.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-available/wildcard.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-available/wildcard.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-available/wildcard.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-available/wildcard.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-enabled/another_wildcard.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-enabled/another_wildcard.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-enabled/another_wildcard.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-enabled/another_wildcard.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-enabled/old-and-default.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-enabled/old-and-default.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-enabled/old-and-default.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-enabled/old-and-default.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-enabled/wildcard.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-enabled/wildcard.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-enabled/wildcard.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/apache2/sites-enabled/wildcard.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/sites b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/sites similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/augeas_vhosts/sites rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/augeas_vhosts/sites diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/apache2.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/apache2.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/apache2.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/apache2.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/other-vhosts-access-log.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/other-vhosts-access-log.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/other-vhosts-access-log.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/other-vhosts-access-log.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/security.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/security.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/security.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/security.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/serve-cgi-bin.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/serve-cgi-bin.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/serve-cgi-bin.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/serve-cgi-bin.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/other-vhosts-access-log.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/other-vhosts-access-log.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/other-vhosts-access-log.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/other-vhosts-access-log.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/security.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/security.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/security.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/security.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/serve-cgi-bin.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/serve-cgi-bin.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/serve-cgi-bin.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/serve-cgi-bin.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/envvars b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/envvars similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/envvars rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/envvars diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.load b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.load similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.load rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.load diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/ports.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/ports.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/ports.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/ports.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/000-default.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/000-default.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/000-default.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/000-default.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/default-ssl.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/default-ssl.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/default-ssl.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/default-ssl.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-enabled/000-default.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/sites-enabled/000-default.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-enabled/000-default.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/apache2/sites-enabled/000-default.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/sites b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/sites similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/default_vhost/sites rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/default_vhost/sites diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multi_vhosts/apache2/apache2.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multi_vhosts/apache2/apache2.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multi_vhosts/apache2/apache2.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multi_vhosts/apache2/apache2.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multi_vhosts/apache2/envvars b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multi_vhosts/apache2/envvars similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multi_vhosts/apache2/envvars rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multi_vhosts/apache2/envvars diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multi_vhosts/apache2/ports.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multi_vhosts/apache2/ports.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multi_vhosts/apache2/ports.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multi_vhosts/apache2/ports.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multi_vhosts/apache2/sites-available/default.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multi_vhosts/apache2/sites-available/default.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multi_vhosts/apache2/sites-available/default.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multi_vhosts/apache2/sites-available/default.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multi_vhosts/apache2/sites-available/multi-vhost.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multi_vhosts/apache2/sites-available/multi-vhost.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multi_vhosts/apache2/sites-available/multi-vhost.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multi_vhosts/apache2/sites-available/multi-vhost.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multi_vhosts/apache2/sites-enabled/default.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multi_vhosts/apache2/sites-enabled/default.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multi_vhosts/apache2/sites-enabled/default.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multi_vhosts/apache2/sites-enabled/default.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multi_vhosts/apache2/sites-enabled/multi-vhost.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multi_vhosts/apache2/sites-enabled/multi-vhost.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multi_vhosts/apache2/sites-enabled/multi-vhost.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multi_vhosts/apache2/sites-enabled/multi-vhost.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/apache2.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/apache2.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/apache2.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/apache2.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-available/bad_conf_file.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-available/bad_conf_file.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-available/bad_conf_file.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-available/bad_conf_file.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-available/other-vhosts-access-log.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-available/other-vhosts-access-log.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-available/other-vhosts-access-log.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-available/other-vhosts-access-log.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-available/security.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-available/security.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-available/security.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-available/security.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-available/serve-cgi-bin.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-available/serve-cgi-bin.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-available/serve-cgi-bin.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-available/serve-cgi-bin.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-enabled/other-vhosts-access-log.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-enabled/other-vhosts-access-log.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-enabled/other-vhosts-access-log.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-enabled/other-vhosts-access-log.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-enabled/security.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-enabled/security.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-enabled/security.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-enabled/security.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-enabled/serve-cgi-bin.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-enabled/serve-cgi-bin.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-enabled/serve-cgi-bin.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/conf-enabled/serve-cgi-bin.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/envvars b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/envvars similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/envvars rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/envvars diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/authz_svn.load b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/authz_svn.load similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/authz_svn.load rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/authz_svn.load diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/dav.load b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/dav.load similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/dav.load rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/dav.load diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/dav_svn.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/dav_svn.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/dav_svn.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/dav_svn.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/dav_svn.load b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/dav_svn.load similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/dav_svn.load rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/dav_svn.load diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/rewrite.load b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/rewrite.load similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/rewrite.load rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/rewrite.load diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/ssl.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/ssl.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/ssl.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/ssl.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/ssl.load b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/ssl.load similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/ssl.load rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-available/ssl.load diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-enabled/authz_svn.load b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-enabled/authz_svn.load similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-enabled/authz_svn.load rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-enabled/authz_svn.load diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-enabled/dav.load b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-enabled/dav.load similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-enabled/dav.load rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-enabled/dav.load diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-enabled/dav_svn.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-enabled/dav_svn.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-enabled/dav_svn.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-enabled/dav_svn.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-enabled/dav_svn.load b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-enabled/dav_svn.load similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-enabled/dav_svn.load rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/mods-enabled/dav_svn.load diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/ports.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/ports.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/ports.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/ports.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/000-default.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/000-default.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/000-default.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/000-default.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/certbot.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/certbot.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/certbot.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/certbot.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/default-ssl-port-only.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/default-ssl-port-only.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/default-ssl-port-only.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/default-ssl-port-only.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/default-ssl.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/default-ssl.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/default-ssl.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/default-ssl.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/duplicatehttp.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/duplicatehttp.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/duplicatehttp.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/duplicatehttp.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/duplicatehttps.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/duplicatehttps.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/duplicatehttps.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/duplicatehttps.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/empty.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/empty.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/empty.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/empty.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/encryption-example.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/encryption-example.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/encryption-example.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/encryption-example.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/mod_macro-example.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/mod_macro-example.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/mod_macro-example.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/mod_macro-example.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/no-directives.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/no-directives.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/no-directives.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/no-directives.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/ocsp-ssl.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/ocsp-ssl.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/ocsp-ssl.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/ocsp-ssl.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/wildcard.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/wildcard.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/wildcard.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-available/wildcard.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/000-default.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/000-default.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/000-default.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/000-default.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/certbot.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/certbot.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/certbot.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/certbot.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/default-ssl-port-only.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/default-ssl-port-only.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/default-ssl-port-only.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/default-ssl-port-only.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/default-ssl.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/default-ssl.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/default-ssl.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/default-ssl.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/duplicatehttp.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/duplicatehttp.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/duplicatehttp.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/duplicatehttp.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/duplicatehttps.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/duplicatehttps.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/duplicatehttps.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/duplicatehttps.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/encryption-example.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/encryption-example.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/encryption-example.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/encryption-example.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/mod_macro-example.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/mod_macro-example.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/mod_macro-example.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/mod_macro-example.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/non-symlink.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/non-symlink.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/non-symlink.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/non-symlink.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/ocsp-ssl.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/ocsp-ssl.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/ocsp-ssl.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/ocsp-ssl.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/wildcard.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/wildcard.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/wildcard.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/apache2/sites-enabled/wildcard.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/sites b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/sites similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/debian_apache_2_4/multiple_vhosts/sites rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/debian_apache_2_4/multiple_vhosts/sites diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/httpd.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/httpd.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/httpd.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/httpd.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/magic b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/magic similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/magic rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/magic diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_default_settings.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_default_settings.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_default_settings.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_default_settings.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_error_documents.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_error_documents.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_error_documents.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_error_documents.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_languages.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_languages.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_languages.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_languages.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_autoindex.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_autoindex.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_autoindex.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_autoindex.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_info.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_info.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_info.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_info.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_log_config.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_log_config.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_log_config.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_log_config.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_mime.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_mime.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_mime.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_mime.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_status.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_status.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_status.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_status.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_userdir.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_userdir.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_userdir.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_mod_userdir.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_mpm.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_mpm.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/00_mpm.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/00_mpm.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/10_mod_mem_cache.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/10_mod_mem_cache.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/10_mod_mem_cache.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/10_mod_mem_cache.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/40_mod_ssl.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/40_mod_ssl.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/40_mod_ssl.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/40_mod_ssl.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/41_mod_http2.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/41_mod_http2.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/41_mod_http2.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/41_mod_http2.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/45_mod_dav.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/45_mod_dav.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/45_mod_dav.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/45_mod_dav.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/46_mod_ldap.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/46_mod_ldap.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/modules.d/46_mod_ldap.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/modules.d/46_mod_ldap.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/vhosts.d/00_default_ssl_vhost.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/vhosts.d/00_default_ssl_vhost.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/vhosts.d/00_default_ssl_vhost.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/vhosts.d/00_default_ssl_vhost.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/vhosts.d/00_default_vhost.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/vhosts.d/00_default_vhost.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/vhosts.d/00_default_vhost.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/vhosts.d/00_default_vhost.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/vhosts.d/default_vhost.include b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/vhosts.d/default_vhost.include similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/vhosts.d/default_vhost.include rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/vhosts.d/default_vhost.include diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/vhosts.d/gentoo.example.com.conf b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/vhosts.d/gentoo.example.com.conf similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/apache2/vhosts.d/gentoo.example.com.conf rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/apache2/vhosts.d/gentoo.example.com.conf diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/conf.d/apache2 b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/conf.d/apache2 similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/conf.d/apache2 rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/conf.d/apache2 diff --git a/certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/sites b/certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/sites similarity index 100% rename from certbot-apache/src/certbot_apache/_internal/tests/testdata/gentoo_apache/apache/sites rename to certbot/src/certbot/_internal/tests/plugins/apache/testdata/gentoo_apache/apache/sites diff --git a/certbot-apache/src/certbot_apache/_internal/tests/util.py b/certbot/src/certbot/_internal/tests/plugins/apache/util.py similarity index 93% rename from certbot-apache/src/certbot_apache/_internal/tests/util.py rename to certbot/src/certbot/_internal/tests/plugins/apache/util.py index faef22bdf..33c598fff 100644 --- a/certbot-apache/src/certbot_apache/_internal/tests/util.py +++ b/certbot/src/certbot/_internal/tests/plugins/apache/util.py @@ -1,4 +1,4 @@ -"""Common utilities for certbot_apache.""" +"""Common test utilities for the apache plugin.""" import shutil from typing import Optional import unittest @@ -11,9 +11,9 @@ from certbot import util from certbot.compat import os from certbot.plugins import common from certbot.tests import util as test_util -from certbot_apache._internal import configurator -from certbot_apache._internal import entrypoint -from certbot_apache._internal import obj +from certbot._internal.plugins.apache import configurator +from certbot._internal.plugins.apache import entrypoint +from certbot._internal.plugins.apache import obj class ApacheTest(unittest.TestCase): @@ -68,10 +68,10 @@ class ParserTest(ApacheTest): ) -> None: super().setUp(test_dir, config_root, vhost_root) - from certbot_apache._internal.parser import ApacheParser + from certbot._internal.plugins.apache.parser import ApacheParser self.aug = augeas.Augeas( flags=augeas.Augeas.NONE | augeas.Augeas.NO_MODL_AUTOLOAD) - with mock.patch("certbot_apache._internal.parser.ApacheParser." + with mock.patch("certbot._internal.plugins.apache.parser.ApacheParser." "update_runtime_variables"): self.parser = ApacheParser( self.config_path, self.config, self.vhost_path) @@ -103,13 +103,13 @@ def get_apache_configurator( in_progress_dir=os.path.join(backups, "IN_PROGRESS"), work_dir=work_dir) - with mock.patch("certbot_apache._internal.configurator.util.run_script"): - with mock.patch("certbot_apache._internal.configurator.util." + with mock.patch("certbot._internal.plugins.apache.configurator.util.run_script"): + with mock.patch("certbot._internal.plugins.apache.configurator.util." "exe_exists") as mock_exe_exists: mock_exe_exists.return_value = True - with mock.patch("certbot_apache._internal.parser.ApacheParser." + with mock.patch("certbot._internal.plugins.apache.parser.ApacheParser." "update_runtime_variables"): - with mock.patch("certbot_apache._internal.apache_util.parse_from_subprocess") as mock_sp: + with mock.patch("certbot._internal.plugins.apache.apache_util.parse_from_subprocess") as mock_sp: mock_sp.return_value = [] try: config_class = entrypoint.OVERRIDE_CLASSES[os_info] diff --git a/certbot/src/certbot/_internal/tests/plugins/nginx/__init__.py b/certbot/src/certbot/_internal/tests/plugins/nginx/__init__.py new file mode 100644 index 000000000..60c94e900 --- /dev/null +++ b/certbot/src/certbot/_internal/tests/plugins/nginx/__init__.py @@ -0,0 +1,6 @@ +"""certbot-nginx tests""" +import pytest + + +# Make sure we're only running these tests if our nginx plugin dependencies are installed +pytest.importorskip("pyparsing") diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/configurator_test.py b/certbot/src/certbot/_internal/tests/plugins/nginx/configurator_test.py similarity index 93% rename from certbot-nginx/src/certbot_nginx/_internal/tests/configurator_test.py rename to certbot/src/certbot/_internal/tests/plugins/nginx/configurator_test.py index 9eec8c38f..95ffbd35b 100644 --- a/certbot-nginx/src/certbot_nginx/_internal/tests/configurator_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/nginx/configurator_test.py @@ -1,4 +1,4 @@ -"""Test for certbot_nginx._internal.configurator.""" +"""Test for certbot._internal.plugins.nginx.configurator.""" import sys from unittest import mock @@ -11,11 +11,11 @@ from certbot import crypto_util from certbot import errors from certbot.compat import os from certbot.tests import util as certbot_test_util -from certbot_nginx._internal import obj -from certbot_nginx._internal import parser -from certbot_nginx._internal.configurator import _redirect_block_for_domain -from certbot_nginx._internal.nginxparser import UnspacedList -from certbot_nginx._internal.tests import test_util as util +from certbot._internal.plugins.nginx import obj +from certbot._internal.plugins.nginx import parser +from certbot._internal.plugins.nginx.configurator import _redirect_block_for_domain +from certbot._internal.plugins.nginx.nginxparser import UnspacedList +from certbot._internal.tests.plugins.nginx import test_util as util class NginxConfiguratorTest(util.NginxTest): @@ -27,11 +27,11 @@ class NginxConfiguratorTest(util.NginxTest): self.config = self.get_nginx_configurator( self.config_path, self.config_dir, self.work_dir, self.logs_dir) - patch = mock.patch('certbot_nginx._internal.configurator.display_util.notify') + patch = mock.patch('certbot._internal.plugins.nginx.configurator.display_util.notify') self.mock_notify = patch.start() self.addCleanup(patch.stop) - @mock.patch("certbot_nginx._internal.configurator.util.exe_exists") + @mock.patch("certbot._internal.plugins.nginx.configurator.util.exe_exists") def test_prepare_no_install(self, mock_exe_exists): mock_exe_exists.return_value = False with pytest.raises(errors.NoInstallationError): @@ -41,8 +41,8 @@ class NginxConfiguratorTest(util.NginxTest): assert (1, 6, 2) == self.config.version assert 16 == len(self.config.parser.parsed) - @mock.patch("certbot_nginx._internal.configurator.util.exe_exists") - @mock.patch("certbot_nginx._internal.configurator.subprocess.run") + @mock.patch("certbot._internal.plugins.nginx.configurator.util.exe_exists") + @mock.patch("certbot._internal.plugins.nginx.configurator.subprocess.run") def test_prepare_initializes_version(self, mock_run, mock_exe_exists): mock_run.return_value.stdout = "" mock_run.return_value.stderr = "\n".join( @@ -76,7 +76,7 @@ class NginxConfiguratorTest(util.NginxTest): self.config.config_test = mock.Mock() certbot_test_util.lock_and_call(self._test_prepare_locked, server_root) - @mock.patch("certbot_nginx._internal.configurator.util.exe_exists") + @mock.patch("certbot._internal.plugins.nginx.configurator.util.exe_exists") def _test_prepare_locked(self, unused_exe_exists): try: self.config.prepare() @@ -87,8 +87,8 @@ class NginxConfiguratorTest(util.NginxTest): else: # pragma: no cover self.fail("Exception wasn't raised!") - @mock.patch("certbot_nginx._internal.configurator.socket.gethostname") - @mock.patch("certbot_nginx._internal.configurator.socket.gethostbyaddr") + @mock.patch("certbot._internal.plugins.nginx.configurator.socket.gethostname") + @mock.patch("certbot._internal.plugins.nginx.configurator.socket.gethostbyaddr") def test_get_all_names(self, mock_gethostbyaddr, mock_gethostname): mock_gethostbyaddr.return_value = ('155.225.50.69.nephoscale.net', [], []) mock_gethostname.return_value = ('example.net') @@ -268,7 +268,7 @@ class NginxConfiguratorTest(util.NginxTest): "example/chain.pem", None) - @mock.patch('certbot_nginx._internal.parser.NginxParser.update_or_add_server_directives') + @mock.patch('certbot._internal.plugins.nginx.parser.NginxParser.update_or_add_server_directives') def test_deploy_cert_raise_on_add_error(self, mock_update_or_add_server_directives): mock_update_or_add_server_directives.side_effect = errors.MisconfigurationError() with pytest.raises(errors.PluginError): @@ -364,9 +364,9 @@ class NginxConfiguratorTest(util.NginxTest): ]] == \ parsed_migration_conf[0] - @mock.patch("certbot_nginx._internal.configurator.http_01.NginxHttp01.perform") - @mock.patch("certbot_nginx._internal.configurator.NginxConfigurator.restart") - @mock.patch("certbot_nginx._internal.configurator.NginxConfigurator.revert_challenge_config") + @mock.patch("certbot._internal.plugins.nginx.configurator.http_01.NginxHttp01.perform") + @mock.patch("certbot._internal.plugins.nginx.configurator.NginxConfigurator.restart") + @mock.patch("certbot._internal.plugins.nginx.configurator.NginxConfigurator.revert_challenge_config") def test_perform_and_cleanup(self, mock_revert, mock_restart, mock_http_perform): # Only tests functionality specific to configurator.perform # Note: As more challenges are offered this will have to be expanded @@ -394,7 +394,7 @@ class NginxConfiguratorTest(util.NginxTest): assert mock_revert.call_count == 1 assert mock_restart.call_count == 2 - @mock.patch("certbot_nginx._internal.configurator.subprocess.run") + @mock.patch("certbot._internal.plugins.nginx.configurator.subprocess.run") def test_get_version(self, mock_run): mock_run.return_value.stdout = "" mock_run.return_value.stderr = "\n".join( @@ -455,7 +455,7 @@ class NginxConfiguratorTest(util.NginxTest): with pytest.raises(errors.PluginError): self.config.get_version() - @mock.patch("certbot_nginx._internal.configurator.subprocess.run") + @mock.patch("certbot._internal.plugins.nginx.configurator.subprocess.run") def test_get_openssl_version(self, mock_run): # pylint: disable=protected-access mock_run.return_value.stdout = "" @@ -517,8 +517,8 @@ class NginxConfiguratorTest(util.NginxTest): """ assert self.config._get_openssl_version() == "" - @mock.patch("certbot_nginx._internal.configurator.subprocess.run") - @mock.patch("certbot_nginx._internal.configurator.time") + @mock.patch("certbot._internal.plugins.nginx.configurator.subprocess.run") + @mock.patch("certbot._internal.plugins.nginx.configurator.time") def test_nginx_restart(self, mock_time, mock_run): mocked = mock_run.return_value mocked.stdout = '' @@ -528,8 +528,8 @@ class NginxConfiguratorTest(util.NginxTest): assert mock_run.call_count == 1 mock_time.sleep.assert_called_once_with(0.1234) - @mock.patch("certbot_nginx._internal.configurator.subprocess.run") - @mock.patch("certbot_nginx._internal.configurator.logger.debug") + @mock.patch("certbot._internal.plugins.nginx.configurator.subprocess.run") + @mock.patch("certbot._internal.plugins.nginx.configurator.logger.debug") def test_nginx_restart_fail(self, mock_log_debug, mock_run): mocked = mock_run.return_value mocked.stdout = '' @@ -540,7 +540,7 @@ class NginxConfiguratorTest(util.NginxTest): assert mock_run.call_count == 2 mock_log_debug.assert_called_once_with("nginx reload failed:\n%s", "") - @mock.patch("certbot_nginx._internal.configurator.subprocess.run") + @mock.patch("certbot._internal.plugins.nginx.configurator.subprocess.run") def test_no_nginx_start(self, mock_run): mock_run.side_effect = OSError("Can't find program") with pytest.raises(errors.MisconfigurationError): @@ -687,20 +687,20 @@ class NginxConfiguratorTest(util.NginxTest): self.config.enhance("migration.com", "ensure-http-header", "Strict-Transport-Security") - @mock.patch('certbot_nginx._internal.obj.VirtualHost.contains_list') + @mock.patch('certbot._internal.plugins.nginx.obj.VirtualHost.contains_list') def test_certbot_redirect_exists(self, mock_contains_list): # Test that we add no redirect statement if there is already a # redirect in the block that is managed by certbot # Has a certbot redirect mock_contains_list.return_value = True - with mock.patch("certbot_nginx._internal.configurator.logger") as mock_logger: + with mock.patch("certbot._internal.plugins.nginx.configurator.logger") as mock_logger: self.config.enhance("www.example.com", "redirect") assert mock_logger.info.call_args[0][0] == \ "Traffic on port %s already redirecting to ssl in %s" def test_redirect_dont_enhance(self): # Test that we don't accidentally add redirect to ssl-only block - with mock.patch("certbot_nginx._internal.configurator.logger") as mock_logger: + with mock.patch("certbot._internal.plugins.nginx.configurator.logger") as mock_logger: self.config.enhance("geese.com", "redirect") assert mock_logger.info.call_args[0][0] == \ 'No matching insecure server blocks listening on port %s found.' @@ -895,7 +895,7 @@ class NginxConfiguratorTest(util.NginxTest): assert util.contains_at_depth(generated_conf, expected, 2) @mock.patch('certbot.reverter.logger') - @mock.patch('certbot_nginx._internal.parser.NginxParser.load') + @mock.patch('certbot._internal.plugins.nginx.parser.NginxParser.load') def test_parser_reload_after_config_changes(self, mock_parser_load, unused_mock_logger): self.config.recovery_routine() self.config.revert_challenge_config() @@ -904,7 +904,7 @@ class NginxConfiguratorTest(util.NginxTest): def test_choose_vhosts_wildcard(self): # pylint: disable=protected-access - mock_path = "certbot_nginx._internal.display_ops.select_vhost_multiple" + mock_path = "certbot._internal.plugins.nginx.display_ops.select_vhost_multiple" with mock.patch(mock_path) as mock_select_vhs: vhost = [x for x in self.config.parser.get_vhosts() if 'summer.com' in x.names][0] @@ -920,7 +920,7 @@ class NginxConfiguratorTest(util.NginxTest): def test_choose_vhosts_wildcard_redirect(self): # pylint: disable=protected-access - mock_path = "certbot_nginx._internal.display_ops.select_vhost_multiple" + mock_path = "certbot._internal.plugins.nginx.display_ops.select_vhost_multiple" with mock.patch(mock_path) as mock_select_vhs: vhost = [x for x in self.config.parser.get_vhosts() if 'summer.com' in x.names][0] @@ -941,7 +941,7 @@ class NginxConfiguratorTest(util.NginxTest): if 'geese.com' in x.names][0] mock_choose_vhosts.return_value = [vhost] self.config._choose_vhosts_wildcard = mock_choose_vhosts - mock_d = "certbot_nginx._internal.configurator.NginxConfigurator._deploy_cert" + mock_d = "certbot._internal.plugins.nginx.configurator.NginxConfigurator._deploy_cert" with mock.patch(mock_d) as mock_dep: self.config.deploy_cert("*.com", "/tmp/path", "/tmp/path", "/tmp/path", "/tmp/path") @@ -949,7 +949,7 @@ class NginxConfiguratorTest(util.NginxTest): assert len(mock_dep.call_args_list) == 1 assert vhost == mock_dep.call_args_list[0][0][0] - @mock.patch("certbot_nginx._internal.display_ops.select_vhost_multiple") + @mock.patch("certbot._internal.plugins.nginx.display_ops.select_vhost_multiple") def test_deploy_cert_wildcard_no_vhosts(self, mock_dialog): # pylint: disable=protected-access mock_dialog.return_value = [] @@ -957,7 +957,7 @@ class NginxConfiguratorTest(util.NginxTest): self.config.deploy_cert("*.wild.cat", "/tmp/path", "/tmp/path", "/tmp/path", "/tmp/path") - @mock.patch("certbot_nginx._internal.display_ops.select_vhost_multiple") + @mock.patch("certbot._internal.plugins.nginx.display_ops.select_vhost_multiple") def test_enhance_wildcard_ocsp_after_install(self, mock_dialog): # pylint: disable=protected-access vhost = [x for x in self.config.parser.get_vhosts() @@ -966,7 +966,7 @@ class NginxConfiguratorTest(util.NginxTest): self.config.enhance("*.com", "staple-ocsp", "example/chain.pem") assert not mock_dialog.called - @mock.patch("certbot_nginx._internal.display_ops.select_vhost_multiple") + @mock.patch("certbot._internal.plugins.nginx.display_ops.select_vhost_multiple") def test_enhance_wildcard_redirect_or_ocsp_no_install(self, mock_dialog): # we need to select an SSL enabled vhost here for the OCSP stapling # enhancement @@ -976,7 +976,7 @@ class NginxConfiguratorTest(util.NginxTest): self.config.enhance("*.com", "staple-ocsp", "example/chain.pem") assert mock_dialog.called is True - @mock.patch("certbot_nginx._internal.display_ops.select_vhost_multiple") + @mock.patch("certbot._internal.plugins.nginx.display_ops.select_vhost_multiple") def test_enhance_wildcard_double_redirect(self, mock_dialog): # pylint: disable=protected-access vhost = [x for x in self.config.parser.get_vhosts() @@ -987,7 +987,7 @@ class NginxConfiguratorTest(util.NginxTest): def test_choose_vhosts_wildcard_no_ssl_filter_port(self): # pylint: disable=protected-access - mock_path = "certbot_nginx._internal.display_ops.select_vhost_multiple" + mock_path = "certbot._internal.plugins.nginx.display_ops.select_vhost_multiple" with mock.patch(mock_path) as mock_select_vhs: mock_select_vhs.return_value = [] self.config._choose_vhosts_wildcard("*.com", @@ -1055,14 +1055,14 @@ class InstallSslOptionsConfTest(util.NginxTest): return _hash def test_prev_file_updates_to_current(self): - from certbot_nginx._internal.constants import ALL_SSL_OPTIONS_HASHES + from certbot._internal.plugins.nginx.constants import ALL_SSL_OPTIONS_HASHES with mock.patch('certbot.crypto_util.sha256sum', new=self._mock_hash_except_ssl_conf_src(ALL_SSL_OPTIONS_HASHES[0])): self._call() self._assert_current_file() def test_prev_file_updates_to_current_old_nginx(self): - from certbot_nginx._internal.constants import ALL_SSL_OPTIONS_HASHES + from certbot._internal.plugins.nginx.constants import ALL_SSL_OPTIONS_HASHES self.config.version = (1, 5, 8) with mock.patch('certbot.crypto_util.sha256sum', new=self._mock_hash_except_ssl_conf_src(ALL_SSL_OPTIONS_HASHES[0])): @@ -1099,7 +1099,7 @@ class InstallSslOptionsConfTest(util.NginxTest): assert not mock_logger.warning.called def test_current_file_hash_in_all_hashes(self): - from certbot_nginx._internal.constants import ALL_SSL_OPTIONS_HASHES + from certbot._internal.plugins.nginx.constants import ALL_SSL_OPTIONS_HASHES assert self._current_ssl_options_hash() in ALL_SSL_OPTIONS_HASHES, \ "Constants.ALL_SSL_OPTIONS_HASHES must be appended" \ " with the sha256 hash of self.config.mod_ssl_conf when it is updated." @@ -1113,10 +1113,10 @@ class InstallSslOptionsConfTest(util.NginxTest): """ import importlib.resources - from certbot_nginx._internal.constants import ALL_SSL_OPTIONS_HASHES + from certbot._internal.plugins.nginx.constants import ALL_SSL_OPTIONS_HASHES - tls_configs_ref = importlib.resources.files("certbot_nginx").joinpath( - "_internal", "tls_configs") + tls_configs_ref = importlib.resources.files("certbot").joinpath( + "_internal", "plugins", "nginx", "tls_configs") with importlib.resources.as_file(tls_configs_ref) as tls_configs_dir: for tls_config_file in os.listdir(tls_configs_dir): file_hash = crypto_util.sha256sum(os.path.join(tls_configs_dir, tls_config_file)) @@ -1149,10 +1149,10 @@ class InstallSslOptionsConfTest(util.NginxTest): class DetermineDefaultServerRootTest(certbot_test_util.ConfigTestCase): - """Tests for certbot_nginx._internal.configurator._determine_default_server_root.""" + """Tests for certbot._internal.plugins.nginx.configurator._determine_default_server_root.""" def _call(self): - from certbot_nginx._internal.configurator import _determine_default_server_root + from certbot._internal.plugins.nginx.configurator import _determine_default_server_root return _determine_default_server_root() @mock.patch.dict(os.environ, {"CERTBOT_DOCS": "1"}) diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/display_ops_test.py b/certbot/src/certbot/_internal/tests/plugins/nginx/display_ops_test.py similarity index 79% rename from certbot-nginx/src/certbot_nginx/_internal/tests/display_ops_test.py rename to certbot/src/certbot/_internal/tests/plugins/nginx/display_ops_test.py index 4d1256b0d..96f21495d 100644 --- a/certbot-nginx/src/certbot_nginx/_internal/tests/display_ops_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/nginx/display_ops_test.py @@ -1,17 +1,17 @@ -"""Test certbot_nginx._internal.display_ops.""" +"""Test certbot._internal.plugins.nginx.display_ops.""" import sys import pytest from certbot.display import util as display_util from certbot.tests import util as certbot_util -from certbot_nginx._internal import parser -from certbot_nginx._internal.display_ops import select_vhost_multiple -from certbot_nginx._internal.tests import test_util as util +from certbot._internal.plugins.nginx import parser +from certbot._internal.plugins.nginx.display_ops import select_vhost_multiple +from certbot._internal.tests.plugins.nginx import test_util as util class SelectVhostMultiTest(util.NginxTest): - """Tests for certbot_nginx._internal.display_ops.select_vhost_multiple.""" + """Tests for certbot._internal.plugins.nginx.display_ops.select_vhost_multiple.""" def setUp(self): super().setUp() diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/http_01_test.py b/certbot/src/certbot/_internal/tests/plugins/nginx/http_01_test.py similarity index 90% rename from certbot-nginx/src/certbot_nginx/_internal/tests/http_01_test.py rename to certbot/src/certbot/_internal/tests/plugins/nginx/http_01_test.py index c06edb3dd..6c62033f1 100644 --- a/certbot-nginx/src/certbot_nginx/_internal/tests/http_01_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/nginx/http_01_test.py @@ -1,4 +1,4 @@ -"""Tests for certbot_nginx._internal.http_01""" +"""Tests for certbot._internal.plugins.nginx.http_01""" import sys from unittest import mock @@ -9,8 +9,8 @@ from acme import challenges, messages from certbot import achallenges from certbot.tests import acme_util from certbot.tests import util as test_util -from certbot_nginx._internal.obj import Addr -from certbot_nginx._internal.tests import test_util as util +from certbot._internal.plugins.nginx.obj import Addr +from certbot._internal.tests.plugins.nginx import test_util as util AUTH_KEY = jose.JWKRSA.load(test_util.load_vector("rsa512_key.pem")) @@ -59,14 +59,14 @@ class HttpPerformTest(util.NginxTest): config = self.get_nginx_configurator( self.config_path, self.config_dir, self.work_dir, self.logs_dir) - from certbot_nginx._internal import http_01 + from certbot._internal.plugins.nginx import http_01 self.http01 = http_01.NginxHttp01(config) def test_perform0(self): responses = self.http01.perform() assert [] == responses - @mock.patch("certbot_nginx._internal.configurator.NginxConfigurator.save") + @mock.patch("certbot._internal.plugins.nginx.configurator.NginxConfigurator.save") def test_perform1(self, mock_save): self.http01.add_chall(self.achalls[0]) response = self.achalls[0].response(self.account_key) @@ -112,7 +112,7 @@ class HttpPerformTest(util.NginxTest): # self.assertEqual(vhost.addrs, set(v_addr2_print)) # self.assertEqual(vhost.names, set([response.z_domain.decode('ascii')])) - @mock.patch('certbot_nginx._internal.parser.NginxParser.add_server_directives') + @mock.patch('certbot._internal.plugins.nginx.parser.NginxParser.add_server_directives') def test_mod_config_http_and_https(self, mock_add_server_directives): """A server_name with both HTTP and HTTPS vhosts should get modded in both vhosts""" self.configuration.https_port = 443 @@ -123,8 +123,8 @@ class HttpPerformTest(util.NginxTest): # 2 * 'rewrite' + 2 * 'return 200 keyauthz' = 4 assert mock_add_server_directives.call_count == 4 - @mock.patch('certbot_nginx._internal.parser.nginxparser.dump') - @mock.patch('certbot_nginx._internal.parser.NginxParser.add_server_directives') + @mock.patch('certbot._internal.plugins.nginx.parser.nginxparser.dump') + @mock.patch('certbot._internal.plugins.nginx.parser.NginxParser.add_server_directives') def test_mod_config_only_https(self, mock_add_server_directives, mock_dump): """A server_name with only an HTTPS vhost should get modded""" self.http01.add_chall(self.achalls[4]) # ipv6ssl.com @@ -136,7 +136,7 @@ class HttpPerformTest(util.NginxTest): # should have been created and written to the challenge conf file assert mock_dump.call_args[0][0] != [] - @mock.patch('certbot_nginx._internal.parser.NginxParser.add_server_directives') + @mock.patch('certbot._internal.plugins.nginx.parser.NginxParser.add_server_directives') def test_mod_config_deduplicate(self, mock_add_server_directives): """A vhost that appears in both HTTP and HTTPS vhosts only gets modded once""" achall = achallenges.KeyAuthorizationAnnotatedChallenge( @@ -198,7 +198,7 @@ class HttpPerformTest(util.NginxTest): f.write(original_example_com) self.http01.configurator.parser.load() - @mock.patch("certbot_nginx._internal.configurator.NginxConfigurator.ipv6_info") + @mock.patch("certbot._internal.plugins.nginx.configurator.NginxConfigurator.ipv6_info") def test_default_listen_addresses_no_memoization(self, ipv6_info): # pylint: disable=protected-access ipv6_info.return_value = (True, True) @@ -208,7 +208,7 @@ class HttpPerformTest(util.NginxTest): self.http01._default_listen_addresses() assert ipv6_info.call_count == 2 - @mock.patch("certbot_nginx._internal.configurator.NginxConfigurator.ipv6_info") + @mock.patch("certbot._internal.plugins.nginx.configurator.NginxConfigurator.ipv6_info") def test_default_listen_addresses_t_t(self, ipv6_info): # pylint: disable=protected-access ipv6_info.return_value = (True, True) @@ -217,7 +217,7 @@ class HttpPerformTest(util.NginxTest): http_ipv6_addr = Addr.fromstring("[::]:80") assert addrs == [http_addr, http_ipv6_addr] - @mock.patch("certbot_nginx._internal.configurator.NginxConfigurator.ipv6_info") + @mock.patch("certbot._internal.plugins.nginx.configurator.NginxConfigurator.ipv6_info") def test_default_listen_addresses_t_f(self, ipv6_info): # pylint: disable=protected-access ipv6_info.return_value = (True, False) @@ -226,7 +226,7 @@ class HttpPerformTest(util.NginxTest): http_ipv6_addr = Addr.fromstring("[::]:80 ipv6only=on") assert addrs == [http_addr, http_ipv6_addr] - @mock.patch("certbot_nginx._internal.configurator.NginxConfigurator.ipv6_info") + @mock.patch("certbot._internal.plugins.nginx.configurator.NginxConfigurator.ipv6_info") def test_default_listen_addresses_f_f(self, ipv6_info): # pylint: disable=protected-access ipv6_info.return_value = (False, False) diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/nginxparser_test.py b/certbot/src/certbot/_internal/tests/plugins/nginx/nginxparser_test.py similarity index 97% rename from certbot-nginx/src/certbot_nginx/_internal/tests/nginxparser_test.py rename to certbot/src/certbot/_internal/tests/plugins/nginx/nginxparser_test.py index 764634832..58c7f4faa 100644 --- a/certbot-nginx/src/certbot_nginx/_internal/tests/nginxparser_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/nginx/nginxparser_test.py @@ -1,4 +1,4 @@ -"""Test for certbot_nginx._internal.nginxparser.""" +"""Test for certbot._internal.plugins.nginx.nginxparser.""" import copy import operator import sys @@ -8,13 +8,13 @@ import unittest from pyparsing import ParseException import pytest -from certbot_nginx._internal.nginxparser import dump -from certbot_nginx._internal.nginxparser import dumps -from certbot_nginx._internal.nginxparser import load -from certbot_nginx._internal.nginxparser import loads -from certbot_nginx._internal.nginxparser import RawNginxParser -from certbot_nginx._internal.nginxparser import UnspacedList -from certbot_nginx._internal.tests import test_util as util +from certbot._internal.plugins.nginx.nginxparser import dump +from certbot._internal.plugins.nginx.nginxparser import dumps +from certbot._internal.plugins.nginx.nginxparser import load +from certbot._internal.plugins.nginx.nginxparser import loads +from certbot._internal.plugins.nginx.nginxparser import RawNginxParser +from certbot._internal.plugins.nginx.nginxparser import UnspacedList +from certbot._internal.tests.plugins.nginx import test_util as util FIRST = operator.itemgetter(0) diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/obj_test.py b/certbot/src/certbot/_internal/tests/plugins/nginx/obj_test.py similarity index 91% rename from certbot-nginx/src/certbot_nginx/_internal/tests/obj_test.py rename to certbot/src/certbot/_internal/tests/plugins/nginx/obj_test.py index 9dd56aaa4..37c2d16c0 100644 --- a/certbot-nginx/src/certbot_nginx/_internal/tests/obj_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/nginx/obj_test.py @@ -1,4 +1,4 @@ -"""Test the helper objects in certbot_nginx._internal.obj.""" +"""Test the helper objects in certbot._internal.plugins.nginx.obj.""" import itertools import sys import unittest @@ -9,7 +9,7 @@ import pytest class AddrTest(unittest.TestCase): """Test the Addr class.""" def setUp(self): - from certbot_nginx._internal.obj import Addr + from certbot._internal.plugins.nginx.obj import Addr self.addr1 = Addr.fromstring("192.168.1.1") self.addr2 = Addr.fromstring("192.168.1.1:* ssl") self.addr3 = Addr.fromstring("192.168.1.1:80") @@ -52,7 +52,7 @@ class AddrTest(unittest.TestCase): assert self.addr7.default is True def test_fromstring_socket(self): - from certbot_nginx._internal.obj import Addr, SocketAddrError + from certbot._internal.plugins.nginx.obj import Addr, SocketAddrError socket_string = r"unix:/var/run/nginx.sock" with pytest.raises(SocketAddrError, match=socket_string): Addr.fromstring(socket_string) @@ -77,14 +77,14 @@ class AddrTest(unittest.TestCase): assert self.addr6.to_string(include_default=False) == "80" def test_eq(self): - from certbot_nginx._internal.obj import Addr + from certbot._internal.plugins.nginx.obj import Addr new_addr1 = Addr.fromstring("192.168.1.1 spdy") assert self.addr1 == new_addr1 assert self.addr1 != self.addr2 assert self.addr1 != 3333 def test_equivalent_any_addresses(self): - from certbot_nginx._internal.obj import Addr + from certbot._internal.plugins.nginx.obj import Addr any_addresses = ("0.0.0.0:80 default_server ssl", "80 default_server ssl", "*:80 default_server ssl", @@ -102,7 +102,7 @@ class AddrTest(unittest.TestCase): Addr.fromstring(any_address) def test_set_inclusion(self): - from certbot_nginx._internal.obj import Addr + from certbot._internal.plugins.nginx.obj import Addr set_a = {self.addr1, self.addr2} addr1b = Addr.fromstring("192.168.1.1") addr2b = Addr.fromstring("192.168.1.1:* ssl") @@ -114,8 +114,8 @@ class AddrTest(unittest.TestCase): class VirtualHostTest(unittest.TestCase): """Test the VirtualHost class.""" def setUp(self): - from certbot_nginx._internal.obj import Addr - from certbot_nginx._internal.obj import VirtualHost + from certbot._internal.plugins.nginx.obj import Addr + from certbot._internal.plugins.nginx.obj import VirtualHost raw1 = [ ['listen', '69.50.225.155:9000'], [['if', '($scheme', '!=', '"https") '], @@ -164,8 +164,8 @@ class VirtualHostTest(unittest.TestCase): {'localhost'}, raw_has_hsts, []) def test_eq(self): - from certbot_nginx._internal.obj import Addr - from certbot_nginx._internal.obj import VirtualHost + from certbot._internal.plugins.nginx.obj import Addr + from certbot._internal.plugins.nginx.obj import VirtualHost vhost1b = VirtualHost( "filep", {Addr.fromstring("localhost blah")}, False, False, @@ -188,9 +188,9 @@ class VirtualHostTest(unittest.TestCase): assert self.vhost1.has_header('Bogus-Header') is False def test_contains_list(self): - from certbot_nginx._internal.configurator import _test_block_from_block - from certbot_nginx._internal.obj import Addr - from certbot_nginx._internal.obj import VirtualHost + from certbot._internal.plugins.nginx.configurator import _test_block_from_block + from certbot._internal.plugins.nginx.obj import Addr + from certbot._internal.plugins.nginx.obj import VirtualHost test_block = [ ['\n ', 'return', ' ', '301', ' ', 'https://$host$request_uri'], ['\n'] diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/parser_obj_test.py b/certbot/src/certbot/_internal/tests/plugins/nginx/parser_obj_test.py similarity index 89% rename from certbot-nginx/src/certbot_nginx/_internal/tests/parser_obj_test.py rename to certbot/src/certbot/_internal/tests/plugins/nginx/parser_obj_test.py index 05bc86dbc..f809fe025 100644 --- a/certbot-nginx/src/certbot_nginx/_internal/tests/parser_obj_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/nginx/parser_obj_test.py @@ -9,19 +9,19 @@ from unittest import mock import pytest -from certbot_nginx._internal.parser_obj import COMMENT_BLOCK -from certbot_nginx._internal.parser_obj import parse_raw +from certbot._internal.plugins.nginx.parser_obj import COMMENT_BLOCK +from certbot._internal.plugins.nginx.parser_obj import parse_raw class CommentHelpersTest(unittest.TestCase): def test_is_comment(self): - from certbot_nginx._internal.parser_obj import _is_comment + from certbot._internal.plugins.nginx.parser_obj import _is_comment assert _is_comment(parse_raw(['#'])) assert _is_comment(parse_raw(['#', ' literally anything else'])) assert not _is_comment(parse_raw(['not', 'even', 'a', 'comment'])) def test_is_certbot_comment(self): - from certbot_nginx._internal.parser_obj import _is_certbot_comment + from certbot._internal.plugins.nginx.parser_obj import _is_certbot_comment assert _is_certbot_comment( parse_raw(COMMENT_BLOCK)) assert not _is_certbot_comment( @@ -32,8 +32,8 @@ class CommentHelpersTest(unittest.TestCase): parse_raw(['not', 'even', 'a', 'comment'])) def test_certbot_comment(self): - from certbot_nginx._internal.parser_obj import _certbot_comment - from certbot_nginx._internal.parser_obj import _is_certbot_comment + from certbot._internal.plugins.nginx.parser_obj import _certbot_comment + from certbot._internal.plugins.nginx.parser_obj import _is_certbot_comment comment = _certbot_comment(None) assert _is_certbot_comment(comment) assert comment.dump() == COMMENT_BLOCK @@ -43,7 +43,7 @@ class CommentHelpersTest(unittest.TestCase): class ParsingHooksTest(unittest.TestCase): def test_is_sentence(self): - from certbot_nginx._internal.parser_obj import Sentence + from certbot._internal.plugins.nginx.parser_obj import Sentence assert not Sentence.should_parse([]) assert Sentence.should_parse(['']) assert Sentence.should_parse(['word']) @@ -52,7 +52,7 @@ class ParsingHooksTest(unittest.TestCase): assert not Sentence.should_parse(['word', []]) def test_is_block(self): - from certbot_nginx._internal.parser_obj import Block + from certbot._internal.plugins.nginx.parser_obj import Block assert not Block.should_parse([]) assert not Block.should_parse(['']) assert not Block.should_parse(['two', 'words']) @@ -64,7 +64,7 @@ class ParsingHooksTest(unittest.TestCase): assert Block.should_parse([['block_name'], [['many'], ['statements'], 'here']]) assert Block.should_parse([['if', ' ', '(whatever)'], ['hi']]) - @mock.patch("certbot_nginx._internal.parser_obj.Parsable.parsing_hooks") + @mock.patch("certbot._internal.plugins.nginx.parser_obj.Parsable.parsing_hooks") def test_parse_raw(self, parsing_hooks): fake_parser1 = mock.Mock() fake_parser1.should_parse = lambda x: True @@ -82,7 +82,7 @@ class ParsingHooksTest(unittest.TestCase): fake_parser1().parse.assert_not_called() fake_parser2().parse.assert_called_once() - @mock.patch("certbot_nginx._internal.parser_obj.Parsable.parsing_hooks") + @mock.patch("certbot._internal.plugins.nginx.parser_obj.Parsable.parsing_hooks") def test_parse_raw_no_match(self, parsing_hooks): from certbot import errors fake_parser1 = mock.Mock() @@ -94,7 +94,7 @@ class ParsingHooksTest(unittest.TestCase): with pytest.raises(errors.MisconfigurationError): parse_raw([]) - @mock.patch("certbot_nginx._internal.parser_obj.Parsable.parsing_hooks") + @mock.patch("certbot._internal.plugins.nginx.parser_obj.Parsable.parsing_hooks") def test_parse_raw_passes_add_spaces(self, parsing_hooks): fake_parser1 = mock.Mock() fake_parser1.should_parse = lambda x: True @@ -107,7 +107,7 @@ class ParsingHooksTest(unittest.TestCase): class SentenceTest(unittest.TestCase): def setUp(self): - from certbot_nginx._internal.parser_obj import Sentence + from certbot._internal.plugins.nginx.parser_obj import Sentence self.sentence = Sentence(None) def test_parse_bad_sentence_raises_error(self): @@ -157,7 +157,7 @@ class SentenceTest(unittest.TestCase): class BlockTest(unittest.TestCase): def setUp(self): - from certbot_nginx._internal.parser_obj import Block + from certbot._internal.plugins.nginx.parser_obj import Block self.bloc = Block(None) self.name = ['server', 'name'] self.contents = [['thing', '1'], ['thing', '2'], ['another', 'one']] @@ -173,8 +173,8 @@ class BlockTest(unittest.TestCase): def test_iterate_match(self): # can match on contents while expanded - from certbot_nginx._internal.parser_obj import Block - from certbot_nginx._internal.parser_obj import Sentence + from certbot._internal.plugins.nginx.parser_obj import Block + from certbot._internal.plugins.nginx.parser_obj import Sentence expected = [['thing', '1'], ['thing', '2']] for i, elem in enumerate(self.bloc.iterate(expanded=True, match=lambda x: isinstance(x, Sentence) and 'thing' in x.words)): @@ -216,7 +216,7 @@ class BlockTest(unittest.TestCase): class StatementsTest(unittest.TestCase): def setUp(self): - from certbot_nginx._internal.parser_obj import Statements + from certbot._internal.plugins.nginx.parser_obj import Statements self.statements = Statements(None) self.raw = [ ['sentence', 'one'], diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/parser_test.py b/certbot/src/certbot/_internal/tests/plugins/nginx/parser_test.py similarity index 97% rename from certbot-nginx/src/certbot_nginx/_internal/tests/parser_test.py rename to certbot/src/certbot/_internal/tests/plugins/nginx/parser_test.py index 1e398717c..912bd48fe 100644 --- a/certbot-nginx/src/certbot_nginx/_internal/tests/parser_test.py +++ b/certbot/src/certbot/_internal/tests/plugins/nginx/parser_test.py @@ -1,4 +1,4 @@ -"""Tests for certbot_nginx._internal.parser.""" +"""Tests for certbot._internal.plugins.nginx.parser.""" import glob import re import shutil @@ -8,10 +8,10 @@ import pytest from certbot import errors from certbot.compat import os -from certbot_nginx._internal import nginxparser -from certbot_nginx._internal import obj -from certbot_nginx._internal import parser -from certbot_nginx._internal.tests import test_util as util +from certbot._internal.plugins.nginx import nginxparser +from certbot._internal.plugins.nginx import obj +from certbot._internal.plugins.nginx import parser +from certbot._internal.tests.plugins.nginx import test_util as util class NginxParserTest(util.NginxTest): @@ -264,7 +264,7 @@ class NginxParserTest(util.NginxTest): [['foo', 'bar'], ['ssl_certificate', '/etc/ssl/cert2.pem']]) nparser.add_server_directives(mock_vhost, [['foo', 'bar']]) - from certbot_nginx._internal.parser import COMMENT + from certbot._internal.plugins.nginx.parser import COMMENT assert nparser.parsed[example_com] == \ [[['server'], [['listen', '69.50.225.155:9000'], ['listen', '127.0.0.1'], @@ -298,7 +298,7 @@ class NginxParserTest(util.NginxTest): nparser.add_server_directives(mock_vhost, [['\n ', 'include', ' ', nparser.abs_path('comment_in_file.conf')]]) - from certbot_nginx._internal.parser import COMMENT + from certbot._internal.plugins.nginx.parser import COMMENT assert nparser.parsed[example_com] == \ [[['server'], [['listen', '69.50.225.155:9000'], ['listen', '127.0.0.1'], @@ -317,7 +317,7 @@ class NginxParserTest(util.NginxTest): mock_vhost = obj.VirtualHost(filep, None, None, None, target, None, [0]) nparser.update_or_add_server_directives( mock_vhost, [['server_name', 'foobar.com']]) - from certbot_nginx._internal.parser import COMMENT + from certbot._internal.plugins.nginx.parser import COMMENT assert nparser.parsed[filep] == \ [[['server'], [['listen', '69.50.225.155:9000'], ['listen', '127.0.0.1'], @@ -378,8 +378,8 @@ class NginxParserTest(util.NginxTest): ["\n", "a", " ", "b", "\n"], ["c", " ", "d"], ["\n", "e", " ", "f"]]) - from certbot_nginx._internal.parser import COMMENT_BLOCK - from certbot_nginx._internal.parser import comment_directive + from certbot._internal.plugins.nginx.parser import COMMENT_BLOCK + from certbot._internal.plugins.nginx.parser import comment_directive comment_directive(block, 1) comment_directive(block, 0) assert block.spaced == [ @@ -403,7 +403,7 @@ class NginxParserTest(util.NginxTest): ssl_prefer_server_ciphers on; }""") block = server_block[0][1] - from certbot_nginx._internal.parser import _comment_out_directive + from certbot._internal.plugins.nginx.parser import _comment_out_directive _comment_out_directive(block, 4, "blah1") _comment_out_directive(block, 5, "blah2") _comment_out_directive(block, 6, "blah3") diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/test_util.py b/certbot/src/certbot/_internal/tests/plugins/nginx/test_util.py similarity index 93% rename from certbot-nginx/src/certbot_nginx/_internal/tests/test_util.py rename to certbot/src/certbot/_internal/tests/plugins/nginx/test_util.py index cf73b3d42..ddb2b0ea1 100644 --- a/certbot-nginx/src/certbot_nginx/_internal/tests/test_util.py +++ b/certbot/src/certbot/_internal/tests/plugins/nginx/test_util.py @@ -1,4 +1,4 @@ -"""Common utilities for certbot_nginx.""" +"""Common test utilities for the nginx plugin.""" import copy import importlib.resources import shutil @@ -12,8 +12,8 @@ from certbot import util from certbot.compat import os from certbot.plugins import common from certbot.tests import util as test_util -from certbot_nginx._internal import configurator -from certbot_nginx._internal import nginxparser +from certbot._internal.plugins.nginx import configurator +from certbot._internal.plugins.nginx import nginxparser class NginxTest(test_util.ConfigTestCase): @@ -63,9 +63,9 @@ class NginxTest(test_util.ConfigTestCase): self.configuration.http01_port = 80 self.configuration.https_port = 5001 - with mock.patch("certbot_nginx._internal.configurator.NginxConfigurator." + with mock.patch("certbot._internal.plugins.nginx.configurator.NginxConfigurator." "config_test"): - with mock.patch("certbot_nginx._internal.configurator.util." + with mock.patch("certbot._internal.plugins.nginx.configurator.util." "exe_exists") as mock_exe_exists: mock_exe_exists.return_value = True config = configurator.NginxConfigurator( diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/broken.conf b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/broken.conf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/broken.conf rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/broken.conf diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/comment_in_file.conf b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/comment_in_file.conf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/comment_in_file.conf rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/comment_in_file.conf diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/edge_cases.conf b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/edge_cases.conf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/edge_cases.conf rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/edge_cases.conf diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/foo.conf b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/foo.conf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/foo.conf rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/foo.conf diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/invalid_unicode_comments.conf b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/invalid_unicode_comments.conf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/invalid_unicode_comments.conf rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/invalid_unicode_comments.conf diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/mime.types b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/mime.types similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/mime.types rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/mime.types diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/minimalistic_comments.conf b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/minimalistic_comments.conf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/minimalistic_comments.conf rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/minimalistic_comments.conf diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/multiline_quotes.conf b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/multiline_quotes.conf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/multiline_quotes.conf rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/multiline_quotes.conf diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/nginx-include.conf b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/nginx-include.conf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/nginx-include.conf rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/nginx-include.conf diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/nginx.conf b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/nginx.conf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/nginx.conf rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/nginx.conf diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/server.conf b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/server.conf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/server.conf rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/server.conf diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/addr-80.com b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/addr-80.com similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/addr-80.com rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/addr-80.com diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/both.com b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/both.com similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/both.com rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/both.com diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/default b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/default similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/default rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/default diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/example.com b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/example.com similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/example.com rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/example.com diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/example.net b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/example.net similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/example.net rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/example.net diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/globalssl.com b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/globalssl.com similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/globalssl.com rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/globalssl.com diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/headers.com b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/headers.com similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/headers.com rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/headers.com diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/ipv6.com b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/ipv6.com similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/ipv6.com rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/ipv6.com diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/ipv6ssl.com b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/ipv6ssl.com similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/ipv6ssl.com rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/ipv6ssl.com diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/migration.com b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/migration.com similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/migration.com rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/migration.com diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/no-listens.com b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/no-listens.com similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/no-listens.com rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/no-listens.com diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/sslon.com b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/sslon.com similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/sites-enabled/sslon.com rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/sites-enabled/sslon.com diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/fastcgi_params b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/fastcgi_params similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/fastcgi_params rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/fastcgi_params diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-utf b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-utf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-utf rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-utf diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-win b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-win similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-win rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-win diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/mime.types b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/mime.types similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/mime.types rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/mime.types diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi-ui.conf.1.4.1 b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi-ui.conf.1.4.1 similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi-ui.conf.1.4.1 rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi-ui.conf.1.4.1 diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi.rules b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi.rules similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi.rules rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi.rules diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi_core.rules b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi_core.rules similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi_core.rules rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi_core.rules diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/nginx.conf b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/nginx.conf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/nginx.conf rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/nginx.conf diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/proxy_params b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/proxy_params similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/proxy_params rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/proxy_params diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/scgi_params b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/scgi_params similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/scgi_params rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/scgi_params diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-available/default b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-available/default similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-available/default rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-available/default diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-enabled/default b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-enabled/default similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-enabled/default rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-enabled/default diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/uwsgi_params b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/uwsgi_params similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/uwsgi_params rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/uwsgi_params diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/win-utf b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/win-utf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/win-utf rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/ubuntu_nginx_1_4_6/default_vhost/nginx/win-utf diff --git a/certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/valid_unicode_comments.conf b/certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/valid_unicode_comments.conf similarity index 100% rename from certbot-nginx/src/certbot_nginx/_internal/tests/testdata/etc_nginx/valid_unicode_comments.conf rename to certbot/src/certbot/_internal/tests/plugins/nginx/testdata/etc_nginx/valid_unicode_comments.conf diff --git a/certbot/src/certbot/plugins/apache.py b/certbot/src/certbot/plugins/apache.py new file mode 100644 index 000000000..13a4c831a --- /dev/null +++ b/certbot/src/certbot/plugins/apache.py @@ -0,0 +1,7 @@ +"""Despite being public API, this is only meant for use in our certbot-apache plugin, and isn't +intended for public use.""" + +from certbot._internal.plugins.apache import entrypoint + + +ENTRYPOINT = entrypoint.get_configurator() diff --git a/certbot/src/certbot/plugins/common.py b/certbot/src/certbot/plugins/common.py index 90c499206..a29c7104b 100644 --- a/certbot/src/certbot/plugins/common.py +++ b/certbot/src/certbot/plugins/common.py @@ -431,7 +431,7 @@ def install_version_controlled_file(dest_path: str, digest_path: str, src_path: dest_path, src_path, dest_path) -# test utils used by certbot_apache/certbot_nginx (hence +# test utils used by the apache/nginx plugins (hence # "pragma: no cover") TODO: this might quickly lead to dead code (also # c.f. #383) diff --git a/certbot/src/certbot/plugins/nginx.py b/certbot/src/certbot/plugins/nginx.py new file mode 100644 index 000000000..41fd96aef --- /dev/null +++ b/certbot/src/certbot/plugins/nginx.py @@ -0,0 +1,7 @@ +"""Despite being public API, this is only meant for use in our certbot-nginx plugin, and isn't +intended for public use.""" + +from certbot._internal.plugins.nginx import configurator + + +ENTRYPOINT = configurator.NginxConfigurator diff --git a/letstest/setup.py b/letstest/setup.py index ac63492d4..053b082ff 100644 --- a/letstest/setup.py +++ b/letstest/setup.py @@ -1,6 +1,6 @@ from setuptools import setup -version = '5.5.0.dev0' +version = '5.6.0.dev0' setup( version=version, diff --git a/newsfragments/10584.changed b/newsfragments/10584.changed deleted file mode 100644 index 653153284..000000000 --- a/newsfragments/10584.changed +++ /dev/null @@ -1 +0,0 @@ -The certbot.ocsp module has been deprecated and will be removed in the next major release. This is not a change to Certbot's OCSP functionality. The code is just being removed from Certbot's public API. diff --git a/newsfragments/10619.fixed b/newsfragments/10619.fixed new file mode 100644 index 000000000..256831182 --- /dev/null +++ b/newsfragments/10619.fixed @@ -0,0 +1 @@ +Our Docker images have been updated to use Python 3.14 and Alpine Linux 3.23. diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 760c65b98..67350a0d2 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -1,5 +1,5 @@ #base image -FROM python:3.12-alpine3.20 AS certbot +FROM python:3.14-alpine3.23 AS certbot ENTRYPOINT [ "certbot" ] EXPOSE 80 443 diff --git a/tools/notify_mattermost.py b/tools/notify_mattermost.py new file mode 100755 index 000000000..320f90c64 --- /dev/null +++ b/tools/notify_mattermost.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +""" +Script to notify the person doing the release that the Azure run was successful. + +Run: + +python tools/notify_mattermost.py GITHUB_AUTHOR_NAME MATTERMOST_WEBHOOK_URL +""" +import os +import random +import requests +import sys + +repo_name = os.environ['BUILD_REPOSITORY_ID'] +build_id = os.environ['BUILD_BUILDID'] + +def get_greeting(): + fun_greetings = [ + 'Hey', + 'Paging', + 'Hi', + 'Pinging', + ] + return random.choice(fun_greetings) + +def get_message(): + fun_success_messages = [ + 'the certbot release is ready to come out of the oven!', + "it's release-finishing go time!", + 'all certbot release systems are set for launch!', + ] + + # https://learn.microsoft.com/en-us/rest/api/azure/devops/build/timeline/get?view=azure-devops-rest-7.1 + timeline_url = f'https://dev.azure.com/{repo_name}/_apis/build/builds/{build_id}/timeline/?api-version=7.1' + response = requests.get(timeline_url) + response.raise_for_status() + data = response.json() + deploy_record = next((rec for rec in data['records'] if rec['name'] == 'Deploy'), None) + if deploy_record is None: + raise RuntimeError('Unable to find the record for the Deploy stage') + deploy_result = deploy_record['result'] + if deploy_result in ['succeeded', 'succeededWithIssues']: + message = random.choice(fun_success_messages) + elif deploy_result in ['skipped', 'failed', 'abandoned']: + message = "the release pipeline has failed." + else: + raise RuntimeError('Unexpected stage result {0}'.format(deploy_result)) + return message + +def get_mattermost_url(): + # This should be a mattermost webhook url that posts to a specific channel, + # created by certbotbot, with a file containing the url saved in azure pipelines secret + # files, under pipelines > library. The secret file will need to be given permission to + # be used by the specific pipeline, in this case 'release.' + url_path = sys.argv[2] + with open(url_path, 'r') as file: + url = file.read().rstrip() + return url + +def get_headers(): + headers = { + 'Content-Type': 'application/json', + } + return headers + +def get_content(): + build_url = f'https://dev.azure.com/{repo_name}/_build/results?buildId={build_id}&view=results' + + # We use github author here because it's what we have access to. If the name sometimes + # changes, add any name it might be. Check the git log. + requested_for = sys.argv[1].rstrip() + # This is a map of team member github author names to opensource mattermost username + usernames_map = { + 'Will Greenberg': 'willg', + 'Erica Portnoy': 'erica', + 'Brad Warren': 'brad', + 'ohemorange': 'erica', + } + + if requested_for in usernames_map: + text_body = f'{get_greeting()} @{usernames_map[requested_for]}, {get_message()}\n{build_url}' + else: + text_body = (f"{get_greeting()} {requested_for}, {get_message()}\nIf you'd like to get @ mentioned for " + "releases you do in the future, please modify tools/notify_mattermost.py with your " + f"git author name.\n{build_url}") + + content = { + 'text': text_body, + } + return content + +response = requests.request( + method='POST', + url=get_mattermost_url(), + headers=get_headers(), + json=get_content(), +) +response.raise_for_status() diff --git a/tools/pinning/current/pyproject.toml b/tools/pinning/current/pyproject.toml index 8889cf620..ce2be69fe 100644 --- a/tools/pinning/current/pyproject.toml +++ b/tools/pinning/current/pyproject.toml @@ -28,7 +28,7 @@ certbot-dns-rfc2136 = {path = "../../../certbot-dns-rfc2136", extras = ["docs"]} certbot-dns-route53 = {path = "../../../certbot-dns-route53", extras = ["docs"]} certbot-dns-sakuracloud = {path = "../../../certbot-dns-sakuracloud", extras = ["docs"]} certbot-nginx = {path = "../../../certbot-nginx"} -certbot-apache = {path = "../../../certbot-apache", extras = ["dev"]} +certbot-apache = {path = "../../../certbot-apache"} certbot = {path = "../../../certbot", extras = ["all"]} acme = {path = "../../../acme", extras = ["docs", "test"]} letstest = {path = "../../../letstest"} diff --git a/tools/pinning/oldest/pyproject.toml b/tools/pinning/oldest/pyproject.toml index a5e70e455..875a567d9 100644 --- a/tools/pinning/oldest/pyproject.toml +++ b/tools/pinning/oldest/pyproject.toml @@ -39,7 +39,7 @@ certbot-dns-rfc2136 = {path = "../../../certbot-dns-rfc2136"} certbot-dns-route53 = {path = "../../../certbot-dns-route53"} certbot-dns-sakuracloud = {path = "../../../certbot-dns-sakuracloud"} certbot-nginx = {path = "../../../certbot-nginx"} -certbot-apache = {path = "../../../certbot-apache", extras = ["dev"]} +certbot-apache = {path = "../../../certbot-apache"} certbot = {path = "../../../certbot", extras = ["test"]} acme = {path = "../../../acme", extras = ["test"]} diff --git a/tools/requirements.txt b/tools/requirements.txt index e393a6802..d0966b7f7 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -6,35 +6,34 @@ # https://docs.github.com/en/github/visualizing-repository-data-with-graphs/about-the-dependency-graph#supported-package-ecosystems # for more info. alabaster==1.0.0 ; python_version >= "3.10" and python_version < "4.0" -anyio==4.12.1 ; python_version >= "3.10" and python_version < "4.0" +anyio==4.13.0 ; python_version >= "3.10" and python_version < "4.0" apacheconfig==0.3.2 ; python_version >= "3.10" and python_version < "4.0" astroid==3.3.11 ; python_version >= "3.10" and python_version < "4.0" asttokens==3.0.1 ; python_version >= "3.10" and python_version < "4.0" -attrs==25.4.0 ; python_version >= "3.10" and python_version < "4.0" -azure-core==1.38.0 ; python_version >= "3.10" and python_version < "4.0" +attrs==26.1.0 ; python_version >= "3.10" and python_version < "4.0" +azure-core==1.39.0 ; python_version >= "3.10" and python_version < "4.0" azure-devops==7.1.0b4 ; python_version >= "3.10" and python_version < "4.0" babel==2.18.0 ; python_version >= "3.10" and python_version < "4.0" backports-tarfile==1.2.0 ; python_version >= "3.10" and python_version < "3.12" bcrypt==5.0.0 ; python_version >= "3.10" and python_version < "4.0" beautifulsoup4==4.14.3 ; python_version >= "3.10" and python_version < "4.0" -boto3==1.42.40 ; python_version >= "3.10" and python_version < "4.0" -botocore==1.42.40 ; python_version >= "3.10" and python_version < "4.0" -build==1.4.0 ; python_version >= "3.10" and python_version < "4.0" +boto3==1.42.81 ; python_version >= "3.10" and python_version < "4.0" +botocore==1.42.81 ; python_version >= "3.10" and python_version < "4.0" +build==1.4.2 ; python_version >= "3.10" and python_version < "4.0" cachecontrol==0.14.4 ; python_version >= "3.10" and python_version < "4.0" -cachetools==7.0.0 ; python_version >= "3.10" and python_version < "4.0" -certifi==2026.1.4 ; python_version >= "3.10" and python_version < "4.0" +cachetools==7.0.5 ; python_version >= "3.10" and python_version < "4.0" +certifi==2026.2.25 ; python_version >= "3.10" and python_version < "4.0" cffi==2.0.0 ; python_version >= "3.10" and python_version < "4.0" -chardet==5.2.0 ; python_version >= "3.10" and python_version < "4.0" -charset-normalizer==3.4.4 ; python_version >= "3.10" and python_version < "4.0" +charset-normalizer==3.4.7 ; python_version >= "3.10" and python_version < "4.0" cleo==2.1.0 ; python_version >= "3.10" and python_version < "4.0" click==8.3.1 ; python_version >= "3.10" and python_version < "4.0" cloudflare==2.19.4 ; python_version >= "3.10" and python_version < "4.0" colorama==0.4.6 ; python_version >= "3.10" and python_version < "4.0" -configargparse==1.7.1 ; python_version >= "3.10" and python_version < "4.0" +configargparse==1.7.5 ; python_version >= "3.10" and python_version < "4.0" configobj==5.0.9 ; python_version >= "3.10" and python_version < "4.0" -coverage==7.13.3 ; python_version >= "3.10" and python_version < "4.0" +coverage==7.13.5 ; python_version >= "3.10" and python_version < "4.0" crashtest==0.4.1 ; python_version >= "3.10" and python_version < "4.0" -cryptography==46.0.4 ; python_version >= "3.10" and python_version < "4.0" +cryptography==46.0.6 ; python_version >= "3.10" and python_version < "4.0" cython==0.29.37 ; python_version >= "3.10" and python_version <= "3.12" cython==3.2.4 ; python_version >= "3.13" and python_version < "4.0" decorator==5.2.1 ; python_version >= "3.10" and python_version < "4.0" @@ -46,38 +45,40 @@ dns-lexicon==3.23.2 ; python_version >= "3.10" and python_version < "4.0" dnspython==2.8.0 ; python_version >= "3.10" and python_version < "4.0" docutils==0.21.2 ; python_version == "3.10" docutils==0.22.4 ; python_version >= "3.11" and python_version < "4.0" -dulwich==1.0.0 ; python_version >= "3.10" and python_version < "4.0" +dulwich==1.1.0 ; python_version >= "3.10" and python_version < "4.0" exceptiongroup==1.3.1 ; python_version == "3.10" execnet==2.1.2 ; python_version >= "3.10" and python_version < "4.0" executing==2.2.1 ; python_version >= "3.10" and python_version < "4.0" fabric==3.2.2 ; python_version >= "3.10" and python_version < "4.0" fastjsonschema==2.21.2 ; python_version >= "3.10" and python_version < "4.0" -filelock==3.20.3 ; python_version >= "3.10" and python_version < "4.0" +filelock==3.25.2 ; python_version >= "3.10" and python_version < "4.0" findpython==0.7.1 ; python_version >= "3.10" and python_version < "4.0" -google-api-core==2.29.0 ; python_version >= "3.10" and python_version < "4.0" -google-api-python-client==2.188.0 ; python_version >= "3.10" and python_version < "4.0" -google-auth-httplib2==0.3.0 ; python_version >= "3.10" and python_version < "4.0" -google-auth==2.48.0 ; python_version >= "3.10" and python_version < "4.0" -googleapis-common-protos==1.72.0 ; python_version >= "3.10" and python_version < "4.0" +google-api-core==2.30.1 ; python_version >= "3.10" and python_version < "4.0" +google-api-python-client==2.193.0 ; python_version >= "3.10" and python_version < "4.0" +google-auth-httplib2==0.3.1 ; python_version >= "3.10" and python_version < "4.0" +google-auth==2.49.1 ; python_version >= "3.10" and python_version < "4.0" +googleapis-common-protos==1.73.1 ; python_version >= "3.10" and python_version < "4.0" h11==0.16.0 ; python_version >= "3.10" and python_version < "4.0" httpcore==1.0.9 ; python_version >= "3.10" and python_version < "4.0" httplib2==0.31.2 ; python_version >= "3.10" and python_version < "4.0" httpx==0.28.1 ; python_version >= "3.10" and python_version < "4.0" -id==1.5.0 ; python_version >= "3.10" and python_version < "4.0" +id==1.6.1 ; python_version >= "3.10" and python_version < "4.0" idna==3.11 ; python_version >= "3.10" and python_version < "4.0" -imagesize==1.4.1 ; python_version >= "3.10" and python_version < "4.0" -importlib-metadata==8.7.1 ; python_version >= "3.10" and python_version < "3.12" +imagesize==1.5.0 ; python_version >= "3.13" and python_version < "4.0" +imagesize==2.0.0 ; python_version >= "3.10" and python_version <= "3.12" +importlib-metadata==9.0.0 ; python_version >= "3.10" and python_version < "3.12" iniconfig==2.3.0 ; python_version >= "3.10" and python_version < "4.0" installer==0.7.0 ; python_version >= "3.10" and python_version < "4.0" invoke==2.2.1 ; python_version >= "3.10" and python_version < "4.0" ipdb==0.13.13 ; python_version >= "3.10" and python_version < "4.0" ipython-pygments-lexers==1.1.1 ; python_version >= "3.11" and python_version < "4.0" -ipython==8.38.0 ; python_version == "3.10" -ipython==9.10.0 ; python_version >= "3.11" and python_version < "4.0" +ipython==8.39.0 ; python_version == "3.10" +ipython==9.10.1 ; python_version == "3.11" +ipython==9.12.0 ; python_version >= "3.12" and python_version < "4.0" isodate==0.7.2 ; python_version >= "3.10" and python_version < "4.0" isort==5.13.2 ; python_version >= "3.10" and python_version < "4.0" jaraco-classes==3.4.0 ; python_version >= "3.10" and python_version < "4.0" -jaraco-context==6.1.0 ; python_version >= "3.10" and python_version < "4.0" +jaraco-context==6.1.2 ; python_version >= "3.10" and python_version < "4.0" jaraco-functools==4.4.0 ; python_version >= "3.10" and python_version < "4.0" jedi==0.19.2 ; python_version >= "3.10" and python_version < "4.0" jeepney==0.9.0 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "linux" @@ -92,50 +93,51 @@ markupsafe==3.0.3 ; python_version >= "3.10" and python_version < "4.0" matplotlib-inline==0.2.1 ; python_version >= "3.10" and python_version < "4.0" mccabe==0.7.0 ; python_version >= "3.10" and python_version < "4.0" mdurl==0.1.2 ; python_version >= "3.10" and python_version < "4.0" -more-itertools==10.8.0 ; python_version >= "3.10" and python_version < "4.0" +more-itertools==11.0.0 ; python_version >= "3.10" and python_version < "4.0" msgpack==1.1.2 ; python_version >= "3.10" and python_version < "4.0" msrest==0.7.1 ; python_version >= "3.10" and python_version < "4.0" mypy-extensions==1.1.0 ; python_version >= "3.10" and python_version < "4.0" mypy==1.9.0 ; python_version >= "3.10" and python_version < "4.0" -nh3==0.3.2 ; python_version >= "3.10" and python_version < "4.0" +nh3==0.3.4 ; python_version >= "3.10" and python_version < "4.0" oauthlib==3.3.1 ; python_version >= "3.10" and python_version < "4.0" packaging==26.0 ; python_version >= "3.10" and python_version < "4.0" paramiko==4.0.0 ; python_version >= "3.10" and python_version < "4.0" parsedatetime==2.6 ; python_version >= "3.10" and python_version < "4.0" -parso==0.8.5 ; python_version >= "3.10" and python_version < "4.0" -pbs-installer==2026.1.27 ; python_version >= "3.10" and python_version < "4.0" +parso==0.8.6 ; python_version >= "3.10" and python_version < "4.0" +pbs-installer==2026.3.25 ; python_version >= "3.10" and python_version < "4.0" pexpect==4.9.0 ; python_version >= "3.10" and python_version < "4.0" and sys_platform != "win32" and sys_platform != "emscripten" -pip==26.0 ; python_version >= "3.10" and python_version < "4.0" +pip==26.0.1 ; python_version >= "3.10" and python_version < "4.0" pkginfo==1.12.1.2 ; python_version >= "3.10" and python_version < "4.0" -platformdirs==4.5.1 ; python_version >= "3.10" and python_version < "4.0" +platformdirs==4.9.4 ; python_version >= "3.10" and python_version < "4.0" pluggy==1.6.0 ; python_version >= "3.10" and python_version < "4.0" ply==3.11 ; python_version >= "3.10" and python_version < "4.0" -poetry-core==2.3.1 ; python_version >= "3.10" and python_version < "4.0" +poetry-core==2.3.2 ; python_version >= "3.10" and python_version < "4.0" poetry-plugin-export==1.10.0 ; python_version >= "3.10" and python_version < "4.0" -poetry==2.3.2 ; python_version >= "3.10" and python_version < "4.0" +poetry==2.3.3 ; python_version >= "3.10" and python_version < "4.0" prompt-toolkit==3.0.52 ; python_version >= "3.10" and python_version < "4.0" -proto-plus==1.27.1 ; python_version >= "3.10" and python_version < "4.0" -protobuf==6.33.5 ; python_version >= "3.10" and python_version < "4.0" +proto-plus==1.27.2 ; python_version >= "3.10" and python_version < "4.0" +protobuf==6.33.6 ; python_version >= "3.10" and python_version < "4.0" ptyprocess==0.7.0 ; python_version >= "3.10" and python_version < "4.0" and sys_platform != "win32" and sys_platform != "emscripten" pure-eval==0.2.3 ; python_version >= "3.10" and python_version < "4.0" pyasn1-modules==0.4.2 ; python_version >= "3.10" and python_version < "4.0" -pyasn1==0.6.2 ; python_version >= "3.10" and python_version < "4.0" +pyasn1==0.6.3 ; python_version >= "3.10" and python_version < "4.0" pycparser==3.0 ; python_version >= "3.10" and python_version < "4.0" and implementation_name != "PyPy" -pygments==2.19.2 ; python_version >= "3.10" and python_version < "4.0" +pygments==2.20.0 ; python_version >= "3.10" and python_version < "4.0" pylint==3.3.3 ; python_version >= "3.10" and python_version < "4.0" pynacl==1.6.2 ; python_version >= "3.10" and python_version < "4.0" -pyopenssl==25.3.0 ; python_version >= "3.10" and python_version < "4.0" +pyopenssl==26.0.0 ; python_version >= "3.10" and python_version < "4.0" pyotp==2.9.0 ; python_version >= "3.10" and python_version < "4.0" pyparsing==3.3.2 ; python_version >= "3.10" and python_version < "4.0" pyproject-api==1.10.0 ; python_version >= "3.10" and python_version < "4.0" pyproject-hooks==1.2.0 ; python_version >= "3.10" and python_version < "4.0" pyrfc3339==2.1.0 ; python_version >= "3.10" and python_version < "4.0" -pytest-cov==7.0.0 ; python_version >= "3.10" and python_version < "4.0" +pytest-cov==7.1.0 ; python_version >= "3.10" and python_version < "4.0" pytest-xdist==3.8.0 ; python_version >= "3.10" and python_version < "4.0" pytest==9.0.2 ; python_version >= "3.10" and python_version < "4.0" python-augeas==1.2.0 ; python_version >= "3.10" and python_version < "4.0" python-dateutil==2.9.0.post0 ; python_version >= "3.10" and python_version < "4.0" python-digitalocean==1.17.0 ; python_version >= "3.10" and python_version < "4.0" +python-discovery==1.2.1 ; python_version >= "3.10" and python_version < "4.0" pywin32-ctypes==0.2.3 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "win32" pywin32==311 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "win32" pyyaml==6.0.3 ; python_version >= "3.10" and python_version < "4.0" @@ -144,17 +146,16 @@ readme-renderer==44.0 ; python_version >= "3.10" and python_version < "4.0" requests-file==3.0.1 ; python_version >= "3.10" and python_version < "4.0" requests-oauthlib==2.0.0 ; python_version >= "3.10" and python_version < "4.0" requests-toolbelt==1.0.0 ; python_version >= "3.10" and python_version < "4.0" -requests==2.32.5 ; python_version >= "3.10" and python_version < "4.0" +requests==2.33.1 ; python_version >= "3.10" and python_version < "4.0" rfc3986==2.0.0 ; python_version >= "3.10" and python_version < "4.0" -rich==14.3.2 ; python_version >= "3.10" and python_version < "4.0" +rich==14.3.3 ; python_version >= "3.10" and python_version < "4.0" roman-numerals==4.1.0 ; python_version >= "3.11" and python_version < "4.0" -rsa==4.9.1 ; python_version >= "3.10" and python_version < "4.0" -ruff==0.15.0 ; python_version >= "3.10" and python_version < "4.0" +ruff==0.15.8 ; python_version >= "3.10" and python_version < "4.0" s3transfer==0.16.0 ; python_version >= "3.10" and python_version < "4.0" secretstorage==3.5.0 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "linux" semantic-version==2.10.0 ; python_version >= "3.10" and python_version < "4.0" -setuptools-rust==1.12.0 ; python_version >= "3.10" and python_version < "4.0" -setuptools==80.10.2 ; python_version >= "3.10" and python_version < "4.0" +setuptools-rust==1.12.1 ; python_version >= "3.10" and python_version < "4.0" +setuptools==82.0.1 ; python_version >= "3.10" and python_version < "4.0" shellingham==1.5.4 ; python_version >= "3.10" and python_version < "4.0" six==1.17.0 ; python_version >= "3.10" and python_version < "4.0" snowballstemmer==3.0.1 ; python_version >= "3.10" and python_version < "4.0" @@ -172,27 +173,28 @@ sphinxcontrib-qthelp==2.0.0 ; python_version >= "3.10" and python_version < "4.0 sphinxcontrib-serializinghtml==2.0.0 ; python_version >= "3.10" and python_version < "4.0" stack-data==0.6.3 ; python_version >= "3.10" and python_version < "4.0" tldextract==5.3.1 ; python_version >= "3.10" and python_version < "4.0" -tomli==2.4.0 ; python_version == "3.10" +tomli-w==1.2.0 ; python_version >= "3.10" and python_version < "4.0" +tomli==2.4.1 ; python_version == "3.10" tomlkit==0.14.0 ; python_version >= "3.10" and python_version < "4.0" towncrier==25.8.0 ; python_version >= "3.10" and python_version < "4.0" -tox==4.34.1 ; python_version >= "3.10" and python_version < "4.0" +tox==4.52.0 ; python_version >= "3.10" and python_version < "4.0" traitlets==5.14.3 ; python_version >= "3.10" and python_version < "4.0" trove-classifiers==2026.1.14.14 ; python_version >= "3.10" and python_version < "4.0" twine==6.2.0 ; python_version >= "3.10" and python_version < "4.0" -types-httplib2==0.31.2.20260125 ; python_version >= "3.10" and python_version < "4.0" +types-httplib2==0.31.2.20260402 ; python_version >= "3.10" and python_version < "4.0" types-pyrfc3339==2.0.1.20250825 ; python_version >= "3.10" and python_version < "4.0" -types-python-dateutil==2.9.0.20260124 ; python_version >= "3.10" and python_version < "4.0" -types-pywin32==311.0.0.20251008 ; python_version >= "3.10" and python_version < "4.0" -types-requests==2.32.4.20260107 ; python_version >= "3.10" and python_version < "4.0" -types-setuptools==80.10.0.20260124 ; python_version >= "3.10" and python_version < "4.0" +types-python-dateutil==2.9.0.20260402 ; python_version >= "3.10" and python_version < "4.0" +types-pywin32==311.0.0.20260402 ; python_version >= "3.10" and python_version < "4.0" +types-requests==2.33.0.20260402 ; python_version >= "3.10" and python_version < "4.0" +types-setuptools==82.0.0.20260402 ; python_version >= "3.10" and python_version < "4.0" typing-extensions==4.15.0 ; python_version >= "3.10" and python_version < "4.0" uritemplate==4.2.0 ; python_version >= "3.10" and python_version < "4.0" urllib3==2.6.3 ; python_version >= "3.10" and python_version < "4.0" -uv==0.9.28 ; python_version >= "3.10" and python_version < "4.0" -virtualenv==20.36.1 ; python_version >= "3.10" and python_version < "4.0" -wcwidth==0.5.3 ; python_version >= "3.10" and python_version < "4.0" +uv==0.11.3 ; python_version >= "3.10" and python_version < "4.0" +virtualenv==21.2.0 ; python_version >= "3.10" and python_version < "4.0" +wcwidth==0.6.0 ; python_version >= "3.10" and python_version < "4.0" wheel==0.46.3 ; python_version >= "3.10" and python_version < "4.0" -wrapt==2.1.1 ; python_version >= "3.10" and python_version < "4.0" +wrapt==2.1.2 ; python_version >= "3.10" and python_version < "4.0" xattr==1.3.0 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "darwin" zipp==3.23.0 ; python_version >= "3.10" and python_version < "3.12" zstandard==0.25.0 ; python_version >= "3.10" and python_version < "4.0" diff --git a/tox.ini b/tox.ini index 00366755b..94ffdac7b 100644 --- a/tox.ini +++ b/tox.ini @@ -24,7 +24,7 @@ deps = -e acme[test] -e certbot -e certbot[test] - -e certbot-apache[dev] + -e certbot-apache -e certbot-dns-cloudflare -e certbot-dns-digitalocean -e certbot-dns-dnsimple @@ -50,7 +50,7 @@ commands = [testenv:py{,-posix}] commands = - {[base]pytest} acme certbot certbot-dns-cloudflare certbot-dns-digitalocean certbot-dns-dnsimple certbot-dns-dnsmadeeasy certbot-dns-gehirn certbot-dns-google certbot-dns-linode certbot-dns-luadns certbot-dns-nsone certbot-dns-ovh certbot-dns-rfc2136 certbot-dns-route53 certbot-dns-sakuracloud certbot-nginx certbot-apache + {[base]pytest} acme certbot certbot-dns-cloudflare certbot-dns-digitalocean certbot-dns-dnsimple certbot-dns-dnsmadeeasy certbot-dns-gehirn certbot-dns-google certbot-dns-linode certbot-dns-luadns certbot-dns-nsone certbot-dns-ovh certbot-dns-rfc2136 certbot-dns-route53 certbot-dns-sakuracloud [testenv:py3{,10,11,12,13,14}] commands = {[testenv:py]commands} @@ -87,12 +87,10 @@ common_coverage_report_commands = {[testenv:cover]coverage_report} --fail-under 99 --include certbot-dns-rfc2136/* {[testenv:cover]coverage_report} --fail-under 94 --include certbot-dns-route53/* {[testenv:cover]coverage_report} --fail-under 99 --include certbot-dns-sakuracloud/* - {[testenv:cover]coverage_report} --fail-under 98 --include certbot-nginx/* commands = {[testenv:py]commands} --cov --cov-report= {[testenv:cover]coverage_report} --fail-under 100 --include acme/* - {[testenv:cover]coverage_report} --fail-under 95 --include certbot/* - {[testenv:cover]coverage_report} --fail-under 100 --include certbot-apache/* + {[testenv:cover]coverage_report} --fail-under 96 --include certbot/* {[testenv:cover]common_coverage_report_commands} # Another workaround for https://github.com/tox-dev/tox/issues/2858 in tox v4. @@ -119,16 +117,16 @@ commands = {[base]pytest} acme [testenv:isolated-certbot] description = Tests Certbot without any additional plugins installed +commands = {[base]pytest} certbot deps = {[testenv:isolated-acme]deps} -e certbot[test] -commands = {[base]pytest} certbot [testenv:isolated-{apache,cloudflare,digitalocean,dnsimple,dnsmadeeasy,gehirn,google,linode,luadns,nsone,ovh,rfc2136,route53,sakuracloud,nginx}] description = Tests the plugin without installing any other plugins deps = {[testenv:isolated-certbot]deps} - apache: -e certbot-apache[dev] + apache: -e certbot-apache cloudflare: -e certbot-dns-cloudflare digitalocean: -e certbot-dns-digitalocean dnsimple: -e certbot-dns-dnsimple @@ -144,7 +142,7 @@ deps = sakuracloud: -e certbot-dns-sakuracloud nginx: -e certbot-nginx commands = - apache: {[base]pytest} certbot-apache + apache: {[base]pytest} certbot/src/certbot/_internal/tests/plugins/apache cloudflare: {[base]pytest} certbot-dns-cloudflare digitalocean: {[base]pytest} certbot-dns-digitalocean dnsimple: {[base]pytest} certbot-dns-dnsimple @@ -158,7 +156,7 @@ commands = rfc2136: {[base]pytest} certbot-dns-rfc2136 route53: {[base]pytest} certbot-dns-route53 sakuracloud: {[base]pytest} certbot-dns-sakuracloud - nginx: {[base]pytest} certbot-nginx + nginx: {[base]pytest} certbot/src/certbot/_internal/tests/plugins/nginx [testenv:apacheconftest] deps = @@ -166,27 +164,27 @@ deps = -e certbot -e certbot-apache commands = - {toxinidir}/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test --debian-modules + {toxinidir}/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/apache-conf-test --debian-modules passenv = SERVER allowlist_externals = - {toxinidir}/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test + {toxinidir}/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/apache-conf-test [testenv:apacheconftest-external-with-pebble] description = Run apacheconftest with pebble and Certbot outside of the tox virtual environment. deps = -e certbot-ci allowlist_externals = - {toxinidir}/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test-pebble.py + {toxinidir}/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/apache-conf-test-pebble.py commands = - {toxinidir}/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test-pebble.py --debian-modules + {toxinidir}/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/apache-conf-test-pebble.py --debian-modules [testenv:apacheconftest-with-pebble] deps = {[testenv:apacheconftest]deps} {[testenv:apacheconftest-external-with-pebble]deps} allowlist_externals = - {toxinidir}/certbot-apache/src/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test-pebble.py + {toxinidir}/certbot/src/certbot/_internal/tests/plugins/apache/apache-conf-files/apache-conf-test-pebble.py commands = {[testenv:apacheconftest-external-with-pebble]commands} [testenv:nginxroundtrip] @@ -235,8 +233,7 @@ commands = {[base]pytest} certbot-ci/src/certbot_integration_tests \ --cov=acme --cov=certbot --cov=certbot_nginx --cov-report= \ --cov-config=certbot-ci/src/certbot_integration_tests/.coveragerc - coverage report --include 'certbot/*' --show-missing --fail-under=65 - coverage report --include 'certbot-nginx/*' --show-missing --fail-under=74 + coverage report --include 'certbot/*' --show-missing --fail-under=71 passenv = DOCKER_* [testenv:integration-certbot]