示例#1
0
    def __init__(self, *args, **kwargs):
        """Initialize an Nginx Configurator.

        :param tup version: version of Nginx as a tuple (1, 4, 7)
            (used mostly for unittesting)

        """
        version = kwargs.pop("version", None)
        super(NginxConfigurator, self).__init__(*args, **kwargs)

        # Verify that all directories and files exist with proper permissions
        self._verify_setup()

        # Files to save
        self.save_notes = ""

        # Add number of outstanding challenges
        self._chall_out = 0

        # These will be set in the prepare function
        self.parser = None
        self.version = version
        self._enhance_func = {
            "redirect": self._enable_redirect,
            "staple-ocsp": self._enable_ocsp_stapling
        }

        # Set up reverter
        self.reverter = reverter.Reverter(self.config)
        self.reverter.recovery_routine()
示例#2
0
    def __init__(self, *args, **kwargs):
        """Initialize an External Configurator."""
        super(ExternalConfigurator, self).__init__(*args, **kwargs)

        # Set up reverter
        self.reverter = reverter.Reverter(self.config)
        self.reverter.recovery_routine()
示例#3
0
文件: manual.py 项目: uzunnet/certbot
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.reverter = reverter.Reverter(self.config)
     self.reverter.recovery_routine()
     self.env: Dict[achallenges.KeyAuthorizationAnnotatedChallenge, Dict[str, str]] = {}
     self.subsequent_dns_challenge = False
     self.subsequent_any_challenge = False
示例#4
0
 def __init__(self, *args, **kwargs):
     super(Authenticator, self).__init__(*args, **kwargs)
     self.reverter = reverter.Reverter(self.config)
     self.reverter.recovery_routine()
     self.env = dict() \
     # type: Dict[achallenges.KeyAuthorizationAnnotatedChallenge, Dict[str, str]]
     self.tls_sni_01 = None
     self.subsequent_dns_challenge = False
     self.subsequent_any_challenge = False
示例#5
0
def view_config_changes(config, num=None):
    """View checkpoints and associated configuration changes.

    .. note:: This assumes that the installation is using a Reverter object.

    :param config: Configuration.
    :type config: :class:`certbot.interfaces.IConfig`

    """
    rev = reverter.Reverter(config)
    rev.recovery_routine()
    rev.view_config_changes(num)
示例#6
0
    def __init__(self, *args, **kwargs):
        super(AugeasConfigurator, self).__init__(*args, **kwargs)

        # Placeholder for augeas
        self.aug = None

        self.save_notes = ""

        # See if any temporary changes need to be recovered
        # This needs to occur before VirtualHost objects are setup...
        # because this will change the underlying configuration and potential
        # vhosts
        self.reverter = reverter.Reverter(self.config)
示例#7
0
    def __init__(self, *args, **kwargs):
        super(AuthenticatorOut, self).__init__(*args, **kwargs)
        self._root = (tempfile.mkdtemp()
                      if self.conf("test-mode") else "/tmp/certbot")
        self._httpd = None
        self._start_time = calendar.timegm(time.gmtime())
        self._handler_file_problem = False

        # Set up reverter
        self.reverter = reverter.Reverter(self.config)
        self.reverter.recovery_routine()

        # Reporter
        self.orig_reporter = None
        self.messages = queue.PriorityQueue()
示例#8
0
    def __init__(self, *args, **kwargs):
        super(AugeasConfigurator, self).__init__(*args, **kwargs)

        self.aug = augeas.Augeas(
            # specify a directory to load our preferred lens from
            loadpath=constants.AUGEAS_LENS_DIR,
            # Do not save backup (we do it ourselves), do not load
            # anything by default
            flags=(augeas.Augeas.NONE | augeas.Augeas.NO_MODL_AUTOLOAD))
        self.save_notes = ""

        # See if any temporary changes need to be recovered
        # This needs to occur before VirtualHost objects are setup...
        # because this will change the underlying configuration and potential
        # vhosts
        self.reverter = reverter.Reverter(self.config)
        self.recovery_routine()
示例#9
0
    def __init__(self, *args, **kwargs):
        """Initialize an ASA Authenticator."""
        super(AsaConfigurator, self).__init__(*args, **kwargs)

        # credfile lives in self.credfile rather than self.conf('credfile')
        # because I couldn't figure out how collect work_dir in
        # add_parser_arguments, presumably because of the @classmethod
        # decorator. Without work_dir, I couldn't set up the default value
        # correctly. So, I do it here.
        if self.conf('credfile'):
            self.credfile = self.conf('credfile')
        else:
            self.credfile = os.path.join(self.config.config_dir, 'asa_creds.txt')

        self.asa = {}
        self.asacreds = {}
        self.argprefix = ''.join(["--",args[1],"-"])

        # Set up reverter
        self.reverter = reverter.Reverter(self.config)
        self.reverter.recovery_routine()
示例#10
0
    def __init__(self, *args, **kwargs):
        super(HAProxyInstaller, self).__init__(*args, **kwargs)

        #: This dictionary holds the file contents of all the changed
        #: certificates for HAProxy
        self.crt_files = {}
        #: This dictionary holds the file contents of all the new certificates
        #: for HAProxy
        self.new_crt_files = {}

        #: Notes to be added to each reverter checkpoint
        self.save_notes = ""

        #: File extension for saved certificates
        self.crt_postfix = ".pem"

        # Set up reverter
        self.reverter = reverter.Reverter(self.config)
        self.reverter.recovery_routine()

        #: Dict of supported enhancement functions:
        self._enhance_func = {}
示例#11
0
 def __init__(self, *args, **kwargs):
     super(Installer, self).__init__(*args, **kwargs)
     self.reverter = reverter.Reverter(self.config)
示例#12
0
 def __init__(self, *args, **kwargs):
     super(Authenticator, self).__init__(*args, **kwargs)
     self.reverter = reverter.Reverter(self.config)
     self.reverter.recovery_routine()
     self.env = dict()
     self.tls_sni_01 = None
示例#13
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.storage = PluginStorage(self.config, self.name)
     self.reverter = reverter.Reverter(self.config)
示例#14
0
    def __init__(self, *args, **kwargs):
        super(Authenticator, self).__init__(*args, **kwargs)

        self.reverter = reverter.Reverter(self.config)
        self.reverter.recovery_routine()