diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.h b/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.h index 58bf1a4..ab93f54 100644 --- a/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.h +++ b/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.h @@ -38,7 +38,6 @@ typedef enum { NSTabViewItem *_releaseNotesTabViewItem; NSButton *_dnscryptButton; - NSButton *_fallbackButton; NSButton *_disableIPv6Button; NSTextField *_currentResolverTextField; @@ -60,7 +59,6 @@ typedef enum { @property (nonatomic, strong) IBOutlet NSTabViewItem *releaseNotesTabViewItem; @property (nonatomic, strong) IBOutlet NSButton *dnscryptButton; -@property (nonatomic, strong) IBOutlet NSButton *fallbackButton; @property (nonatomic, strong) IBOutlet NSButton *disableIPv6Button; @property (nonatomic, strong) IBOutlet NSTextField *currentResolverTextField; @@ -86,7 +84,6 @@ typedef enum { - (void) mainViewDidLoad; - (IBAction)dnscryptButtonPressed:(NSButton *)sender; -- (IBAction)fallbackButtonPressed:(NSButton *)sender; - (IBAction)disableIPv6ButtonPressed:(NSButton *)sender; - (IBAction)providerLinkPushed:(NSButton *)sender; diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m b/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m index c9a704d..e2e45c2 100644 --- a/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m +++ b/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m @@ -15,7 +15,6 @@ @synthesize queryLoggingButton = _queryLoggingButton; @synthesize exceptionsTextField = _exceptionsTextField; @synthesize dnscryptButton = _dnscryptButton; -@synthesize fallbackButton = _fallbackButton; @synthesize disableIPv6Button = _disableIPv6Button; @synthesize statusImageView = _statusImageView; @synthesize statusText = _statusText; @@ -28,7 +27,6 @@ NSArray *resolversList; - (void) setCheckBoxesEnabled: (BOOL) enabled { [_dnscryptButton setEnabled: enabled]; - [_fallbackButton setEnabled: enabled]; [_disableIPv6Button setEnabled: enabled]; [_resolverNamesButton setEnabled: enabled]; } @@ -57,17 +55,12 @@ NSArray *resolversList; NSString *res; _dnscryptButton.state = 0; - _fallbackButton.state = 0; _disableIPv6Button.state = 0; res = [self fromCommand: @"/bin/csh" withArguments: [NSArray arrayWithObjects: @"-f", @"-c", @"cd '" kDNSCRYPT_SCRIPTS_BASE_DIR @"' && exec ./get-dnscrypt-status.sh", nil]]; if ([res isEqualToString: @"yes"]) { [_dnscryptButton setState: 1]; } - res = [self fromCommand: @"/bin/csh" withArguments: [NSArray arrayWithObjects: @"-f", @"-c", @"cd '" kDNSCRYPT_SCRIPTS_BASE_DIR @"' && exec ./get-fallback-status.sh", nil]]; - if ([res isEqualToString: @"yes"]) { - [_fallbackButton setState: 1]; - } res = [self fromCommand: @"/bin/csh" withArguments: [NSArray arrayWithObjects: @"-f", @"-c", @"cd '" kDNSCRYPT_SCRIPTS_BASE_DIR @"' && exec ./get-aaaa-blocking-status.sh", nil]]; if ([res isEqualToString: @"yes"]) { [_disableIPv6Button setState: 1]; @@ -196,20 +189,6 @@ NSArray *resolversList; return TRUE; } -- (BOOL) setFallbackOn { - [self showSpinners]; - NSString *res = [self fromCommand: @"/bin/csh" withArguments: [NSArray arrayWithObjects: @"-f", @"-c", @"cd '" kDNSCRYPT_SCRIPTS_BASE_DIR @"' && ./create-ticket.sh && ./switch-fallback-on.sh", nil]]; - (void) res; - return TRUE; -} - -- (BOOL) setFallbackOff { - [self showSpinners]; - NSString *res = [self fromCommand: @"/bin/csh" withArguments: [NSArray arrayWithObjects: @"-f", @"-c", @"cd '" kDNSCRYPT_SCRIPTS_BASE_DIR @"' && ./create-ticket.sh && ./switch-fallback-off.sh", nil]]; - (void) res; - return TRUE; -} - - (BOOL) setDisableIPv6On { [self showSpinners]; NSString *res = [self fromCommand: @"/bin/csh" withArguments: [NSArray arrayWithObjects: @"-f", @"-c", @"cd '" kDNSCRYPT_SCRIPTS_BASE_DIR @"' && ./create-ticket.sh && ./switch-aaaa-blocking-on.sh", nil]]; @@ -233,15 +212,6 @@ NSArray *resolversList; } } -- (IBAction)fallbackButtonPressed:(NSButton *)sender -{ - if (sender.state != 0) { - [self setFallbackOn]; - } else { - [self setFallbackOff]; - } -} - - (IBAction)disableIPv6ButtonPressed:(NSButton *)sender { if (sender.state != 0) { diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/en.lproj/DNSCrypt.xib b/DNSCrypt-Preference-Pane/DNSCrypt/en.lproj/DNSCrypt.xib index fb07053..c569cc3 100644 --- a/DNSCrypt-Preference-Pane/DNSCrypt/en.lproj/DNSCrypt.xib +++ b/DNSCrypt-Preference-Pane/DNSCrypt/en.lproj/DNSCrypt.xib @@ -1,5 +1,5 @@ - + @@ -14,11 +14,11 @@ + - @@ -55,7 +55,7 @@ - - - - - - - - - - - @@ -168,8 +146,17 @@ - - - + + - - - + + + - + + + + + + + @@ -410,6 +399,7 @@ ads.* + diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/bin/hostip b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/bin/hostip index fd68a1d..675e2fd 100755 Binary files a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/bin/hostip and b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/bin/hostip differ diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/check-hijacking.sh b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/check-hijacking.sh deleted file mode 100755 index 7df605d..0000000 --- a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/check-hijacking.sh +++ /dev/null @@ -1,35 +0,0 @@ -#! /bin/sh - -. ./common.inc - -try_resolution() { - exec alarmer 5 dig +tries=2 +time=3 +short google-public-dns-a.google.com \ - | egrep '^8[.]8[.]8[.]8' > /dev/null 2>&1 -} - -try_http_query() { - exec alarmer 5 curl -L --max-redirs 5 -4 -m 5 --connect-timeout 5 -s \ - http://www.apple.com 2>/dev/null | \ - fgrep -c Apple > /dev/null 2>&1 -} - -try_everything() { - try_resolution & - resolution_pid=$! - try_http_query & - http_query_pid=$! - wait $resolution_pid - resolution_ret=$? - if [ $resolution_ret != 0 ]; then - return 1 - fi - wait $http_query_pid - http_query_ret=$? - [ $resolution_ret = 0 -a $http_query_ret = 0 ] -} - -try_everything_with_retries() { - try_everything || try_everything -} - -try_everything_with_retries diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/check-local-dns.sh b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/check-local-dns.sh deleted file mode 100755 index 0111412..0000000 --- a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/check-local-dns.sh +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/sh - -. ./common.inc - -try_local_resolution() { - exec dig +tries=2 +time=3 +short google-public-dns-a.google.com @$INTERFACE_PROXY \ - | egrep '^8[.]8[.]8[.]8' > /dev/null 2>&1 -} - -try_local_resolution diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/common.inc b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/common.inc index c89d1a4..4b1e4a8 100644 --- a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/common.inc +++ b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/common.inc @@ -16,7 +16,6 @@ STATES_DIR="${DNSCRYPT_VAR_BASE_DIR}/states" DNSCRYPT_RESOLVER_NAME_FILE="${CONTROL_DIR}/dnscrypt-resolver-name" DNSCRYPT_FILE="${CONTROL_DIR}/dnscrypt" -FALLBACK_FILE="${CONTROL_DIR}/fallback" HANDLERS_LOCK_FILE="${DNSCRYPT_VAR_RUN_BASE_DIR}/dnscrypt-handlers.lock" DNSCRYPT_PROXY_PLUGINS_BASE_FILE="${CONTROL_DIR}/plugin" STATIC_RESOLVERS_FILE="${CONTROL_DIR}/static-resolvers" @@ -24,6 +23,7 @@ STATIC_RESOLVERS_FILE="${CONTROL_DIR}/static-resolvers" DEBUG_ENABLED_FILE="${CONTROL_DIR}/debug.enabled" PLUGINS_ENABLED_FILE="${CONTROL_DIR}/plugins.enabled" +CACHE_FILE="${CONTROL_DIR}/plugin-cache.enabled" QUERY_LOGGING_FILE="${CONTROL_DIR}/plugin-query-logging.enabled" BLOCKING_FILE="${CONTROL_DIR}/plugin-blocking.enabled" AAAA_BLOCKING_FILE="${CONTROL_DIR}/plugin-aaaa-blocking.enabled" @@ -49,12 +49,8 @@ RESOLVERS_LIST_BASE_DIR="${DNSCRYPT_USR_BASE_DIR}/share/dnscrypt-proxy" RESOLVERS_LIST_PUBLIC_KEY="RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3" RESOLVERS_LIST_STATE="${STATES_DIR}/resolvers-updated" -INTERFACE_UNBOUND="127.0.0.53" -INTERFACE_UNBOUND_MASK="24" INTERFACE_PROXY="127.0.0.54" INTERFACE_PROXY_MASK="24" -INTERFACE_PROBES="127.0.0.55" -INTERFACE_PROBES_MASK="24" DOMAINS_EXCEPTIONS=' belkin corp domain example home host invalid lan local localdomain test freebox.fr fritz.box nowtv.com routerlogin.net l onion @@ -63,9 +59,7 @@ belkin corp domain example home host invalid lan local localdomain test freebox. export PATH="${DNSCRYPT_USR_BASE_DIR}/sbin:${DNSCRYPT_USR_BASE_DIR}/bin:${DNSCRYPT_USR_BASE_DIR}/scripts:$PATH" init_interfaces() { - /sbin/ifconfig lo0 alias ${INTERFACE_UNBOUND}/${INTERFACE_UNBOUND_MASK} /sbin/ifconfig lo0 alias ${INTERFACE_PROXY}/${INTERFACE_PROXY_MASK} - /sbin/ifconfig lo0 alias ${INTERFACE_PROBES}/${INTERFACE_PROBES_MASK} } logger_debug() { diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-dhcp-resolvers.sh b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-dhcp-resolvers.sh index f342dd5..bb2e6bc 100755 --- a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-dhcp-resolvers.sh +++ b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-dhcp-resolvers.sh @@ -3,7 +3,7 @@ . ./common.inc ifs=$(ifconfig -a | \ - awk '/^[^ :]*:/ { sub(/:.*$/,empty); iface=$0 } /status: active/ { print iface }') + awk '/^[^ :]*:/ { sub(/:.*$/,empty); iface=$0 } /status: active/ { print iface }') ifs=$(echo $ifs) typeset -A found diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-fallback-status.sh b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-fallback-status.sh deleted file mode 100755 index b444567..0000000 --- a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-fallback-status.sh +++ /dev/null @@ -1,9 +0,0 @@ -#! /bin/sh - -. ./common.inc - -if [ -e "$FALLBACK_FILE" ]; then - echo 'yes' -else - echo 'no' -fi diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-upstream-resolvers.sh b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-upstream-resolvers.sh index fc3d454..fb8df9a 100755 --- a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-upstream-resolvers.sh +++ b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-upstream-resolvers.sh @@ -19,7 +19,7 @@ done if [ "$dnscrypt_proxy_used" = 'yes' \ -a -r "${STATES_DIR}/dnscrypt-proxy-description" ]; then - cat "${STATES_DIR}/dnscrypt-proxy-description" && exit 0 + cat "${STATES_DIR}/dnscrypt-proxy-description" && exit 0 fi echo "$upstream_resolvers" exit 0 diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/handle-console-change.sh b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/handle-console-change.sh index fdd9666..fa26aa2 100755 --- a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/handle-console-change.sh +++ b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/handle-console-change.sh @@ -28,3 +28,5 @@ fi [ x"$current_uid" != x"$wanted_uid" ] && \ chown -R "${wanted_uid}:0" "$CONTROL_DIR" + +exec sleep 1 diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/handle-network-change.sh b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/handle-network-change.sh index 14790c1..8da5e90 100755 --- a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/handle-network-change.sh +++ b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/handle-network-change.sh @@ -6,13 +6,11 @@ tickets_count=$(./get-tickets-count.sh) [ "$tickets_count" != '0' ] && exit 0 if [ x"$1" != 'x--boot' ]; then - [ ! -e "$FALLBACK_FILE" ] && exit 0 ./check-network-change.sh || exit 0 fi logger_debug "Network configuration changed" - lockfile -1 -r 30 "$HANDLERS_LOCK_FILE" || exit 1 ./set-dns-to-dhcp.sh if [ ! -e "$DNSCRYPT_FILE" ]; then diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/start-dnscrypt-proxy.sh b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/start-dnscrypt-proxy.sh index e02cd81..397ab6d 100755 --- a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/start-dnscrypt-proxy.sh +++ b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/start-dnscrypt-proxy.sh @@ -2,6 +2,8 @@ . ./common.inc +CERTIFICATE_MIN_VALIDITY=60 + DNSCRYPT_LIB_BASE_DIR="${DNSCRYPT_USR_BASE_DIR}/lib" export DYLD_LIBRARY_PATH="${DNSCRYPT_LIB_BASE_DIR}:${DYLD_LIBRARY_PATH}" @@ -34,32 +36,15 @@ try_resolver() { logger_debug "Running a test dnscrypt proxy for [$description]" rm -f "${RES_DIR}/${priority}" - exec alarmer 3 dnscrypt-proxy --pid="$pid_file" \ + alarmer 3 dnscrypt-proxy --pid="$pid_file" \ --resolver-name="$RESOLVER_NAME" \ - --local-address="${INTERFACE_PROBES}:${priority}" $args 2>&1 | \ - while read line; do - case "$line" in - *Proxying\ from\ *) - logger_debug "Proxy for [$description] is up" - -# This doesn't send anything to Apple, and any reliable domain name can be used -- -# The following line sends a common query to the chosen DNSCrypt resolver to -# check that it responds and can be used instead of leaving the mac without -# a working DNS configuration. - answers=$(exec dig +time=1 +short +tries=2 -p $priority \ - @"$INTERFACE_PROBES" www.apple.com. 2> /dev/null | \ - egrep -ic '^[0-9.:]+$') - - [ -r "$pid_file" ] && kill $(cat -- "$pid_file") - if [ $answers -gt 0 ]; then - logger_debug "Proxy for [$description] can be used" - echo "$args" > "${RES_DIR}/${priority}" - echo "$description" > "${DESCRIPTIONS_DIR}/${priority}" - fi - ;; - *) ;; - esac - done + --test="$CERTIFICATE_MIN_VALIDITY" $args + if [ $? = 0 ]; then + logger_debug "Certificate for [$description] received" + echo "$args" > "${RES_DIR}/${priority}" + echo "$description" > "${DESCRIPTIONS_DIR}/${priority}" + fi + rm -f "$pid_file" } get_plugin_args() { @@ -82,11 +67,11 @@ logger_debug "dnscrypt-proxy should be (re)started, stopping previous instance i wait_pids="" -try_resolver 5004 "${RESOLVER_NAME} using DNSCrypt over UDP" \ +try_resolver 1 "${RESOLVER_NAME} using DNSCrypt over UDP" \ "--resolver-name=$RESOLVER_NAME" & wait_pids="$wait_pids $!" -try_resolver 5005 "${RESOLVER_NAME} using DNSCrypt over TCP" \ +try_resolver 2 "${RESOLVER_NAME} using DNSCrypt over TCP" \ "--resolver-name=$RESOLVER_NAME --tcp-only" & wait_pids="$wait_pids $!" @@ -105,6 +90,8 @@ if [ x"$best_file" = "x" ]; then exit 1 fi +./switch-cache-on.sh + plugins_args='' if [ -r "${DNSCRYPT_PROXY_PLUGINS_BASE_FILE}s.enabled" ]; then plugin_args=$(get_plugin_args) @@ -133,23 +120,6 @@ if [ $? != 0 ]; then logger_debug "dnscrypt-proxy $best_args worked after a retry" fi -sleep 1 -logger_debug "Checking if the current configuration hijacks all DNS queries" -i=0 -while [ $i -lt 30 ]; do - ./check-local-dns.sh && break - sleep 0.1 - i=$((i + 1)) -done - -if [ $i -ge 30 ]; then - logger_debug "Current configuration hijacks all DNS queries, disabling DNSCrypt" - ./switch-to-dhcp.sh - exit 1 -fi - -logger_debug "Current configuration doesn't seem to hijack all DNS queries" - mv "${DESCRIPTIONS_DIR}/${best_file}" \ "${STATES_DIR}/dnscrypt-proxy-description" 2>/dev/null || exit 0 diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-blacklists-on.sh b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-blacklists-on.sh index 4b573bb..875703f 100755 --- a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-blacklists-on.sh +++ b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-blacklists-on.sh @@ -14,4 +14,4 @@ plugin_args='' echo "libdcplugin_example_ldns_blocking.la${plugin_args}" > \ "$BLOCKING_FILE" -touch "$PLUGINS_ENABLED_FILE" +touch "$PLUGINS_ENABLED_FILE" diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-fallback-on.sh b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-cache-off.sh similarity index 54% rename from DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-fallback-on.sh rename to DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-cache-off.sh index 714cb55..f802155 100755 --- a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-fallback-on.sh +++ b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-cache-off.sh @@ -2,4 +2,5 @@ . ./common.inc -touch "$FALLBACK_FILE" +rm -f "$CACHE_FILE" + diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-cache-on.sh b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-cache-on.sh new file mode 100755 index 0000000..a9cefab --- /dev/null +++ b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-cache-on.sh @@ -0,0 +1,8 @@ +#! /bin/sh + +. ./common.inc + +echo "libdcplugin_example_cache.la" > \ + "$CACHE_FILE" + +touch "$PLUGINS_ENABLED_FILE" diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-fallback-off.sh b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-fallback-off.sh deleted file mode 100755 index 22deae2..0000000 --- a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-fallback-off.sh +++ /dev/null @@ -1,5 +0,0 @@ -#! /bin/sh - -. ./common.inc - -rm -f "$FALLBACK_FILE" diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-to-dnscrypt-if-required.sh b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-to-dnscrypt-if-required.sh index 38cfa05..2d09c31 100755 --- a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-to-dnscrypt-if-required.sh +++ b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-to-dnscrypt-if-required.sh @@ -10,8 +10,6 @@ PAUSE_INCREMENT=1 logger_debug "DNSCrypt has been requested" -./set-dns-to-dhcp.sh - pause=0 while [ -e "$DNSCRYPT_FILE" ]; do logger_debug "Switching to dnscrypt if required (pause=$pause)" @@ -22,41 +20,26 @@ while [ -e "$DNSCRYPT_FILE" ]; do ./switch-to-dhcp.sh fi fi - [ $pause -lt $PAUSE_MAX ] && pause=$((pause + 1)) pause_counter=0 while [ -e "$DNSCRYPT_FILE" -a $pause_counter -lt $pause ]; do sleep $PAUSE_UNIT pause_counter=$((pause_counter + 1)) done + [ $pause -lt $PAUSE_MAX ] && pause=$((pause + 1)) [ ! -e "$DNSCRYPT_FILE" ] && break - if [ -e "$FALLBACK_FILE" ]; then - logger_debug "Checking if the router hijacks HTTP queries" - if ./check-hijacking.sh; then - logger_debug "The router doesn't hijack HTTP queries" - else - logger_debug "The router hijacks HTTP queries - DNSCrypt is likely to be blocked" - continue - fi - fi ./start-dnscrypt-proxy.sh || continue - ./check-local-dns.sh || continue ./set-dns.sh "$INTERFACE_PROXY" if [ $? != 0 ]; then logger_debug "Setting the DNS to [$INTERFACE_PROXY] didn't work" ./set-dns-to-dhcp.sh continue fi - ./check-hijacking.sh - if [ $? != 0 ]; then - logger_debug "Current configuration seems to be hijacking HTTP queries. Reverting to default resolvers." - ./set-dns-to-dhcp.sh - continue - fi break done if [ ! -e "$DNSCRYPT_FILE" ]; then touch "$CONTROL_DIR" + exit 0 fi exec ./exceptions-add.sh diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/update.sh b/DNSCrypt-Preference-Pane/DNSCrypt/update.sh index eef07fd..ba847e1 100755 --- a/DNSCrypt-Preference-Pane/DNSCrypt/update.sh +++ b/DNSCrypt-Preference-Pane/DNSCrypt/update.sh @@ -7,7 +7,7 @@ cp /Library/PreferencePanes/DNSCrypt.prefPane/Contents/Resources/usr/bin/hostip mkdir -p extra/usr/sbin cp /Library/PreferencePanes/DNSCrypt.prefPane/Contents/Resources/usr/sbin/dnscrypt-proxy \ extra/usr/sbin/ - + mkdir -p extra/usr/lib cp /opt/ldns/lib/libldns.1.dylib \ @@ -19,6 +19,7 @@ cp /opt/ldns/lib/libldns.1.dylib \ if [ -f /usr/local/lib/libsodium.18.dylib ]; then echo '*** /usr/local/lib/libsodium.{dylib,la} found' echo '*** Compile dnscrypt-proxy without them to get a static build' + echo '*** Then reinstall them' sleep 10 fi @@ -37,6 +38,6 @@ mkdir -p extra/usr/share/dnscrypt-proxy cp /Library/PreferencePanes/DNSCrypt.prefPane/Contents/Resources/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv \ extra/usr/share/dnscrypt-proxy/ - + cp /Library/PreferencePanes/DNSCrypt.prefPane/Contents/Resources/usr/share/dnscrypt-proxy/minisign.pub \ extra/usr/share/dnscrypt-proxy/