Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boringtun 0.4.0 #96335

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions Formula/boringtun.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class Boringtun < Formula
desc "Userspace WireGuard implementation in Rust"
homepage "https://github.com/cloudflare/boringtun"
url "https://github.com/cloudflare/boringtun/archive/v0.3.0.tar.gz"
sha256 "1107b0170a33769db36876334261924edc71dfc1eb00f9b464c7d2ad6d5743d3"
url "https://github.com/cloudflare/boringtun/archive/v0.4.0.tar.gz"
sha256 "23a02ae0c01d194ce428c465de46538f683c696fa23a82cfc42d07d40e668e74"
license "BSD-3-Clause"
head "https://github.com/cloudflare/boringtun.git", branch: "master"

Expand All @@ -21,12 +21,20 @@ def install
system "cargo", "install", *std_cargo_args
chenrui333 marked this conversation as resolved.
Show resolved Hide resolved
end

def caveats
<<~EOS
boringtun requires root privileges so you will need to run `sudo boringtun utun`.
You should be certain that you trust any software you grant root privileges.
EOS
end

test do
system "#{bin}/boringtun", "--help"
assert_match "boringtun " + version.to_s, shell_output("#{bin}/boringtun -V").chomp
shell_output("#{bin}/boringtun utun -v --log #{testpath}/boringtun.log", 1)
assert_match "boringtun #{version}", shell_output("#{bin}/boringtun -V").chomp

output = shell_output("#{bin}/boringtun utun -v --log #{testpath}/boringtun.log 2>&1", 1)
assert_predicate testpath/"boringtun.log", :exist?
boringtun_log = File.read(testpath/"boringtun.log")
assert_match "Success, daemonized", boringtun_log.split("/n").first
# requires `sudo` to start
assert_match "BoringTun failed to start", output
Comment on lines +37 to +38
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sudo requirement seems new. Is this documented upstream?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check on this, the sudo issue got raised in this one

end
end