Add SSL support to grpc-balancer and update playbook for certificate management

- Modified grpc-balancer.py to start an SSL server using certificates.
- Added Ansible tasks in playbook.yml to create and install SSL certificates.
- Updated docker-compose.yaml to mount the SSL certificate into the container.
This commit is contained in:
vvzvlad
2025-01-20 19:21:12 +03:00
parent b988582553
commit e40e14dea5
3 changed files with 27 additions and 3 deletions

View File

@ -319,5 +319,10 @@ if __name__ == '__main__':
upload_thread.start()
from waitress import serve
logging.info(f"Starting server on port {PORT}")
serve(app, host='0.0.0.0', port=PORT, threads=MAX_WORKERS, connection_limit=1000)
import ssl
ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
ssl_context.load_cert_chain('/root/node/cert.pem', '/root/node/key.pem')
logging.info(f"Starting SSL server on port {PORT}")
serve(app, host='0.0.0.0', port=PORT, threads=MAX_WORKERS, connection_limit=1000, _ssl_context=ssl_context)