404

[ Avaa Bypassed ]




Upload:

Command:

botdev@3.147.80.238: ~ $
""" Distribution specific override class for CentOS family (RHEL, Fedora) """
import pkg_resources

import zope.interface

from certbot import interfaces

from certbot_apache import apache_util
from certbot_apache import configurator
from certbot_apache import parser

@zope.interface.provider(interfaces.IPluginFactory)
class CentOSConfigurator(configurator.ApacheConfigurator):
    """CentOS specific ApacheConfigurator override class"""

    OS_DEFAULTS = dict(
        server_root="/etc/httpd",
        vhost_root="/etc/httpd/conf.d",
        vhost_files="*.conf",
        logs_root="/var/log/httpd",
        ctl="apachectl",
        version_cmd=['apachectl', '-v'],
        restart_cmd=['apachectl', 'graceful'],
        restart_cmd_alt=['apachectl', 'restart'],
        conftest_cmd=['apachectl', 'configtest'],
        enmod=None,
        dismod=None,
        le_vhost_ext="-le-ssl.conf",
        handle_modules=False,
        handle_sites=False,
        challenge_location="/etc/httpd/conf.d",
        MOD_SSL_CONF_SRC=pkg_resources.resource_filename(
            "certbot_apache", "centos-options-ssl-apache.conf")
    )

    def _prepare_options(self):
        """
        Override the options dictionary initialization in order to support
        alternative restart cmd used in CentOS.
        """
        super(CentOSConfigurator, self)._prepare_options()
        self.options["restart_cmd_alt"][0] = self.option("ctl")

    def get_parser(self):
        """Initializes the ApacheParser"""
        return CentOSParser(
            self.aug, self.option("server_root"), self.option("vhost_root"),
            self.version, configurator=self)


class CentOSParser(parser.ApacheParser):
    """CentOS specific ApacheParser override class"""
    def __init__(self, *args, **kwargs):
        # CentOS specific configuration file for Apache
        self.sysconfig_filep = "/etc/sysconfig/httpd"
        super(CentOSParser, self).__init__(*args, **kwargs)

    def update_runtime_variables(self):
        """ Override for update_runtime_variables for custom parsing """
        # Opportunistic, works if SELinux not enforced
        super(CentOSParser, self).update_runtime_variables()
        self.parse_sysconfig_var()

    def parse_sysconfig_var(self):
        """ Parses Apache CLI options from CentOS configuration file """
        defines = apache_util.parse_define_file(self.sysconfig_filep, "OPTIONS")
        for k in defines.keys():
            self.variables[k] = defines[k]

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
augeas_lens Folder 0755
tests Folder 0755
__init__.py File 29 B 0644
apache_util.py File 3.1 KB 0644
augeas_configurator.py File 7.17 KB 0644
centos-options-ssl-apache.conf File 1.55 KB 0644
configurator.py File 97.69 KB 0644
constants.py File 2.5 KB 0644
display_ops.py File 4.16 KB 0644
entrypoint.py File 1.84 KB 0644
http_01.py File 7.78 KB 0644
obj.py File 8.92 KB 0644
options-ssl-apache.conf File 1.58 KB 0644
override_arch.py File 980 B 0644
override_centos.py File 2.43 KB 0644
override_darwin.py File 982 B 0644
override_debian.py File 5.55 KB 0644
override_gentoo.py File 2.7 KB 0644
override_suse.py File 1011 B 0644
parser.py File 30.42 KB 0644
tls_sni_01.py File 5.95 KB 0644