diff --git a/scripts/cloudron-support b/scripts/cloudron-support index 73c6b22cf..150ef542d 100755 --- a/scripts/cloudron-support +++ b/scripts/cloudron-support @@ -201,6 +201,16 @@ function send_diagnostics() { echo -e "\nPlease email the following link to support@cloudron.io : ${PASTEBIN}/${paste_key}" } +function check_dns() { + if ! dig cloudron.io +short &>/dev/null; then + fail "DNS is not resolving" + dig cloudron.io + exit 1 + fi + + success "DNS is resolving vis systemd-resolved" +} + function check_unbound() { if ! systemctl is-active -q unbound; then info "unbound is down. updating root anchor to see if it fixes it" @@ -218,9 +228,9 @@ function check_unbound() { exit 1 fi - test_resolve=$(dig cloudron.io @127.0.0.1 +short) - if [[ -z "test_resolve" ]]; then - fail "DNS is not resolving, maybe try forwarding all DNS requests using the --use-external-dns option" + if ! dig cloudron.io @127.0.0.150 +short &>/dev/null; then + fail "Unbound is not resolving, maybe try forwarding all DNS requests. You can do this by running 'cloudron-support --use-external-dns' option" + dig cloudron.io @127.0.0.150 exit 1 fi @@ -242,6 +252,8 @@ function check_dashboard_cert() { echo -e "\tCommon issues include expiry of domain's API key OR incoming http port 80 not being open" exit 1 fi + + success "dashboard cert is valid" } function check_nginx() { @@ -295,6 +307,8 @@ function check_dashboard_site_loopback() { fail "Could not load dashboard website with loopback check" exit 1 fi + + success "dashboard is reachable via loopback" } function check_node() { @@ -381,13 +395,13 @@ function check_expired_domain() { if ! command -v whois &> /dev/null; then info "Domain ${dashboard_domain} expiry check skipped because whois is not installed. Run 'apt install whois' to check" - exit 0 + return fi local -r expdate=$(whois ${dashboard_domain} | egrep -i 'Expiration Date:|Expires on|Expiry Date:' | head -1 | awk '{print $NF}') if [[ -z "${expdate}" ]]; then warn "Domain ${dashboard_domain} expiry check skipped because whois does not have this information" - exit 0 + return fi local -r expdate_secs=$(date -d"$expdate" +%s) @@ -441,10 +455,11 @@ function troubleshoot() { check_nginx # requires mysql to be checked check_dashboard_site_loopback # checks website via loopback check_box - check_unbound + check_dns check_dashboard_cert check_dashboard_site_domain # check website via domain name check_expired_domain + check_unbound # this is less fatal after 8.0 } function check_disk_space() {