summaryrefslogtreecommitdiff
path: root/src/conf_mode/https.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-11-21 09:42:48 -0600
committerJohn Estabrook <jestabro@vyos.io>2023-12-01 09:43:53 -0600
commit006931b8f1926a239bb5be4e27eb40bbe071219c (patch)
tree4929342e892d942d183e60438cf362954a0da16a /src/conf_mode/https.py
parent5b7f7944eb06f2461e5bc95c8171160b8767291d (diff)
downloadvyos-1x-006931b8f1926a239bb5be4e27eb40bbe071219c.tar.gz
vyos-1x-006931b8f1926a239bb5be4e27eb40bbe071219c.zip
http-api: T5768: remove auxiliary http-api.conf
Diffstat (limited to 'src/conf_mode/https.py')
-rwxr-xr-xsrc/conf_mode/https.py25
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
}