diff options
author | John Estabrook <jestabro@vyos.io> | 2023-11-21 09:42:48 -0600 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2023-11-22 13:09:42 -0600 |
commit | 33d5d429f590146ce28a6e992ccb024492bf07f6 (patch) | |
tree | 98f117cbd134b1b5bf56e6c73002e37e2cd6634c /src/conf_mode/https.py | |
parent | c1e170c88cd2222f5ec65764e1559b99efa6a862 (diff) | |
download | vyos-1x-33d5d429f590146ce28a6e992ccb024492bf07f6.tar.gz vyos-1x-33d5d429f590146ce28a6e992ccb024492bf07f6.zip |
http-api: T5768: remove auxiliary http-api.conf
Diffstat (limited to 'src/conf_mode/https.py')
-rwxr-xr-x | src/conf_mode/https.py | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/src/conf_mode/https.py b/src/conf_mode/https.py index 5cbdd1651..81e510b0d 100755 --- a/src/conf_mode/https.py +++ b/src/conf_mode/https.py @@ -52,7 +52,7 @@ default_server_block = { 'address' : '*', 'port' : '443', 'name' : ['_'], - 'api' : {}, + 'api' : False, 'vyos_cert' : {}, 'certbot' : False } @@ -232,35 +232,18 @@ def generate(https): # certbot organizes certificates by first domain sb['certbot_domain_dir'] = cert_domains[0] - # get api data - - api_set = False - api_data = {} if 'api' in list(https): - api_set = True - api_data = vyos.defaults.api_data - api_settings = https.get('api', {}) - if api_settings: - vhosts = https.get('api-restrict', {}).get('virtual-host', []) - if vhosts: - api_data['vhost'] = vhosts[:] - - if api_data: - vhost_list = api_data.get('vhost', []) + vhost_list = https.get('api-restrict', {}).get('virtual-host', []) if not vhost_list: for block in server_block_list: - block['api'] = api_data + block['api'] = True else: for block in server_block_list: if block['id'] in vhost_list: - block['api'] = api_data - - if 'server_block_list' not in https or not https['server_block_list']: - https['server_block_list'] = [default_server_block] + block['api'] = True data = { 'server_block_list': server_block_list, - 'api_set': api_set, 'certbot': certbot } |