]> Sergey Matveev's repositories - tofuproxy.git/commitdiff
No need to hardcode UnZSTDPath during compilation
authorSergey Matveev <stargrave@stargrave.org>
Mon, 20 Mar 2023 09:59:15 +0000 (12:59 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 20 Mar 2023 14:12:10 +0000 (17:12 +0300)
cmd/tofuproxy/main.go
cmd/warc-extract/main.go

index babc8b7e34c34f3cfbe76d7ad9601e4d4edce9d6..ddfa4771d74b910cd82e38855300311b866a7f3c 100644 (file)
@@ -29,6 +29,7 @@ import (
        "go.stargrave.org/tofuproxy/fifos"
        "go.stargrave.org/tofuproxy/rounds"
        ttls "go.stargrave.org/tofuproxy/tls"
+       "go.stargrave.org/tofuproxy/warc"
 )
 
 func main() {
@@ -42,6 +43,7 @@ func main() {
        fifosDir := flag.String("fifos", "fifos", "Directory with FIFOs")
        notai := flag.Bool("notai", false, "Do not prepend TAI64N to logs")
        warcOnly := flag.Bool("warc-only", false, "Server only WARC URIs")
+       unzstdPath := flag.String("unzstd", "cmd/zstd/unzstd", "Path to unzstd utility")
        flag.Parse()
        log.SetFlags(log.Lshortfile)
 
@@ -64,6 +66,7 @@ func main() {
        tofuproxy.CAPrv = caPrv
        tofuproxy.X509Algo = *ai
        rounds.WARCOnly = *warcOnly
+       warc.UnZSTDPath = *unzstdPath
 
        ln, err := net.Listen("tcp", *bind)
        if err != nil {
index 7389e069d29d0027d513a62cd955ab5635cec790..d207273e2ee95f8d349ae3ae16607ce2bcf09c07 100644 (file)
@@ -36,8 +36,10 @@ func main() {
        hdr := flag.Bool("hdr", false, "Also extract WARC's header")
        idx := flag.Bool("idx", false, "Save WARC indices")
        recompress := flag.Bool("for-enzstd", false, "Output for enzstd utility")
+       unzstdPath := flag.String("unzstd", "cmd/zstd/unzstd", "Path to unzstd utility")
        flag.Parse()
        log.SetFlags(log.Lshortfile)
+       warc.UnZSTDPath = *unzstdPath
 
        if *recompress {
                var hdr bytes.Buffer