-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
/
newnode-helper.rb
39 lines (35 loc) 路 1.16 KB
/
newnode-helper.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
class NewnodeHelper < Formula
desc "Web proxy that uses a distributed p2p network to circumvent censorship"
homepage "https://www.newnode.com/newnode-vpn"
url "https://github.com/clostra/newnode.git",
tag: "2.1.4", revision: "c42a04ded55cfdff857878f4d9234950e530bb00"
license "GPL-2.0-only"
depends_on xcode: ["9.3", :build]
depends_on "automake"
depends_on "coreutils"
depends_on "libtool"
depends_on "mbedtls@2"
depends_on "wget"
def install
system "git", "clone", "--recurse-submodules", "https://github.com/clostra/newnode.git"
system "cd newnode && ./build.sh"
bin.install "newnode/client" => "newnode-helper"
path = (var/"newnode-helper")
path.mkpath
path.chmod 0775
end
service do
run [opt_bin/"newnode-helper", "-p", "8006", "-v"]
keep_alive true
working_dir var/"newnode-helper"
log_path var/"log/newnode-helper.log"
error_log_path var/"log/newnode-helper-error.log"
end
test do
# use wget to try to download a file via the newnode's HTTP proxy
# if that works, newnode vpn is working
ENV["https_proxy"] = "http://localhost:8006"
sleep 5
system "wget", "https://brew.sh"
end
end