2011-12-14 18:48:01 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class DnscryptProxy < Formula
|
2012-09-24 21:09:27 +00:00
|
|
|
homepage 'http://dnscrypt.org'
|
2014-05-12 08:42:50 +00:00
|
|
|
url 'http://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-proxy-1.4.0.tar.gz'
|
|
|
|
sha256 '60b57b36aa15706c4cd0c348fc59534c15913c282a2b7d4db0b3787167b33502'
|
2012-07-31 19:13:19 +00:00
|
|
|
|
2013-09-20 15:15:52 +00:00
|
|
|
head do
|
|
|
|
url 'https://github.com/opendns/dnscrypt-proxy.git', :branch => 'master'
|
2012-09-24 21:09:27 +00:00
|
|
|
|
2013-11-13 16:52:55 +00:00
|
|
|
depends_on :autoconf
|
2012-09-24 21:09:27 +00:00
|
|
|
depends_on :automake
|
|
|
|
depends_on :libtool
|
|
|
|
end
|
2011-12-14 18:48:01 +00:00
|
|
|
|
2013-09-20 15:15:52 +00:00
|
|
|
option "plugins", "Support plugins and install example plugins."
|
|
|
|
|
2013-08-26 02:34:24 +00:00
|
|
|
depends_on 'libsodium'
|
|
|
|
|
2011-12-14 18:48:01 +00:00
|
|
|
def install
|
2012-09-24 21:09:27 +00:00
|
|
|
system "autoreconf", "-if" if build.head?
|
|
|
|
|
|
|
|
args = ["--disable-dependency-tracking", "--prefix=#{prefix}"]
|
|
|
|
if build.include? "plugins"
|
|
|
|
args << "--enable-plugins"
|
|
|
|
args << "--enable-relaxed-plugins-permissions"
|
|
|
|
args << "--enable-plugins-root"
|
|
|
|
end
|
|
|
|
system "./configure", *args
|
2011-12-14 18:48:01 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2013-04-28 13:50:24 +00:00
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
2014-03-30 21:17:44 +00:00
|
|
|
After starting dnscrypt-proxy, you will need to point your
|
|
|
|
local DNS server to 127.0.0.1. You can do this by going to
|
|
|
|
System Preferences > "Network" and clicking the "Advanced..."
|
|
|
|
button for your interface. You will see a "DNS" tab where you
|
|
|
|
can click "+" and enter 127.0.0.1 in the "DNS Servers" section.
|
2013-04-28 13:50:24 +00:00
|
|
|
|
2014-03-30 21:17:44 +00:00
|
|
|
By default, dnscrypt-proxy runs on localhost (127.0.0.1), port 53,
|
|
|
|
and under the "nobody" user using the default OpenDNS DNSCrypt-enabled
|
|
|
|
resolver. If you would like to change these settings (e.g., switching to
|
|
|
|
a DNSCrypt-enabled resolver with DNSSEC support), you will have to edit the
|
|
|
|
plist file (e.g., --resolver-address, --provider-name, --provider-key, etc.)
|
2013-04-28 13:50:24 +00:00
|
|
|
|
2014-03-30 21:17:44 +00:00
|
|
|
To check that dnscrypt-proxy is working correctly, open Terminal and enter the
|
|
|
|
following command:
|
2013-04-28 13:50:24 +00:00
|
|
|
|
2014-03-30 21:17:44 +00:00
|
|
|
dig txt debug.opendns.com
|
2013-04-28 13:50:24 +00:00
|
|
|
|
2014-03-30 21:17:44 +00:00
|
|
|
You should see a line in the result that looks like this:
|
2013-04-28 13:50:24 +00:00
|
|
|
|
2014-03-30 21:17:44 +00:00
|
|
|
debug.opendns.com. 0 IN TXT "dnscrypt enabled (......)"
|
|
|
|
|
|
|
|
Note: This will only work if you are using the default OpenDNS DNSCrypt-enabled
|
|
|
|
resolver. If you are using a different resolver, you can use a tool like tcpdump
|
|
|
|
to verify that everything is working correctly.
|
2013-04-28 13:50:24 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
plist_options :startup => true
|
|
|
|
|
|
|
|
def plist; <<-EOS.undent
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist PUBLIC "-/Apple/DTD PLIST 1.0/EN" "http:/www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
|
|
<plist version="1.0">
|
|
|
|
<dict>
|
|
|
|
<key>Label</key>
|
|
|
|
<string>#{plist_name}</string>
|
|
|
|
<key>KeepAlive</key>
|
|
|
|
<true/>
|
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
<key>ProgramArguments</key>
|
|
|
|
<array>
|
2014-03-06 05:28:31 +00:00
|
|
|
<string>#{opt_sbin}/dnscrypt-proxy</string>
|
2013-04-28 13:50:24 +00:00
|
|
|
<string>--user=nobody</string>
|
2014-05-23 04:13:18 +00:00
|
|
|
<string>--resolver-name=opendns</string>
|
2013-04-28 13:50:24 +00:00
|
|
|
</array>
|
|
|
|
<key>UserName</key>
|
|
|
|
<string>root</string>
|
|
|
|
<key>StandardErrorPath</key>
|
|
|
|
<string>/dev/null</string>
|
|
|
|
<key>StandardOutPath</key>
|
|
|
|
<string>/dev/null</string>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOS
|
|
|
|
end
|
2011-12-14 18:48:01 +00:00
|
|
|
end
|