コード例 #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 = {}  # TODO: Support at least redirects

        # Set up reverter
        self.reverter = reverter.Reverter(self.config)
        self.reverter.recovery_routine()
コード例 #2
0
def view_config_changes(config):
    """View checkpoints and associated configuration changes.

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

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

    """
    rev = reverter.Reverter(config)
    rev.recovery_routine()
    rev.view_config_changes()
コード例 #3
0
    def __init__(self, *args, **kwargs):
        super(AugeasConfigurator, self).__init__(*args, **kwargs)

        # Set Augeas flags to not save backup (we do it ourselves)
        # Set Augeas to not load anything by default
        my_flags = augeas.Augeas.NONE | augeas.Augeas.NO_MODL_AUTOLOAD
        self.aug = augeas.Augeas(flags=my_flags)
        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()
コード例 #4
0
    def __init__(self, *args, **kwargs):
        super(IcecastInstaller, self).__init__(*args, **kwargs)

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

        self.icecast_configuration = None
        #Check the following locations in order and see if they exist. Use the first one as the config file.
        self.common_config_locations = [
            '/etc/icecast2/icecast.xml', '/etc/icecast/icecast.xml',
            '/etc/icecast.xml', '/usr/local/etc/icecast.xml'
        ]
        self.concatenated_cert_and_key_file = None
        self.create_ssl_socket = None
        self.default_ssl_port = None
コード例 #5
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()