From 13e3c74ad2255c8ddc9a4bca10eff2e385c92a46 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Sat, 2 Sep 2023 01:04:48 -0400 Subject: [PATCH 1/2] hysteria 2.0.0 hysteria: update build Signed-off-by: Rui Chen --- Formula/h/hysteria.rb | 48 +++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/Formula/h/hysteria.rb b/Formula/h/hysteria.rb index 4f14f09107584a..47f3d5a63526da 100644 --- a/Formula/h/hysteria.rb +++ b/Formula/h/hysteria.rb @@ -1,9 +1,8 @@ class Hysteria < Formula desc "Feature-packed proxy & relay tool optimized for lossy, unstable connections" homepage "https://hysteria.network/" - url "https://github.com/apernet/hysteria.git", - tag: "v1.3.5", - revision: "57c5164854d6cfe00bead730cce731da2babe406" + url "https://github.com/apernet/hysteria/archive/refs/tags/app/v2.0.0.tar.gz" + sha256 "06f86cf466cbe08e7aaea68914263780ed4474cd73df9a591676779535d330d5" license "MIT" head "https://github.com/apernet/hysteria.git", branch: "master" @@ -20,8 +19,18 @@ class Hysteria < Formula depends_on "go" => :build def install - ldflags = "-s -w -X main.appVersion=v#{version} -X main.appDate=#{time.iso8601} -X main.appCommit=#{Utils.git_short_head}" - system "go", "build", *std_go_args(ldflags: ldflags), "./app/cmd" + ldflags = %W[ + -s -w + -X github.com/apernet/hysteria/app/cmd.appVersion=v#{version} + -X github.com/apernet/hysteria/app/cmd.appDate=#{time.iso8601} + -X github.com/apernet/hysteria/app/cmd.appType=release + -X github.com/apernet/hysteria/app/cmd.appCommit=#{tap.user} + -X github.com/apernet/hysteria/app/cmd.appPlatform=#{OS.kernel_name.downcase} + -X github.com/apernet/hysteria/app/cmd.appArch=#{Hardware::CPU.arch} + ] + system "go", "build", *std_go_args(ldflags: ldflags), "./app" + + generate_completions_from_executable(bin/"hysteria", "completion") end service do @@ -31,19 +40,22 @@ def install end test do - (testpath/"config.json").write <<~EOS - { - "listen": ":36712", - "acme": { - "domains": [ - "your.domain.com" - ], - "email": "your@email.com" - }, - "obfs": "8ZuA2Zpqhuk8yakXvMjDqEXBwY" - } + port = free_port + (testpath/"config.yaml").write <<~EOS + listen: :#{port} + acme: + domains: + - your.domain.com + email: your@email.com + + obfs: + type: salamander + salamander: + password: cry_me_a_r1ver EOS - output = pipe_output "#{opt_bin}/hysteria server -c #{testpath}/config.json" - assert_includes output, "Server configuration loaded" + output = shell_output("#{bin}/hysteria server --disable-update-check -c #{testpath}/config.yaml 2>&1", 1) + assert_match "maintenance started background certificate maintenance", output + + assert_match version.to_s, shell_output("#{bin}/hysteria version") end end From 20c5414052938a80474f728b4b0b3e324e3c505d Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Sat, 2 Sep 2023 07:25:01 +0000 Subject: [PATCH 2/2] hysteria: update 2.0.0 bottle. --- Formula/h/hysteria.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Formula/h/hysteria.rb b/Formula/h/hysteria.rb index 47f3d5a63526da..93c985d774f971 100644 --- a/Formula/h/hysteria.rb +++ b/Formula/h/hysteria.rb @@ -7,13 +7,13 @@ class Hysteria < Formula head "https://github.com/apernet/hysteria.git", branch: "master" bottle do - sha256 cellar: :any_skip_relocation, arm64_ventura: "590b5440ea6348e190e579bf6d92e0030c88c1e41d8924d688184dac998add0b" - sha256 cellar: :any_skip_relocation, arm64_monterey: "590b5440ea6348e190e579bf6d92e0030c88c1e41d8924d688184dac998add0b" - sha256 cellar: :any_skip_relocation, arm64_big_sur: "590b5440ea6348e190e579bf6d92e0030c88c1e41d8924d688184dac998add0b" - sha256 cellar: :any_skip_relocation, ventura: "2e4a2e773aafe7bc57c15ac6f2aab7f78791ea2095a0dafa8bc3d12055f5588a" - sha256 cellar: :any_skip_relocation, monterey: "2e4a2e773aafe7bc57c15ac6f2aab7f78791ea2095a0dafa8bc3d12055f5588a" - sha256 cellar: :any_skip_relocation, big_sur: "2e4a2e773aafe7bc57c15ac6f2aab7f78791ea2095a0dafa8bc3d12055f5588a" - sha256 cellar: :any_skip_relocation, x86_64_linux: "e8635bc4da9255afb22cb697da0103d0c37a0b2de97f0bda58d3297f158186f6" + sha256 cellar: :any_skip_relocation, arm64_ventura: "46e68501f245994f2895eacec5699cbe18f4be72de2e5a93c33d538e6d47d95f" + sha256 cellar: :any_skip_relocation, arm64_monterey: "5c929e8bd369937916e5b718845dc54133d19b0c766ef7134e620c4acfa12712" + sha256 cellar: :any_skip_relocation, arm64_big_sur: "c8ee87d36f7360ffe8402948cca7afeecc454523c378add397d9f196b6aa3a08" + sha256 cellar: :any_skip_relocation, ventura: "fb9c781cb41b68ee2ed77e20aba7ff319efb2a693b529b3d91f7e4a90161ed2f" + sha256 cellar: :any_skip_relocation, monterey: "a52e95af5c0fd5d815f7047f0cb33413cd5caa08de9651a566f3e5eebf00cc89" + sha256 cellar: :any_skip_relocation, big_sur: "bdbe3a023ac06a3ae9c70aa1fa134d2ea6dfa25a5ae8ac1788830117d283d4ba" + sha256 cellar: :any_skip_relocation, x86_64_linux: "280f8a218cd15eef68ed85839f495c8ef4699f2997353916d97aae3b3ed4042c" end depends_on "go" => :build