From: Sergey Matveev <stargrave@stargrave.org> Date: Thu, 18 Apr 2024 10:28:38 +0000 (+0300) Subject: Unify redirection operator usage X-Git-Tag: v0.5.0~1 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=457df95b08ca88100d31b7108124d459b82eb7ac;p=tofuproxy.git Unify redirection operator usage --- diff --git a/VERSION.do b/VERSION.do index 90ff3e2..9197a49 100644 --- a/VERSION.do +++ b/VERSION.do @@ -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/doc/certs.texi b/doc/certs.texi index 9d66fa1..5fcf60f 100644 --- a/doc/certs.texi +++ b/doc/certs.texi @@ -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 diff --git a/doc/install.texi b/doc/install.texi index 9d7dff7..2bd9135 100644 --- a/doc/install.texi +++ b/doc/install.texi @@ -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 diff --git a/doc/integrity.texi b/doc/integrity.texi index 04571a7..f44863a 100644 --- a/doc/integrity.texi +++ b/doc/integrity.texi @@ -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 diff --git a/doc/restricted.texi b/doc/restricted.texi index 0774315..fdceca1 100644 --- a/doc/restricted.texi +++ b/doc/restricted.texi @@ -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 diff --git a/doc/spies.texi b/doc/spies.texi index 1b92372..5cb634b 100644 --- a/doc/spies.texi +++ b/doc/spies.texi @@ -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 [...] diff --git a/doc/tlsauth.texi b/doc/tlsauth.texi index 31ea224..ef8039f 100644 --- a/doc/tlsauth.texi +++ b/doc/tlsauth.texi @@ -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 diff --git a/doc/usage.texi b/doc/usage.texi index 57b0b3d..0ea417f 100644 --- a/doc/usage.texi +++ b/doc/usage.texi @@ -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. diff --git a/doc/warcs.texi b/doc/warcs.texi index 7408e91..757f344 100644 --- a/doc/warcs.texi +++ b/doc/warcs.texi @@ -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 diff --git a/fifos/multitail b/fifos/multitail index 05de2fd..d120450 100755 --- a/fifos/multitail +++ b/fifos/multitail @@ -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" diff --git a/makedist b/makedist index aae186e..398e89b 100755 --- 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 @@ -59,10 +59,10 @@ zstd -19 -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") diff --git a/state-init b/state-init index 53607c4..ca6468a 100755 --- a/state-init +++ b/state-init @@ -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