From 547edfaef0a85561e8f879172d36282c7339e639 Mon Sep 17 00:00:00 2001 From: Jakob Scheid Date: Mon, 11 May 2026 22:46:37 +0200 Subject: [PATCH] Generalize the term 'Gitea webhook configuration' to 'Gitea configuration' --- src/jcloud_deployment_server/api/config.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/jcloud_deployment_server/api/config.py b/src/jcloud_deployment_server/api/config.py index 5e64312..afff7f5 100644 --- a/src/jcloud_deployment_server/api/config.py +++ b/src/jcloud_deployment_server/api/config.py @@ -24,8 +24,8 @@ import argparse __all__ = [ 'load_config', 'process_host_and_port', - 'GiteaWebhookConfig', - 'process_gitea_webhook_config', + 'GiteaConfig', + 'process_gitea_config', ] def load_config(config_directory: pathlib.Path) -> tuple[ @@ -116,9 +116,9 @@ def process_host_and_port( return host, int(port) @dataclass -class GiteaWebhookConfig: +class GiteaConfig: enabled: bool - secret_file_path: pathlib.Path + webhook_secret_file_path: pathlib.Path def _is_readable_file(path: pathlib.Path) -> bool: ''' @@ -142,24 +142,24 @@ def _is_readable_file(path: pathlib.Path) -> bool: return True -def process_gitea_webhook_config( +def process_gitea_config( configuration: jcloud_config_parser.ini.INIConfiguration, logger: logging.Logger - ) -> GiteaWebhookConfig: + ) -> GiteaConfig: ''' - Processes the Gitea webhook configuration. + Processes the Gitea configuration. :param configuration: The configuration. :type configuration: jcloud_config_parser.ini.INIConfiguration :param logger: The logger. :type logger: logging.Logger - :return: The Gitea webhooks configuration. - :rtype: GiteaWebhookConfig + :return: The Gitea configuration. + :rtype: GiteaConfig ''' if configuration['gitea'].enabled not in ('true', 'yes', 't', 'y'): - return GiteaWebhookConfig(False, None) + return GiteaConfig(False, None) secret_file_path = pathlib.Path(configuration['gitea'].webhook_secret_file) @@ -167,4 +167,4 @@ def process_gitea_webhook_config( logger.critical(f'{secret_file_path}: Cannot read Gitea webhook secret file') raise Fail(f'{secret_file_path}: Cannot read Gitea webhook secret file', exit_code = 2) - return GiteaWebhookConfig(True, secret_file_path) \ No newline at end of file + return GiteaConfig(True, secret_file_path) \ No newline at end of file