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."
## Linux available memory
##
check_linux_memory() {
- echo `free -g --si | awk ' /Mem:/ {print $2} '`
+ ## some VMs report just under 1GB of RAM, so
+ ## make an exception and allow those with more
+ ## than 989MB
+ mem=`free -m --si | awk ' /Mem:/ {print $2}'`
+ if [ "$mem" -ge 990 -a "$mem" -lt 1000 ]; then
+ echo 1
+ else
+ echo `free -g --si | awk ' /Mem:/ {print $2} '`
+ fi
}
##
fi
fi
+ check_IP_match $hostname
+
if [ ! -z "$developer_emails" ]
then
read -p "Email address for admin account(s)? [$developer_emails]: " new_value
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"
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"
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