This software encrypts and authenticates DNS packets between your computer
and a DNS resolver using DNSCrypt.
Tips:
If you have a firewall, open TCP and UDP ports 53, 54, 443
and 1053. These are the most common ports used for DNSCrypt.
The "Automatically disable if blocked" feature automatically disables
DNSCrypt when DNS queries are not able to reach the DNSCrypt
resolver. This can
happen on public WiFi networks that require going through a captive
portal before you can access external networks.
This function is only provided for conveniency.
When enabled, the protocol can be easily downgraded by
third-parties. In other words, when the "Automatically
disable if blocked" feature is enabled, this software doesn't
provide any security at all against active attackers, but it can
still be useful against passive attackers and in order to bypass
DNS censorship. Don't enable it unless you are frequently
roaming and you don't want to manually disable/enable DNSCrypt.
Using Little Snitch? There are 4 rules you need to establish,
which Little Snitch should prompt for when trying to
activate this application:
Allow any outgoing connection for system processes (dnscrypt-proxy)
Allow any incoming connection for system process (dnscrypt-proxy)
Allow any outgoing connection for system processes (dig)
Allow outgoing TCP connections on port 80( http) of www.apple.com for system process (curl)
(Thanks to @cavemandaveman)
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/html/help.haml
================================================
!!! 5
%html{lang: "en"}
%head
%meta{charset: "utf-8"}
%title Help (advanced settings)
%style{type: "text/css"}
:sass
html
background: #e4e4e4
body
font:
family: arial, helvetica, sans-serif
margin: 1em
h1
margin: 0
%body
%h1 Help (advanced settings)
%section
%h2 Static DNS servers
%p
If you are not using DHCP and want a statically configured set
of default DNS resolvers, enter their IP addresses in this box.
%p
Separate them with spaces.
%section
%h2 Log DNS queries
%p
As a tool designed to protect your privacy, the DNSCrypt proxy does
not log anything about your DNS queries. Nothing about them will be
saved to disk ever, and log messages are intentionally kept as generic
as possible.
%p
However, you still may want to look at the DNS queries sent by
your system. This can be useful in order to spot suspicious
activity and to refine your domain blacklists and whitelists.
%p
Checking the "Log DNS queries" box dumps all DNS queries sent
by your computer to a file named /var/log/dnscrypt-query.log
%p
The "View log" button opens it with the log viewer application
so that you can watch it in real time.
%section
%h2 IP addresses blocking
%p
A response to a query containing at least one IP address
listed here will be blocked.
%p
This make it easy to block spam sources, hosting services and content
providers using a lot of different domain names for a single service.
%p
This can also be useful in order to block DNS rebinding
attacks, even for non-private network spaces.
%p
IP addresses can be IPv4 and IPv6 addresses, and must be
separated with spaces.
%section
%h2 Names blocking
%p
This is a list of domain names to be blocked.
%p
"example.com" will only match this specific name, not
"www.example.com".
%p
But wildcards are also supported. "*.example.com" will match
any name ending with ".example.com" whereas "ads.*" will match
any name beginning with "ads."
%p
Wildcards can also perform substring matching. "*xxx*" will
match any name containing the string "xxx".
%p
Patterns to be blocked should be separated with spaces, and
the blocking takes effect immediately after you hit the Return
key. Flushing your DNS cache is not required.
%p
This feature is only enabled when using DNSCrypt.
%section
%h2 Exceptions - bypassing DNSCrypt for some specific names
%p
Some domain names should not be resolved by a third-party DNS
resolver, that may not know about them.
%p
This includes local domain names provided by home routers
(like "routerlogin.net"), local domain names provided by
operating systems and applications (like ".local" or ".lan"),
local domain names served by appliances like st-top boxes, and
internal domains used in corporate networks.
%p
Domains listed here will bypass DNSCrypt in order to be sent
to the default resolvers.
%p
Do
%strong not
use a tool like hostip(8), drill(1), unbound-host(1), dig(1) or host(1)
in order to check that an exception rule works.
%p
These tools use their own resolution mechanisms that have nothing
to do with how others apps on your system are resolving names.
%p
They don't use the OSX-specific stub resolver, they don't use
the system-wide DNS cache, they have bugs and limitations that the OS
doesn't have (and the opposite is also true), and they don't know a
thing about specific resolvers that have to be used for specific
domains.
%p
Use actual apps, or even a command like ping(8).
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/html/help.html
================================================
Help (advanced settings)
Help (advanced settings)
Static DNS servers
If you are not using DHCP and want a statically configured set
of default DNS resolvers, enter their IP addresses in this box.
Separate them with spaces.
Log DNS queries
As a tool designed to protect your privacy, the DNSCrypt proxy does
not log anything about your DNS queries. Nothing about them will be
saved to disk ever, and log messages are intentionally kept as generic
as possible.
However, you still may want to look at the DNS queries sent by
your system. This can be useful in order to spot suspicious
activity and to refine your domain blacklists and whitelists.
Checking the "Log DNS queries" box dumps all DNS queries sent
by your computer to a file named /var/log/dnscrypt-query.log
The "View log" button opens it with the log viewer application
so that you can watch it in real time.
IP addresses blocking
A response to a query containing at least one IP address
listed here will be blocked.
This make it easy to block spam sources, hosting services and content
providers using a lot of different domain names for a single service.
This can also be useful in order to block DNS rebinding
attacks, even for non-private network spaces.
IP addresses can be IPv4 and IPv6 addresses, and must be
separated with spaces.
Names blocking
This is a list of domain names to be blocked.
"example.com" will only match this specific name, not
"www.example.com".
But wildcards are also supported. "*.example.com" will match
any name ending with ".example.com" whereas "ads.*" will match
any name beginning with "ads."
Wildcards can also perform substring matching. "*xxx*" will
match any name containing the string "xxx".
Patterns to be blocked should be separated with spaces, and
the blocking takes effect immediately after you hit the Return
key. Flushing your DNS cache is not required.
This feature is only enabled when using DNSCrypt.
Exceptions - bypassing DNSCrypt for some specific names
Some domain names should not be resolved by a third-party DNS
resolver, that may not know about them.
This includes local domain names provided by home routers
(like "routerlogin.net"), local domain names provided by
operating systems and applications (like ".local" or ".lan"),
local domain names served by appliances like st-top boxes, and
internal domains used in corporate networks.
Domains listed here will bypass DNSCrypt in order to be sent
to the default resolvers.
Do
not
use a tool like hostip(8), drill(1), unbound-host(1), dig(1) or host(1)
in order to check that an exception rule works.
These tools use their own resolution mechanisms that have nothing
to do with how others apps on your system are resolving names.
They don't use the OSX-specific stub resolver, they don't use
the system-wide DNS cache, they have bugs and limitations that the OS
doesn't have (and the opposite is also true), and they don't know a
thing about specific resolvers that have to be used for specific
domains.
Use actual apps, or even a command like ping(8).
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/html/releasenotes.haml
================================================
!!! 5
%html{lang: "en"}
%head
%meta{charset: "utf-8"}
%title Release notes for DNSCrypt-OSXClient by AlterStep
%style{type: "text/css"}
:sass
body
font:
family: arial, helvetica, sans-serif
margin: 0
h1, h2
margin: 0
h1
border-bottom: 1px solid grey
article
padding-left: 1em
time
font:
style: italic
%body
%h1 Release Notes for DNSCrypt-OSXclient by AlterStep
%article
%h2 Version 1.0.4 by AlterStep
%time Thu, 19 Sep 2014
%p
Updated DNSCrypt proxy to version 1.4.1
%p
Updated libsodium to 0.7.0-minimal
%article
%h2 Version 1.0.3 by AlterStep
%time Thu, 18 Jun 2014
%p
Runs on OSX 10.8 (Snow Leopard), 10.9 (Mavericks) and 10.10 (Yosemite)
%p
New set of icons, contributed by Aaron VonderHaar
%article
%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
version written by OpenDNS.
%p
It has only been tested on OSX 10.9.
%p
It includes dnscrypt-proxy 1.4.0, libsodium 0.4.5, libldns 1.6.17.
%p
Contact me on Github: https://github.com/alterstep/dnscrypt-osx-client
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/html/releasenotes.html
================================================
Release notes for DNSCrypt-OSXClient by AlterStep
Release Notes for DNSCrypt-OSXclient by AlterStep
Version 1.0.4 by AlterStep
Updated DNSCrypt proxy to version 1.4.1
Updated libsodium to 0.7.0-minimal
Version 1.0.3 by AlterStep
Runs on OSX 10.8 (Snow Leopard), 10.9 (Mavericks) and 10.10 (Yosemite)
New set of icons, contributed by Aaron VonderHaar
Version 1.0.2 by AlterStep
Improved installation scripts
LDNS has been downgraded in order to work on systems without
Homebrew.
Version 1.0.1 by AlterStep
Include the release version of dnscrypt-proxy 1.4, with a new
OpenNIC resolver.
Wait after dnscrypt-proxy has been turned on before sending a
query. This actually makes state changes faster.
Debug log, turned off by default and deleted after every
reboot. In order to enable it, create an empty file named
debug.enabled
in
/Library/Application Support/DNSCrypt/control
and the debug log file itself is
/var/log/dnscrypt-osxclient-debug.log
Thanks a lot for your feedback on the first version!
Version 1.0.0 by AlterStep
This is my first release, based on the source code of the beta
version written by OpenDNS.
It has only been tested on OSX 10.9.
It includes dnscrypt-proxy 1.4.0, libsodium 0.4.5, libldns 1.6.17.
Contact me on Github: https://github.com/alterstep/dnscrypt-osx-client
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/bin/Uninstall.app/Contents/Info.plist
================================================
CFBundleAllowMixedLocalizationsCFBundleDevelopmentRegionEnglishCFBundleExecutableappletCFBundleIconFileappletCFBundleIdentifiercom.apple.ScriptEditor.id.UninstallCFBundleInfoDictionaryVersion6.0CFBundleNameUninstallCFBundlePackageTypeAPPLCFBundleShortVersionString1.0CFBundleSignatureapltLSMinimumSystemVersionByArchitecturex86_6410.6LSRequiresCarbonWindowStatedividerCollapsedeventLogLevel-1nameScriptWindowStatepositionOfDivider370savedFrame85 77 1202 655 0 0 1366 746 selectedTabViewresult
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/bin/Uninstall.app/Contents/PkgInfo
================================================
APPLaplt
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/bin/Uninstall.app/Contents/Resources/description.rtfd/TXT.rtf
================================================
{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf200
{\fonttbl}
{\colortbl;\red255\green255\blue255;}
}
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/afterboot.sh
================================================
#! /bin/sh
. ./common.inc
rm -f "$QUERY_LOG_FILE"
rm -f "$DEBUG_LOG_FILE"
./clear-fw.sh
exec ./handle-control-change.sh --boot
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/check-hijacking.sh
================================================
#! /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 \
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
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/check-local-dns.sh
================================================
#! /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
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/check-network-change.sh
================================================
#! /bin/sh
. ./common.inc
NETWORK_STATE_FILE="${STATES_DIR}/network-state"
DHCP_DNS_FILE="${STATES_DIR}/dhcp-dns"
AIRPORT_TOOL="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport"
mkdir -p "$STATES_DIR" || exit 1
ips=$(./get-dhcp-resolvers.sh)
echo "$ips" > "$DHCP_DNS_FILE"
ssid=$("$AIRPORT_TOOL" -I 2>&1 | fgrep '[^B]SSID: ')
bssid=$("$AIRPORT_TOOL" -I 2>&1 | fgrep 'BSSID: ')
if [ -f "$NETWORK_STATE_FILE" ]; then
if echo "$ifs $ips $ssid $bssid" | \
cmp -- "$NETWORK_STATE_FILE" - >/dev/null; then
exit 1
fi
fi
echo "$ifs $ips $ssid $bssid" > "$NETWORK_STATE_FILE"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/clear-fw.sh
================================================
#! /bin/sh
. ./common.inc
exec >/dev/null
exec 2>&1
SOCKETFILTERFW='/usr/libexec/ApplicationFirewall/socketfilterfw'
[ -x "$SOCKETFILTERFW" ] || exit 0
"$SOCKETFILTERFW" --add /usr/local/sbin/dnscrypt-proxy
"$SOCKETFILTERFW" --unblockapp /usr/local/sbin/dnscrypt-proxy
"$SOCKETFILTERFW" --add /usr/local/bin/hostip
"$SOCKETFILTERFW" --unblockapp /usr/local/bin/hostip
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/common.inc
================================================
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="${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="${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="${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"
BLACKLIST_DOMAINS_TMP_FILE="${BLACKLIST_DOMAINS_FILE}.tmp"
EXCEPTIONS_FILE="${CONTROL_DIR}/exceptions"
EXCEPTIONS_TMP_FILE="${EXCEPTIONS_FILE}.tmp"
DEFAULT_RESOLVER_NAME='opendns'
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='
freebox.fr fritz.box intranet lan localdomain nowtv.com private routerlogin.net l
'
DISABLE_IPV6='no'
export PATH="${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() {
[ -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
}
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/create-ticket.sh
================================================
#! /bin/sh
. ./common.inc
ticket_file=$(mktemp "$TICKETS_DIR/ticket-XXXXXXXXXX")
[ -e "$ticket_file" ] || exit 1
basename "$ticket_file"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/exceptions-add.sh
================================================
#! /bin/sh
RESOLVER_DIR='/etc/resolver'
. ./common.inc
[ -r "$EXCEPTIONS_FILE" ] &&
DOMAINS_EXCEPTIONS="$(cat "$EXCEPTIONS_FILE") $DOMAINS_EXCEPTIONS"
get_gw() {
route -n get default | while read line; do
case "$line" in
gateway:\ *)
echo "$line" | sed 's/ *gateway: *//'
return
;;
esac
done
}
get_dhcp_dns() {
cat "${STATES_DIR}/dhcp-dns" 2> /dev/null
}
remove_old_exceptions() {
local found
find -x "$RESOLVER_DIR" -type f -print | {
while read file; do
found='no'
for domain in $DOMAINS_EXCEPTIONS; do
[ "$file" = "${RESOLVER_DIR}/${domain}" ] && found='yes' && break
done
[ "$found" = 'no' ] || continue
fgrep -ci 'automatically generated by the dnscrypt user interface' \
$file > /dev/null 2>&1 || continue
rm -f "$file"
done
}
}
name_servers=$(./get-static-resolvers.sh || get_dhcp_dns || get_gw)
[ x"$name_servers" = 'x' ] && exit 0
default_domain=$(./get-current-default-domain.sh)
mkdir -p "$RESOLVER_DIR" || exit 1
remove_old_exceptions
name_server="$gw"
for domain in $DOMAINS_EXCEPTIONS; do
if [ x"$default_domain" != 'x' ]; then
echo "$domain" | grep -c ".*${default_domain}" > /dev/null
[ $? = 0 ] && continue
fi
echo '# automatically generated by the dnscrypt user interface' \
> "${RESOLVER_DIR}/${domain}"
for name_server in $name_servers; do
echo "nameserver ${name_server}" >> "${RESOLVER_DIR}/${domain}"
done
done
exit 0
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/exceptions-remove.sh
================================================
#! /bin/sh
RESOLVER_DIR='/etc/resolver'
. ./common.inc
[ -r "$EXCEPTIONS_FILE" ] &&
DOMAINS_EXCEPTIONS="$(cat "$EXCEPTIONS_FILE") $DOMAINS_EXCEPTIONS"
for domain in $DOMAINS_EXCEPTIONS; do
rm -f "${RESOLVER_DIR}/${domain}"
done
exit 0
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-current-default-domain.sh
================================================
#! /bin/ksh
. ./common.inc
[ -r /etc/resolv.conf ] || exit 0
domain=""
while read line; do
case "$line" in
domain\ *)
domain=$(echo "$line" | sed -e 's/domain *//' -e 's/ *//')
break
;;
esac
done < /etc/resolv.conf
echo "$domain"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-current-resolvers.sh
================================================
#! /bin/ksh
. ./common.inc
[ -r /etc/resolv.conf ] || exit 0
ips_i=""
while read line; do
case "$line" in
nameserver\ *)
ip=$(echo "$line" | sed -e 's/nameserver *//' -e 's/ *//')
ips_i="$ips_i $ip"
;;
esac
done < /etc/resolv.conf
typeset -A found
ips=""
for ip_i in $ips_i; do
if [ ! ${found["$ip_i"]} ]; then
if [ "$ips" ]; then
ips="$ips "
fi
ips="$ips$ip_i"
found["$ip_i"]=1
fi
done
echo "$ips"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-dhcp-resolvers.sh
================================================
#! /bin/ksh
. ./common.inc
ifs=$(ifconfig -a | \
awk '/^[^ :]*:/ { sub(/:.*$/,empty); iface=$0 } /status: active/ { print iface }')
ifs=$(echo $ifs)
typeset -A found
ips=""
for i in $ifs; do
ips_i=$(ipconfig getpacket "$i" 2> /dev/null | fgrep 'domain_name_server' | \
sed -e 's/^.*{//' -e 's/,/ /g' -e 's/}//' )
for ip_i in $ips_i; do
if [ ! ${found["$ip_i"]} ]; then
if [ "$ips" ]; then
ips="$ips "
fi
ips="$ips$ip_i"
found["$ip_i"]=1
fi
done
done
echo "$ips"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-dnscrypt-resolver-name.sh
================================================
#! /bin/sh
. ./common.inc
[ -r "$DNSCRYPT_RESOLVER_NAME_FILE" ] && \
sed 's/[^a-zA-Z0-9.-]/_/g' < "$DNSCRYPT_RESOLVER_NAME_FILE" && exit 0
echo "$DEFAULT_RESOLVER_NAME"
exit 0
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-dnscrypt-status.sh
================================================
#! /bin/sh
. ./common.inc
if [ -e "$DNSCRYPT_FILE" ]; then
echo 'yes'
else
echo 'no'
fi
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-fallback-status.sh
================================================
#! /bin/sh
. ./common.inc
if [ -e "$FALLBACK_FILE" ]; then
echo 'yes'
else
echo 'no'
fi
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-query-logging-status.sh
================================================
#! /bin/sh
. ./common.inc
if [ -e "$QUERY_LOGGING_FILE" ]; then
echo 'yes'
else
echo 'no'
fi
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-resolvers-description.sh
================================================
#! /bin/sh
. ./common.inc
if [ -e "${STATES_DIR}/updating" ]; then
echo 'Updating'
exit 0
fi
name='None'
level=0
while read resolver; do
case "$resolver" in
127.0.0.5*)
if [ $level -le 80 ]; then
name='DNSCrypt'
level=80
fi
;;
127.0.0.1)
if [ $level -le 20 ]; then
name='Localhost'
level=20
fi
;;
::1)
if [ $level -le 30 ]; then
name='Localhost IPv6'
level=30
fi
;;
*)
if [ $level -le 10 ]; then
name='Default'
level=10
fi
;;
esac
done
echo "$name"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-static-resolvers.sh
================================================
#! /bin/sh
. ./common.inc
[ -r "$STATIC_RESOLVERS_FILE" ] && cat "$STATIC_RESOLVERS_FILE" && exit 0
exit 1
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-tickets-count.sh
================================================
#! /bin/sh
. ./common.inc
exec find "$TICKETS_DIR" -type f -name 'ticket-*' | wc -l | sed 's/ *//g'
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/get-upstream-resolvers.sh
================================================
#! /bin/sh
. ./common.inc
dnscrypt_proxy_used='no'
upstream_resolvers=''
while read resolver; do
case "$resolver" in
127.0.0.5*)
dnscrypt_proxy_used='yes'
;;
esac
if [ x"$upstream_resolvers" = 'x' ]; then
upstream_resolvers="$resolver"
else
upstream_resolvers="${upstream_resolvers} $resolver"
fi
done
if [ "$dnscrypt_proxy_used" = 'yes' \
-a -r "${STATES_DIR}/dnscrypt-proxy-description" ]; then
cat "${STATES_DIR}/dnscrypt-proxy-description" && exit 0
fi
echo "$upstream_resolvers"
exit 0
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/gui-pop-conf-change.sh
================================================
#! /bin/sh
. ./common.inc
[ $# != 1 ] && exit 1
pname="$1"
case "$pname" in
menubar) ;;
prefpane) ;;
*) exit 1;;
esac
changed='no'
if [ -e "${TICKETS_DIR}/gui-change-${pname}" ]; then
rm -f "${TICKETS_DIR}/gui-change-${pname}"
changed='yes'
fi
echo "$changed"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/gui-push-conf-change.sh
================================================
#! /bin/sh
. ./common.inc
[ $# != 1 ] && exit 1
pname="$1"
case "$pname" in
menubar) ;;
prefpane) ;;
*) exit 1;;
esac
touch "${TICKETS_DIR}/gui-change-${pname}"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/handle-console-change.sh
================================================
#! /bin/sh
. ./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
chown -R 0:0 "$DNSCRYPT_VAR_BASE_DIR"
chmod 755 "$DNSCRYPT_VAR_BASE_DIR"
fi
mkdir -m 755 -p "$TICKETS_DIR" || exit 1
chown -R "${wanted_uid}:0" "$TICKETS_DIR"
eval $(stat -s "$CONTROL_DIR") || exit 1
if [ $? != 0 ]; then
mkdir -m 755 -p "$CONTROL_DIR" || exit 1
current_uid='nonexistent'
else
current_uid="$st_uid"
fi
[ x"$current_uid" != x"$wanted_uid" ] && \
chown -R "${wanted_uid}:0" "$CONTROL_DIR"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/handle-control-change.sh
================================================
#! /bin/sh
. ./common.inc
PROCESSED_TICKETS_FILE="${STATES_DIR}/processed-tickets"
update() {
lockfile -1 -r 30 "$HANDLERS_LOCK_FILE" || exit 1
if [ -e "$DNSCRYPT_FILE" ]; then
./switch-to-dnscrypt-if-required.sh
else
./stop-dnscrypt-proxy.sh
./switch-to-dhcp-if-required.sh
fi
rm -f "$HANDLERS_LOCK_FILE"
}
touch "${STATES_DIR}/updating"
logger_debug "DNSCrypt-OSXClient configuration changed"
updated='no'
while :; do
find "$TICKETS_DIR" -type f -name 'ticket-*' > "$PROCESSED_TICKETS_FILE"
if [ ! -s "$PROCESSED_TICKETS_FILE" -a "$updated" = 'yes' ]; then
break
fi
update
updated='yes'
while read ticket_file; do
rm -f "$ticket_file"
done < "$PROCESSED_TICKETS_FILE"
done
rm -f "${STATES_DIR}/updating"
rm -f "${STATES_DIR}/update-request"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/handle-network-change.sh
================================================
#! /bin/sh
. ./common.inc
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
rm -f "$HANDLERS_LOCK_FILE"
exit 0
fi
./switch-to-dnscrypt-if-required.sh
rm -f "$HANDLERS_LOCK_FILE"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/set-dns-to-dhcp.sh
================================================
#! /bin/sh
. ./common.inc
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
case "$server" in
[0-9a-fA-F:.]*) servers="${servers} ${server}" ;;
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 > /dev/null
done
logger_debug "Flushing the local DNS cache"
dscacheutil -flushcache 2> /dev/null
killall -HUP mDNSResponder 2> /dev/null
exit 0
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/set-dns.sh
================================================
#! /bin/sh
. ./common.inc
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
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/set-dnscrypt-resolver-name.sh
================================================
#! /bin/sh
. ./common.inc
[ $# -lt 1 ] && exit 1
resolver_name="$1"
if [ "$resolver_name" = "" ]; then
rm -f "$DNSCRYPT_RESOLVER_NAME_FILE"
else
echo "$resolver_name" | sed 's/^ *//;s/ *$//' \
> "$DNSCRYPT_RESOLVER_NAME_FILE"
fi
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/set-static-resolvers.sh
================================================
#! /bin/sh
. ./common.inc
args="$*"
[ $# -lt 1 ] && exit 1
servers=''
for server in $args; do
servers="${servers} ${server}"
done
if [ "$servers" = "" ]; then
rm -f "$STATIC_RESOLVERS_FILE"
else
echo "$servers" | sed 's/^ *//;s/ *$//' > "$STATIC_RESOLVERS_FILE"
fi
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/start-dnscrypt-proxy.sh
================================================
#! /bin/sh
. ./common.inc
DNSCRYPT_LIB_BASE_DIR="${DNSCRYPT_USR_BASE_DIR}/lib"
export DYLD_LIBRARY_PATH="${DNSCRYPT_LIB_BASE_DIR}:${DYLD_LIBRARY_PATH}"
init_interfaces
mkdir -p -- "$DNSCRYPT_VAR_BASE_DIR" || exit 1
PROBES_BASE_DIR="${DNSCRYPT_VAR_BASE_DIR}/probes"
rm -fr "$PROBES_BASE_DIR" || exit 1
mkdir -p -- "$PROBES_BASE_DIR" || exit 1
RES_DIR="${PROBES_BASE_DIR}/results" || exit 1
mkdir -p -- "$RES_DIR" || exit 1
DESCRIPTIONS_DIR="${PROBES_BASE_DIR}/results-descriptions" || exit 1
mkdir -p -- "$DESCRIPTIONS_DIR" || exit 1
PID_DIR="${PROBES_BASE_DIR}/pids" || exit 1
mkdir -p -- "$PID_DIR" || exit 1
RESOLVER_NAME=$(./get-dnscrypt-resolver-name.sh) || exit 1
try_resolver() {
local priority="$1"
shift
local description="$1"
shift
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" \
--local-address="${INTERFACE_PROBES}:${priority}" $args 2>&1 | \
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
;;
*) ;;
esac
done
}
get_plugin_args() {
cat "$DNSCRYPT_PROXY_PLUGINS_BASE_FILE"[s-]*.enabled | { \
local plugin_args=''
local quoted_line
while read line; do
case "$line" in
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
if [ $? = 0 ]; then
ipv6_supported="yes"
logger_debug "IPv6 connectivity detected"
else
logger_debug "IPv6 connectivity is not available"
fi
fi
wait_pids=""
try_resolver 5004 "${RESOLVER_NAME} using DNSCrypt over UDP" \
"--resolver-name=$RESOLVER_NAME" &
wait_pids="$wait_pids $!"
try_resolver 5005 "${RESOLVER_NAME} using DNSCrypt over TCP" \
"--resolver-name=$RESOLVER_NAME --tcp-only" &
wait_pids="$wait_pids $!"
for pid in $wait_pids; do
wait $pid
best_file=$(ls "$RES_DIR" | head -n 1)
[ x"$best_file" != "x" ] && break
done
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
plugin_args=$(get_plugin_args)
fi
[ "$ipv6_supported" = "no" ] && \
plugin_args="${plugin_args} --plugin=libdcplugin_example_ldns_aaaa_blocking.la"
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
rm -f "$PROXY_PID_FILE"
killall -9 dnscrypt-proxy
sleep 1
eval dnscrypt-proxy $best_args --local-address="$INTERFACE_PROXY" \
--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
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
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/stop-dnscrypt-proxy.sh
================================================
#! /bin/sh
. ./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
while [ $i -lt 30 ]; do
[ ! -r "$PROXY_PID_FILE" ] && exit 0
sleep 0.1
i=$((i + 1))
done
rm -f "$PROXY_PID_FILE"
kill -9 $pid
logger_debug "Killed dnscrypt-proxy with kill -9 pid [$pid]"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-blacklists-off.sh
================================================
#! /bin/sh
. ./common.inc
exec rm -f "$BLOCKING_FILE"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-blacklists-on.sh
================================================
#! /bin/sh
. ./common.inc
plugin_args=''
[ -s "$BLACKLIST_IPS_FILE" ] && \
plugin_args="${plugin_args},--ips='${BLACKLIST_IPS_FILE}'"
[ -s "$BLACKLIST_DOMAINS_FILE" ] && \
plugin_args="${plugin_args},--domains='${BLACKLIST_DOMAINS_FILE}'"
[ -z "$plugin_args" ] && exec ./switch-blacklists-off.sh
echo "libdcplugin_example_ldns_blocking.la${plugin_args}" > \
"$BLOCKING_FILE"
touch "$PLUGINS_ENABLED_FILE"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-fallback-off.sh
================================================
#! /bin/sh
. ./common.inc
rm -f "$FALLBACK_FILE"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-fallback-on.sh
================================================
#! /bin/sh
. ./common.inc
touch "$FALLBACK_FILE"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-query-logging-off.sh
================================================
#! /bin/sh
. ./common.inc
rm -f "$QUERY_LOGGING_FILE"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-query-logging-on.sh
================================================
#! /bin/sh
. ./common.inc
echo "libdcplugin_example_logging.la,${QUERY_LOG_FILE}" > \
"$QUERY_LOGGING_FILE"
touch "$PLUGINS_ENABLED_FILE"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-to-dhcp-if-required.sh
================================================
#! /bin/sh
. ./common.inc
[ -e "$DNSCRYPT_FILE" ] && exit 0
./exceptions-remove.sh
exec ./set-dns-to-dhcp.sh
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-to-dhcp.sh
================================================
#! /bin/sh
. ./common.inc
rm -f "$DNSCRYPT_FILE"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-to-dnscrypt-if-required.sh
================================================
#! /bin/ksh
. ./common.inc
PAUSE_MAX=10
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
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
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
break
done
if [ ! -e "$DNSCRYPT_FILE" ]; then
touch "$CONTROL_DIR"
fi
exec ./exceptions-add.sh
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/switch-to-dnscrypt.sh
================================================
#! /bin/sh
. ./common.inc
touch "$DNSCRYPT_FILE"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/update-blacklist-domains.sh
================================================
#! /bin/sh
. ./common.inc
if [ ! -s "$BLACKLIST_DOMAINS_TMP_FILE" ]; then
rm -f "$BLACKLIST_DOMAINS_FILE" "$BLACKLIST_DOMAINS_TMP_FILE"
exec ./switch-blacklists-on.sh
fi
tr -s '[:blank:]' '\n' < "$BLACKLIST_DOMAINS_TMP_FILE" | \
egrep -vi '^(apple[.]com|resolver1[.]opendns[.]com)$' > \
"${BLACKLIST_DOMAINS_TMP_FILE}~" &&
mv "${BLACKLIST_DOMAINS_TMP_FILE}~" "$BLACKLIST_DOMAINS_FILE"
exec ./switch-blacklists-on.sh
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/update-blacklist-ips.sh
================================================
#! /bin/sh
. ./common.inc
if [ ! -s "$BLACKLIST_IPS_TMP_FILE" ]; then
rm -f "$BLACKLIST_IPS_FILE" "$BLACKLIST_IPS_TMP_FILE"
exec ./switch-blacklists-on.sh
fi
tr -s '[:blank:]' '\n' \
< "$BLACKLIST_IPS_TMP_FILE" > "${BLACKLIST_IPS_TMP_FILE}~" &&
mv "${BLACKLIST_IPS_TMP_FILE}~" "$BLACKLIST_IPS_FILE"
exec ./switch-blacklists-on.sh
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/update-exceptions.sh
================================================
#! /bin/sh
. ./common.inc
if [ ! -s "$EXCEPTIONS_TMP_FILE" ]; then
rm -f "$EXCEPTIONS_FILE" "$EXCEPTIONS_TMP_FILE"
exit 0
fi
tr -s '[:blank:]' '\n' < "$EXCEPTIONS_TMP_FILE" | \
egrep -i '^\s*[0-9a-z_.-]+\s*$' > "${EXCEPTIONS_TMP_FILE}~" &&
mv "${EXCEPTIONS_TMP_FILE}~" "$EXCEPTIONS_FILE"
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
0946B0C613F47F53008277C6 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0946B0C513F47F53008277C6 /* Cocoa.framework */; };
0946B0C813F47F53008277C6 /* PreferencePanes.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0946B0C713F47F53008277C6 /* PreferencePanes.framework */; };
0946B0D213F47F53008277C6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0946B0D013F47F53008277C6 /* InfoPlist.strings */; };
0946B0D613F47F53008277C6 /* DNSCrypt.m in Sources */ = {isa = PBXBuildFile; fileRef = 0946B0D513F47F53008277C6 /* DNSCrypt.m */; };
0946B0D813F47F53008277C6 /* DNSCrypt.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 0946B0D713F47F53008277C6 /* DNSCrypt.tiff */; };
0946B0DB13F47F53008277C6 /* DNSCrypt.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0946B0D913F47F53008277C6 /* DNSCrypt.xib */; };
0946B0E413F48065008277C6 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0946B0E313F48065008277C6 /* Security.framework */; };
09A13ABC145F2D8700B227A4 /* ajax-loader.gif in Resources */ = {isa = PBXBuildFile; fileRef = 09A13ABB145F2D8700B227A4 /* ajax-loader.gif */; };
09AD01A015D2483500638DCE /* html in Resources */ = {isa = PBXBuildFile; fileRef = 09AD019F15D2483500638DCE /* html */; };
09B168721906062E003FDBCC /* CHCSVParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 09B168701906062E003FDBCC /* CHCSVParser.h */; };
09B168731906062E003FDBCC /* CHCSVParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 09B168711906062E003FDBCC /* CHCSVParser.m */; };
09FB094415C9DE6400B8AAB6 /* usr in Resources */ = {isa = PBXBuildFile; fileRef = 09FB094315C9DE6400B8AAB6 /* usr */; };
4B36C4651468B87A0085B07C /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B36C4641468B87A0085B07C /* WebKit.framework */; };
4B89D983147CA39200872F60 /* dnscrypt_256.png in Resources */ = {isa = PBXBuildFile; fileRef = 4B89D982147CA39200872F60 /* dnscrypt_256.png */; };
4BABEA28144F5A7B006AEF34 /* led_green.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BABEA1F144F5A7B006AEF34 /* led_green.png */; };
4BABEA29144F5A7B006AEF34 /* led_yellow.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BABEA20144F5A7B006AEF34 /* led_yellow.png */; };
4BABEA2A144F5A7B006AEF34 /* led_red.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BABEA21144F5A7B006AEF34 /* led_red.png */; };
4BABEA2B144F5A7B006AEF34 /* shield_yellow.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BABEA22144F5A7B006AEF34 /* shield_yellow.png */; };
4BABEA2C144F5A7B006AEF34 /* shield_red.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BABEA23144F5A7B006AEF34 /* shield_red.png */; };
4BABEA2D144F5A7B006AEF34 /* shield_green.png in Resources */ = {isa = PBXBuildFile; fileRef = 4BABEA24144F5A7B006AEF34 /* shield_green.png */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
0946B0C213F47F53008277C6 /* DNSCrypt.prefPane */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DNSCrypt.prefPane; sourceTree = BUILT_PRODUCTS_DIR; };
0946B0C513F47F53008277C6 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
0946B0C713F47F53008277C6 /* PreferencePanes.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PreferencePanes.framework; path = System/Library/Frameworks/PreferencePanes.framework; sourceTree = SDKROOT; };
0946B0CA13F47F53008277C6 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
0946B0CB13F47F53008277C6 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
0946B0CC13F47F53008277C6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
0946B0CF13F47F53008277C6 /* DNSCrypt-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "DNSCrypt-Info.plist"; sourceTree = ""; };
0946B0D113F47F53008277C6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
0946B0D313F47F53008277C6 /* DNSCrypt-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DNSCrypt-Prefix.pch"; sourceTree = ""; };
0946B0D413F47F53008277C6 /* DNSCrypt.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DNSCrypt.h; sourceTree = ""; };
0946B0D513F47F53008277C6 /* DNSCrypt.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DNSCrypt.m; sourceTree = ""; };
0946B0D713F47F53008277C6 /* DNSCrypt.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = DNSCrypt.tiff; sourceTree = ""; };
0946B0DA13F47F53008277C6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/DNSCrypt.xib; sourceTree = ""; };
0946B0E113F48056008277C6 /* SecurityFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SecurityFoundation.framework; path = System/Library/Frameworks/SecurityFoundation.framework; sourceTree = SDKROOT; };
0946B0E313F48065008277C6 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
09A13ABB145F2D8700B227A4 /* ajax-loader.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = "ajax-loader.gif"; sourceTree = ""; };
09AD019F15D2483500638DCE /* html */ = {isa = PBXFileReference; lastKnownFileType = folder; name = html; path = extra/html; sourceTree = ""; };
09B168701906062E003FDBCC /* CHCSVParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CHCSVParser.h; sourceTree = ""; };
09B168711906062E003FDBCC /* CHCSVParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CHCSVParser.m; sourceTree = ""; };
09FB094315C9DE6400B8AAB6 /* usr */ = {isa = PBXFileReference; lastKnownFileType = folder; name = usr; path = extra/usr; sourceTree = ""; };
4B36C4641468B87A0085B07C /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
4B89D982147CA39200872F60 /* dnscrypt_256.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dnscrypt_256.png; sourceTree = ""; };
4BABEA1F144F5A7B006AEF34 /* led_green.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = led_green.png; sourceTree = ""; };
4BABEA20144F5A7B006AEF34 /* led_yellow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = led_yellow.png; sourceTree = ""; };
4BABEA21144F5A7B006AEF34 /* led_red.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = led_red.png; sourceTree = ""; };
4BABEA22144F5A7B006AEF34 /* shield_yellow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = shield_yellow.png; sourceTree = ""; };
4BABEA23144F5A7B006AEF34 /* shield_red.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = shield_red.png; sourceTree = ""; };
4BABEA24144F5A7B006AEF34 /* shield_green.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = shield_green.png; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
0946B0BD13F47F53008277C6 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4B36C4651468B87A0085B07C /* WebKit.framework in Frameworks */,
0946B0E413F48065008277C6 /* Security.framework in Frameworks */,
0946B0C613F47F53008277C6 /* Cocoa.framework in Frameworks */,
0946B0C813F47F53008277C6 /* PreferencePanes.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
0946B0B513F47F52008277C6 = {
isa = PBXGroup;
children = (
0946B0CD13F47F53008277C6 /* DNSCrypt */,
0946B0C413F47F53008277C6 /* Frameworks */,
0946B0C313F47F53008277C6 /* Products */,
);
sourceTree = "";
};
0946B0C313F47F53008277C6 /* Products */ = {
isa = PBXGroup;
children = (
0946B0C213F47F53008277C6 /* DNSCrypt.prefPane */,
);
name = Products;
sourceTree = "";
};
0946B0C413F47F53008277C6 /* Frameworks */ = {
isa = PBXGroup;
children = (
0946B0C513F47F53008277C6 /* Cocoa.framework */,
0946B0C913F47F53008277C6 /* Other Frameworks */,
);
name = Frameworks;
sourceTree = "";
};
0946B0C913F47F53008277C6 /* Other Frameworks */ = {
isa = PBXGroup;
children = (
0946B0CA13F47F53008277C6 /* AppKit.framework */,
0946B0CB13F47F53008277C6 /* CoreData.framework */,
0946B0CC13F47F53008277C6 /* Foundation.framework */,
0946B0C713F47F53008277C6 /* PreferencePanes.framework */,
0946B0E313F48065008277C6 /* Security.framework */,
0946B0E113F48056008277C6 /* SecurityFoundation.framework */,
4B36C4641468B87A0085B07C /* WebKit.framework */,
);
name = "Other Frameworks";
sourceTree = "";
};
0946B0CD13F47F53008277C6 /* DNSCrypt */ = {
isa = PBXGroup;
children = (
0946B0D413F47F53008277C6 /* DNSCrypt.h */,
0946B0D513F47F53008277C6 /* DNSCrypt.m */,
0946B0D913F47F53008277C6 /* DNSCrypt.xib */,
0946B0D713F47F53008277C6 /* DNSCrypt.tiff */,
4B89D982147CA39200872F60 /* dnscrypt_256.png */,
09B1686F1906062E003FDBCC /* CHCSVParser */,
09AD019F15D2483500638DCE /* html */,
09FB094315C9DE6400B8AAB6 /* usr */,
0946B0CE13F47F53008277C6 /* Supporting Files */,
);
path = DNSCrypt;
sourceTree = "";
};
0946B0CE13F47F53008277C6 /* Supporting Files */ = {
isa = PBXGroup;
children = (
4BABEA1E144F5A67006AEF34 /* Status */,
0946B0CF13F47F53008277C6 /* DNSCrypt-Info.plist */,
0946B0D013F47F53008277C6 /* InfoPlist.strings */,
0946B0D313F47F53008277C6 /* DNSCrypt-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "";
};
09B1686F1906062E003FDBCC /* CHCSVParser */ = {
isa = PBXGroup;
children = (
09B168701906062E003FDBCC /* CHCSVParser.h */,
09B168711906062E003FDBCC /* CHCSVParser.m */,
);
path = CHCSVParser;
sourceTree = "";
};
4BABEA1E144F5A67006AEF34 /* Status */ = {
isa = PBXGroup;
children = (
09A13ABB145F2D8700B227A4 /* ajax-loader.gif */,
4BABEA1F144F5A7B006AEF34 /* led_green.png */,
4BABEA20144F5A7B006AEF34 /* led_yellow.png */,
4BABEA21144F5A7B006AEF34 /* led_red.png */,
4BABEA22144F5A7B006AEF34 /* shield_yellow.png */,
4BABEA23144F5A7B006AEF34 /* shield_red.png */,
4BABEA24144F5A7B006AEF34 /* shield_green.png */,
);
name = Status;
sourceTree = "";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
0946B0BE13F47F53008277C6 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
09B168721906062E003FDBCC /* CHCSVParser.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
0946B0C113F47F53008277C6 /* DNSCrypt */ = {
isa = PBXNativeTarget;
buildConfigurationList = 0946B0DE13F47F53008277C6 /* Build configuration list for PBXNativeTarget "DNSCrypt" */;
buildPhases = (
0946B0BC13F47F53008277C6 /* Sources */,
0946B0BD13F47F53008277C6 /* Frameworks */,
0946B0BE13F47F53008277C6 /* Headers */,
0946B0BF13F47F53008277C6 /* Resources */,
0946B0C013F47F53008277C6 /* Rez */,
);
buildRules = (
);
dependencies = (
);
name = DNSCrypt;
productName = DNSCrypt;
productReference = 0946B0C213F47F53008277C6 /* DNSCrypt.prefPane */;
productType = "com.apple.product-type.bundle";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
0946B0B713F47F52008277C6 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0510;
};
buildConfigurationList = 0946B0BA13F47F52008277C6 /* Build configuration list for PBXProject "DNSCrypt" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 0946B0B513F47F52008277C6;
productRefGroup = 0946B0C313F47F53008277C6 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
0946B0C113F47F53008277C6 /* DNSCrypt */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
0946B0BF13F47F53008277C6 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0946B0D213F47F53008277C6 /* InfoPlist.strings in Resources */,
0946B0D813F47F53008277C6 /* DNSCrypt.tiff in Resources */,
0946B0DB13F47F53008277C6 /* DNSCrypt.xib in Resources */,
4BABEA28144F5A7B006AEF34 /* led_green.png in Resources */,
4BABEA29144F5A7B006AEF34 /* led_yellow.png in Resources */,
4BABEA2A144F5A7B006AEF34 /* led_red.png in Resources */,
4BABEA2B144F5A7B006AEF34 /* shield_yellow.png in Resources */,
4BABEA2C144F5A7B006AEF34 /* shield_red.png in Resources */,
4BABEA2D144F5A7B006AEF34 /* shield_green.png in Resources */,
09A13ABC145F2D8700B227A4 /* ajax-loader.gif in Resources */,
4B89D983147CA39200872F60 /* dnscrypt_256.png in Resources */,
09FB094415C9DE6400B8AAB6 /* usr in Resources */,
09AD01A015D2483500638DCE /* html in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXRezBuildPhase section */
0946B0C013F47F53008277C6 /* Rez */ = {
isa = PBXRezBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXRezBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
0946B0BC13F47F53008277C6 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
09B168731906062E003FDBCC /* CHCSVParser.m in Sources */,
0946B0D613F47F53008277C6 /* DNSCrypt.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
0946B0D013F47F53008277C6 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
0946B0D113F47F53008277C6 /* en */,
);
name = InfoPlist.strings;
sourceTree = "";
};
0946B0D913F47F53008277C6 /* DNSCrypt.xib */ = {
isa = PBXVariantGroup;
children = (
0946B0DA13F47F53008277C6 /* en */,
);
name = DNSCrypt.xib;
sourceTree = "";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
0946B0DC13F47F53008277C6 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
CLANG_ENABLE_OBJC_ARC = NO;
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_ENABLE_OBJC_GC = supported;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.6;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
0946B0DD13F47F53008277C6 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
CLANG_ENABLE_OBJC_ARC = NO;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_ENABLE_OBJC_GC = supported;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.6;
SDKROOT = macosx;
};
name = Release;
};
0946B0DF13F47F53008277C6 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)\"",
);
GCC_ENABLE_OBJC_GC = no;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "DNSCrypt/DNSCrypt-Prefix.pch";
GCC_VERSION = "";
INFOPLIST_FILE = "DNSCrypt/DNSCrypt-Info.plist";
INSTALL_PATH = "$(HOME)/Library/PreferencePanes";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = prefPane;
};
name = Debug;
};
0946B0E013F47F53008277C6 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)\"",
);
GCC_ENABLE_OBJC_GC = no;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "DNSCrypt/DNSCrypt-Prefix.pch";
GCC_VERSION = "";
INFOPLIST_FILE = "DNSCrypt/DNSCrypt-Info.plist";
INSTALL_PATH = "$(HOME)/Library/PreferencePanes";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = prefPane;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
0946B0BA13F47F52008277C6 /* Build configuration list for PBXProject "DNSCrypt" */ = {
isa = XCConfigurationList;
buildConfigurations = (
0946B0DC13F47F53008277C6 /* Debug */,
0946B0DD13F47F53008277C6 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
0946B0DE13F47F53008277C6 /* Build configuration list for PBXNativeTarget "DNSCrypt" */ = {
isa = XCConfigurationList;
buildConfigurations = (
0946B0DF13F47F53008277C6 /* Debug */,
0946B0E013F47F53008277C6 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 0946B0B713F47F52008277C6 /* Project object */;
}
================================================
FILE: DNSCrypt-Preference-Pane/DNSCrypt.xcodeproj/project.xcworkspace/contents.xcworkspacedata
================================================
================================================
FILE: Pages/feedback.haml
================================================
!!! 5
%html{lang: "en"}
%head
%meta{charset: "utf-8"}
%title DNSCrypt feedback form
%style{type: "text/css"}
:sass
body
font:
family: arial, helvetica, sans-serif
margin: 0
h1
margin: 0
form
margin: 0 auto
width: 500px
p
margin: 0.25em 0
.error
background: #fbb
color: #000
fieldset
border: none
padding: 0
label
float: left
width: 100px
text-align: right
padding-right: 1em
input
width: 200px
input[type=submit]
width: auto
textarea
width: 300px
height: 170px
#submit
text-align: center
%body
%form{action: "feedback.php", method: "post", action: "{{form_url}}"}
%h1 Feedback
%fieldset
%p
%label{for: "name"} Name:
%input{type: "text", name: "name", autofocus: true,
required: true, value: "{{name}}", class: "{{class_name}}"}
%p
%label{for: "email"} Email:
%input{type: "email", name: "email",
placeholder: "email@example.com", required: true,
value: "{{email}}", class: "{{class_email}}"}
%p
%label{for: "feedback"} Feedback:
%textarea{name: "feedback", class: "{{class_feedback}}"} {{feedback}}
%fieldset#submit
%input{type: "submit"}
================================================
FILE: Pages/feedback.php
================================================
');
define('FEEDBACK_SUBJECT', 'DNSCrypt Feedback');
function strip_slashes_from_user_data(&$array) {
foreach($array as $k => $v) {
if (is_array($v)) {
strip_slashes_from_user_data($array[$k]);
continue;
}
$array[$k] = stripslashes($v);
}
}
function disable_magic_quotes() {
if (get_magic_quotes_gpc()) {
strip_slashes_from_user_data($_GET);
strip_slashes_from_user_data($_POST);
strip_slashes_from_user_data($_COOKIE);
}
}
function render_headers() {
header('X-Frame-Options: sameorigin');
header('X-XSS-Protection: 1; mode=block');
header('X-Content-Security-Policy: allow \'self\'');
header('Cache-Control: private, max-age=3600');
header('Expires: ' . date('r', time() + 3600));
}
function render_tpl($template, $vars) {
$tpl = @file_get_contents($template);
if (empty($tpl)) {
throw new Exception('template');
}
foreach ($vars as $key => $value) {
foreach (array_keys($vars) as $key_) {
if (strstr($value, '{{' . $key . '}}') !== FALSE) {
$value = '';
}
}
$tpl = str_replace('{{' . $key . '}}', htmlspecialchars($value), $tpl);
}
echo $tpl;
}
function redirect_to_sent_page($uri) {
header('HTTP/1.1 303 See other');
header('Location: ' . $uri);
exit;
}
function _send_email($name, $email, $feedback) {
$from = mb_encode_mimeheader($name, 'UTF-8') . '<' . $email . '>';
$to = FEEDBACK_RECIPIENT;
$subject = mb_encode_mimeheader(FEEDBACK_SUBJECT, 'UTF-8');
$body = addslashes($feedback);
return send_email($from, $to, $subject, $body);
}
function send_form($name, $email, $feedback) {
if (_send_email($name, $email, $feedback) !== TRUE) {
redirect_to_sent_page($_SERVER['SCRIPT_NAME']);
}
redirect_to_sent_page('sent.html');
}
function process_feedback(&$errors, &$name, &$email, &$feedback) {
$name = trim(isset($_POST['name']) ? (string) $_POST['name'] : '');
$email = trim(isset($_POST['email']) ? (string) $_POST['email'] : '');
$feedback = trim(isset($_POST['feedback']) ?
(string) $_POST['feedback'] : '');
if (empty($name)) {
array_push($errors, 'name');
}
if (! filter_var($email, FILTER_VALIDATE_EMAIL)) {
array_push($errors, 'email');
}
if (empty($feedback)) {
array_push($errors, 'feedback');
}
if (! empty($errors)) {
return;
}
session_start();
if (empty($_SESSION['authenticity_token']) ||
$_GET['authenticity_token'] !== $_SESSION['authenticity_token']) {
return;
}
send_form($name, $email, $feedback);
unset($_SESSION['authenticity_token']);
}
disable_magic_quotes();
render_headers();
$errors = array();
$name = $email = $feedback = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST' &&
!empty($_GET['authenticity_token'])) {
process_feedback($errors, $name, $email, $feedback);
}
if (session_id() === '') {
session_start();
}
$authenticity_token = md5(uniqid(__FILE__, TRUE));
$_SESSION['authenticity_token'] = $authenticity_token;
$form_url = $_SERVER['SCRIPT_NAME'] . '?' .
http_build_query(array('authenticity_token' => $authenticity_token));
$vars = array('name' => $name,
'email' => $email,
'feedback' => $feedback,
'form_url' => $form_url);
foreach ($errors as $error) {
$vars['class_' . $error] = 'error';
}
render_tpl('feedback.tpl', $vars + $errors);
================================================
FILE: Pages/feedback.tpl
================================================
DNSCrypt feedback form
================================================
FILE: Pages/sent.haml
================================================
!!! 5
%html{lang: "en"}
%head
%meta{charset: "utf-8"}
%meta{"http-equiv" => "refresh", content: "5; url=feedback.php"}
%title DNSCrypt feedback sent
%style{type: "text/css"}
:sass
body
font:
family: arial, helvetica, sans-serif
%body
%h1 Feedback sent!
================================================
FILE: README.markdown
================================================
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.4.dmg](https://github.com/alterstep/dnscrypt-osxclient/releases/download/1.0.4/dnscrypt-osxclient-1.0.4.dmg)
for OSX 10.8 (Snow Leopard), OSX 10.9 (Mavericks) and OSX 10.10 (Yosemite).
Compatible with:
* CloudNS
* d0wn
* DNSCrypt.eu
* okTurtles
* OpenDNS
* OpenNIC
* Soltysiak