2023-03-04 12:14:45 +00:00
{ lib
, stdenv
, buildGoModule
, fetchFromGitHub
, 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 " ;
2023-08-04 22:07:22 +00:00
version = " 2 0 2 3 . 7 . 3 " ;
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 " ;
2023-03-04 12:14:45 +00:00
rev = " r e f s / t a g s / ${ version } " ;
2023-08-04 22:07:22 +00:00
hash = " s h a 2 5 6 - S v 6 f 1 2 X X V H I i 9 7 O w s 1 h s q A e b 4 z + Z t V M 5 B 0 v 0 X z / b 5 i Y = " ;
2020-04-24 23:36:52 +00:00
} ;
2023-04-29 16:46:19 +00:00
vendorHash = null ;
2020-04-24 23:36:52 +00:00
2023-03-04 12:14:45 +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 "
2023-02-16 17:41:37 +00:00
# Workaround for: manager_test.go:197:
# Should be false
substituteInPlace " d a t a g r a m s e s s i o n / m a n a g e r _ t e s t . g o " \
- - replace " T e s t M a n a g e r C t x D o n e C l o s e S e s s i o n s " " S k i p M a n a g e r C t x D o n e C l o s e S e s s i o n s "
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 " ;
2023-03-04 12:14:45 +00:00
changelog = " h t t p s : / / 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 / r e l e a s e s / t a g / ${ version } " ;
2022-12-17 10:02:37 +00:00
license = licenses . asl20 ;
platforms = platforms . unix ++ platforms . windows ;
maintainers = with maintainers ; [ bbigras enorris thoughtpolice piperswe ] ;
2023-08-04 22:07:22 +00:00
mainProgram = " c l o u d f l a r e d " ;
2020-04-24 23:36:52 +00:00
} ;
}