summaryrefslogtreecommitdiff
path: root/gnu/packages/networking.scm
diff options
context:
space:
mode:
authorGrigory Shepelev <mail@grigory.tech>2026-06-09 13:47:55 +0300
committerSharlatan Hellseher <sharlatanus@gmail.com>2026-06-24 20:31:49 +0100
commit4ff634fb8f5caf49c6f011fe09e6e4cd3198968d (patch)
tree6ac27ed1d94e52fb949d5bddf2d39312f7edf2d4 /gnu/packages/networking.scm
parent2114a3355448d55f5803b63f4043abd3fff86417 (diff)
gnu: zapret2: Fix runtime dependencies and control-script paths.
The init.d/sysv/zapret2 control script could not find its "functions" library (sourced relative to bin/ rather than libexec/zapret2):, defaulted ZAPRET_CONFIG to a read-only store path instead of /etc/zapret2/config, and the scripts call sed/grep/awk and coreutils that were absent from PATH at runtime (e.g. under shepherd). * gnu/packages/networking.scm (zapret2)[arguments]<#:phases>: Add 'fix-zapret2-script phase setting ZAPRET_BASE, ZAPRET_CONFIG and the functions source path in the control script. In 'wrap-scripts, add sed/grep/awk and coreutils to PATH for both scripts. [inputs]: Add coreutils, gawk, grep and sed. Merges: guix/guix!9191 Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Diffstat (limited to 'gnu/packages/networking.scm')
-rw-r--r--gnu/packages/networking.scm35
1 files changed, 27 insertions, 8 deletions
diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index 6ef01d1c175..f3bec1efddb 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -5652,6 +5652,15 @@ WireGuard peer, and exposes a SOCKS5/HTTP proxy or tunnels on the machine.")
5652 (("^MDIG=.*") 5652 (("^MDIG=.*")
5653 (string-append "MDIG=" 5653 (string-append "MDIG="
5654 #$output "/libexec/zapret2/nfq2/mdig\n"))))) 5654 #$output "/libexec/zapret2/nfq2/mdig\n")))))
5655 (add-after 'fix-blockcheck-file 'fix-zapret2-script
5656 (lambda _
5657 (substitute* "init.d/sysv/zapret2"
5658 (("^ZAPRET_BASE=.*")
5659 (string-append "ZAPRET_BASE="
5660 #$output "/libexec/zapret2\n"
5661 "ZAPRET_CONFIG=/etc/zapret2/config\n"))
5662 (("\\$EXEDIR/functions")
5663 (string-append #$output "/libexec/zapret2/functions")))))
5655 (replace 'install 5664 (replace 'install
5656 (lambda _ 5665 (lambda _
5657 (let ((bin (string-append #$output "/bin")) 5666 (let ((bin (string-append #$output "/bin"))
@@ -5670,19 +5679,28 @@ WireGuard peer, and exposes a SOCKS5/HTTP proxy or tunnels on the machine.")
5670 (string-append bin "/zapret2-blockcheck"))))) 5679 (string-append bin "/zapret2-blockcheck")))))
5671 (add-after 'install 'wrap-scripts 5680 (add-after 'install 'wrap-scripts
5672 (lambda* (#:key inputs #:allow-other-keys) 5681 (lambda* (#:key inputs #:allow-other-keys)
5673 (wrap-program (string-append #$output "/bin/zapret2") 5682 ;; Tools expected at runtime.
5674 `("PATH" ":" prefix 5683 (let* ((dir (lambda (f) (dirname (search-input-file inputs f))))
5675 (,(dirname (search-input-file inputs "/sbin/nft"))))) 5684 (utils (list (dir "/bin/sed")
5676 (wrap-program (string-append #$output "/bin/zapret2-blockcheck") 5685 (dir "/bin/grep")
5677 `("PATH" ":" prefix 5686 (dir "/bin/awk")
5678 (,(dirname (search-input-file inputs "/bin/curl")) 5687 (dir "/bin/cut")
5679 ,(dirname (search-input-file inputs "/sbin/nft")) 5688 (dir "/sbin/nft"))))
5680 ,(dirname (search-input-file inputs "/bin/nslookup")))))))))) 5689 (wrap-program (string-append #$output "/bin/zapret2")
5690 `("PATH" ":" prefix ,utils))
5691 (wrap-program (string-append #$output "/bin/zapret2-blockcheck")
5692 `("PATH" ":" prefix
5693 (,(dir "/bin/curl")
5694 ,(dir "/bin/nslookup")
5695 ,@utils)))))))))
5681 (native-inputs 5696 (native-inputs
5682 (list pkg-config)) 5697 (list pkg-config))
5683 (inputs 5698 (inputs
5684 (list bash-minimal 5699 (list bash-minimal
5700 coreutils
5685 curl 5701 curl
5702 gawk
5703 grep
5686 `(,isc-bind "utils") 5704 `(,isc-bind "utils")
5687 libcap 5705 libcap
5688 libmnl 5706 libmnl
@@ -5690,6 +5708,7 @@ WireGuard peer, and exposes a SOCKS5/HTTP proxy or tunnels on the machine.")
5690 libnfnetlink 5708 libnfnetlink
5691 luajit 5709 luajit
5692 nftables 5710 nftables
5711 sed
5693 zlib)) 5712 zlib))
5694 (home-page "https://github.com/bol-van/zapret2") 5713 (home-page "https://github.com/bol-van/zapret2")
5695 (synopsis "DPI bypass platform configured in Lua") 5714 (synopsis "DPI bypass platform configured in Lua")