X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=discourse-setup;h=2b86fca40617256e3e5d61c87cb6528c8e7ac684;hb=70a33234631fea8a6b04d2fdef507c178fc19272;hp=c4daa6b9f62dcf48ff37211b6f277954d3e51fa4;hpb=20e812e3d8f37818aaaf9d5e2775cd45653c40c2;p=discourse_docker.git diff --git a/discourse-setup b/discourse-setup index c4daa6b..2b86fca 100755 --- a/discourse-setup +++ b/discourse-setup @@ -68,11 +68,9 @@ check_IP_match() { echo echo Google: \"open ports YOUR CLOUD SERVICE\" for information for resolving this problem. echo - echo You should probably answer \"n\" at the next prompt and disable Let\'s Encrypt. - echo - echo This test might not work for all situations, - echo "so if you can access Discourse at http://$HOST, you might try anyway." - sleep 3 + echo If you want to proceed anyway, you will need to + echo edit the containers/app.yml file manually. + exit 1 ;; 2) echo "Continuing without port check." @@ -374,6 +372,8 @@ ask_user_for_config() { fi fi + check_IP_match $hostname + if [ ! -z "$developer_emails" ] then read -p "Email address for admin account(s)? [$developer_emails]: " new_value @@ -437,7 +437,7 @@ ask_user_for_config() { if [ ! -z $letsencrypt_account_email ] then - read -p "Optional email address for setting up Let's Encrypt? ($letsencrypt_status) [$letsencrypt_account_email]: " new_value + read -p "Optional email address for Let's Encrypt warnings? ($letsencrypt_status) [$letsencrypt_account_email]: " new_value if [ ! -z "$new_value" ] then letsencrypt_account_email="$new_value" @@ -450,11 +450,6 @@ ask_user_for_config() { fi fi - if [ "$letsencrypt_status" == "Enter 'OFF' to disable." ] - then - check_IP_match $hostname - fi - echo -e "\nDoes this look right?\n" echo "Hostname : $hostname" echo "Email : $developer_emails" @@ -559,57 +554,37 @@ ask_user_for_config() { update_ok="n" fi fi - if [ "$letsencrypt_status" = "ENTER to skip" ] - then - local src='^ #\?- "templates\/web.ssl.template.yml"' - local dst=' #\- "templates\/web.ssl.template.yml"' - sed -i -e "s/$src/$dst/w $changelog" $web_file - if [ ! -s $changelog ] - then - update_ok="n" - echo "web.ssl.template.yml NOT DISABLED--Are you using a non-standard template?" - fi - local src='^ #\?- "templates\/web.letsencrypt.ssl.template.yml"' - local dst=' #- "templates\/web.letsencrypt.ssl.template.yml"' - sed -i -e "s/$src/$dst/w $changelog" $web_file - if [ ! -s $changelog ] - then - update_ok="n" - echo "web.ssl.template.yml NOT DISABLED--Are you using a non-standard template?" - fi - else # enable let's encrypt - echo "Let's Encrypt will be enabled for $letsencrypt_account_email" - sed -i -e "s/^ #\?LETSENCRYPT_ACCOUNT_EMAIL:.*/ LETSENCRYPT_ACCOUNT_EMAIL: $letsencrypt_account_email/w $changelog" $web_file - if [ -s $changelog ] - then - rm $changelog - else - echo "LETSENCRYPT_ACCOUNT_EMAIL change failed." - update_ok="n" - fi - local src='^ #\?- "templates\/web.ssl.template.yml"' - local dst=' \- "templates\/web.ssl.template.yml"' - sed -i -e "s/$src/$dst/w $changelog" $web_file - if [ -s $changelog ] - then - echo "web.ssl.template.yml enabled" - else - update_ok="n" - echo "web.ssl.template.yml NOT ENABLED--was it on already?" - fi - local src='^ #\?- "templates\/web.letsencrypt.ssl.template.yml"' - local dst=' - "templates\/web.letsencrypt.ssl.template.yml"' + echo "Enabling Let's Encrypt" + sed -i -e "s/^ #\?LETSENCRYPT_ACCOUNT_EMAIL:.*/ LETSENCRYPT_ACCOUNT_EMAIL: $letsencrypt_account_email/w $changelog" $web_file + if [ -s $changelog ] + then + rm $changelog + else + echo "LETSENCRYPT_ACCOUNT_EMAIL change failed." + update_ok="n" + fi + local src='^ #\?- "templates\/web.ssl.template.yml"' + local dst=' \- "templates\/web.ssl.template.yml"' + sed -i -e "s/$src/$dst/w $changelog" $web_file + if [ -s $changelog ] + then + echo "web.ssl.template.yml enabled" + else + update_ok="n" + echo "web.ssl.template.yml NOT ENABLED--was it on already?" + fi + local src='^ #\?- "templates\/web.letsencrypt.ssl.template.yml"' + local dst=' - "templates\/web.letsencrypt.ssl.template.yml"' - sed -i -e "s/$src/$dst/w $changelog" $web_file - if [ -s $changelog ] - then - echo "letsencrypt.ssl.template.yml enabled" - else - update_ok="n" - echo "letsencrypt.ssl.template.yml NOT ENABLED -- was it on already?" - fi - fi + sed -i -e "s/$src/$dst/w $changelog" $web_file + if [ -s $changelog ] + then + echo "letsencrypt.ssl.template.yml enabled" + else + update_ok="n" + echo "letsencrypt.ssl.template.yml NOT ENABLED -- was it on already?" + fi if [ "$update_ok" == "y" ] then