From b288c05cb7c28cd89743bb2a440d09c5f9202ff0 Mon Sep 17 00:00:00 2001 From: Hanketsu Date: Sat, 1 Feb 2025 00:34:49 +0100 Subject: battering: Add go-github-com-evilsocket-opensnitch-daemon. * battering/packages/opensnitch.scm (go-github-com-evilsocket-opensnitch-daemon): New variable. --- battering/packages/opensnitch.scm | 61 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/battering/packages/opensnitch.scm b/battering/packages/opensnitch.scm index f607d14..97744fe 100644 --- a/battering/packages/opensnitch.scm +++ b/battering/packages/opensnitch.scm @@ -137,3 +137,64 @@ (description "This package provides an additional module that allows Opensnitch to monitor traffic via eBPF rules.") (license license:gpl3+))) + +(define-public go-github-com-evilsocket-opensnitch-daemon + (package + (name "go-github-com-evilsocket-opensnitch-daemon") + (version "1.6.7") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/evilsocket/opensnitch/") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0990hdc3vn50axyz21v11gwkc2svlwf9wlnf03lwxgnm2q4ha76q")))) + (build-system go-build-system) + (arguments + (list + #:go go-1.23 + #:import-path "github.com/evilsocket/opensnitch/daemon" + #:unpack-path "github.com/evilsocket/opensnitch" + #:tests? #f + #:phases #~(modify-phases %standard-phases + (add-before 'build 'make-proto-definitions + (lambda* (#:key unpack-path #:allow-other-keys) + (with-directory-excursion (format #f "src/~a/proto/" unpack-path) + (invoke "make" "../daemon/ui/protocol/ui.pb.go")))) + (add-before 'build 'replace-ebpf-path + (lambda* (#:key tests? import-path #:allow-other-keys) + (with-directory-excursion (format #f "src/~a/" import-path) + (substitute* "core/ebpf.go" + (("/usr") + #$opensnitch-ebpf-module) + (("modulesDir = .*$") + "modulesDir = \"\"\n"))))) + (add-before 'check 'delete-buggy-test-data + (lambda* (#:key tests? import-path #:allow-other-keys) + (when tests? + (delete-file + (string-append + "src/" import-path "/ui/testdata/default-config.json")))))))) + (inputs (list go-google-golang-org-grpc + go-golang-org-x-sys + go-golang-org-x-net + go-github-com-vishvananda-netns + go-github-com-vishvananda-netlink + go-github-com-varlink-go + go-github-com-iovisor-gobpf + go-github-com-google-uuid + go-github-com-google-nftables + go-github-com-google-gopacket + go-github-com-golang-protobuf + go-github-com-fsnotify-fsnotify + libnetfilter-queue + libnfnetlink + opensnitch-ebpf-module)) + (native-inputs (list protobuf protoc-gen-go + go-google-golang-org-grpc-cmd-protoc-gen-go-grpc + pkg-config)) + (home-page "https://github.com/evilsocket/opensnitch") + (synopsis "GNU/Linux application firewall.") + (description "OpenSnitch is an interactive GNU/Linux application firewall inspired by Little Snitch.") + (license license:gpl3))) -- cgit v1.2.3