From 85328b8eeaff4184aa77aeb252cf1d20d8c60ceb Mon Sep 17 00:00:00 2001 From: Kelvin Chen Date: Wed, 11 Nov 2015 00:10:08 -0500 Subject: [PATCH] Auto create self-signed keys If the USE_SSl var is true and the private key and certificate does not exist, then automatically create self signed keys. The common name would be invalid so you would have to change it later. This addition was added so the server would not crash if USE_SSL is true and keys do not exist. --- Dockerfiles/frontend/start | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dockerfiles/frontend/start b/Dockerfiles/frontend/start index 2f43c2c..1d1cfd9 100755 --- a/Dockerfiles/frontend/start +++ b/Dockerfiles/frontend/start @@ -12,6 +12,12 @@ cp -f /etc/nginx/common_default.conf /etc/nginx/common.conf ${USE_SSL:=false} if $USE_SSL ; then echo "include ssl.conf;" >> /etc/nginx/common.conf + + # Create self-signed certificate if using ssl and keys do not exist. + # You can always replace these with your own keys later. + if [[ ! -f /config/frontend/ssl.key || ! -f /config/frontend/ssl.crt ]]; then + ssl-gen seedbox + fi fi nginx -g "daemon off;"