feat(nginx/tools): now setup a certificate to generate certificate if needed
This commit is contained in:
parent
971f30f8f1
commit
9383276ddc
1 changed files with 14 additions and 0 deletions
14
srcs/requirements/nginx/tools/generate_ssl_certificate.sh
Normal file
14
srcs/requirements/nginx/tools/generate_ssl_certificate.sh
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue