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'
|
2013-08-26 02:34:24 +00:00
|
|
|
url 'http://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-proxy-1.3.3.tar.bz2'
|
|
|
|
sha256 'd9aca5253b9fe0fd0bb756201e837d3b723c091e5be0eb3a81cf5432cedaec47'
|
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
|
|
|
|
|
|
|
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
|
|
|
|
Once dnscrypt-proxy is running, you will have to update your local
|
|
|
|
DNS server to point to 127.0.0.1 in order for it to actually work.
|
|
|
|
This is generally done under System Preferences > Network > Advanced.
|
|
|
|
Once there, you will see a "DNS" tab where you can enter a list of DNS
|
|
|
|
servers. You will want to make sure that 127.0.0.1 is listed there first.
|
|
|
|
|
|
|
|
Note: By default, dnscrypt-proxy runs on 127.0.0.1:53 under the "nobody" user.
|
|
|
|
If you would like to change these settings, you will have to edit the plist file.
|
|
|
|
|
|
|
|
To check that dnscrypt-proxy is running properly, open Terminal and enter this at
|
|
|
|
the command prompt:
|
|
|
|
|
|
|
|
nslookup -type=txt debug.opendns.com
|
|
|
|
|
|
|
|
You should see something like this in the output:
|
|
|
|
|
|
|
|
debug.opendns.com text = "dnscrypt enabled (...)"
|
|
|
|
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>
|
|
|
|
<string>#{opt_prefix}/sbin/dnscrypt-proxy</string>
|
|
|
|
<string>--local-address=127.0.0.1:53</string>
|
|
|
|
<string>--user=nobody</string>
|
|
|
|
</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
|