mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 08:03:10 +02:00
change verify_no_redirects to verify_no_letsencrypt_redirect
This commit is contained in:
@@ -878,7 +878,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
|
|||||||
self._create_redirect_vhost(ssl_vhost)
|
self._create_redirect_vhost(ssl_vhost)
|
||||||
else:
|
else:
|
||||||
# Check if LetsEncrypt redirection already exists
|
# Check if LetsEncrypt redirection already exists
|
||||||
self._verify_no_redirects(general_vh)
|
self._verify_no_letsencrypt_redirect(general_vh)
|
||||||
|
|
||||||
# Add directives to server
|
# Add directives to server
|
||||||
# Note: These are not immediately searchable in sites-enabled
|
# Note: These are not immediately searchable in sites-enabled
|
||||||
@@ -893,21 +893,17 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
|
|||||||
logger.info("Redirecting vhost in %s to ssl vhost in %s",
|
logger.info("Redirecting vhost in %s to ssl vhost in %s",
|
||||||
general_vh.filep, ssl_vhost.filep)
|
general_vh.filep, ssl_vhost.filep)
|
||||||
|
|
||||||
def _verify_no_redirects(self, vhost):
|
def _verify_no_letsencrypt_redirect(self, vhost):
|
||||||
"""Checks to see if existing redirect is in place.
|
"""Checks to see if a redirect was already installed by letsencrypt.
|
||||||
|
|
||||||
Checks to see if virtualhost already contains a rewrite or redirect
|
Checks to see if virtualhost already contains a rewrite rule that is
|
||||||
returns boolean, integer
|
identical to Letsencrypt's redirection rewrite rule.
|
||||||
|
|
||||||
:param vhost: vhost to check
|
:param vhost: vhost to check
|
||||||
:type vhost: :class:`~letsencrypt_apache.obj.VirtualHost`
|
:type vhost: :class:`~letsencrypt_apache.obj.VirtualHost`
|
||||||
|
|
||||||
:raises errors.PluginEnhancementAlreadyPresent: When the exact
|
:raises errors.PluginEnhancementAlreadyPresent: When the exact
|
||||||
letsencrypt redirection WriteRule exists in virtual host.
|
letsencrypt redirection WriteRule exists in virtual host.
|
||||||
|
|
||||||
errors.PluginError: When there exists directives that may hint
|
|
||||||
other redirection. (TODO: We should not throw a PluginError,
|
|
||||||
but that's for an other PR.)
|
|
||||||
"""
|
"""
|
||||||
rewrite_path = self.parser.find_dir(
|
rewrite_path = self.parser.find_dir(
|
||||||
"RewriteRule", None, start=vhost.path)
|
"RewriteRule", None, start=vhost.path)
|
||||||
|
|||||||
Reference in New Issue
Block a user