certdeploy.server.config package¶
Submodules¶
certdeploy.server.config.client module¶
CertDeploy Server client connection configs.
- class certdeploy.server.config.client.ClientConnection(address: str, domains: list[str], pubkey: str, port: int = 22, username: str = 'certdeploy', path: PathLike | None = '/var/cache/certdeploy', needs_chain: bool = False, needs_fullchain: bool = True, needs_privkey: bool = True, push_retries: int | None = None, push_retry_interval: int | None = None)[source]¶
Bases:
objectCertDeploy client connection config.
- hash: str | None¶
A hash of the client’s user, address, and port.
Used internally for indexing queues.
- needs_fullchain: bool = True¶
If True the client needs the
fullchain.pemfor the domains in domains.
- pubkey_blob: Ed25519Key | None¶
The text of the public key formatted for paramiko. Set on instance creation.
This is automatically generated when the configs are loaded.
- push_retries: int | None = None¶
The number of times to retry connecting to this client.
None lets the global push_retries config control this value.
0 will cause the server to only try to push once (no retries).
- Any other positive integer will cause the server to try to push certs
to this client and retry as many as that many times before giving up.
certdeploy.server.config.server module¶
CertDeploy Server config backend.
- class certdeploy.server.config.server.PushMode(value)[source]¶
Bases:
EnumServer push modes.
- PARALLEL = 'parallel'¶
- SERIAL = 'serial'¶
- class certdeploy.server.config.server.Server(privkey_filename: ~os.PathLike, client_configs: list[dict] = <factory>, client_config_directory: ~os.PathLike = None, fail_fast: bool = False, log_level: ~certdeploy.LogLevel | str = LogLevel.ERROR, log_filename: ~os.PathLike | None = None, sftp_log_level: ~certdeploy.LogLevel | str = LogLevel.ERROR, sftp_log_filename: ~os.PathLike | None = None, sftp_auth_timeout: float = None, sftp_banner_timeout: float = 60, sftp_tcp_timeout: float = None, renew_every: int = 1, renew_unit: str = 'day', renew_at: str | None = None, renew_exec: str = None, renew_args: list[str] = <factory>, renew_timeout: int | None = None, push_mode: ~certdeploy.server.config.server.PushMode = PushMode.SERIAL, push_interval: int = 0, push_retries: int = 1, push_retry_interval: int = 30, join_timeout: float | None = None, queue_dir: ~os.PathLike = '/var/run/certdeploy')[source]¶
Bases:
objectBase server configuration.
- client_config_directory: PathLike = None¶
A directory containing individual client connection config `dict`s.
- join_timeout: float | None = None¶
The number of seconds to wait while joining PushWorker threads. Defaults to 60 seconds.
- Any positive number (float or int) will be used as the number of
seconds.
None will cause the join to wait indefinitely.
- log_level: LogLevel | str = 'ERROR'¶
The log level of the CertDeploy server. Valid values are DEBUG, INFO, WARNING, ERROR, and CRITICAL.
- push_interval: int = 0¶
The interval between the beginning of parallel pushes. Defaults to 0.
- 0 disables any delay between the beginning or parallel pushes to
clients.
- Any other positive integer is used as the number of seconds between
beginning attempts to push certs to this client.
- push_mode: PushMode = 'serial'¶
The type of deployment to use. Defaults to PushMode.SERIAL.
- PushMode.Serial causes the certs to be pushed to clients one client at
a time.
- PushMode.PARALLEL causes the certs to be pushed to all clients all at
once.
- push_retries: int = 1¶
The number of times to retry pushing certs to clients. Defaults to 1.
This is overridden by the push_retries in client configs, on a per client basis.
0 will cause the server to only try to push once (no retries).
- Any other positive integer will cause the server to try to push certs
to clients and retry for each client as many as that many times before giving up.
- push_retry_interval: int = 30¶
The delay in seconds between retrying to push certs to clients. Defaults to 30.
This is overridden by the push_retry_interval in client configs, on a per client basis.
0 disables any delay between retries.
- Any other positive integer is used as the number of seconds between
attempts to push certs to this client.
- queue_dir: PathLike = '/var/run/certdeploy'¶
The directory where runtime files will be stored.
The queue and its lockfile are stored here.
- renew_at: str | None = None¶
The time of day to try to renew certs. Formatted
HH:MMfor renew_unit more thanhourand:MMfor minutes within an hour.
- renew_every: int = 1¶
The interval to try to renew certs on. Valid values are integers greater than 0.
- renew_timeout: int | None = None¶
Timeout for the
certbot renewcommand. None means wait indefinitely.
- renew_unit: str = 'day'¶
The type of interval to try to renew certs on. Valid values are minute, hour, day, week and weekday names.
- sftp_auth_timeout: float = None¶
This sets the SFTP auth step timeout in seconds. paramiko.SSHClient.connect() auth_timeout argument.
- sftp_banner_timeout: float = 60¶
This sets the SFTP banner timeout in seconds. paramiko.SSHClient.connect() banner_timeout argument.
Module contents¶
The CertDeploy server config.
- class certdeploy.server.config.ServerConfig(*args, **kwargs)[source]¶
Bases:
ServerServer configuration.
See certdeploy.server.config.server.Server for arguments and keyword arguments.
- 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) ServerConfig[source]¶
Load the ServerConfig from a file.
- Parameters:
filename – The path of the CertDeploy server config.
override_log_filename – The path of the CertDeploy log file as given by the command line arguments. Defaults to the log_filename option in the config.
override_log_level – The CertDeploy log level as given by the command line arguments. Defaults to the log_level option in the config.
override_sftp_log_filename – The path of the SFTP client log file as given by the command line arguments. Defaults to the sftp_log_level option in the config.
override_sftp_log_level – The SFTP client log level as given by the command line arguments. Defaults to the log_level option in the config.