50 lines
1.8 KiB
Ruby
50 lines
1.8 KiB
Ruby
class Teleport < Formula
|
|
desc "Modern SSH server for teams managing distributed infrastructure"
|
|
homepage "https://gravitational.com/teleport"
|
|
url "https://github.com/gravitational/teleport/archive/v3.1.3.tar.gz"
|
|
sha256 "224e89e65e83ebd4bd48a3d0e1f4f65e7c203240d63194b6d3617a5a35edd0ca"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "947a11d0d644b2d42b08ee34c6898297afa56dcf01f3ec0c4db465871978d674" => :mojave
|
|
sha256 "ea228d043a8128b466e2d2308d6dee50152df46e08e2d4e60660b592f528ddff" => :high_sierra
|
|
sha256 "fb8482ef098769a913216dbf77b11255e0e5e47079bd2e52c8be9489b94f1b1b" => :sierra
|
|
end
|
|
|
|
depends_on "go" => :build
|
|
|
|
conflicts_with "etsh", :because => "both install `tsh` binaries"
|
|
|
|
def install
|
|
ENV["GOOS"] = "darwin"
|
|
ENV["GOARCH"] = "amd64"
|
|
ENV["GOPATH"] = buildpath
|
|
ENV["GOROOT"] = Formula["go"].opt_libexec
|
|
|
|
(buildpath/"src/github.com/gravitational/teleport").install buildpath.children
|
|
cd "src/github.com/gravitational/teleport" do
|
|
ENV.deparallelize { system "make", "full" }
|
|
bin.install Dir["build/*"]
|
|
prefix.install_metafiles
|
|
end
|
|
end
|
|
|
|
test do
|
|
assert_match version.to_s, shell_output("#{bin}/teleport version")
|
|
(testpath/"config.yml").write shell_output("#{bin}/teleport configure")
|
|
.gsub("0.0.0.0", "127.0.0.1")
|
|
.gsub("/var/lib/teleport", testpath)
|
|
.gsub("/var/run", testpath)
|
|
.gsub(/https_(.*)/, "")
|
|
begin
|
|
pid = spawn("#{bin}/teleport start -c #{testpath}/config.yml")
|
|
sleep 5
|
|
system "/usr/bin/curl", "--insecure", "https://localhost:3080"
|
|
system "/usr/bin/nc", "-z", "localhost", "3022"
|
|
system "/usr/bin/nc", "-z", "localhost", "3023"
|
|
system "/usr/bin/nc", "-z", "localhost", "3025"
|
|
ensure
|
|
Process.kill(9, pid)
|
|
end
|
|
end
|
|
end
|