diff --git a/scripts/cloudron-support b/scripts/cloudron-support index a4be07d85..dba4388c7 100755 --- a/scripts/cloudron-support +++ b/scripts/cloudron-support @@ -35,9 +35,9 @@ readonly HELP_MESSAGE=" --recreate-docker Deletes docker storage (containers and images) and recreates it without loss of data --send-diagnostics Collects server diagnostics and uploads it to ${PASTEBIN} --troubleshoot Dashboard down? Run tests to identify the potential problem - --unbound-use-external-dns Forwards all Unbound requests to Google (8.8.8.8) and Cloudflare (1.1.1.1) DNS servers. - Unbound is the internal DNS server used for recursive DNS queries. This is only needed + --unbound-forward-dns Unbound is the internal DNS server used for recursive DNS queries. This is only needed if your network does not allow outbound DNS requests. + Options are 'google', 'cloudflare' or comma separated custom server (e.g 8.8.8.8,1.1.1.1). --help Show this message " @@ -329,7 +329,7 @@ function check_unbound() { fi if ! host cloudron.io 127.0.0.150 &>/dev/null; then - fail "Unbound is not resolving, maybe try forwarding all DNS requests. You can do this by running 'cloudron-support --unbound-use-external-dns' option" + fail "Unbound is not resolving, maybe try forwarding all DNS requests. You can do this by running 'cloudron-support --unbound-forward-dns' option" host cloudron.io 127.0.0.150 exit 1 fi @@ -576,16 +576,23 @@ function check_expired_domain() { success "Domain ${dashboard_domain} is valid and has not expired" } -function unbound_use_external_dns() { +function unbound_forward_dns() { local -r conf_file="/etc/unbound/unbound.conf.d/forward-everything.conf" info "To remove the forwarding, please delete $conf_file and 'systemctl restart unbound'" + case "$2" in + google) ns_list="8.8.8.8,4.4.4.4";; # https://developers.google.com/speed/public-dns + cloudflare) ns_list="1.1.1.1,1.0.0.1";; # https://developers.cloudflare.com/1.1.1.1/ip-addresses/ + *) ns_list="$2";; + esac + + forward_addrs=$(echo "$ns_list" | tr ',' '\n' | sed 's/^/ forward-addr: /') + cat > $conf_file <