redo-ifchange version.go
-perl -ne 'print "$1\n" if /Version.*"(.*)"$/' < version.go
+perl -ne 'print "$1\n" if /Version.*"(.*)"$/' <version.go
#!/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
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
@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}
$ [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
@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
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
(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
[...]
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
@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.
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
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
@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.
@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
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"
########################################################################
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
texi=$(mktemp)
-cat > $texi <<EOF
+cat >$texi <<EOF
\input texinfo
@documentencoding UTF-8
@settitle INSTALL
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")
@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
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)
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, " <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, " <a href=\"%s\">[2]</a>", u2)
+ }
+ fmt.Fprintf(&buf, "(<tt>%s</tt>)<br/>\n", cols[0])
}
continue
}
[ -s cert.pem ] || {
prev=`umask`
umask 077
- "$root"/cmd/certgen/certgen > cert.pem
+ "$root"/cmd/certgen/certgen >cert.pem
umask $prev
}
mkdir -p fifos
package tofuproxy
-const Version = "0.4.0"
+const Version = "0.6.0"