2022-12-17 10:02:37 +00:00
{ lib , buildGoModule , fetchFromGitHub , stdenv , callPackage }:
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 = " c l o u d f l a r e d " ;
2022-12-17 10:02:37 +00:00
version = " 2 0 2 2 . 1 1 . 1 " ;
2020-04-24 23:36:52 +00:00
src = fetchFromGitHub {
2022-12-17 10:02:37 +00:00
owner = " c l o u d f l a r e " ;
repo = " c l o u d f l a r e d " ;
rev = version ;
hash = " s h a 2 5 6 - a G 6 3 C E J f E L 9 r 0 S v i Z u 9 V z A r t t 3 e 4 V u A b O M a Y k 9 a t S G o = " ;
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 m a i n . V e r s i o n = ${ version } " " - X g i t h u b . c o m / c l o u d f l a r e / c l o u d f l a r e d / c m d / c l o u d f l a r e d / u p d a t e r . B u i l t F o r P a c k a g e M a n a g e r = n i x p k g s " ] ;
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
2022-12-17 10:02:37 +00:00
export HOME = " $ ( m k t e m p - d ) "
2022-04-15 01:41:22 +00:00
# Workaround for: protocol_test.go:11:
# lookup protocol-v2.argotunnel.com on [::1]:53: read udp [::1]:51876->[::1]:53: read: connection refused
substituteInPlace " e d g e d i s c o v e r y / p r o t o c o l _ t e s t . g o " \
- - replace " T e s t P r o t o c o l P e r c e n t a g e " " S k i p P r o t o c o l P e r c e n t a g e "
2022-12-17 10:02:37 +00:00
# Workaround for: origin_icmp_proxy_test.go:46:
# cannot create ICMPv4 proxy: socket: permission denied nor ICMPv6 proxy: socket: permission denied
substituteInPlace " i n g r e s s / o r i g i n _ i c m p _ p r o x y _ t e s t . g o " \
- - replace " T e s t I C M P R o u t e r E c h o " " S k i p I C M P R o u t e r E c h o "
# Workaround for: origin_icmp_proxy_test.go:110:
# cannot create ICMPv4 proxy: socket: permission denied nor ICMPv6 proxy: socket: permission denied
substituteInPlace " i n g r e s s / o r i g i n _ i c m p _ p r o x y _ t e s t . g o " \
- - replace " T e s t C o n c u r r e n t R e q u e s t s T o S a m e D s t " " S k i p C o n c u r r e n t R e q u e s t s T o S a m e D s t "
# Workaround for: origin_icmp_proxy_test.go:242:
# cannot create ICMPv4 proxy: socket: permission denied nor ICMPv6 proxy: socket: permission denied
substituteInPlace " i n g r e s s / o r i g i n _ i c m p _ p r o x y _ t e s t . g o " \
- - replace " T e s t I C M P R o u t e r R e j e c t N o t E c h o " " S k i p I C M P R o u t e r R e j e c t N o t E c h o "
# Workaround for: origin_icmp_proxy_test.go:108:
# Received unexpected error: cannot create ICMPv4 proxy: Group ID 100 is not between ping group 65534 to 65534 nor ICMPv6 proxy: socket: permission denied
substituteInPlace " i n g r e s s / o r i g i n _ i c m p _ p r o x y _ t e s t . g o " \
- - replace " T e s t T r a c e I C M P R o u t e r E c h o " " S k i p T r a c e I C M P R o u t e r E c h o "
# Workaround for: icmp_posix_test.go:28: socket: permission denied
substituteInPlace " i n g r e s s / i c m p _ p o s i x _ t e s t . g o " \
- - replace " T e s t F u n n e l I d l e T i m e o u t " " S k i p F u n n e l I d l e T i m e o u t "
# Workaround for: icmp_posix_test.go:88: Received unexpected error: Group ID 100 is not between ping group 65534 to 65534
substituteInPlace " i n g r e s s / i c m p _ p o s i x _ t e s t . g o " \
- - replace " T e s t R e u s e F u n n e l " " S k i p R e u s e F u n n e l "
# Workaround for: supervisor_test.go:49:
# Expected nil, but got: Could not lookup srv records on _us-v2-origintunneld._tcp.argotunnel.com: lookup _us-v2-origintunneld._tcp.argotunnel.com on [::1]:53: read udp [::1]:49342->[::1]:53: read: connection refused
substituteInPlace " s u p e r v i s o r / s u p e r v i s o r _ t e s t . g o " \
- - replace " T e s t _ I n i t i a l i z e _ S a m e _ P r o t o c o l " " S k i p _ I n i t i a l i z e _ S a m e _ P r o t o c o l "
2022-04-15 01:41:22 +00:00
'' ;
doCheck = ! stdenv . isDarwin ;
2022-12-17 10:02:37 +00:00
passthru . tests . simple = callPackage ./tests.nix { inherit version ; } ;
2021-01-15 22:18:51 +00:00
meta = with lib ; {
2022-12-17 10:02:37 +00:00
description = " C l o u d f l a r e T u n n e l d a e m o n , C l o u d f l a r e A c c e s s t o o l k i t , a n d D N S - o v e r - H T T P S c l i e n t " ;
homepage = " h t t p s : / / w w w . c l o u d f l a r e . c o m / p r o d u c t s / t u n n e l " ;
license = licenses . asl20 ;
platforms = platforms . unix ++ platforms . windows ;
maintainers = with maintainers ; [ bbigras enorris thoughtpolice piperswe ] ;
2020-04-24 23:36:52 +00:00
} ;
}