]> Sergey Matveev's repositories - tofuproxy.git/commitdiff
Download link for 0.6.0 release master
authorSergey Matveev <stargrave@stargrave.org>
Sun, 21 Apr 2024 13:09:28 +0000 (16:09 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 21 Apr 2024 13:09:28 +0000 (16:09 +0300)
16 files changed:
VERSION.do
build
doc/certs.texi
doc/download.texi
doc/install.texi
doc/integrity.texi
doc/restricted.texi
doc/spies.texi
doc/tlsauth.texi
doc/usage.texi
doc/warcs.texi
fifos/multitail
makedist
rounds/gemini.go
state-init
version.go

index 90ff3e2d59915bbb1213c245858d5b332c1a95f2..9197a49b0f244d794fcab1277e73b58371133360 100644 (file)
@@ -1,2 +1,2 @@
 redo-ifchange version.go
-perl -ne 'print "$1\n" if /Version.*"(.*)"$/' < version.go
+perl -ne 'print "$1\n" if /Version.*"(.*)"$/' <version.go
diff --git a/build b/build
index d895a717e81d95efe522f479030d5b31bfabb168..b85960f3b26f683302e74391d0c4f126b3cf52ad 100755 (executable)
--- a/build
+++ b/build
@@ -1,7 +1,7 @@
 #!/bin/sh -e
 
 GO_FLAGS="${GO_FLAGS:--ldflags=-s}"
-GO_FLAGS="$GO_FLAGS -mod=vendor"
+[ ! -d vendor ] || GO_FLAGS="$GO_FLAGS -mod=vendor"
 ${GO:-go} build -o cmd/certgen/certgen $GO_FLAGS cmd/certgen/main.go
 ${GO:-go} build -o cmd/tofuproxy/tofuproxy $GO_FLAGS cmd/tofuproxy/main.go
 ${GO:-go} build -o cmd/warc-extract/warc-extract $GO_FLAGS cmd/warc-extract/main.go
index 9d66fa134c1a9dee1585a6193b72ae1bb8efeb44..5fcf60f9723bc1b8606357954ccb2be5c534909a 100644 (file)
@@ -30,5 +30,5 @@ $ cat fifos/list-@{accepted,rejected,http-auth,tls-auth@}
 To remove knowledge of the host from any of the states mentioned above:
 
 @example
-$ echo www.example.com > fifos/del-tls-auth
+$ echo www.example.com >fifos/del-tls-auth
 @end example
index cb3c2d65ba9207f5b312dff378706346c9dfcdd8..64845135f9d53b393c295628d611384cf6ee80b2 100644 (file)
@@ -1,17 +1,29 @@
 @multitable {XXXXX} {XXXX-XX-XX} {XXXX KiB} {meta4 tar pgp ssh}
 @headitem Version @tab Date @tab Size @tab Tarball
 
+@item 0.6.0 @tab 2024-04-21 @tab 651 KiB @tab
+    @url{download/tofuproxy-0.6.0.tar.zst.meta4, meta4}
+    @url{download/tofuproxy-0.6.0.tar.zst, tar}
+    @url{download/tofuproxy-0.6.0.tar.zst.asc, pgp}
+    @url{download/tofuproxy-0.6.0.tar.zst.sig, ssh}
+
+@item 0.5.0 @tab 2024-04-18 @tab 651 KiB @tab
+    @url{download/tofuproxy-0.5.0.tar.zst.meta4, meta4}
+    @url{download/tofuproxy-0.5.0.tar.zst, tar}
+    @url{download/tofuproxy-0.5.0.tar.zst.asc, pgp}
+    @url{download/tofuproxy-0.5.0.tar.zst.sig, ssh}
+
 @item 0.4.0 @tab 2023-08-12 @tab 673 KiB @tab
     @url{download/tofuproxy-0.4.0.tar.zst.meta4, meta4}
     @url{download/tofuproxy-0.4.0.tar.zst, tar}
     @url{download/tofuproxy-0.4.0.tar.zst.asc, pgp}
-    @url{download/tofuproxy-0.4.0.tar.zst.asc, ssh}
+    @url{download/tofuproxy-0.4.0.tar.zst.sig, ssh}
 
 @item 0.3.0 @tab 2023-08-11 @tab 672 KiB @tab
     @url{download/tofuproxy-0.3.0.tar.zst.meta4, meta4}
     @url{download/tofuproxy-0.3.0.tar.zst, tar}
     @url{download/tofuproxy-0.3.0.tar.zst.asc, pgp}
-    @url{download/tofuproxy-0.3.0.tar.zst.asc, ssh}
+    @url{download/tofuproxy-0.3.0.tar.zst.sig, ssh}
 
 @item 0.1.0 @tab 2023-03-20 @tab 672 KiB @tab
     @url{download/tofuproxy-0.1.0.tar.zst.meta4, meta4}
index 9d7dff718f256e5a4c57794ee933e7be3144c22e..2bd9135d95c0ffd423b14debf5b4c6ac004e065d 100644 (file)
@@ -10,7 +10,7 @@ WARCs support.
 $ [fetch|wget] http://www.tofuproxy.stargrave.org/download/tofuproxy-@value{VERSION}.tar.zst
 $ [fetch|wget] http://www.tofuproxy.stargrave.org/download/tofuproxy-@value{VERSION}.tar.zst.@{asc,sig@}
 [verify signature]
-$ zstd -d < tofuproxy-@value{VERSION}.tar.zst | tar xf -
+$ tar xf tofuproxy-@value{VERSION}.tar.zst
 $ cd tofuproxy-@value{VERSION}
 $ ./build
 @end example
index 04571a7011bc28defc643ff27935391e9d38bdb8..f44863afd124f7420b9d870dad909b2ea2c801d7 100644 (file)
@@ -28,7 +28,7 @@ $ gpg --auto-key-locate  wkd --locate-keys tofuproxy at stargrave dot org
 
 @example
 $ ssh-keygen -Y verify -f PUBKEY-SSH.pub -I tofuproxy@@cypherpunks.ru -n file \
-    -s tofuproxy-@value{VERSION}.tar.zst.sig < tofuproxy-@value{VERSION}.tar.zst
+    -s tofuproxy-@value{VERSION}.tar.zst.sig <tofuproxy-@value{VERSION}.tar.zst
 @end example
 
 @end table
index 0774315a1ed822a4ff67b7d5ae4e3810f05e2b44..fdceca198bdb8fdca5b0226f831c42109463f119 100644 (file)
@@ -7,7 +7,7 @@ CA. For example you want to limit CA with SPKI's SHA256 hash of
 to domains only in @code{stargrave.org} tree:
 
 @example
-$ tee fifos/add-restricted < contrib/restricted.txt
+$ tee fifos/add-restricted <contrib/restricted.txt
 9215d9eeddeb403b0ffebb228cfc13104da825117d3640a0dfbfc0c08a012124 stargrave.org
 [...]
 @end example
index 1b9237261c69c71c431d3136064d0e6c8aeace98..5cb634b28141a8582a0b08657608bd2c4ca2770a 100644 (file)
@@ -5,7 +5,7 @@ You can reject requests to the whole domains. As a rule some spying ones
 (for advertisements and better user experience, they say).
 
 @example
-$ tee fifos/add-spies < contrib/spies.txt
+$ tee fifos/add-spies <contrib/spies.txt
 ads.google.com
 advertising.yandex.ru
 [...]
index 31ea224484c63ee6ae5dc1dab032f4b4eabe7944..ef8039fac6f1b42f1c3f2c2f18867ccb1346f4b4 100644 (file)
@@ -18,11 +18,11 @@ gemini.example.com  NONE
 To delete one of them:
 
 @example
-$ echo example.com > fifos/del-tls-auth
+$ echo example.com >fifos/del-tls-auth
 @end example
 
 To preadd:
 
 @example
-$ echo example.com path/to/client.cert.pem > fifos/add-tls-auth
+$ echo example.com path/to/client.cert.pem >fifos/add-tls-auth
 @end example
index 57b0b3d50cf6feec2a15295902204d7d2372261e..0ea417fa83162193d4f2d53856463acedb4b623e 100644 (file)
@@ -34,7 +34,7 @@ main.go:70: listening: [::1]:8080 dns: [::1]:53 certs: ./certs ccerts: ./ccerts
 @item Trust your newly generated CA:
 
 @example
-# cat cert.pem >> /etc/ssl/cert.pem
+# cat cert.pem >>/etc/ssl/cert.pem
 @end example
 
 @item Point you HTTP/HTTPS clients to @code{http://localhost:8080} proxy.
index 7408e9137fd85c8141717d5290c9ed454364627b..757f344c82c255fbaa0ac418248af254484b3364 100644 (file)
@@ -38,7 +38,7 @@ opened).
 Load WARCs:
 
 @example
-$ tee fifos/add-warcs < warcs.txt
+$ tee fifos/add-warcs <warcs.txt
 smth.warc-00000.warc.gz
 smth.warc-00001.warc.gz
 smth.warc-00002.warc.gz
@@ -64,7 +64,7 @@ smth.warc-00000.warc.gz 154
 smth.warc-00001.warc.gz 13
 smth.warc-00002.warc.gz 0
 another.warc 123
-$ echo another.warc > fifos/del-warcs
+$ echo another.warc >fifos/del-warcs
 @end example
 
 One possibility that @file{smth.warc-00002.warc.gz} has no URIs is that
@@ -73,7 +73,7 @@ it contains continuation segmented records.
 @end itemize
 
 Loading of WARC involves its whole reading and remembering where is each
-URI response is located. You can @code{echo SAVE > fifos/add-warcs} to
+URI response is located. You can @code{echo SAVE >fifos/add-warcs} to
 save in-memory index to the disk as @file{....idx.gob} files. During
 the next load, if those files exists, they are used as index immediately,
 without expensive WARC parsing.
@@ -100,7 +100,7 @@ and much higher decompression speed, than @file{.warc.gz}.
 
 @example
 $ cmd/warc-extract/warc-extract -for-enzstd /path/to.warc.gz |
-    cmd/zstd/enzstd > /path/to.warc.zst
+    cmd/zstd/enzstd >/path/to.warc.zst
 @end example
 
 @url{https://www.gnu.org/software/wget/, GNU Wget} can be easily used to
index 05de2fd0af13323c1e4090050eb6a78272d82247..d12045048aa91785f7a0057fb49a95efbc874932 100755 (executable)
@@ -2,15 +2,15 @@
 
 exec multitail \
     -wh 10 \
-    -t "Trust" -ci magenta -l "while :; do tai64nlocal < log-cert ; done" \
-    -t "DANE" -ci yellow --label "DANE " -L "while :; do tai64nlocal < log-dane ; done" \
-    -t "Error" -ci red -L "while :; do tai64nlocal < log-err ; done" \
-    -t "HTTPAuth" -ci green --label "Auth " -L "while :; do tai64nlocal < log-http-auth ; done" \
-    -t "TLSAuth" -ci green --label "Auth " -l "while :; do tai64nlocal < log-tls-auth ; done" \
-    -t "Response non-OK" --label "< " -L "while :; do tai64nlocal < log-non-ok ; done" \
-    -t "Response OK" -ci green --label "< " -L "while :; do tai64nlocal < log-ok ; done" \
-    -t "Redirect " -ci cyan --label "R " -L "while :; do tai64nlocal < log-redir ; done" \
-    -t "Request" -ci blue --label "> " -L "while :; do tai64nlocal < log-req ; done" \
-    -t "TLS connection" -ci yellow --label "S " -L "while :; do tai64nlocal < log-tls ; done" \
-    -t "Various" -ci yellow -L "while :; do tai64nlocal < log-various ; done" \
-    -t "WARC" -ci green --label "W " -L "while :; do tai64nlocal < log-warc ; done"
+    -t "Trust" -ci magenta -l "while :; do tai64nlocal <log-cert ; done" \
+    -t "DANE" -ci yellow --label "DANE " -L "while :; do tai64nlocal <log-dane ; done" \
+    -t "Error" -ci red -L "while :; do tai64nlocal <log-err ; done" \
+    -t "HTTPAuth" -ci green --label "Auth " -L "while :; do tai64nlocal <log-http-auth ; done" \
+    -t "TLSAuth" -ci green --label "Auth " -l "while :; do tai64nlocal <log-tls-auth ; done" \
+    -t "Response non-OK" --label "< " -L "while :; do tai64nlocal <log-non-ok ; done" \
+    -t "Response OK" -ci green --label "< " -L "while :; do tai64nlocal <log-ok ; done" \
+    -t "Redirect " -ci cyan --label "R " -L "while :; do tai64nlocal <log-redir ; done" \
+    -t "Request" -ci blue --label "> " -L "while :; do tai64nlocal <log-req ; done" \
+    -t "TLS connection" -ci yellow --label "S " -L "while :; do tai64nlocal <log-tls ; done" \
+    -t "Various" -ci yellow -L "while :; do tai64nlocal <log-various ; done" \
+    -t "WARC" -ci green --label "W " -L "while :; do tai64nlocal <log-warc ; done"
index 23c5851dad3b687e5e34d391a6eb5616de458ecf..3df55082e9a917ccf73b31eb5bdb775688a16c55 100755 (executable)
--- a/makedist
+++ b/makedist
@@ -13,7 +13,7 @@ redo-ifchange VERSION
 
 ########################################################################
 cd doc
-cat > download.texi <<EOF
+cat >download.texi <<EOF
 You can obtain releases source code prepared tarballs on
 @url{http://www.tofuproxy.stargrave.org}.
 EOF
@@ -26,7 +26,7 @@ mkinfo() {
 
 texi=$(mktemp)
 
-cat > $texi <<EOF
+cat >$texi <<EOF
 \input texinfo
 @documentencoding UTF-8
 @settitle INSTALL
@@ -55,14 +55,14 @@ chmod +x build state-init fifos/ensure fifos/multitail cmd/zstd/build
 
 cd ..
 tar cvf tofuproxy-"$release".tar --uid=0 --gid=0 --numeric-owner tofuproxy-"$release"
-zstd -19 -v tofuproxy-"$release".tar
+zstd -22 --ultra -v tofuproxy-"$release".tar
 tarball=tofuproxy-"$release".tar.zst
 ssh-keygen -Y sign -f ~/.ssh/sign/tofuproxy@stargrave.org -n file $tarball
 gpg --armor --detach-sign --sign --local-user 3477D3292C775BF39DAA0E075921D596A332F844 "$tarball"
-meta4-create -fn "$tarball" -mtime "$tarball" \
+meta4ra-create -fn "$tarball" -mtime "$tarball" \
     -sig-pgp "$tarball".asc -sig-ssh "$tarball".sig \
     http://www.tofuproxy.stargrave.org/download/"$tarball" \
-    http://y.www.tofuproxy.stargrave.org/download/"$tarball" < "$tarball" > "$tarball".meta4
+    http://y.www.tofuproxy.stargrave.org/download/"$tarball" <"$tarball" >"$tarball".meta4
 
 size=$(( $(stat -f %z $tarball) / 1024 ))
 release_date=$(date "+%Y-%m-%d")
@@ -74,7 +74,7 @@ An entry for documentation:
     @url{download/$tarball.meta4, meta4}
     @url{download/$tarball, tar}
     @url{download/$tarball.asc, pgp}
-    @url{download/$tarball.asc, ssh}
+    @url{download/$tarball.sig, ssh}
 EOF
 
 mv $tmp/$tarball $tmp/"$tarball".asc $tmp/"$tarball".sig $tarball.meta4 $cur/doc/tofuproxy.html/download
index b87c18a19f69a78785e73f8a5bfa05cc9f251589..71da97f361bfe33526a696be30e00ac0b2177b62 100644 (file)
@@ -124,7 +124,7 @@ func RoundGemini(
                log.Printf("%s: can not read response: %+v\n", req.URL, err)
                return false, err
        }
-       cols := strings.SplitN(rawResp, " ", 2)
+       cols := strings.SplitN(strings.TrimRight(rawResp, "\r\n"), " ", 2)
        if len(cols) < 2 {
                err = fmt.Errorf("invalid response format: %s", rawResp)
                log.Printf("%s: %s\n", req.URL, err)
@@ -222,18 +222,27 @@ func RoundGemini(
                        if strings.HasPrefix(line, "=>") {
                                line = strings.TrimLeft(line[2:], " ")
                                cols = strings.Fields(line)
-                               u := geminifyURL(host, cols[0], paths...)
+                               u1 := geminifyURL(host, cols[0], paths...)
+                               u2 := geminifyURL(host, cols[0])
                                switch len(cols) {
                                case 1:
                                        fmt.Fprintf(
-                                               &buf, "<a href=\"%s\">%s</a><br/>\n",
-                                               u, html.EscapeString(cols[0]),
+                                               &buf, "<a href=\"%s\">%s</a>",
+                                               u1, html.EscapeString(cols[0]),
                                        )
+                                       if u1 != u2 {
+                                               fmt.Fprintf(&buf, "&nbsp;<a href=\"%s\">[2]</a>", u2)
+                                       }
+                                       fmt.Fprintf(&buf, "<br/>\n")
                                default:
                                        fmt.Fprintf(
-                                               &buf, "<a href=\"%s\">%s</a> (<tt>%s</tt>)<br/>\n",
-                                               u, html.EscapeString(strings.Join(cols[1:], " ")), cols[0],
+                                               &buf, "<a href=\"%s\">%s</a>",
+                                               u1, html.EscapeString(strings.Join(cols[1:], " ")),
                                        )
+                                       if u1 != u2 {
+                                               fmt.Fprintf(&buf, "&nbsp;<a href=\"%s\">[2]</a>", u2)
+                                       }
+                                       fmt.Fprintf(&buf, "(<tt>%s</tt>)<br/>\n", cols[0])
                                }
                                continue
                        }
index 53607c4e1dd122e75cabb6011ffa9e26fdd74a04..ca6468a779e09483815a2e1722bed7ca5933b516 100755 (executable)
@@ -4,7 +4,7 @@ root="$(dirname "$(realpath -- "$0")")"
 [ -s cert.pem ] || {
     prev=`umask`
     umask 077
-    "$root"/cmd/certgen/certgen > cert.pem
+    "$root"/cmd/certgen/certgen >cert.pem
     umask $prev
 }
 mkdir -p fifos
index 732fa0428e946848d530823f74e6b3b1d1af5c72..25e1f19e59b583ae8e84bf4c6bc238661eac3aa3 100644 (file)
@@ -1,3 +1,3 @@
 package tofuproxy
 
-const Version = "0.4.0"
+const Version = "0.6.0"