Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
690fc9038d | ||
|
|
3724e78ab2 | ||
|
|
dd3b6a2aa7 | ||
|
|
455ee1dbcb | ||
|
|
b036e93a6a | ||
|
|
73ca3e136f | ||
|
|
11640d3038 | ||
|
|
af6b2485ae | ||
|
|
b1e4f1a064 | ||
|
|
cf513f4745 | ||
|
|
12eff619cc | ||
|
|
065c93519e | ||
|
|
da8a4c2b55 | ||
|
|
18310fd607 | ||
|
|
128ee7809f | ||
|
|
76462a39b3 | ||
|
|
1e5cc145e3 | ||
|
|
e5d8a9f579 | ||
|
|
89e8c923fa | ||
|
|
fb416bf21e | ||
|
|
20b40f8cd9 | ||
|
|
917aa0034b | ||
|
|
c4c2aa4a9f | ||
|
|
2896256872 | ||
|
|
e226cba2f4 | ||
|
|
a430afe4c9 | ||
|
|
16039bf898 |
@@ -17,11 +17,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<string>1.0.2</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0.0</string>
|
||||
<string>1.0.2</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
|
||||
@@ -1436,7 +1436,7 @@
|
||||
<key>USE_HFS+_COMPRESSION</key>
|
||||
<true/>
|
||||
<key>VERSION</key>
|
||||
<string>1.0.0</string>
|
||||
<string>1.0.2</string>
|
||||
</dict>
|
||||
<key>TYPE</key>
|
||||
<integer>0</integer>
|
||||
@@ -1929,7 +1929,7 @@
|
||||
<key>USE_HFS+_COMPRESSION</key>
|
||||
<true/>
|
||||
<key>VERSION</key>
|
||||
<string>1.0.0</string>
|
||||
<string>1.0.2</string>
|
||||
</dict>
|
||||
<key>TYPE</key>
|
||||
<integer>0</integer>
|
||||
|
||||
@@ -2,14 +2,24 @@
|
||||
|
||||
exec 2>/dev/null
|
||||
|
||||
/bin/launchctl stop com.opendns.osx.RoamingClientMenubar
|
||||
/bin/launchctl remove com.opendns.osx.RoamingClientMenubar
|
||||
/bin/launchctl remove com.opendns.osx.RoamingClientConfigUpdater
|
||||
/bin/rm -f /Library/LaunchDaemons/com.opendns.osx.Roaming*.plist
|
||||
|
||||
/bin/launchctl remove com.opendns.osx.DNSCryptMenuBar
|
||||
/bin/rm -f /Library/LaunchDaemons/com.opendns.osx.DNSCryptMenuBar.plist
|
||||
/bin/launchctl stop com.opendns.osx.RoamingClientConfigUpdater
|
||||
/bin/launchctl remove com.opendns.osx.RoamingClientConfigUpdater
|
||||
|
||||
/bin/rm -f /Library/LaunchDaemons/com.opendns.osx.Roaming*.plist
|
||||
|
||||
/bin/launchctl stop com.opendns.osx.DNSCryptMenuBar
|
||||
/bin/launchctl remove com.opendns.osx.DNSCryptMenuBar
|
||||
|
||||
/bin/launchctl stop com.github.dnscrypt-osxclient.DNSCryptMenuBar
|
||||
/bin/launchctl remove com.github.dnscrypt-osxclient.DNSCryptMenuBar
|
||||
|
||||
killall 'DNSCrypt-Menubar'
|
||||
killall 'DNSCrypt Menubar'
|
||||
|
||||
/bin/rm -f /Library/LaunchDaemons/com.opendns.osx.DNSCryptMenuBar.plist
|
||||
/bin/rm -f /Library/LaunchDaemons/com.github.dnscrypt-osxclient.DNSCryptMenuBar.plist
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -2,29 +2,46 @@
|
||||
|
||||
exec 2>/dev/null
|
||||
|
||||
if [ -x /usr/bin/pkill ]; then
|
||||
/usr/bin/pkill -f '/Applications/System Preferences.app'
|
||||
fi
|
||||
killall 'System Preferences'
|
||||
|
||||
/bin/rm -rf '/Library/Application Support/DNSCrypt Updater'
|
||||
|
||||
/bin/launchctl stop com.opendns.osx.DNSCryptConfigUpdater
|
||||
/bin/launchctl remove com.opendns.osx.DNSCryptConfigUpdater
|
||||
/bin/rm -f '/Library/LaunchDaemons/com.opendns.osx.DNSCryptConfigUpdater.plist'
|
||||
|
||||
/bin/launchctl remove com.opendns.osx.DNSCryptAfterboot
|
||||
/bin/launchctl remove com.opendns.osx.DNSCryptConsoleChange
|
||||
/bin/launchctl remove com.opendns.osx.DNSCryptControlChange
|
||||
/bin/launchctl remove com.opendns.osx.DNSCryptNetworkChange
|
||||
/bin/rm -f /Library/LaunchDaemons/com.opendns.osx.DNSCrypt*.plist
|
||||
|
||||
/bin/launchctl stop com.github.dnscrypt-osxclient.DNSCryptConfigUpdater
|
||||
/bin/launchctl remove com.github.dnscrypt-osxclient.DNSCryptConfigUpdater
|
||||
/bin/rm -f '/Library/LaunchDaemons/com.github.dnscrypt-osxclient.DNSCryptConfigUpdater.plist'
|
||||
|
||||
/bin/launchctl stop com.opendns.osx.DNSCryptAfterboot
|
||||
/bin/launchctl remove com.opendns.osx.DNSCryptAfterboot
|
||||
/bin/launchctl stop com.opendns.osx.DNSCryptConsoleChange
|
||||
/bin/launchctl remove com.opendns.osx.DNSCryptConsoleChange
|
||||
/bin/launchctl stop com.opendns.osx.DNSCryptControlChange
|
||||
/bin/launchctl remove com.opendns.osx.DNSCryptControlChange
|
||||
/bin/launchctl stop com.opendns.osx.DNSCryptNetworkChange
|
||||
/bin/launchctl remove com.opendns.osx.DNSCryptNetworkChange
|
||||
|
||||
/bin/rm -f /Library/LaunchDaemons/com.opendns.osx.DNSCryptAfterboot.plist
|
||||
/bin/rm -f /Library/LaunchDaemons/com.opendns.osx.DNSCryptConsoleChange.plist
|
||||
/bin/rm -f /Library/LaunchDaemons/com.opendns.osx.DNSCryptControlChange.plist
|
||||
/bin/rm -f /Library/LaunchDaemons/com.opendns.osx.DNSCryptNetworkChange.plist
|
||||
|
||||
/bin/launchctl stop com.github.dnscrypt-osxclient.DNSCryptAfterboot
|
||||
/bin/launchctl remove com.github.dnscrypt-osxclient.DNSCryptAfterboot
|
||||
/bin/launchctl stop com.github.dnscrypt-osxclient.DNSCryptConsoleChange
|
||||
/bin/launchctl remove com.github.dnscrypt-osxclient.DNSCryptConsoleChange
|
||||
/bin/launchctl stop com.github.dnscrypt-osxclient.DNSCryptControlChange
|
||||
/bin/launchctl remove com.github.dnscrypt-osxclient.DNSCryptControlChange
|
||||
/bin/launchctl stop com.github.dnscrypt-osxclient.DNSCryptNetworkChange
|
||||
/bin/launchctl remove com.github.dnscrypt-osxclient.DNSCryptNetworkChange
|
||||
|
||||
/bin/rm -f /Library/LaunchDaemons/com.github.dnscrypt-osxclient.DNSCryptAfterboot.plist
|
||||
/bin/rm -f /Library/LaunchDaemons/com.github.dnscrypt-osxclient.DNSCryptConsoleChange.plist
|
||||
/bin/rm -f /Library/LaunchDaemons/com.github.dnscrypt-osxclient.DNSCryptControlChange.plist
|
||||
/bin/rm -f /Library/LaunchDaemons/com.github.dnscrypt-osxclient.DNSCryptNetworkChange.plist
|
||||
|
||||
/bin/rm -f /var/run/dnscrypt*.lock
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
VERSION='1.0.0'
|
||||
VERSION='1.0.2'
|
||||
|
||||
cd build || exit 1
|
||||
[ -d DNSCrypt.mpkg ] || exit 1
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<string>1.0.2</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0.0</string>
|
||||
<string>1.0.2</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>BSD</string>
|
||||
<key>NSMainNibFile</key>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#import <WebKit/WebKit.h>
|
||||
#import "CHCSVParser/CHCSVParser.h"
|
||||
|
||||
#define kDNSCRYPT_PACKAGE_VERSION @"1.0.0"
|
||||
#define kDNSCRYPT_PACKAGE_VERSION @"1.0.2"
|
||||
|
||||
#define kDNSCRYPT_PREFPANE_APP_PATH @"/Library/PreferencePanes/DNSCrypt.prefPane"
|
||||
#define kDNSCRYPT_USR_BASE_DIR kDNSCRYPT_PREFPANE_APP_PATH @"/Contents/Resources/usr"
|
||||
|
||||
@@ -22,7 +22,36 @@
|
||||
%h1 Release Notes for DNSCrypt-OSXclient by AlterStep
|
||||
|
||||
%article
|
||||
%h2 Version 1.0 by AlterStep
|
||||
%h2 Version 1.0.2 by AlterStep
|
||||
%time Thu, 05 Jun 2014
|
||||
%p
|
||||
Improved installation scripts
|
||||
%p
|
||||
LDNS has been downgraded in order to work on systems without
|
||||
Homebrew.
|
||||
|
||||
%article
|
||||
%h2 Version 1.0.1 by AlterStep
|
||||
%time Mon, 28 Apr 2014
|
||||
%p
|
||||
Include the release version of dnscrypt-proxy 1.4, with a new
|
||||
OpenNIC resolver.
|
||||
%p
|
||||
Wait after dnscrypt-proxy has been turned on before sending a
|
||||
query. This actually makes state changes faster.
|
||||
%p
|
||||
Debug log, turned off by default and deleted after every
|
||||
reboot. In order to enable it, create an empty file named
|
||||
%code debug.enabled
|
||||
in
|
||||
%code /Library/Application Support/DNSCrypt/control
|
||||
and the debug log file itself is
|
||||
%code /var/log/dnscrypt-osxclient-debug.log
|
||||
%p
|
||||
Thanks a lot for your feedback on the first version!
|
||||
|
||||
%article
|
||||
%h2 Version 1.0.0 by AlterStep
|
||||
%time Thu, 21 Apr 2014
|
||||
%p
|
||||
This is my first release, based on the source code of the beta
|
||||
|
||||
@@ -26,7 +26,42 @@
|
||||
<body>
|
||||
<h1>Release Notes for DNSCrypt-OSXclient by AlterStep</h1>
|
||||
<article>
|
||||
<h2>Version 1.0 by AlterStep</h2>
|
||||
<h2>Version 1.0.2 by AlterStep</h2>
|
||||
<time>Thu, 05 Jun 2014</time>
|
||||
<p>
|
||||
Improved installation scripts
|
||||
</p>
|
||||
<p>
|
||||
LDNS has been downgraded in order to work on systems without
|
||||
Homebrew.
|
||||
</p>
|
||||
</article>
|
||||
<article>
|
||||
<h2>Version 1.0.1 by AlterStep</h2>
|
||||
<time>Mon, 28 Apr 2014</time>
|
||||
<p>
|
||||
Include the release version of dnscrypt-proxy 1.4, with a new
|
||||
OpenNIC resolver.
|
||||
</p>
|
||||
<p>
|
||||
Wait after dnscrypt-proxy has been turned on before sending a
|
||||
query. This actually makes state changes faster.
|
||||
</p>
|
||||
<p>
|
||||
Debug log, turned off by default and deleted after every
|
||||
reboot. In order to enable it, create an empty file named
|
||||
<code>debug.enabled</code>
|
||||
in
|
||||
<code>/Library/Application Support/DNSCrypt/control</code>
|
||||
and the debug log file itself is
|
||||
<code>/var/log/dnscrypt-osxclient-debug.log</code>
|
||||
</p>
|
||||
<p>
|
||||
Thanks a lot for your feedback on the first version!
|
||||
</p>
|
||||
</article>
|
||||
<article>
|
||||
<h2>Version 1.0.0 by AlterStep</h2>
|
||||
<time>Thu, 21 Apr 2014</time>
|
||||
<p>
|
||||
This is my first release, based on the source code of the beta
|
||||
|
||||
@@ -38,9 +38,9 @@
|
||||
<key>name</key>
|
||||
<string>ScriptWindowState</string>
|
||||
<key>positionOfDivider</key>
|
||||
<real>333</real>
|
||||
<real>370</real>
|
||||
<key>savedFrame</key>
|
||||
<string>60 149 1053 597 0 0 1366 746 </string>
|
||||
<string>85 77 1202 655 0 0 1366 746 </string>
|
||||
<key>selectedTabView</key>
|
||||
<string>result</string>
|
||||
</dict>
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 362 B After Width: | Height: | Size: 362 B |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
libsodium.4.dylib
|
||||
libsodium.10.dylib
|
||||
@@ -3,6 +3,7 @@
|
||||
. ./common.inc
|
||||
|
||||
rm -f "$QUERY_LOG_FILE"
|
||||
rm -f "$DEBUG_LOG_FILE"
|
||||
|
||||
./clear-fw.sh
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
. ./common.inc
|
||||
|
||||
try_resolution() {
|
||||
exec alarmer 5 dig +tries=2 +time=3 +short resolver1.opendns.com \
|
||||
| egrep '^208[.]67[.]' > /dev/null 2>&1
|
||||
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() {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
. ./common.inc
|
||||
|
||||
try_local_resolution() {
|
||||
exec dig +tries=2 +time=3 +short resolver1.opendns.com @$INTERFACE_PROXY \
|
||||
| egrep '^208[.]67[.]' > /dev/null 2>&1
|
||||
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
|
||||
|
||||
@@ -1,27 +1,33 @@
|
||||
|
||||
DNSCRYPT_USR_BASE_DIR='/Library/PreferencePanes/DNSCrypt.prefPane/Contents/Resources/usr'
|
||||
DNSCRYPT_VAR_BASE_DIR='/Library/Application Support/DNSCrypt'
|
||||
DNSCRYPT_LOG_BASE_DIR='/var/log'
|
||||
DNSCRYPT_VAR_RUN_BASE_DIR='/var/run'
|
||||
|
||||
cd -- "${DNSCRYPT_USR_BASE_DIR}/scripts" || exit 1
|
||||
|
||||
CONTROL_DIR="${DNSCRYPT_VAR_BASE_DIR}/control"
|
||||
TICKETS_DIR="${DNSCRYPT_VAR_BASE_DIR}/tickets"
|
||||
DNSCRYPT_PROXY_BASE_DIR="${DNSCRYPT_VAR_BASE_DIR}/dnscrypt-proxy"
|
||||
PROXY_PID_FILE="/var/run/dnscrypt-proxy.pid"
|
||||
PROXY_PID_FILE="${DNSCRYPT_VAR_RUN_BASE_DIR}/dnscrypt-proxy.pid"
|
||||
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="/var/run/dnscrypt-handlers.lock"
|
||||
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"
|
||||
|
||||
DEBUG_ENABLED_FILE="${CONTROL_DIR}/debug.enabled"
|
||||
|
||||
PLUGINS_ENABLED_FILE="${CONTROL_DIR}/plugins.enabled"
|
||||
QUERY_LOGGING_FILE="${CONTROL_DIR}/plugin-query-logging.enabled"
|
||||
BLOCKING_FILE="${CONTROL_DIR}/plugin-blocking.enabled"
|
||||
|
||||
QUERY_LOG_FILE="/var/log/dnscrypt-query.log"
|
||||
QUERY_LOG_FILE="${DNSCRYPT_LOG_BASE_DIR}/dnscrypt-query.log"
|
||||
DEBUG_LOG_FILE="${DNSCRYPT_LOG_BASE_DIR}/dnscrypt-osxclient-debug.log"
|
||||
DEBUG_LOG_FILE_LOCK="${DEBUG_LOG_FILE}.lock"
|
||||
|
||||
BLACKLIST_IPS_FILE="${CONTROL_DIR}/blacklist-ips"
|
||||
BLACKLIST_IPS_TMP_FILE="${BLACKLIST_IPS_FILE}.tmp"
|
||||
BLACKLIST_DOMAINS_FILE="${CONTROL_DIR}/blacklist-domains"
|
||||
@@ -47,7 +53,14 @@ DISABLE_IPV6='no'
|
||||
export PATH="${DNSCRYPT_USR_BASE_DIR}/bin:${DNSCRYPT_USR_BASE_DIR}/scripts:$PATH"
|
||||
|
||||
init_interfaces() {
|
||||
sudo ifconfig lo0 alias ${INTERFACE_UNBOUND}/${INTERFACE_UNBOUND_MASK}
|
||||
sudo ifconfig lo0 alias ${INTERFACE_PROXY}/${INTERFACE_PROXY_MASK}
|
||||
sudo ifconfig lo0 alias ${INTERFACE_PROBES}/${INTERFACE_PROBES_MASK}
|
||||
/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() {
|
||||
[ -f "$DEBUG_ENABLED_FILE" ] || return
|
||||
lockfile -1 -r 1 "$DEBUG_LOG_FILE_LOCK" > /dev/null 2>&1
|
||||
echo "$(date) - $1" >> "$DEBUG_LOG_FILE"
|
||||
rm -f "$DEBUG_LOG_FILE_LOCK" 2> /dev/null
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
. ./common.inc
|
||||
|
||||
eval $(stat -s '/dev/console') || exit 1
|
||||
|
||||
logger_debug "OSX console ownership changed"
|
||||
|
||||
wanted_uid="$st_uid"
|
||||
if [ ! -d "$DNSCRYPT_VAR_BASE_DIR" ]; then
|
||||
mkdir -p "$DNSCRYPT_VAR_BASE_DIR" || exit 1
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
PROCESSED_TICKETS_FILE="${STATES_DIR}/processed-tickets"
|
||||
|
||||
update() {
|
||||
lockfile -1 -r 30 -l 60 "$HANDLERS_LOCK_FILE" || exit 1
|
||||
lockfile -1 -r 30 "$HANDLERS_LOCK_FILE" || exit 1
|
||||
|
||||
if [ -e "$DNSCRYPT_FILE" ]; then
|
||||
./switch-to-dnscrypt-if-required.sh
|
||||
@@ -19,6 +19,8 @@ update() {
|
||||
|
||||
touch "${STATES_DIR}/updating"
|
||||
|
||||
logger_debug "DNSCrypt-OSXClient configuration changed"
|
||||
|
||||
updated='no'
|
||||
while :; do
|
||||
find "$TICKETS_DIR" -type f -name 'ticket-*' > "$PROCESSED_TICKETS_FILE"
|
||||
|
||||
@@ -10,7 +10,10 @@ if [ x"$1" != 'x--boot' ]; then
|
||||
./check-network-change.sh || exit 0
|
||||
fi
|
||||
|
||||
lockfile -1 -r 30 -l 60 "$HANDLERS_LOCK_FILE" || exit 1
|
||||
logger_debug "Network configuration changed"
|
||||
|
||||
|
||||
lockfile -1 -r 30 "$HANDLERS_LOCK_FILE" || exit 1
|
||||
./set-dns-to-dhcp.sh
|
||||
if [ ! -e "$DNSCRYPT_FILE" ]; then
|
||||
rm -f "$HANDLERS_LOCK_FILE"
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
servers='empty'
|
||||
|
||||
logger_debug "Changing the DNS configuration to use the default DNS resolvers"
|
||||
|
||||
if [ -r "$STATIC_RESOLVERS_FILE" ]; then
|
||||
servers=''
|
||||
while read server; do
|
||||
@@ -12,12 +14,16 @@ if [ -r "$STATIC_RESOLVERS_FILE" ]; then
|
||||
esac
|
||||
done < "$STATIC_RESOLVERS_FILE"
|
||||
[ -z "$servers" ] && servers='empty'
|
||||
logger_debug "Static list of DNS resolvers: [$servers]"
|
||||
fi
|
||||
|
||||
exec networksetup -listallnetworkservices 2>/dev/null | \
|
||||
fgrep -v '*' | while read x ; do
|
||||
networksetup -setdnsservers "$x" $servers
|
||||
networksetup -setdnsservers "$x" $servers > /dev/null
|
||||
done
|
||||
|
||||
logger_debug "Flushing the local DNS cache"
|
||||
|
||||
dscacheutil -flushcache 2> /dev/null
|
||||
killall -HUP mDNSResponder 2> /dev/null
|
||||
exit 0
|
||||
|
||||
@@ -5,10 +5,16 @@
|
||||
servers="$*"
|
||||
|
||||
[ $# -lt 1 ] && exit 1
|
||||
|
||||
logger_debug "Setting DNS resolvers to [$servers]"
|
||||
|
||||
exec networksetup -listallnetworkservices 2>/dev/null | \
|
||||
fgrep -v '*' | while read x ; do
|
||||
networksetup -setdnsservers "$x" $servers
|
||||
done
|
||||
|
||||
logger_debug "Flushing local DNS cache"
|
||||
|
||||
dscacheutil -flushcache 2> /dev/null
|
||||
killall -HUP mDNSResponder 2> /dev/null
|
||||
exit 0
|
||||
|
||||
@@ -32,6 +32,7 @@ try_resolver() {
|
||||
local args="$*"
|
||||
local pid_file="${PID_DIR}/${priority}.pid"
|
||||
|
||||
logger_debug "Running a test dnscrypt proxy for [$description]"
|
||||
rm -f "${RES_DIR}/${priority}"
|
||||
exec alarmer 3 dnscrypt-proxy --pid="$pid_file" \
|
||||
--resolver-name="$RESOLVER_NAME" \
|
||||
@@ -39,11 +40,13 @@ try_resolver() {
|
||||
while read line; do
|
||||
case "$line" in
|
||||
*Proxying\ from\ *)
|
||||
logger_debug "Proxy for [$description] is up"
|
||||
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
|
||||
@@ -63,16 +66,24 @@ get_plugin_args() {
|
||||
libdcplugin_*) plugin_args="${plugin_args} --plugin=${line}" ;;
|
||||
esac
|
||||
done
|
||||
logger_debug "Plugins to be used: [$plugin_args]"
|
||||
echo "$plugin_args"
|
||||
}
|
||||
}
|
||||
|
||||
logger_debug "dnscrypt-proxy should be (re)started, stopping previous instance if needed"
|
||||
./stop-dnscrypt-proxy.sh
|
||||
|
||||
ipv6_supported="no"
|
||||
if [ x"$DISABLE_IPV6" = "xno" ]; then
|
||||
logger_debug "Testing IPv6 connectivity"
|
||||
ping6 -c 1 2620:0:ccc::2 > /dev/null 2>&1
|
||||
[ $? = 0 ] && ipv6_supported="yes"
|
||||
if [ $? = 0 ]; then
|
||||
ipv6_supported="yes"
|
||||
logger_debug "IPv6 connectivity detected"
|
||||
else
|
||||
logger_debug "IPv6 connectivity is not available"
|
||||
fi
|
||||
fi
|
||||
|
||||
wait_pids=""
|
||||
@@ -91,7 +102,10 @@ for pid in $wait_pids; do
|
||||
[ x"$best_file" != "x" ] && break
|
||||
done
|
||||
|
||||
[ x"$best_file" = "x" ] && exit 1
|
||||
if [ x"$best_file" = "x" ]; then
|
||||
logger_debug "No usable proxy configuration has been found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
plugins_args=''
|
||||
if [ -r "${DNSCRYPT_PROXY_PLUGINS_BASE_FILE}s.enabled" ]; then
|
||||
@@ -102,12 +116,14 @@ fi
|
||||
|
||||
best_args=$(cat "${RES_DIR}/${best_file}")
|
||||
|
||||
logger_debug "Starting dnscrypt-proxy $best_args"
|
||||
eval dnscrypt-proxy $best_args --local-address="$INTERFACE_PROXY" \
|
||||
--resolver-name="$RESOLVER_NAME" \
|
||||
--pidfile="$PROXY_PID_FILE" --user=daemon --daemonize $plugin_args
|
||||
|
||||
if [ $? != 0 ]; then
|
||||
[ -r "$PROXY_PID_FILE" ] && kill $(cat -- "$PROXY_PID_FILE")
|
||||
logger_debug "dnscrypt-proxy $best_args command failed, retrying"
|
||||
sleep 1
|
||||
killall dnscrypt-proxy
|
||||
sleep 1
|
||||
@@ -118,8 +134,11 @@ if [ $? != 0 ]; then
|
||||
--resolver-name="$RESOLVER_NAME" \
|
||||
--pidfile="$PROXY_PID_FILE" --user=daemon --daemonize $plugin_args || \
|
||||
exit 1
|
||||
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
|
||||
@@ -128,8 +147,12 @@ while [ $i -lt 30 ]; do
|
||||
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
|
||||
|
||||
@@ -2,12 +2,17 @@
|
||||
|
||||
. ./common.inc
|
||||
|
||||
logger_debug "Stopping dnscrypt-proxy"
|
||||
|
||||
if [ -x /usr/bin/pgrep ]; then
|
||||
pgrep -x dnscrypt-proxy | egrep '[0-9]+' > /dev/null || exit 0
|
||||
fi
|
||||
|
||||
[ ! -r "$PROXY_PID_FILE" ] && exit 0
|
||||
pid=$(cat "$PROXY_PID_FILE")
|
||||
[ $pid -lt 2 ] && exit 0
|
||||
|
||||
logger_debug "Trying to stop dnscrypt-proxy by killing pid [$pid]"
|
||||
kill $pid
|
||||
|
||||
i=0
|
||||
@@ -19,3 +24,5 @@ done
|
||||
|
||||
rm -f "$PROXY_PID_FILE"
|
||||
kill -9 $pid
|
||||
|
||||
logger_debug "Killed dnscrypt-proxy with kill -9 pid [$pid]"
|
||||
|
||||
+15
-3
@@ -7,30 +7,42 @@ PAUSE_INCREMENT=0.1
|
||||
|
||||
[ ! -e "$DNSCRYPT_FILE" ] && exit 0
|
||||
|
||||
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)"
|
||||
current_resolvers=$(./get-current-resolvers.sh)
|
||||
if [ "$current_resolvers" = "$INTERFACE_PROXY" ]; then
|
||||
if [ ! -e "$PROXY_PID_FILE" ]; then
|
||||
./start-dnscrypt-proxy.sh || ./switch-to-dhcp.sh
|
||||
logger_debug "The proxy should be running but it isn't."
|
||||
./switch-to-dhcp.sh
|
||||
fi
|
||||
fi
|
||||
if [ $pause -lt $PAUSE_MAX ]; then
|
||||
pause=$((pause + $PAUSE_INCREMENT))
|
||||
fi
|
||||
sleep $pause
|
||||
./check-hijacking.sh || continue
|
||||
./start-dnscrypt-proxy.sh || continue
|
||||
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
|
||||
./start-dnscrypt-proxy.sh
|
||||
./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
|
||||
|
||||
Binary file not shown.
@@ -3,3 +3,15 @@ OSX client for managing the DNSCrypt Proxy
|
||||
|
||||
The purpose of this application is to allow the user to have a better
|
||||
experience controlling the DNSCrypt Proxy on OSX.
|
||||
|
||||
[Download dnscrypt-osxclient-1.0.1.zip](https://github.com/alterstep/dnscrypt-osxclient/releases/download/1.0.1/dnscrypt-osxclient-1.0.1.zip)
|
||||
for OSX 10.8 (Mountain Lion) and OSX 10.9 (Mavericks).
|
||||
|
||||
Compatible with:
|
||||
* CloudNS
|
||||
* d0wn
|
||||
* DNSCrypt.eu
|
||||
* okTurtles
|
||||
* OpenDNS
|
||||
* OpenNIC
|
||||
* Soltysiak
|
||||
|
||||
Reference in New Issue
Block a user