fix
This commit is contained in:
parent
f7a1e39c98
commit
79b8240592
@ -3,19 +3,20 @@ import os
|
|||||||
from minio import Minio
|
from minio import Minio
|
||||||
|
|
||||||
|
|
||||||
minio_client = Minio(
|
def main():
|
||||||
|
minio_client = Minio(
|
||||||
"minio.develop.sprinthub.ru:9000",
|
"minio.develop.sprinthub.ru:9000",
|
||||||
access_key="serviceminioadmin",
|
access_key="serviceminioadmin",
|
||||||
secret_key=os.getenv("MINIO_SECRET_KEY", "minioadmin"),
|
secret_key=os.getenv("MINIO_SECRET_KEY", "minioadmin"),
|
||||||
secure=False
|
secure=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
hosts = get('http://configurator/api/v1/fetch?project=certupdater&stage=development').json()['configs']['hosts']
|
hosts = get('http://configurator/api/v1/fetch?project=certupdater&stage=development').json()['configs']['hosts']
|
||||||
hosts = {**hosts, 'platform.develop.sprinthub.ru': {'host': 'platform-nginx', 'port': 1238}}
|
hosts = {**hosts, 'platform.develop.sprinthub.ru': {'host': 'platform-nginx', 'port': 1238}}
|
||||||
|
|
||||||
config = ''
|
config = ''
|
||||||
for host, params in hosts.items():
|
for host, params in hosts.items():
|
||||||
config += '''
|
config += '''
|
||||||
server {{
|
server {{
|
||||||
listen 443 ssl http2;
|
listen 443 ssl http2;
|
||||||
@ -48,5 +49,11 @@ for host, params in hosts.items():
|
|||||||
with open(f"/etc/nginx/{host}/privkey.pem", 'wb') as fp:
|
with open(f"/etc/nginx/{host}/privkey.pem", 'wb') as fp:
|
||||||
fp.write(privkey.data)
|
fp.write(privkey.data)
|
||||||
|
|
||||||
with open('/etc/nginx/hosts.conf', 'w') as fp:
|
with open('/etc/nginx/hosts.conf', 'w') as fp:
|
||||||
fp.write(config)
|
fp.write(config)
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
main()
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
Loading…
Reference in New Issue
Block a user