Beispiel #1
0
    def prepare(self):
        """Prepare the authenticator/installer.

        :raises .errors.NoInstallationError: If Apache configs cannot be found
        :raises .errors.MisconfigurationError: If Apache is misconfigured
        :raises .errors.NotSupportedError: If Apache version is not supported
        :raises .errors.PluginError: If there is any other error

        """
        # Verify Apache is installed
        for exe in (self.conf("ctl"), self.conf("enmod"), self.conf("dismod"), self.conf("init-script")):
            if not le_util.exe_exists(exe):
                raise errors.NoInstallationError

        # Make sure configuration is valid
        self.config_test()

        self.parser = parser.ApacheParser(self.aug, self.conf("server-root"), self.conf("ctl"))
        # Check for errors in parsing files with Augeas
        self.check_parsing_errors("httpd.aug")

        # Set Version
        if self.version is None:
            self.version = self.get_version()
        if self.version < (2, 2):
            raise errors.NotSupportedError("Apache Version %s not supported.", str(self.version))

        # Get all of the available vhosts
        self.vhosts = self.get_virtual_hosts()

        temp_install(self.mod_ssl_conf)
Beispiel #2
0
    def prepare(self):
        """Prepare the authenticator/installer.

        :raises .errors.NoInstallationError: If Apache configs cannot be found
        :raises .errors.MisconfigurationError: If Apache is misconfigured
        :raises .errors.NotSupportedError: If Apache version is not supported
        :raises .errors.PluginError: If there is any other error

        """
        # Verify Apache is installed
        for exe in (self.conf("ctl"), self.conf("enmod"),
                    self.conf("dismod"), self.conf("init-script")):
            if not le_util.exe_exists(exe):
                raise errors.NoInstallationError

        # Make sure configuration is valid
        self.config_test()

        self.parser = parser.ApacheParser(
            self.aug, self.conf("server-root"), self.conf("ctl"))
        # Check for errors in parsing files with Augeas
        self.check_parsing_errors("httpd.aug")

        # Set Version
        if self.version is None:
            self.version = self.get_version()
        if self.version < (2, 2):
            raise errors.NotSupportedError(
                "Apache Version %s not supported.", str(self.version))

        # Get all of the available vhosts
        self.vhosts = self.get_virtual_hosts()

        temp_install(self.mod_ssl_conf)
Beispiel #3
0
    def _enable_mod_debian(self, mod_name, temp):
        """Assumes mods-available, mods-enabled layout."""
        # Generate reversal command.
        # Try to be safe here... check that we can probably reverse before
        # applying enmod command
        if not le_util.exe_exists(self.conf("dismod")):
            raise errors.MisconfigurationError(
                "Unable to find a2dismod, please make sure a2enmod and "
                "a2dismod are configured correctly for letsencrypt.")

        self.reverter.register_undo_command(
            temp, [self.conf("dismod"), mod_name])
        le_util.run_script([self.conf("enmod"), mod_name])
Beispiel #4
0
    def _enable_mod_debian(self, mod_name, temp):
        """Assumes mods-available, mods-enabled layout."""
        # Generate reversal command.
        # Try to be safe here... check that we can probably reverse before
        # applying enmod command
        if not le_util.exe_exists(self.conf("dismod")):
            raise errors.MisconfigurationError(
                "Unable to find a2dismod, please make sure a2enmod and "
                "a2dismod are configured correctly for letsencrypt.")

        self.reverter.register_undo_command(
            temp, [self.conf("dismod"), mod_name])
        le_util.run_script([self.conf("enmod"), mod_name])
Beispiel #5
0
    def prepare(self):
        """Prepare the authenticator/installer."""
        # Verify Nginx is installed
        if not le_util.exe_exists(self.conf('ctl')):
            raise errors.NoInstallationError

        self.parser = parser.NginxParser(self.conf('server-root'),
                                         self.mod_ssl_conf)

        # Set Version
        if self.version is None:
            self.version = self.get_version()

        temp_install(self.mod_ssl_conf)
    def prepare(self):
        """Prepare the authenticator/installer."""
        # Verify Nginx is installed
        if not le_util.exe_exists(self.conf('ctl')):
            raise errors.NoInstallationError

        self.parser = parser.NginxParser(
            self.conf('server-root'), self.mod_ssl_conf)

        # Set Version
        if self.version is None:
            self.version = self.get_version()

        temp_install(self.mod_ssl_conf)
Beispiel #7
0
    def prepare(self):
        """Prepare the authenticator/installer.

        :raises .errors.NoInstallationError: If Nginx ctl cannot be found
        :raises .errors.MisconfigurationError: If Nginx is misconfigured
        """
        # Verify Nginx is installed
        if not le_util.exe_exists(self.conf('ctl')):
            raise errors.NoInstallationError

        # Make sure configuration is valid
        self.config_test()

        self.parser = parser.NginxParser(self.conf('server-root'),
                                         self.mod_ssl_conf)

        # Set Version
        if self.version is None:
            self.version = self.get_version()

        temp_install(self.mod_ssl_conf)
Beispiel #8
0
    def prepare(self):
        """Prepare the authenticator/installer.

        :raises .errors.NoInstallationError: If Nginx ctl cannot be found
        :raises .errors.MisconfigurationError: If Nginx is misconfigured
        """
        # Verify Nginx is installed
        if not le_util.exe_exists(self.conf('ctl')):
            raise errors.NoInstallationError

        # Make sure configuration is valid
        self.config_test()

        self.parser = parser.NginxParser(
            self.conf('server-root'), self.mod_ssl_conf)

        # Set Version
        if self.version is None:
            self.version = self.get_version()

        temp_install(self.mod_ssl_conf)
Beispiel #9
0
    def _call(cls, exe):
        from letsencrypt.le_util import exe_exists

        return exe_exists(exe)
Beispiel #10
0
 def _call(cls, exe):
     from letsencrypt.le_util import exe_exists
     return exe_exists(exe)