2022-04-15 01:41:22 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, stdenv }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "cloudflared";
|
2022-09-09 14:08:57 +00:00
|
|
|
version = "2022.8.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cloudflare";
|
|
|
|
repo = "cloudflared";
|
|
|
|
rev = version;
|
2022-09-09 14:08:57 +00:00
|
|
|
hash = "sha256-Kyt5d3KmLefTVVUmUUU23UV0lghzhLFCKLlmwTjN68I=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
vendorSha256 = null;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
ldflags = [ "-s" "-w" "-X main.Version=${version}" "-X github.com/cloudflare/cloudflared/cmd/cloudflared/updater.BuiltForPackageManager=nixpkgs" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
preCheck = ''
|
|
|
|
# Workaround for: sshgen_test.go:74: mkdir /homeless-shelter/.cloudflared: no such file or directory
|
|
|
|
export HOME="$(mktemp -d)";
|
|
|
|
|
|
|
|
# Workaround for: protocol_test.go:11:
|
|
|
|
# lookup protocol-v2.argotunnel.com on [::1]:53: read udp [::1]:51876->[::1]:53: read: connection refused
|
|
|
|
|
|
|
|
substituteInPlace "edgediscovery/protocol_test.go" \
|
|
|
|
--replace "TestProtocolPercentage" "SkipProtocolPercentage"
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-02-20 05:27:41 +00:00
|
|
|
description = "CloudFlare Tunnel daemon (and DNS-over-HTTPS client)";
|
|
|
|
homepage = "https://www.cloudflare.com/products/tunnel";
|
|
|
|
license = licenses.asl20;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
2022-09-09 14:08:57 +00:00
|
|
|
maintainers = with maintainers; [ bbigras enorris thoughtpolice ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|