From 523f47654093ba28d096a7a78375c8ad92cc03eb Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Fri, 17 Nov 2017 14:22:48 -0500 Subject: [PATCH] Typo, hostname check --- start.sh | 2 +- webodm.sh | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/start.sh b/start.sh index 58e8d4dc..8daa346c 100755 --- a/start.sh +++ b/start.sh @@ -96,7 +96,7 @@ else # Check if SSL key/certs are available conf="nginx.conf" - if [ -e nginx/ssl ]; + if [ -e nginx/ssl ]; then echo "Using nginx SSL configuration" conf="nginx-ssl.conf" fi diff --git a/webodm.sh b/webodm.sh index ef62a76e..7cb49ed5 100755 --- a/webodm.sh +++ b/webodm.sh @@ -161,18 +161,24 @@ start(){ command+=" -f docker-compose.ssl-manual.yml" fi - echo "SSL will be enabled ($method)" - - # Check port settings - # as let's encrypt cannot communicate on ports - # different than 80 or 443 if [ "$method" = "Lets Encrypt" ]; then + # Check port settings + # as let's encrypt cannot communicate on ports + # different than 80 or 443 if [ "$PORT" != "$DEFAULT_PORT" ]; then echo -e "\033[93mLets Encrypt cannot run on port: $PORT, switching to 443.\033[39m" echo "If you need to use a different port, you'll need to generate the SSL certificate files separately and use the --ssl-key and --ssl-certificate options." fi export PORT=443 + + # Make sure we have a hostname + if [ "$HOST" = "localhost" ]; then + echo -e "\033[91mSSL is enabled, but hostname cannot be set to $HOST. Set the --hostname argument to the domain of your WebODM server (for example: www.mywebodm.org).\033[39m" + exit 1 + fi fi + + echo "Will enable SSL ($method)" fi run "$command start || $command up"