1 class TraefikAT2 < Formula
2 desc "Modern reverse proxy"
3 homepage "https://traefik.io/"
4 url "https://github.com/traefik/traefik/releases/download/v2.11.20/traefik-v2.11.20.src.tar.gz"
5 sha256 "3852b76dfc9053e3354649c76c1ef7c1e1dfb8123d7150281495bf25f93fcdce"
10 regex(/^v?(2\.\d+\.\d+)$/i)
14 sha256 cellar: :any_skip_relocation, arm64_sequoia: "9e90ea9a97bd844f3a999e30d170d62a9d5a7bfe590d1b4734476b6263b5fcb5"
15 sha256 cellar: :any_skip_relocation, arm64_sonoma: "b2eeff8b0ab8417d1ee7f5a034039305f0f63abe9c6612bbf8e3982e999ad519"
16 sha256 cellar: :any_skip_relocation, arm64_ventura: "2ec7f78e94a574ffe34af759a721161154a3879dd742d279d8049de2fa383639"
17 sha256 cellar: :any_skip_relocation, sonoma: "c4f072468480597d3be732ab6b3b26fececba8991c9d04f328aa3c9a077d7afe"
18 sha256 cellar: :any_skip_relocation, ventura: "0e369a24fc7d1362ba3799746bc0b77632a0f424742614d8fcd4d565eba111c1"
19 sha256 cellar: :any_skip_relocation, x86_64_linux: "29a9e1ac043b5ec0f5cab9b517fd8f99a55bb835d198d06656090889e2ee861e"
22 keg_only :versioned_formula
24 # https://doc.traefik.io/traefik/deprecation/releases/
25 disable! date: "2025-04-30", because: :unmaintained
27 depends_on "go" => :build
32 -X github.com/traefik/traefik/v#{version.major}/pkg/version.Version=#{version}
34 system "go", "generate"
35 system "go", "build", *std_go_args(ldflags:, output: bin/"traefik"), "./cmd/traefik"
39 run [opt_bin/"traefik", "--configfile=#{etc}/traefik/traefik.toml"]
42 log_path var/"log/traefik.log"
43 error_log_path var/"log/traefik.log"
50 (testpath/"traefik.toml").write <<~TOML
53 address = ":#{http_port}"
55 address = ":#{ui_port}"
63 exec bin/"traefik", "--configfile=#{testpath}/traefik.toml"
66 cmd_ui = "curl -sIm3 -XGET http://127.0.0.1:#{http_port}/"
67 assert_match "404 Not Found", shell_output(cmd_ui)
69 cmd_ui = "curl -sIm3 -XGET http://127.0.0.1:#{ui_port}/dashboard/"
70 assert_match "200 OK", shell_output(cmd_ui)
76 assert_match version.to_s, shell_output("#{bin}/traefik version 2>&1")