certdeploy.client.config package¶
Submodules¶
certdeploy.client.config.client module¶
CertDeploy Client config backends.
- class certdeploy.client.config.client.Config(destination: ~os.PathLike, source: ~os.PathLike = '/var/cache/certdeploy', sftpd: dict = <factory>, init_timeout: float | int | None = None, rc_service_exec: ~os.PathLike = '/usr/sbin/service', systemd_exec: ~os.PathLike = '/usr/bin/systemctl', docker_url: str = 'unix://var/run/docker.sock', docker_timeout: int | None = 10, script_timeout: float | int | None = None, update_services: list[dict] = <factory>, update_delay: str = '1h', fail_fast: bool = False, file_permissions: dict = <factory>, log_level: ~certdeploy.LogLevel = 'ERROR', log_filename: ~os.PathLike | None = None)[source]¶
Bases:
objectCertDeploy client config.
- docker_url: str = 'unix://var/run/docker.sock'¶
The URI of the docker socket. Defaults to the default unix socket.
- file_permissions: dict¶
Permissions to set on the installed certificate files and directories. See certdeploy.client.config.client.Permissions for the valid dictionary keys. Defaults to an empty dict.
- init_timeout: float | int | None = None¶
The timeout for executing the init system’s
serviceorsystemctl. Defaults to None (wait indefinitely).
- classmethod load(filename: PathLike, override_log_filename: PathLike | None = None, override_log_level: LogLevel | None = None, override_sftp_log_filename: PathLike | None = None, override_sftp_log_level: LogLevel | None = None)[source]¶
Load the config from a file.
- log_level: LogLevel = 'ERROR'¶
The log level of the CertDeploy client. Valid values are DEBUG, INFO, WARNING, ERROR, and CRITICAL.
- script_timeout: float | int | None = None¶
The timeout for script based service updates. Defaults to None (wait indefinitely).
- class certdeploy.client.config.client.Permissions(owner: int | str = None, group: int | str = None, mode: int = None, directory_mode: int = None)[source]¶
Bases:
objectCertDepoly output permissions.
- directory_mode: int = None¶
The mode for the lineage directory. This must be a numeric mode (see mode for more info).
- class certdeploy.client.config.client.SFTPDConfig(listen_port: int = 22, listen_address: str = '', username: str = 'certdeploy', privkey_filename: PathLike | None = None, server_pubkey: str = None, server_pubkey_filename: PathLike | None = None, log_level: str = LogLevel.ERROR, log_filename: PathLike | None = None, socket_backlog: int = 10)[source]¶
Bases:
objectCertDeploy client SFTP server config.
certdeploy.client.config.service module¶
CertDeploy Client update service config types.
- class certdeploy.client.config.service.DockerContainer(config: dict)[source]¶
Bases:
DockerServiceDocker container update config.
- class certdeploy.client.config.service.DockerService(config: dict)[source]¶
Bases:
ServiceDocker service update config.
Notes
- If no value is given for filters in config and name is given
filters will be set to exactly match name.
- If no value is given for both filters and name in config,
ConfigError is raised.
- class certdeploy.client.config.service.RCService(config: dict)[source]¶
Bases:
ServiceRC Service update config.
OpenRC/Upstart/SysV style service update config.
- Note: action and name are validated. action has to be either
reloadorrestart. name must be a valid rc service name. It doesn’t have to exist on the system to pass validation it just has to look right.
- class certdeploy.client.config.service.Script(config: dict)[source]¶
Bases:
ServiceScript based update config.
Note
- The value of name is made into an absolute path as part of
validation. This means any relative paths are evaluated relative to the current working directory of the client if they aren’t found with shutil.which(). If the script isn’t found ConfigError is raised.
- class certdeploy.client.config.service.Service(config: dict)[source]¶
Bases:
objectService config base class.
- Note: Some simple validation is done in this base class and its subclasses.
The goal is to catch obvious mistakes like invalid names or values of the wrong type early in the execution of the process.
- action: str = None¶
The action to preform on the service. Defaults to None. This must be overriden if a service type uses it.
- static load(config: dict) Service[source]¶
Load an update service model from a config dict.
- Parameters:
config (dict) – An update service config dict. The only required key for all types of services is type. Which is used to specify the type of service. Each service type has its own required config keys beyond type.
- class certdeploy.client.config.service.SystemdUnit(config: dict)[source]¶
Bases:
ServiceSystemd unit update config.
- Note: action and name are validated. action has to be either
reloadorrestart. name must be a valid Systemd unit name. It doesn’t have to exist on the system to pass validation it just has to look right.
Module contents¶
Public CertDeploy Client Config.