fix
All checks were successful
Deploy Dev / Build (pull_request) Successful in 43s
Deploy Dev / Push (pull_request) Successful in 44s
Deploy Dev / prepare (pull_request) Successful in 5s
Deploy Dev / Deploy dev (pull_request) Successful in 25s

This commit is contained in:
Egor Matveev 2025-06-08 11:12:54 +03:00
parent 0994e3b25a
commit d1212d852b
4 changed files with 19 additions and 3 deletions

View File

@ -6,6 +6,9 @@ services:
image: mathwave/sprint-repo:sprint-infra-nginx-dev image: mathwave/sprint-repo:sprint-infra-nginx-dev
networks: networks:
- common-infra-nginx-development - common-infra-nginx-development
- configurator
environment:
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_DEV
ports: ports:
- published: 80 - published: 80
target: 80 target: 80
@ -27,3 +30,5 @@ services:
networks: networks:
common-infra-nginx-development: common-infra-nginx-development:
external: true external: true
configurator:
external: true

View File

@ -6,6 +6,9 @@ services:
image: mathwave/sprint-repo:sprint-infra-nginx-prod image: mathwave/sprint-repo:sprint-infra-nginx-prod
networks: networks:
- common-infra-nginx - common-infra-nginx
- configurator
environment:
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_PROD
ports: ports:
- published: 80 - published: 80
target: 80 target: 80
@ -26,4 +29,6 @@ services:
networks: networks:
common-infra-nginx: common-infra-nginx:
external: true external: true
configurator:
external: true

View File

@ -39,7 +39,10 @@ for host, params in hosts.items():
'''.format(host=host, target_host=params['host'], port=params['port']) '''.format(host=host, target_host=params['host'], port=params['port'])
fullchain = minio_client.get_object("certupdater", f'certificates/{host}/fullchain.pem') fullchain = minio_client.get_object("certupdater", f'certificates/{host}/fullchain.pem')
privkey = minio_client.get_object("certupdater", f'certificates/{host}/privkey.pem') privkey = minio_client.get_object("certupdater", f'certificates/{host}/privkey.pem')
os.mkdir(f'/etc/nginx/{host}') try:
os.mkdir(f'/etc/nginx/{host}')
except FileExistsError:
...
with open(f"/etc/nginx/{host}/fullchain.pem", 'wb') as fp: with open(f"/etc/nginx/{host}/fullchain.pem", 'wb') as fp:
fp.write(fullchain.data) fp.write(fullchain.data)
with open(f"/etc/nginx/{host}/privkey.pem", 'wb') as fp: with open(f"/etc/nginx/{host}/privkey.pem", 'wb') as fp:

View File

@ -39,7 +39,10 @@ for host, params in hosts.items():
'''.format(host=host, target_host=params['host'], port=params['port']) '''.format(host=host, target_host=params['host'], port=params['port'])
fullchain = minio_client.get_object("certupdater", f'certificates/{host}/fullchain.pem') fullchain = minio_client.get_object("certupdater", f'certificates/{host}/fullchain.pem')
privkey = minio_client.get_object("certupdater", f'certificates/{host}/privkey.pem') privkey = minio_client.get_object("certupdater", f'certificates/{host}/privkey.pem')
os.mkdir(f'/etc/nginx/{host}') try:
os.mkdir(f'/etc/nginx/{host}')
except FileExistsError:
...
with open(f"/etc/nginx/{host}/fullchain.pem", 'wb') as fp: with open(f"/etc/nginx/{host}/fullchain.pem", 'wb') as fp:
fp.write(fullchain.data) fp.write(fullchain.data)
with open(f"/etc/nginx/{host}/privkey.pem", 'wb') as fp: with open(f"/etc/nginx/{host}/privkey.pem", 'wb') as fp: