Linux sh52.ich-4.com 5.14.0-611.26.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan 29 05:24:47 EST 2026 x86_64
LiteSpeed
Server IP : 198.143.147.58 & Your IP : 216.73.217.21
Domains :
Cant Read [ /etc/named.conf ]
User : actualbuzz
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib /
python3.9 /
site-packages /
cockpit /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2026-04-16 01:40
_vendor
[ DIR ]
drwxr-xr-x
2026-04-16 01:40
channels
[ DIR ]
drwxr-xr-x
2026-04-16 01:40
data
[ DIR ]
drwxr-xr-x
2026-04-16 01:40
__init__.py
68
B
-rw-r--r--
2026-04-11 14:14
_version.py
20
B
-rw-r--r--
2026-04-11 14:14
beiboot.py
22.16
KB
-rw-r--r--
2026-04-11 14:14
beipack.py
2.99
KB
-rw-r--r--
2026-04-11 14:14
bridge.py
12
KB
-rw-r--r--
2026-04-11 14:14
channel.py
22.32
KB
-rw-r--r--
2026-04-11 14:14
config.py
3.37
KB
-rw-r--r--
2026-04-11 14:14
internal_endpoints.py
5.95
KB
-rw-r--r--
2026-04-11 14:14
jsonutil.py
7.42
KB
-rw-r--r--
2026-04-11 14:14
osinfo.py
929
B
-rw-r--r--
2026-04-11 14:14
packages.py
21.25
KB
-rw-r--r--
2026-04-11 14:14
peer.py
12.45
KB
-rw-r--r--
2026-04-11 14:14
polkit.py
7.4
KB
-rw-r--r--
2026-04-11 14:14
polyfills.py
2.27
KB
-rw-r--r--
2026-04-11 14:14
protocol.py
9.52
KB
-rw-r--r--
2026-04-11 14:14
remote.py
8.93
KB
-rw-r--r--
2026-04-11 14:14
router.py
10.08
KB
-rw-r--r--
2026-04-11 14:14
samples.py
17.02
KB
-rw-r--r--
2026-04-11 14:14
superuser.py
9.74
KB
-rw-r--r--
2026-04-11 14:14
transports.py
17.92
KB
-rw-r--r--
2026-04-11 14:14
Save
Rename
# This file is part of Cockpit. # # Copyright (C) 2023 Red Hat, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. import configparser import logging import os from pathlib import Path from cockpit._vendor.systemd_ctypes import bus logger = logging.getLogger(__name__) XDG_CONFIG_HOME = Path(os.getenv('XDG_CONFIG_HOME') or os.path.expanduser('~/.config')) DOT_CONFIG_COCKPIT = XDG_CONFIG_HOME / 'cockpit' def lookup_config(filename: str) -> Path: config_dirs = os.environ.get('XDG_CONFIG_DIRS', '/etc').split(':') fallback = None for config_dir in config_dirs: config_path = Path(config_dir, 'cockpit', filename) if not fallback: fallback = config_path if config_path.exists(): logger.debug('lookup_config(%s): found %s', filename, config_path) return config_path # default to the first entry in XDG_CONFIG_DIRS; that's not according to the spec, # but what Cockpit has done for years logger.debug('lookup_config(%s): defaulting to %s', filename, fallback) assert fallback # mypy; config_dirs always has at least one string return fallback class Config(bus.Object, interface='cockpit.Config'): def __init__(self) -> None: self.reload() @bus.Interface.Method(out_types='s', in_types='ss') def get_string(self, section: str, key: str) -> str: try: return self.config[section][key] except KeyError as exc: raise bus.BusError('cockpit.Config.KeyError', f'key {key} in section {section} does not exist') from exc @bus.Interface.Method(out_types='u', in_types='ssuuu') def get_u_int(self, section: str, key: str, default: int, maximum: int, minimum: int) -> int: try: value = self.config[section][key] except KeyError: return default try: int_val = int(value) except ValueError: logger.warning('cockpit.conf: [%s] %s is not an integer', section, key) return default return min(max(int_val, minimum), maximum) @bus.Interface.Method() def reload(self) -> None: self.config = configparser.ConfigParser(interpolation=None) cockpit_conf = lookup_config('cockpit.conf') logger.debug("cockpit.Config: loading %s", cockpit_conf) # this may not exist, but it's ok to not have a config file and thus leave self.config empty try: self.config.read(cockpit_conf) except configparser.Error as exc: logger.warning("cockpit.conf is invalid: %s", exc) self.config.clear() return class Environment(bus.Object, interface='cockpit.Environment'): variables = bus.Interface.Property('a{ss}') @variables.getter def get_variables(self) -> 'dict[str, str]': return os.environ.copy()