commit
0e3d0395d7
@ -12,10 +12,10 @@ minio_client = Minio(
|
||||
|
||||
|
||||
hosts = get('http://configurator/api/v1/fetch?project=certupdater&stage=development').json()['configs']['hosts']
|
||||
hosts = list(set(hosts + ['platform.develop.sprinthub.ru']))
|
||||
hosts = {**hosts, 'platform.develop.sprinthub.ru': {'host': 'platform-nginx', 'port': 1238}}
|
||||
|
||||
config = ''
|
||||
for host in hosts:
|
||||
for host, params in hosts.items():
|
||||
config += '''
|
||||
server {{
|
||||
listen 443 ssl http2;
|
||||
@ -33,10 +33,10 @@ for host in hosts:
|
||||
|
||||
location / {{
|
||||
resolver 127.0.0.11;
|
||||
proxy_pass http://{pre_domain}-nginx:1238$request_uri;
|
||||
proxy_pass http://{target_host}:{port}$request_uri;
|
||||
}}
|
||||
}}\n\n
|
||||
'''.format(host=host, pre_domain=host.split('.')[0])
|
||||
'''.format(host=host, target_host=params['host'], port=params['port'])
|
||||
fullchain = minio_client.get_object("certupdater", f'certificates/{host}/fullchain.pem')
|
||||
privkey = minio_client.get_object("certupdater", f'certificates/{host}/privkey.pem')
|
||||
os.mkdir(f'/etc/nginx/{host}')
|
||||
|
Loading…
Reference in New Issue
Block a user