|
|
|
;; SPDX-FileCopyrightText: 2022-2023 Hilton Chain <hako@ultrarare.space>
|
|
|
|
;;
|
|
|
|
;; SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
(define-module (rosenthal packages networking)
|
|
|
|
#:use-module ((guix licenses) #:prefix license:)
|
|
|
|
#:use-module (guix build-system go)
|
|
|
|
#:use-module (guix gexp)
|
|
|
|
#:use-module (guix git-download)
|
|
|
|
#:use-module (guix packages)
|
|
|
|
#:use-module (guix utils)
|
|
|
|
#:use-module (gnu packages admin)
|
|
|
|
#:use-module (gnu packages golang))
|
|
|
|
|
|
|
|
(define-public cloudflared
|
|
|
|
(package
|
|
|
|
(name "cloudflared")
|
|
|
|
(version "2023.7.3")
|
|
|
|
(source (origin
|
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
|
|
|
(url "https://github.com/cloudflare/cloudflared")
|
|
|
|
(commit version)))
|
|
|
|
(file-name (git-file-name name version))
|
|
|
|
;; TODO: Unbundle vendored dependencies.
|
|
|
|
;; (modules '((guix build utils)))
|
|
|
|
;; (snippet '(delete-file-recursively "vendor"))
|
|
|
|
(sha256
|
|
|
|
(base32
|
|
|
|
"09p6vczmzx2b0wwm7dcr7zirn1x8dicb7c5kywi74m6pcpbrzzja"))))
|
|
|
|
(build-system go-build-system)
|
|
|
|
(arguments
|
|
|
|
(list #:go go-1.19
|
|
|
|
#:install-source? #f
|
|
|
|
#:import-path "github.com/cloudflare/cloudflared/cmd/cloudflared"
|
|
|
|
#:unpack-path "github.com/cloudflare/cloudflared"
|
|
|
|
#:build-flags
|
|
|
|
#~(list (string-append
|
|
|
|
"-ldflags="
|
|
|
|
" -X main.Version=" #$version
|
|
|
|
" -X github.com/cloudflare/cloudflared/cmd/cloudflared/updater.BuiltForPackageManager=Guix"))
|
|
|
|
#:phases
|
|
|
|
#~(modify-phases %standard-phases
|
|
|
|
(add-before 'build 'disable-cgo
|
|
|
|
(lambda _
|
|
|
|
(setenv "CGO_ENABLED" "0")))
|
|
|
|
(add-after 'install 'install-documentation
|
|
|
|
(lambda _
|
|
|
|
(let ((src "src/github.com/cloudflare/cloudflared/cloudflared_man_template")
|
|
|
|
(dst (string-append #$output "/share/man/man1/cloudflared.1")))
|
|
|
|
(substitute* src
|
|
|
|
(("\\$\\{VERSION\\}") #$version))
|
|
|
|
(mkdir-p (dirname dst))
|
|
|
|
(copy-file src dst)))))))
|
|
|
|
(home-page "https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/")
|
|
|
|
(synopsis "Cloudflare Tunnel client")
|
|
|
|
(description
|
|
|
|
"This package provides the command-line client for Cloudflare Tunnel, a
|
|
|
|
tunneling daemon that proxies traffic from the Cloudflare network to your
|
|
|
|
origins. This daemon sits between Cloudflare network and your origin (e.g. a
|
|
|
|
webserver). Cloudflare attracts client requests and sends them to you via
|
|
|
|
this daemon, without requiring you to poke holes on your firewall --- your
|
|
|
|
origin can remain as closed as possible.")
|
|
|
|
(license license:asl2.0)))
|