From 9c293dd8d443a44dc2f764d8d1f21d805356d1fe Mon Sep 17 00:00:00 2001 From: GotthardG <51994228+GotthardG@users.noreply.github.com> Date: Mon, 16 Dec 2024 22:57:34 +0100 Subject: [PATCH] fixing bugs with ci pipeline --- backend/main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/main.py b/backend/main.py index af02a9f..a2f2a8b 100644 --- a/backend/main.py +++ b/backend/main.py @@ -104,6 +104,16 @@ if __name__ == "__main__": key_path = "ssl/key.pem" host = "127.0.0.1" print("Running in CI mode with self-signed certificates...") + # Ensure SSL certificate and key are generated + if is_ci or environment == "dev": + Path("ssl").mkdir(exist_ok=True) + + if not Path(cert_path).exists() or not Path(key_path).exists(): + print( + f"Generating self-signed SSL certificate" + f"at {cert_path} and {key_path}" + ) + ssl_heidi.generate_self_signed_cert(cert_path, key_path) elif environment == "test": cert_path = "ssl/mx-aare-test.psi.ch.pem" key_path = "ssl/mx-aare-test.psi.ch.key"