OXIESEC PANEL
- Current Dir:
/
/
snap
/
certbot
/
4730
/
lib
/
python3.12
/
site-packages
/
certbot_apache
/
_internal
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/10/2025 09:51:14 PM
rwxr-xr-x
📄
__init__.py
29 bytes
06/10/2025 09:51:04 PM
rw-r--r--
📁
__pycache__
-
06/10/2025 09:51:14 PM
rwxr-xr-x
📄
apache_util.py
7.39 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
apacheparser.py
7.88 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
assertions.py
5.75 KB
06/10/2025 09:51:04 PM
rw-r--r--
📁
augeas_lens
-
06/10/2025 09:51:14 PM
rwxr-xr-x
📄
augeasparser.py
20.62 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
configurator.py
110.05 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
constants.py
3.78 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
display_ops.py
4.47 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
dualparser.py
14.7 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
entrypoint.py
2.9 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
http_01.py
8.27 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
interfaces.py
22.29 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
obj.py
9.06 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
override_alpine.py
694 bytes
06/10/2025 09:51:04 PM
rw-r--r--
📄
override_arch.py
676 bytes
06/10/2025 09:51:04 PM
rw-r--r--
📄
override_centos.py
4.59 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
override_darwin.py
604 bytes
06/10/2025 09:51:04 PM
rw-r--r--
📄
override_debian.py
5.16 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
override_fedora.py
3.38 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
override_gentoo.py
2.37 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
override_suse.py
670 bytes
06/10/2025 09:51:04 PM
rw-r--r--
📄
override_void.py
681 bytes
06/10/2025 09:51:04 PM
rw-r--r--
📄
parser.py
35.95 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
parsernode_util.py
5.69 KB
06/10/2025 09:51:04 PM
rw-r--r--
📁
tests
-
06/10/2025 09:51:14 PM
rwxr-xr-x
📁
tls_configs
-
06/10/2025 09:51:14 PM
rwxr-xr-x
Editing: override_gentoo.py
Close
""" Distribution specific override class for Gentoo Linux """ from typing import Any from certbot_apache._internal import apache_util from certbot_apache._internal import configurator from certbot_apache._internal import parser from certbot_apache._internal.configurator import OsOptions class GentooConfigurator(configurator.ApacheConfigurator): """Gentoo specific ApacheConfigurator override class""" OS_DEFAULTS = OsOptions( server_root="/etc/apache2", vhost_root="/etc/apache2/vhosts.d", vhost_files="*.conf", restart_cmd_alt=['apache2ctl', 'restart'], challenge_location="/etc/apache2/vhosts.d", ) def _prepare_options(self) -> None: """ Override the options dictionary initialization in order to support alternative restart cmd used in Gentoo. """ super()._prepare_options() if not self.options.restart_cmd_alt: # pragma: no cover raise ValueError("OS option restart_cmd_alt must be set for Gentoo.") self.options.restart_cmd_alt[0] = self.options.ctl def get_parser(self) -> "GentooParser": """Initializes the ApacheParser""" return GentooParser( self.options.server_root, self, self.options.vhost_root, self.version) class GentooParser(parser.ApacheParser): """Gentoo specific ApacheParser override class""" def __init__(self, *args: Any, **kwargs: Any) -> None: # Gentoo specific configuration file for Apache2 self.apacheconfig_filep = "/etc/conf.d/apache2" super().__init__(*args, **kwargs) def update_runtime_variables(self) -> None: """ Override for update_runtime_variables for custom parsing """ self.parse_sysconfig_var() self.update_modules() def parse_sysconfig_var(self) -> None: """ Parses Apache CLI options from Gentoo configuration file """ defines = apache_util.parse_define_file(self.apacheconfig_filep, "APACHE2_OPTS") for k, v in defines.items(): self.variables[k] = v def update_modules(self) -> None: """Get loaded modules from httpd process, and add them to DOM""" mod_cmd = [self.configurator.options.ctl, "modules"] matches = apache_util.parse_from_subprocess(mod_cmd, r"(.*)_module") for mod in matches: self.add_mod(mod.strip())