feat(nginx/tools): now setup a certificate to generate certificate if needed

This commit is contained in:
Raphael 2025-06-14 18:54:06 +02:00
parent 971f30f8f1
commit 9383276ddc

View file

@ -0,0 +1,14 @@
#!/usr/bin/env bash
GREEN = \033[32m
GREY = \033[0;90m
RED = \033[0;31m
GOLD = \033[38;5;220m
END = \033[0m
if [ ! -f "$CERT_DIR/nginx.key" ]; then
@printf '$GREYGenerating the ssl$GREEN Certificate$END\n';
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt -subj "/C=FR/ST=Paris/L=42/O=Students/OU=Inception/CN=rparodi.42.fr"
else
@printf '$GREYGenerating the ssl certificate$RED already exist$END\n';
fi