From e201bd35511e1a000ffa21a4194d234634cfd76c Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Fri, 19 May 2023 09:57:11 +0000 Subject: T5222: Refactoring load-balancing reverse-proxy Improve and refactoring "load-balancing reverse-proxy" - replace 'reverse-proxy server ' => 'reverse-proxy service ' - replace 'reverse-proxy global-parameters tls ' => 'reverse-proxy global-parameters tls-version-min xxx' => 'reverse-proxy global-parameters ssl-bind-ciphers xxx' - replace 'reverse-proxy service https rule set server 'xxx' => 'reverse-proxy service https rule set backend 'xxx' 'service https rule domain-name xxx' set as multinode --- src/conf_mode/load-balancing-haproxy.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/conf_mode/load-balancing-haproxy.py') diff --git a/src/conf_mode/load-balancing-haproxy.py b/src/conf_mode/load-balancing-haproxy.py index d2b895fbe..938af6cda 100755 --- a/src/conf_mode/load-balancing-haproxy.py +++ b/src/conf_mode/load-balancing-haproxy.py @@ -74,15 +74,12 @@ def verify(lb): if not lb: return None - if 'backend' not in lb or 'server' not in lb: - raise ConfigError(f'"server" and "backend" must be configured!') + if 'backend' not in lb or 'service' not in lb: + raise ConfigError(f'"service" and "backend" must be configured!') - for front, front_config in lb['server'].items(): + for front, front_config in lb['service'].items(): if 'port' not in front_config: - raise ConfigError(f'"{front} server port" must be configured!') - # We can use redirect to HTTPS without backend section - if 'backend' not in front_config and 'redirect_http_to_https' not in front_config: - raise ConfigError(f'"{front} backend" must be configured!') + raise ConfigError(f'"{front} service port" must be configured!') # Check if bind address:port are used by another service tmp_address = front_config.get('address', '0.0.0.0') @@ -117,7 +114,7 @@ def generate(lb): os.mkdir(load_balancing_dir) # SSL Certificates for frontend - for front, front_config in lb['server'].items(): + for front, front_config in lb['service'].items(): if 'ssl' in front_config: cert_file_path = os.path.join(load_balancing_dir, 'cert.pem') cert_key_path = os.path.join(load_balancing_dir, 'cert.pem.key') -- cgit v1.2.3