From 6ad7d0971f4d29ccb307b08e92aec06da4809342 Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Fri, 31 Mar 2023 12:48:25 +0000 Subject: [PATCH 01/21] Refactor http client --- .github/workflows/testing.yml | 2 +- README.md | 1 + cmd/wayback/serve.go | 4 +++ config/config_test.go | 61 +++++++++++++++++++++++++++++++++++ config/options.go | 7 ++++ config/parser.go | 2 ++ go.mod | 19 +++++++---- go.sum | 50 +++++++++++++++++----------- wayback.1 | 3 ++ wayback.go | 48 +++++++++++++++++++++++++-- 10 files changed, 168 insertions(+), 29 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 0fec1dca..02e9476f 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -44,7 +44,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - go: [ "1.18", "1.19", "1.20" ] + go: [ "1.20" ] include: # only update test coverage stats with the most recent go version on linux - go: 1.x diff --git a/README.md b/README.md index ac12cc59..3a6fdaae 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,7 @@ You can also specify configuration options either via command flags or via envir | - | `WAYBACK_LISTEN_ADDR` | `0.0.0.0:8964` | The listen address for the HTTP server | | - | `CHROME_BIN` | - | Preferred to sets the path to the Chrome executable | | - | `CHROME_REMOTE_ADDR` | - | Chrome/Chromium remote debugging address, for screenshot, format: `host:port`, `wss://domain.tld` | +| - | `WIREGUARD_CONFIG` | - | WireGuard proxy client config | | - | `WAYBACK_POOLING_SIZE` | `3` | Number of worker pool for wayback at once | | - | `WAYBACK_BOLT_PATH` | `./wayback.db` | File path of bolt database | | - | `WAYBACK_STORAGE_DIR` | - | Directory to store binary file, e.g. PDF, html file | diff --git a/cmd/wayback/serve.go b/cmd/wayback/serve.go index ab11da40..f48e2480 100644 --- a/cmd/wayback/serve.go +++ b/cmd/wayback/serve.go @@ -11,6 +11,7 @@ import ( "github.com/spf13/cobra" "github.com/wabarc/logger" + "github.com/wabarc/wayback" "github.com/wabarc/wayback/config" "github.com/wabarc/wayback/pooling" "github.com/wabarc/wayback/publish" @@ -42,6 +43,9 @@ func serve(_ *cobra.Command, opts *config.Options, _ []string) { pool := pooling.New(ctx, cfg...) go pool.Roll() + // Set global client + go wayback.NewClient(opts) + pub := publish.New(ctx, opts) go pub.Start() diff --git a/config/config_test.go b/config/config_test.go index 0d16a0c5..3ef73623 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -3070,3 +3070,64 @@ func TestEnableServices(t *testing.T) { }) } } + +func TestWireGuardConfig(t *testing.T) { + t.Parallel() + + var tests = []struct { + config string + expected string + }{ + { + config: "", + expected: defWireGuardConfig, + }, + { + config: "[Interface]\nPrivateKey = cHjrT4AVXJBkufpQxfWFKbLGeKAykzJ6SitAXRRZKmU=\nAddress = 10.0.0.2/32\n\n[Peer]\nPublicKey = qEfR4bOboFVaavdICJoSujBmdJ2LOvjDZItWBqDh8HM=\nEndpoint = example.com:51820\nAllowedIPs = 0.0.0.0/0, ::/0", + expected: `[Interface] +PrivateKey = cHjrT4AVXJBkufpQxfWFKbLGeKAykzJ6SitAXRRZKmU= +Address = 10.0.0.2/32 + +[Peer] +PublicKey = qEfR4bOboFVaavdICJoSujBmdJ2LOvjDZItWBqDh8HM= +Endpoint = example.com:51820 +AllowedIPs = 0.0.0.0/0, ::/0`, + }, + { + config: `[Interface] +PrivateKey = cHjrT4AVXJBkufpQxfWFKbLGeKAykzJ6SitAXRRZKmU= +Address = 10.0.0.2/32 + +[Peer] +PublicKey = qEfR4bOboFVaavdICJoSujBmdJ2LOvjDZItWBqDh8HM= +Endpoint = example.com:51820 +AllowedIPs = 0.0.0.0/0, ::/0`, + expected: `[Interface] +PrivateKey = cHjrT4AVXJBkufpQxfWFKbLGeKAykzJ6SitAXRRZKmU= +Address = 10.0.0.2/32 + +[Peer] +PublicKey = qEfR4bOboFVaavdICJoSujBmdJ2LOvjDZItWBqDh8HM= +Endpoint = example.com:51820 +AllowedIPs = 0.0.0.0/0, ::/0`, + }, + } + + for i, test := range tests { + t.Run(strconv.Itoa(i), func(t *testing.T) { + os.Clearenv() + os.Setenv("WIREGUARD_CONFIG", test.config) + + parser := NewParser() + opts, err := parser.ParseEnvironmentVariables() + if err != nil { + t.Fatalf(`Parsing environment variables failed: %v`, err) + } + + got := opts.WireGuardConfig() + if got != test.expected { + t.Fatalf(`Unexpected get WireGuard config, got %s instead of %s`, got, test.expected) + } + }) + } +} diff --git a/config/options.go b/config/options.go index 3aa304d6..729f0858 100644 --- a/config/options.go +++ b/config/options.go @@ -92,6 +92,7 @@ const ( defWaybackMaxRetries = 2 defWaybackUserAgent = "WaybackArchiver/1.0" defWaybackFallback = false + defWireGuardConfig = "" defWaybackMeiliEndpoint = "" defWaybackMeiliIndexing = "capsules" @@ -143,6 +144,7 @@ type Options struct { poolingSize int storageDir string maxMediaSize string + wireguardConfig string waybackTimeout int waybackMaxRetries int waybackUserAgent string @@ -910,3 +912,8 @@ func (o *Options) EnabledMeilisearch() bool { func (o *Options) HTTPdEnabled() bool { return o.isEnabled(ServiceHTTPd) } + +// WireGuardConfig returns the WireGuard configuration. +func (o *Options) WireGuardConfig() string { + return breakLine(o.wireguardConfig) +} diff --git a/config/parser.go b/config/parser.go index 1e07c766..d73bb897 100644 --- a/config/parser.go +++ b/config/parser.go @@ -93,6 +93,8 @@ func (p *Parser) parseLines(lines []string) (err error) { case "CHROME_REMOTE_ADDR": p.opts.enabledChromeRemote = hasValue(val, defEnabledChromeRemote) p.opts.chromeRemoteAddr = parseString(val, defChromeRemoteAddr) + case "WIREGUARD_CONFIG": + p.opts.wireguardConfig = parseString(val, defWireGuardConfig) case "WAYBACK_IPFS_HOST": p.opts.ipfs.host = parseString(val, defIPFSHost) case "WAYBACK_IPFS_PORT": diff --git a/go.mod b/go.mod index e14238da..297c6df2 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/wabarc/wayback -// +heroku goVersion go1.19 +// +heroku goVersion go1.20 -go 1.18 +go 1.20 require ( github.com/PuerkitoBio/goquery v1.8.1 @@ -34,7 +34,7 @@ require ( github.com/slack-go/slack v0.11.2 github.com/spf13/cobra v1.6.1 github.com/thoj/go-ircevent v0.0.0-20190807115034-8e7ce4b5a1eb - github.com/wabarc/archive.is v1.3.0 + github.com/wabarc/archive.is v1.3.1-0.20230411045956-7bc7ff721b7d github.com/wabarc/archive.org v1.2.1-0.20210708220121-cb9b83ff9896 github.com/wabarc/go-anonfile v0.1.0 github.com/wabarc/go-catbox v0.1.0 @@ -42,7 +42,8 @@ require ( github.com/wabarc/imgbb v1.0.0 github.com/wabarc/ipfs-pinner v1.1.1-0.20220126131044-16299c0dd43d github.com/wabarc/logger v0.0.0-20210730133522-86bd3f31e792 - github.com/wabarc/playback v0.0.0-20220715111526-90d0327d3f04 + github.com/wabarc/playback v0.0.0-20230331122619-84484ab4d599 + github.com/wabarc/proxier v0.0.0-20230331160507-4294c0d4f82c github.com/wabarc/rivet v0.1.4-0.20221226142645-ebc8a29d914f github.com/wabarc/screenshot v1.6.1-0.20230315004517-7587f8bc14e0 github.com/wabarc/telegra.ph v0.0.0-20230318134541-a0922e1ace3a @@ -83,6 +84,7 @@ require ( github.com/dop251/goja v0.0.0-20221115122301-6c0d9883792e // indirect github.com/fatih/color v1.15.0 // indirect github.com/fortytw2/leaktest v1.3.0 // indirect + github.com/go-ini/ini v1.67.0 // indirect github.com/go-shiori/dom v0.0.0-20210627111528-4e4722cd0d65 // indirect github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect github.com/gobwas/httphead v0.1.0 // indirect @@ -91,6 +93,7 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f // indirect github.com/golang/protobuf v1.5.2 // indirect + github.com/google/btree v1.0.1 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/uuid v1.3.0 // indirect github.com/iawia002/lia v0.0.0-20221116085912-1f653221be4b // indirect @@ -147,19 +150,23 @@ require ( github.com/tidwall/pretty v1.2.0 // indirect github.com/tidwall/sjson v1.2.4 // indirect github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 // indirect - github.com/wabarc/memento v0.0.0-20210703205719-adc2f8ab8bae // indirect + github.com/wabarc/memento v0.0.0-20221023035729-e42d0fe1cefb // indirect github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b // indirect github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect github.com/ybbus/httpretry v1.0.1 // indirect - golang.org/x/crypto v0.5.0 // indirect + golang.org/x/crypto v0.7.0 // indirect golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 // indirect golang.org/x/mod v0.8.0 // indirect golang.org/x/sys v0.7.0 // indirect golang.org/x/text v0.9.0 // indirect + golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect golang.org/x/tools v0.6.0 // indirect + golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect + golang.zx2c4.com/wireguard v0.0.0-20230325221338-052af4a8072b // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/sourcemap.v1 v1.0.5 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect + gvisor.dev/gvisor v0.0.0-20221203005347-703fd9b7fbc0 // indirect lukechampine.com/blake3 v1.1.7 // indirect mellium.im/reader v0.1.0 // indirect mvdan.cc/xurls/v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index aac68363..d88dfb1d 100644 --- a/go.sum +++ b/go.sum @@ -37,8 +37,6 @@ github.com/MercuryEngineering/CookieMonster v0.0.0-20180304172713-1584578b3403 h github.com/MercuryEngineering/CookieMonster v0.0.0-20180304172713-1584578b3403/go.mod h1:mM6WvakkX2m+NgMiPCfFFjwfH4KzENC07zeGEqq9U7s= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg= -github.com/PuerkitoBio/goquery v1.6.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= -github.com/PuerkitoBio/goquery v1.7.0/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM= github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ= github.com/SaveTheRbtz/generic-sync-map-go v0.0.0-20230201052002-6c5833b989be h1:ZUMGZpetBeapAS/oOlffnBL6aSG6WwXSWfNXeadAzXE= @@ -53,7 +51,6 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= -github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/andybalholm/cascadia v1.2.0/go.mod h1:YCyR8vOZT9aZ1CHEd8ap0gMVm2aFgxBp0T0eFw1RUQY= github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= @@ -187,6 +184,8 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= +github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= @@ -257,6 +256,8 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -269,7 +270,7 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-github/v40 v40.0.0 h1:oBPVDaIhdUmwDWRRH8XJ/dZG+Rn755i08+Hp1uJHlR0= github.com/google/go-github/v40 v40.0.0/go.mod h1:G8wWKTEjUCL0zdbaQvpwDk0hqf6KZgPQH+ssJa+/NVc= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= @@ -412,6 +413,7 @@ github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOA github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-mastodon v0.0.5-0.20210515144304-86627ec7d635 h1:SX3lH+1XhJ8bUKhSVve0vIpz1YXICbPAQAwLO7EeX7w= @@ -585,7 +587,7 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.4/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tdewolff/parse/v2 v2.5.27/go.mod h1:WzaJpRSbwq++EIQHYIRTpbYKNA3gn9it1Ik++q4zyho= github.com/tdewolff/parse/v2 v2.6.5 h1:lYvWBk55GkqKl0JJenGpmrgu/cPHQQ6/Mm1hBGswoGQ= @@ -609,8 +611,9 @@ github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 h1:nrZ3ySNYwJ github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80/go.mod h1:iFyPdL66DjUD96XmzVL3ZntbzcflLnznH0fr99w5VqE= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/wabarc/archive.is v1.3.0 h1:H4hA1Wk8DXLpS7i4FAyoPb5Z6l6fQDdJoFoNqw9ei+U= -github.com/wabarc/archive.is v1.3.0/go.mod h1:01mgwPSUip7WkigtaZypTTHSpv3NVbtWpKF0JoWVrAU= +github.com/wabarc/archive.is v1.3.1-0.20230331115359-f27bc96f2b65/go.mod h1:MaYWQ+x3A4ZH33k2K5M9te0T5RBwF4vRS5vdeIYtnUI= +github.com/wabarc/archive.is v1.3.1-0.20230411045956-7bc7ff721b7d h1:gXcxaYfrff8V+mICj3wmA9SF+QPUQ3RarxR8eSMvt6U= +github.com/wabarc/archive.is v1.3.1-0.20230411045956-7bc7ff721b7d/go.mod h1:MaYWQ+x3A4ZH33k2K5M9te0T5RBwF4vRS5vdeIYtnUI= github.com/wabarc/archive.org v1.2.0/go.mod h1:yEmUMlNO2PPAxIvo/Hf/VxOrCS5SBwL2/vCW8pyTWjA= github.com/wabarc/archive.org v1.2.1-0.20210708220121-cb9b83ff9896 h1:c3uD+IKXpNhtAHC2/fTt7R9dXnNhw1Q6sQrHUX3xo64= github.com/wabarc/archive.org v1.2.1-0.20210708220121-cb9b83ff9896/go.mod h1:yEmUMlNO2PPAxIvo/Hf/VxOrCS5SBwL2/vCW8pyTWjA= @@ -623,7 +626,7 @@ github.com/wabarc/helper v0.0.0-20210407153720-1bfe98b427fe/go.mod h1:TuTZtoiOu9 github.com/wabarc/helper v0.0.0-20210614160629-1a5ba5e551eb/go.mod h1:TuTZtoiOu984UWOf7FfX58JllKMjq7FCz701kB5W88E= github.com/wabarc/helper v0.0.0-20210701193643-e0fe0a807cb9/go.mod h1:TuTZtoiOu984UWOf7FfX58JllKMjq7FCz701kB5W88E= github.com/wabarc/helper v0.0.0-20210718171053-59c70d0b20c2/go.mod h1:uS6mimKlWkGvEZXkJ6JoW7LYnnB2JP6dLU9q7pgDaWQ= -github.com/wabarc/helper v0.0.0-20220320101038-dbb2ea36249b/go.mod h1:JGo6GZ+m/xGV63ZiNH0apOrWczV/f8w2JzjoTOg8u58= +github.com/wabarc/helper v0.0.0-20230318095659-969de9ddf4b6/go.mod h1:eb3rEZVnsfvRAbjKZOTBuLVDtICaDysuscD+MOnPX2M= github.com/wabarc/helper v0.0.0-20230418130954-be7440352bcb h1:psEAY4wXvhXp/Hp5CJWgAOKWqhvAom+/hOjK+Qscx7o= github.com/wabarc/helper v0.0.0-20230418130954-be7440352bcb/go.mod h1:S1N1F/2lwcHYqCowYTrR6i0DZ/1lcXKU+s+7rv5dUno= github.com/wabarc/imgbb v1.0.0 h1:vNud9qY4dRGp1nikb+GHIrc/sE3WOdNq5gfT/vhWEUQ= @@ -633,10 +636,12 @@ github.com/wabarc/ipfs-pinner v1.1.1-0.20220126131044-16299c0dd43d/go.mod h1:Ah+ github.com/wabarc/logger v0.0.0-20210417045349-d0d82e8e99ee/go.mod h1:4uYr9fnQaQoDk1ttTzLnSB3lZm3i/vrJwN8EZIB2YuI= github.com/wabarc/logger v0.0.0-20210730133522-86bd3f31e792 h1:0xD4NsQtdPCB77q4wuRn1TJOuHQ3drL0SfRd6xF4ryk= github.com/wabarc/logger v0.0.0-20210730133522-86bd3f31e792/go.mod h1:2an5YHL0CegFbaDNSU3kwqYRfxFfmcwlwSi5Bk4yk5c= -github.com/wabarc/memento v0.0.0-20210703205719-adc2f8ab8bae h1:7TLEQYM7GxeysDd6IbK5F7krZuYEipdXno9qV3eedWU= -github.com/wabarc/memento v0.0.0-20210703205719-adc2f8ab8bae/go.mod h1:qP6GisnqoSDc5Ivj34yV+Qar3B6tYyLDKx42oCDX1zY= -github.com/wabarc/playback v0.0.0-20220715111526-90d0327d3f04 h1:D1XXhpIu2DO0LEvqnVYYdH7x5cEdADDEk6GIZoW4eow= -github.com/wabarc/playback v0.0.0-20220715111526-90d0327d3f04/go.mod h1:rxvBzfzci+rMEEsupy1yo58Nbg9KtUmY4WJ67EPzNH8= +github.com/wabarc/memento v0.0.0-20221023035729-e42d0fe1cefb h1:mi8kE7ET/CLeMCzQkpMgtIoR1rwAd4ccpv17/SXwnt8= +github.com/wabarc/memento v0.0.0-20221023035729-e42d0fe1cefb/go.mod h1:qP6GisnqoSDc5Ivj34yV+Qar3B6tYyLDKx42oCDX1zY= +github.com/wabarc/playback v0.0.0-20230331122619-84484ab4d599 h1:5L4QkS8MzMQNSDQ36VIaMEu7eSox0c9D5080pyJSZMM= +github.com/wabarc/playback v0.0.0-20230331122619-84484ab4d599/go.mod h1:7Bs329a9s+wwKvINBacECHMN13VhQLGOQcJAT7gtS74= +github.com/wabarc/proxier v0.0.0-20230331160507-4294c0d4f82c h1:99TLxQ+XuDF6GPOc2Fn2/XjeofTZj19hBiU0BCRy2Jg= +github.com/wabarc/proxier v0.0.0-20230331160507-4294c0d4f82c/go.mod h1:04UOGGKErS7VR/9S6em6hlWoQwLLfXi/Co6uWh80qhA= github.com/wabarc/rivet v0.1.4-0.20221226142645-ebc8a29d914f h1:fkaTPNIalAj8i51BEPb3dPjxrE3ryzYt/+3yzV1u4nM= github.com/wabarc/rivet v0.1.4-0.20221226142645-ebc8a29d914f/go.mod h1:lNEgL14wbyTc+ZNQPM+QtEZcQjB0AifzlWJbRJYQn/A= github.com/wabarc/screenshot v1.6.1-0.20230315004517-7587f8bc14e0 h1:H7Ufx43fg3khCS7s39mfHHbpRFoo5GBJS846QhxfClo= @@ -679,14 +684,12 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= -golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -759,7 +762,6 @@ golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210415231046-e915ea6b2b7d/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210505214959-0714010a04ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -769,7 +771,9 @@ golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -843,9 +847,7 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201207223542-d4d67f95c62d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210415045647-66c3f260301c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -867,6 +869,7 @@ golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -875,11 +878,14 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220609170525-579cf78fd858 h1:Dpdu/EMxGMFgq0CeYMh4fazTD2vtlZRYE7wyynxJb9U= +golang.org/x/time v0.0.0-20220609170525-579cf78fd858/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -931,6 +937,10 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeunTOisW56dUokqW/FOteYJJ/yg= +golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI= +golang.zx2c4.com/wireguard v0.0.0-20230325221338-052af4a8072b h1:J1CaxgLerRR5lgx3wnr6L04cJFbWoceSK9JWBdglINo= +golang.zx2c4.com/wireguard v0.0.0-20230325221338-052af4a8072b/go.mod h1:tqur9LnfstdR9ep2LaJT4lFUl0EjlHtge+gAjmsHUG4= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1037,6 +1047,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gvisor.dev/gvisor v0.0.0-20221203005347-703fd9b7fbc0 h1:Wobr37noukisGxpKo5jAsLREcpj61RxrWYzD8uwveOY= +gvisor.dev/gvisor v0.0.0-20221203005347-703fd9b7fbc0/go.mod h1:Dn5idtptoW1dIos9U6A2rpebLs/MtTwFacjKb8jLdQA= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/wayback.1 b/wayback.1 index f34fcb8f..c4677a54 100644 --- a/wayback.1 +++ b/wayback.1 @@ -123,6 +123,9 @@ Log level, supported level are "debug", "info", "warn", "error", "fatal", defaul .B ENABLE_METRICS Enable metrics collector\&. .TP +.B WIREGUARD_CONFIG +WireGuard proxy client config.\&. +.TP .B WAYBACK_LISTEN_ADDR The listen address for the HTTP server. default "0.0.0.0:8964"\&. .TP diff --git a/wayback.go b/wayback.go index b1405dc8..f5900d7e 100644 --- a/wayback.go +++ b/wayback.go @@ -5,16 +5,20 @@ package wayback // import "github.com/wabarc/wayback" import ( + "bytes" "context" "fmt" + "io" "net/http" "net/url" "os" + "strings" "sync" "time" "github.com/wabarc/logger" "github.com/wabarc/playback" + "github.com/wabarc/proxier" "github.com/wabarc/rivet/ipfs" "github.com/wabarc/wayback/config" "github.com/wabarc/wayback/errors" @@ -30,7 +34,9 @@ import ( ) // TODO: find a better way to handle it -var client = &http.Client{Timeout: 30 * time.Second} +var client = &http.Client{ + Timeout: 30 * time.Second, +} // Collect results that archived, Arc is name of the archive service, // Dst mapping the original URL and archived destination URL, @@ -81,7 +87,7 @@ type Waybacker interface { // Wayback implements the standard Waybacker interface: // it reads URL from the IA and returns archived URL as a string. func (i IA) Wayback(_ reduxer.Reduxer) string { - arc := &ia.Archiver{} + arc := &ia.Archiver{Client: client} dst, err := arc.Wayback(i.ctx, i.URL) if err != nil { logger.Error("wayback %s to Internet Archive failed: %v", i.URL.String(), err) @@ -93,7 +99,9 @@ func (i IA) Wayback(_ reduxer.Reduxer) string { // Wayback implements the standard Waybacker interface: // it reads URL from the IS and returns archived URL as a string. func (i IS) Wayback(_ reduxer.Reduxer) string { - arc := &is.Archiver{} + arc := is.NewArchiver(client) + defer arc.CloseTor() + dst, err := arc.Wayback(i.ctx, i.URL) if err != nil { logger.Error("wayback %s to archive.today failed: %v", i.URL.String(), err) @@ -295,3 +303,37 @@ func duration(ctx context.Context) time.Duration { return time.Duration(safeTime) * time.Second } + +// NewClient sets a http client. +// TODO: refactoring +func NewClient(opts *config.Options) { + if opts.WireGuardConfig() != "" && client != nil { + r := strings.NewReader(opts.WireGuardConfig()) + proxy := proxier.NewClient(client) + if _, er := proxy.ViaWireGuard(r); er == nil { + client = proxy.Client + client.Timeout = opts.WaybackTimeout() * 90 / 100 + if opts.HasDebugMode() { + for { + resp, err := client.Get("https://www.zx2c4.com/ip") + if err != nil { + logger.Error("request error: %v", err) + continue + } + body, err := io.ReadAll(resp.Body) + if err != nil { + logger.Error("read body error: %v", err) + continue + } + logger.Debug("client handshake: %s", bytes.ReplaceAll(body, []byte("\n"), []byte(" "))) + resp.Body.Close() + time.Sleep(time.Minute) + } + } + } else { + logger.Fatal("new client error: %v", er) + } + } + + select {} +} From 882c2777a8897757688ce8f142b37bb48ed583e5 Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Fri, 5 May 2023 04:01:49 +0000 Subject: [PATCH 02/21] Sets rivet client --- go.mod | 54 +++--- go.sum | 471 ++++++----------------------------------------------- wayback.go | 3 +- 3 files changed, 78 insertions(+), 450 deletions(-) diff --git a/go.mod b/go.mod index 297c6df2..4e5f34da 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/dustin/go-humanize v1.0.0 github.com/gabriel-vasile/mimetype v1.4.2 github.com/go-shiori/go-readability v0.0.0-20220215145315-dd6828d2f09b - github.com/go-shiori/obelisk v0.0.0-20221119111008-23c015a8fad7 + github.com/go-shiori/obelisk v0.0.0-20230316095823-42f6a2f99d9d github.com/google/go-github/v40 v40.0.0 github.com/gookit/color v1.5.3 github.com/gorilla/mux v1.8.0 @@ -29,7 +29,7 @@ require ( github.com/phf/go-queue v0.0.0-20170504031614-9abe38d0371d github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 - github.com/prometheus/common v0.37.0 + github.com/prometheus/common v0.42.0 github.com/rs/xid v1.4.0 github.com/slack-go/slack v0.11.2 github.com/spf13/cobra v1.6.1 @@ -40,11 +40,11 @@ require ( github.com/wabarc/go-catbox v0.1.0 github.com/wabarc/helper v0.0.0-20230418130954-be7440352bcb github.com/wabarc/imgbb v1.0.0 - github.com/wabarc/ipfs-pinner v1.1.1-0.20220126131044-16299c0dd43d + github.com/wabarc/ipfs-pinner v1.1.1-0.20230502052510-dc378f9e202b github.com/wabarc/logger v0.0.0-20210730133522-86bd3f31e792 github.com/wabarc/playback v0.0.0-20230331122619-84484ab4d599 github.com/wabarc/proxier v0.0.0-20230331160507-4294c0d4f82c - github.com/wabarc/rivet v0.1.4-0.20221226142645-ebc8a29d914f + github.com/wabarc/rivet v0.1.4-0.20230505152228-2c5c81b4bd10 github.com/wabarc/screenshot v1.6.1-0.20230315004517-7587f8bc14e0 github.com/wabarc/telegra.ph v0.0.0-20230318134541-a0922e1ace3a github.com/wabarc/warcraft v0.3.1-0.20230308125707-3daa5592ba52 @@ -62,15 +62,15 @@ require ( github.com/MercuryEngineering/CookieMonster v0.0.0-20180304172713-1584578b3403 // indirect github.com/SaveTheRbtz/generic-sync-map-go v0.0.0-20230201052002-6c5833b989be // indirect github.com/VividCortex/ewma v1.2.0 // indirect - github.com/andybalholm/cascadia v1.3.1 // indirect - github.com/benbjohnson/clock v1.3.0 // indirect + github.com/andybalholm/cascadia v1.3.2 // indirect + github.com/benbjohnson/clock v1.3.3 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bitly/go-simplejson v0.5.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/btcsuite/btcd/btcutil v1.1.3 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect github.com/cenkalti/backoff v2.2.1+incompatible // indirect - github.com/cenkalti/backoff/v4 v4.2.0 // indirect + github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cheggaaa/pb/v3 v3.0.8 // indirect github.com/chromedp/cdproto v0.0.0-20230310204135-a6d692f2c96d // indirect @@ -90,17 +90,16 @@ require ( github.com/gobwas/httphead v0.1.0 // indirect github.com/gobwas/pool v0.2.1 // indirect github.com/gobwas/ws v1.1.0 // indirect - github.com/gogo/protobuf v1.3.2 // indirect github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/google/btree v1.0.1 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/uuid v1.3.0 // indirect github.com/iawia002/lia v0.0.0-20221116085912-1f653221be4b // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect - github.com/ipfs/go-cid v0.3.2 // indirect - github.com/ipfs/go-ipfs-api v0.3.0 // indirect - github.com/ipfs/go-ipfs-files v0.2.0 // indirect + github.com/ipfs/boxo v0.8.1 // indirect + github.com/ipfs/go-cid v0.4.1 // indirect + github.com/ipfs/go-ipfs-api v0.6.0 // indirect github.com/itchyny/gojq v0.12.7 // indirect github.com/itchyny/timefmt-go v0.1.3 // indirect github.com/josharian/intern v1.0.0 // indirect @@ -108,18 +107,15 @@ require ( github.com/kallydev/telegraph-go v1.0.1-0.20230318133700-df034d9eed50 // indirect github.com/kennygrant/sanitize v1.2.4 // indirect github.com/kkdai/youtube/v2 v2.7.18 // indirect - github.com/klauspost/cpuid/v2 v2.2.2 // indirect + github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/kr/pretty v0.3.0 // indirect github.com/kr/text v0.2.0 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/libp2p/go-flow-metrics v0.1.0 // indirect - github.com/libp2p/go-libp2p v0.24.1 // indirect - github.com/libp2p/go-libp2p-core v0.20.1 // indirect - github.com/libp2p/go-openssl v0.1.0 // indirect + github.com/libp2p/go-libp2p v0.27.1 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.18 // indirect - github.com/mattn/go-pointer v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/minio/sha256-simd v1.0.0 // indirect @@ -129,19 +125,19 @@ require ( github.com/mr-tron/base58 v1.2.0 // indirect github.com/multiformats/go-base32 v0.1.0 // indirect github.com/multiformats/go-base36 v0.2.0 // indirect - github.com/multiformats/go-multiaddr v0.8.0 // indirect - github.com/multiformats/go-multibase v0.1.1 // indirect - github.com/multiformats/go-multicodec v0.7.0 // indirect + github.com/multiformats/go-multiaddr v0.9.0 // indirect + github.com/multiformats/go-multibase v0.2.0 // indirect + github.com/multiformats/go-multicodec v0.9.0 // indirect github.com/multiformats/go-multihash v0.2.1 // indirect + github.com/multiformats/go-multistream v0.4.1 // indirect github.com/multiformats/go-varint v0.0.7 // indirect github.com/oliamb/cutter v0.2.2 // indirect github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect + github.com/prometheus/procfs v0.9.0 // indirect github.com/rivo/uniseg v0.4.3 // indirect github.com/robertkrimen/otto v0.0.0-20211024170158-b87d35c0b86f // indirect - github.com/rogpeppe/go-internal v1.9.0 // indirect + github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/sirupsen/logrus v1.9.0 // indirect - github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tdewolff/parse/v2 v2.6.5 // indirect @@ -153,21 +149,21 @@ require ( github.com/wabarc/memento v0.0.0-20221023035729-e42d0fe1cefb // indirect github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b // indirect github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect - github.com/ybbus/httpretry v1.0.1 // indirect - golang.org/x/crypto v0.7.0 // indirect + github.com/ybbus/httpretry v1.0.2 // indirect + golang.org/x/crypto v0.8.0 // indirect golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 // indirect - golang.org/x/mod v0.8.0 // indirect + golang.org/x/mod v0.10.0 // indirect golang.org/x/sys v0.7.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect - golang.org/x/tools v0.6.0 // indirect + golang.org/x/tools v0.7.0 // indirect golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect golang.zx2c4.com/wireguard v0.0.0-20230325221338-052af4a8072b // indirect - google.golang.org/protobuf v1.28.1 // indirect + google.golang.org/protobuf v1.30.0 // indirect gopkg.in/sourcemap.v1 v1.0.5 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gvisor.dev/gvisor v0.0.0-20221203005347-703fd9b7fbc0 // indirect lukechampine.com/blake3 v1.1.7 // indirect mellium.im/reader v0.1.0 // indirect - mvdan.cc/xurls/v2 v2.4.0 // indirect + mvdan.cc/xurls/v2 v2.5.0 // indirect ) diff --git a/go.sum b/go.sum index d88dfb1d..fb116405 100644 --- a/go.sum +++ b/go.sum @@ -1,38 +1,5 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/MercuryEngineering/CookieMonster v0.0.0-20180304172713-1584578b3403 h1:EtZwYyLbkEcIt+B//6sujwRCnHuTEK3qiSypAX5aJeM= github.com/MercuryEngineering/CookieMonster v0.0.0-20180304172713-1584578b3403/go.mod h1:mM6WvakkX2m+NgMiPCfFFjwfH4KzENC07zeGEqq9U7s= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -46,17 +13,15 @@ github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1o github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/andybalholm/cascadia v1.2.0/go.mod h1:YCyR8vOZT9aZ1CHEd8ap0gMVm2aFgxBp0T0eFw1RUQY= -github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= +github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= +github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/benbjohnson/clock v1.3.3 h1:g+rSsSaAzhHJYcIQE78hJ3AhyjjtQvleKDjlhdBnIhc= +github.com/benbjohnson/clock v1.3.3/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -94,16 +59,12 @@ github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QH github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= -github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 h1:SKI1/fuSdodxmNNyVBR8d7X/HuLnRpvvFO0AgyQk764= -github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U= github.com/cheggaaa/pb/v3 v3.0.8 h1:bC8oemdChbke2FHIIGy9mn4DPJ2caZYQnfbRqwmdCoA= github.com/cheggaaa/pb/v3 v3.0.8/go.mod h1:UICbiLec/XO6Hw6k+BHEtHeQFzzBH4i2/qk/ow1EJTA= github.com/chromedp/cdproto v0.0.0-20230220211738-2b1ec77315c9/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs= @@ -114,14 +75,11 @@ github.com/chromedp/chromedp v0.9.1/go.mod h1:DUgZWRvYoEfgi66CgZ/9Yv+psgi+Sksy5D github.com/chromedp/sysutil v1.0.0 h1:+ZxhTpfpZlmchB58ih/LBHX52ky7w2VhQVKQMucy3Ic= github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -164,10 +122,6 @@ github.com/dstotijn/go-notion v0.11.0 h1:v+ZUiyKd+UBk1SRkUSa86QOU5DP8ziSI4E7NFIS github.com/dstotijn/go-notion v0.11.0/go.mod h1:FWfmGRnE8Drm6CnNQQO7slXcu1lrKmRY2KfFgeq6Z2g= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= @@ -181,19 +135,11 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= @@ -202,8 +148,8 @@ github.com/go-shiori/dom v0.0.0-20210627111528-4e4722cd0d65 h1:zx4B0AiwqKDQq+Agq github.com/go-shiori/dom v0.0.0-20210627111528-4e4722cd0d65/go.mod h1:NPO1+buE6TYOWhUI98/hXLHHJhunIpXRuvDN4xjkCoE= github.com/go-shiori/go-readability v0.0.0-20220215145315-dd6828d2f09b h1:yrGomo5CP7IvXwSwKbDeaJkhwa4BxfgOO/s1V7iOQm4= github.com/go-shiori/go-readability v0.0.0-20220215145315-dd6828d2f09b/go.mod h1:LTRGsNyO3/Y6u3ERbz17OiXy2qO1Y+/8QjXpg2ViyEY= -github.com/go-shiori/obelisk v0.0.0-20221119111008-23c015a8fad7 h1:/GN4M29BcqDvcvuu12fVobP0krLlpoaIU671j4AO9WU= -github.com/go-shiori/obelisk v0.0.0-20221119111008-23c015a8fad7/go.mod h1:qKa73D7hc0YucHndvsCOgZ5Ap54XgSmZxaIytNAFUAQ= +github.com/go-shiori/obelisk v0.0.0-20230316095823-42f6a2f99d9d h1:LQ2q0hNiWx8XrR+6qWYFS4mk+qVzmpSprhoO2V/DM/I= +github.com/go-shiori/obelisk v0.0.0-20230316095823-42f6a2f99d9d/go.mod h1:qKa73D7hc0YucHndvsCOgZ5Ap54XgSmZxaIytNAFUAQ= github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -218,43 +164,26 @@ github.com/gobwas/ws v1.1.0/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL github.com/goccy/go-yaml v1.9.5/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14= github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f h1:3BSP1Tbs2djlpprl7wCLuiqMaUh5SJkkzI2gDs+FgLs= github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= @@ -262,9 +191,6 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -277,21 +203,9 @@ github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gookit/color v1.5.3 h1:twfIhZs4QLCtimkP7MOxlF3A0U/5cDPseRT9M/+2SCE= github.com/gookit/color v1.5.3/go.mod h1:NUzwzeehUfl7GIb36pqId+UGmRfQcU/WiiyTTeNjHtE= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= @@ -306,11 +220,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/iawia002/lia v0.0.0-20221116085912-1f653221be4b h1:rCLzCJKes3J0QCtEyPy6iefW28PCPSMwkPWhslaJLBQ= github.com/iawia002/lia v0.0.0-20221116085912-1f653221be4b/go.mod h1:aL35R6u/LH1owTr+DdEOFtUMGsED9DhVddvN6KIyPbU= github.com/iawia002/lux v0.17.0 h1:jv19arlCxogNM397T6tHDPvzoP889YeR2DcVVed8pmM= @@ -318,23 +229,18 @@ github.com/iawia002/lux v0.17.0/go.mod h1:VAFYExVvU+EV+3uofKnn3wHlNgpRmxkVfflsND github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= -github.com/ipfs/go-cid v0.3.2 h1:OGgOd+JCFM+y1DjWPmVH+2/4POtpDzwcr7VgnB7mZXc= -github.com/ipfs/go-cid v0.3.2/go.mod h1:gQ8pKqT/sUxGY+tIwy1RPpAojYu7jAyCp5Tz1svoupw= -github.com/ipfs/go-ipfs-api v0.3.0 h1:ZzVrsTV31Z53ZlUare6a5UJ46lC7lW93q/s1/fXyATk= -github.com/ipfs/go-ipfs-api v0.3.0/go.mod h1:A1naQGm0Jg01GxDq7oDyVSZxt20SuRTNIBFNZJgPDmg= -github.com/ipfs/go-ipfs-files v0.0.9/go.mod h1:aFv2uQ/qxWpL/6lidWvnSQmaVqCrf0TBGoUr+C1Fo84= -github.com/ipfs/go-ipfs-files v0.2.0 h1:z6MCYHQSZpDWpUSK59Kf0ajP1fi4gLCf6fIulVsp8A8= -github.com/ipfs/go-ipfs-files v0.2.0/go.mod h1:vT7uaQfIsprKktzbTPLnIsd+NGw9ZbYwSq0g3N74u0M= -github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= +github.com/ipfs/boxo v0.8.1 h1:3DkKBCK+3rdEB5t77WDShUXXhktYwH99mkAsgajsKrU= +github.com/ipfs/boxo v0.8.1/go.mod h1:xJ2hVb4La5WyD7GvKYE0lq2g1rmQZoCD2K4WNrV6aZI= +github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= +github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= +github.com/ipfs/go-ipfs-api v0.6.0 h1:JARgG0VTbjyVhO5ZfesnbXv9wTcMvoKRBLF1SzJqzmg= +github.com/ipfs/go-ipfs-api v0.6.0/go.mod h1:iDC2VMwN9LUpQV/GzEeZ2zNqd8NUdRmWcFM+K/6odf0= github.com/ipsn/go-libtor v1.0.380 h1:hCmALDBe3bPpgwMunonMLArrG41MxzpE91Bk8KQYnYM= github.com/ipsn/go-libtor v1.0.380/go.mod h1:6rIeHU7irp8ZH8E/JqaEOKlD6s4vSSUh4ngHelhlSMw= github.com/itchyny/gojq v0.12.7 h1:hYPTpeWfrJ1OT+2j6cvBScbhl0TkdwGM4bc66onUSOQ= github.com/itchyny/gojq v0.12.7/go.mod h1:ZdvNHVlzPgUf8pgjnuDTmGfHA/21KoutQUJ3An/xNuw= github.com/itchyny/timefmt-go v0.1.3 h1:7M3LGVDsqcd0VZH2U+x393obrzZisp7C0uEe921iRkU= github.com/itchyny/timefmt-go v0.1.3/go.mod h1:0osSSCQSASBJMsIZnhAaF1C2fCBTJZXrnj37mG8/c+A= -github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA= -github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= github.com/jedib0t/go-pretty/v6 v6.4.0 h1:YlI/2zYDrweA4MThiYMKtGRfT+2qZOO65ulej8GTcVI= github.com/jedib0t/go-pretty/v6 v6.4.0/go.mod h1:MgmISkTWDSFu0xOqiZ0mKNntMQ2mDgOcwOkwBEkMDJI= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -342,34 +248,24 @@ github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJS github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kallydev/telegraph-go v1.0.1-0.20230318133700-df034d9eed50 h1:Os2f/xCaCfWqMAW8hAW8uviDY8XsRqkLUgLFFldSTYw= github.com/kallydev/telegraph-go v1.0.1-0.20230318133700-df034d9eed50/go.mod h1:vZj7M9HridntSIuQ7D9hgn2idKiA0T1VIblLp6l9uuc= github.com/kennygrant/sanitize v1.2.4 h1:gN25/otpP5vAsO2djbMhF/LQX6R7+O1TB4yv8NzpJ3o= github.com/kennygrant/sanitize v1.2.4/go.mod h1:LGsjYYtgxbetdg5owWB2mpgUL6e2nfw2eObZ0u0qvak= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/kkdai/youtube/v2 v2.7.18 h1:bVP60bULmCZg5H9GsLLeBx0ONHEsZwdSrzPrVCVWJ1k= github.com/kkdai/youtube/v2 v2.7.18/go.mod h1:CeUYFc227iiNNpEaipwmJIYPNsuH6rb/8H3HpWEG63U= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.2 h1:xPMwiykqNK9VK0NYC3+jTMYv9I6Vl3YdjZgPZKG3zO0= -github.com/klauspost/cpuid/v2 v2.2.2/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -383,21 +279,12 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80 h1:6Yzfa6GP0rIo/kULo2bwGEkFvCePZ3qHDDTC3/J9Swo= github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= -github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM= github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro= -github.com/libp2p/go-libp2p v0.24.1 h1:+lS4fqj7RF9egcPq9Yo3iqdRTcDMApzoBbQMhxtwOVw= -github.com/libp2p/go-libp2p v0.24.1/go.mod h1:5LJqbrqFsUzWrq70JHCYqjATlX4ey8Klpct3OEe8hSI= -github.com/libp2p/go-libp2p-core v0.6.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= -github.com/libp2p/go-libp2p-core v0.20.1 h1:fQz4BJyIFmSZAiTbKV8qoYhEH5Dtv/cVhZbG3Ib/+Cw= -github.com/libp2p/go-libp2p-core v0.20.1/go.mod h1:6zR8H7CvQWgYLsbG4on6oLNSGcyKaYFSEYyDt51+bIY= -github.com/libp2p/go-msgio v0.0.6/go.mod h1:4ecVB6d9f4BDSL5fqvPiC4A3KivjWn+Venn/1ALLMWA= -github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-openssl v0.1.0 h1:LBkKEcUv6vtZIQLVTegAil8jbNpJErQ9AnT+bWV+Ooo= -github.com/libp2p/go-openssl v0.1.0/go.mod h1:OiOxwPpL3n4xlenjx2h7AwSGaFSC/KZvf6gNdOBQMtc= +github.com/libp2p/go-libp2p v0.27.1 h1:k1u6RHsX3hqKnslDjsSgLNURxJ3O1atIZCY4gpMbbus= +github.com/libp2p/go-libp2p v0.27.1/go.mod h1:FAvvfQa/YOShUYdiSS03IR9OXzkcJXwcNA2FUCh9ImE= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= @@ -418,8 +305,6 @@ github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp9 github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-mastodon v0.0.5-0.20210515144304-86627ec7d635 h1:SX3lH+1XhJ8bUKhSVve0vIpz1YXICbPAQAwLO7EeX7w= github.com/mattn/go-mastodon v0.0.5-0.20210515144304-86627ec7d635/go.mod h1:CZ3bPYRNGgvMZr4d/SNMvCObyCQvTgCXdIOrW040z5U= -github.com/mattn/go-pointer v0.0.1 h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o0= -github.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= @@ -430,9 +315,6 @@ github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvr github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= -github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= -github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -441,39 +323,27 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= -github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= -github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= -github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u0xW5UouOmQQrn6a3Y= -github.com/multiformats/go-multiaddr v0.3.0/go.mod h1:dF9kph9wfJ+3VLAaeBqo9Of8x4fJxp6ggJGteB8HQTI= -github.com/multiformats/go-multiaddr v0.8.0 h1:aqjksEcqK+iD/Foe1RRFsGZh8+XFiGo7FgUCZlpv3LU= -github.com/multiformats/go-multiaddr v0.8.0/go.mod h1:Fs50eBDWvZu+l3/9S6xAE7ZYj6yhxlvaVZjakWN7xRs= -github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= -github.com/multiformats/go-multibase v0.1.1 h1:3ASCDsuLX8+j4kx58qnJ4YFq/JWTJpCyDW27ztsVTOI= -github.com/multiformats/go-multibase v0.1.1/go.mod h1:ZEjHE+IsUrgp5mhlEAYjMtZwK1k4haNkcaPg9aoe1a8= -github.com/multiformats/go-multicodec v0.7.0 h1:rTUjGOwjlhGHbEMbPoSUJowG1spZTVsITRANCjKTUAQ= -github.com/multiformats/go-multicodec v0.7.0/go.mod h1:GUC8upxSBE4oG+q3kWZRw/+6yC1BqO550bjhWsJbZlw= -github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= -github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= +github.com/multiformats/go-multiaddr v0.9.0 h1:3h4V1LHIk5w4hJHekMKWALPXErDfz/sggzwC/NcqbDQ= +github.com/multiformats/go-multiaddr v0.9.0/go.mod h1:mI67Lb1EeTOYb8GQfL/7wpIZwc46ElrvzhYnoJOmTT0= +github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= +github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= +github.com/multiformats/go-multicodec v0.9.0 h1:pb/dlPnzee/Sxv/j4PmkDRxCOi3hXTz3IbPKOXWJkmg= +github.com/multiformats/go-multicodec v0.9.0/go.mod h1:L3QTQvMIaVBkXOXXtVmYE+LI16i14xuaojr/H7Ai54k= github.com/multiformats/go-multihash v0.2.1 h1:aem8ZT0VA2nCHHk7bPJ1BjUbHNciqZC/d16Vve9l108= github.com/multiformats/go-multihash v0.2.1/go.mod h1:WxoMcYG85AZVQUyRyo9s4wULvW5qrI9vb2Lt6evduFc= -github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= -github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/multiformats/go-multistream v0.4.1 h1:rFy0Iiyn3YT0asivDUIR05leAdwZq3de4741sbiSdfo= +github.com/multiformats/go-multistream v0.4.1/go.mod h1:Mz5eykRVAjJWckE2U78c6xqdtyNUEhKSM0Lwar2p77Q= github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nbd-wtf/go-nostr v0.17.1-0.20230426111250-32ca737acf77 h1:D7BdjjOD0D8r7RwLmrOTOJKEZ56D9YhLCEETz2Xh0Vo= github.com/nbd-wtf/go-nostr v0.17.1-0.20230426111250-32ca737acf77/go.mod h1:YCDHJtaFQE76d1ZkcUsTkz3dYNP+bldo5CIQwXPPcbk= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -495,7 +365,6 @@ github.com/phf/go-queue v0.0.0-20170504031614-9abe38d0371d h1:U+PMnTlV2tu7RuMK5e github.com/phf/go-queue v0.0.0-20170504031614-9abe38d0371d/go.mod h1:lXfE4PvvTW5xOjO6Mba8zDPyw8M93B6AQ7frTGnMlA8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= @@ -503,34 +372,20 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= +github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= @@ -539,12 +394,11 @@ github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUc github.com/robertkrimen/otto v0.0.0-20211024170158-b87d35c0b86f h1:a7clxaGmmqtdNTXyvrp/lVO/Gnkzlhc/+dLs5v965GM= github.com/robertkrimen/otto v0.0.0-20211024170158-b87d35c0b86f/go.mod h1:/mK7FZ3mFYEn9zvNPhpngTyatyehSwte5bJZ4ehL5Xw= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/rs/xid v1.4.0 h1:qd7wPTDkN6KQx2VmMBLrpHkiyQwgFXRnkOLacUiaSNY= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -553,16 +407,12 @@ github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/slack-go/slack v0.11.2 h1:IWl90Rk+jqPEVyiBytH27CSN/TFAg2vuDDfoPRog/nc= github.com/slack-go/slack v0.11.2/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 h1:RC6RW7j+1+HkWaX/Yh71Ee5ZHaHYt7ZP4sQgUrm6cDU= -github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -631,8 +481,8 @@ github.com/wabarc/helper v0.0.0-20230418130954-be7440352bcb h1:psEAY4wXvhXp/Hp5C github.com/wabarc/helper v0.0.0-20230418130954-be7440352bcb/go.mod h1:S1N1F/2lwcHYqCowYTrR6i0DZ/1lcXKU+s+7rv5dUno= github.com/wabarc/imgbb v1.0.0 h1:vNud9qY4dRGp1nikb+GHIrc/sE3WOdNq5gfT/vhWEUQ= github.com/wabarc/imgbb v1.0.0/go.mod h1:piz6QXkVfFpQbaQHx70/rPDwaICkW5Ew3lShTzbnVt0= -github.com/wabarc/ipfs-pinner v1.1.1-0.20220126131044-16299c0dd43d h1:rSjZNYtr/5ep62nmcAF31v8zUGb0scD3bov/vAzYUpc= -github.com/wabarc/ipfs-pinner v1.1.1-0.20220126131044-16299c0dd43d/go.mod h1:Ah+jDIIAr5MWYIFKeWHP1EfanCm3kvIMK1jyuk2NfoM= +github.com/wabarc/ipfs-pinner v1.1.1-0.20230502052510-dc378f9e202b h1:GhmOE3qTmrPKAtu92E3wXvRwukbvO59roGs/D0jKcNc= +github.com/wabarc/ipfs-pinner v1.1.1-0.20230502052510-dc378f9e202b/go.mod h1:GwWp3WMeY7BA2jYWYJDLjnsjMntNFLTFI03qluuH6R4= github.com/wabarc/logger v0.0.0-20210417045349-d0d82e8e99ee/go.mod h1:4uYr9fnQaQoDk1ttTzLnSB3lZm3i/vrJwN8EZIB2YuI= github.com/wabarc/logger v0.0.0-20210730133522-86bd3f31e792 h1:0xD4NsQtdPCB77q4wuRn1TJOuHQ3drL0SfRd6xF4ryk= github.com/wabarc/logger v0.0.0-20210730133522-86bd3f31e792/go.mod h1:2an5YHL0CegFbaDNSU3kwqYRfxFfmcwlwSi5Bk4yk5c= @@ -642,36 +492,26 @@ github.com/wabarc/playback v0.0.0-20230331122619-84484ab4d599 h1:5L4QkS8MzMQNSDQ github.com/wabarc/playback v0.0.0-20230331122619-84484ab4d599/go.mod h1:7Bs329a9s+wwKvINBacECHMN13VhQLGOQcJAT7gtS74= github.com/wabarc/proxier v0.0.0-20230331160507-4294c0d4f82c h1:99TLxQ+XuDF6GPOc2Fn2/XjeofTZj19hBiU0BCRy2Jg= github.com/wabarc/proxier v0.0.0-20230331160507-4294c0d4f82c/go.mod h1:04UOGGKErS7VR/9S6em6hlWoQwLLfXi/Co6uWh80qhA= -github.com/wabarc/rivet v0.1.4-0.20221226142645-ebc8a29d914f h1:fkaTPNIalAj8i51BEPb3dPjxrE3ryzYt/+3yzV1u4nM= -github.com/wabarc/rivet v0.1.4-0.20221226142645-ebc8a29d914f/go.mod h1:lNEgL14wbyTc+ZNQPM+QtEZcQjB0AifzlWJbRJYQn/A= +github.com/wabarc/rivet v0.1.4-0.20230505152228-2c5c81b4bd10 h1:d1lm7aXwtuVcUjHMW9Cm8CZIhoQtZCpvF2kXNEB2RGs= +github.com/wabarc/rivet v0.1.4-0.20230505152228-2c5c81b4bd10/go.mod h1:fAjDHISxh7louWQ06lipWB0Dz7eYvQTzOOI86Mj+KiQ= github.com/wabarc/screenshot v1.6.1-0.20230315004517-7587f8bc14e0 h1:H7Ufx43fg3khCS7s39mfHHbpRFoo5GBJS846QhxfClo= github.com/wabarc/screenshot v1.6.1-0.20230315004517-7587f8bc14e0/go.mod h1:iQ6N8Myjc1XCR7Vh/1ihsWGZQY/vXAMneHwUmKRitxE= github.com/wabarc/telegra.ph v0.0.0-20230318134541-a0922e1ace3a h1:W1gb0ww1oIARudOfXEMoXkZU1gqk0JERkIvVEgtuzq4= github.com/wabarc/telegra.ph v0.0.0-20230318134541-a0922e1ace3a/go.mod h1:n+wNWjpzSvzIw8l5JbpeRzJqkOnSsXSgmI45635MUC4= github.com/wabarc/warcraft v0.3.1-0.20230308125707-3daa5592ba52 h1:ys1ltR7cKqATsLeqXBCp7kPCItIDxwyOjAFj0btH0wQ= github.com/wabarc/warcraft v0.3.1-0.20230308125707-3daa5592ba52/go.mod h1:/BbCwReBjlqHRaw8Yh+7sfAicOesiMYNhiFpuL1x8Rc= -github.com/whyrusleeping/tar-utils v0.0.0-20180509141711-8c6c8ba81d5c/go.mod h1:xxcJeBb7SIUl/Wzkz1eVKJE/CB34YNrqX2TQI6jY9zs= github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b h1:wA3QeTsaAXybLL2kb2cKhCAQTHgYTMwuI8lBlJSv5V8= github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b/go.mod h1:xT1Y5p2JR2PfSZihE0s4mjdJaRGp1waCTf5JzhQLBck= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/ybbus/httpretry v1.0.1 h1:lpo0rx/qY4kvishWD6kDgEFW7uGzx4gB/9AgPO5rg9Q= -github.com/ybbus/httpretry v1.0.1/go.mod h1:Md7FpyqeEX8F0pOnH0KN4MW1ek3cypGJmbtCNJSJMZg= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/ybbus/httpretry v1.0.2 h1:QIU8dfSF+kZx5xO1bUcLKyxYNEUsLX/hsN6gN6Up1So= +github.com/ybbus/httpretry v1.0.2/go.mod h1:fwOEa1URVFYikEqgQLCBtLyExFt5danZrxF5xF2qZh8= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= @@ -679,88 +519,36 @@ golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= +golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o= golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210505214959-0714010a04ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -768,8 +556,6 @@ golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210716203947-853a461950ff/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= @@ -777,22 +563,11 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= @@ -804,53 +579,24 @@ golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190302025703-b6889370fb10/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201207223542-d4d67f95c62d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -870,9 +616,8 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -881,145 +626,40 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220609170525-579cf78fd858 h1:Dpdu/EMxGMFgq0CeYMh4fazTD2vtlZRYE7wyynxJb9U= golang.org/x/time v0.0.0-20220609170525-579cf78fd858/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeunTOisW56dUokqW/FOteYJJ/yg= golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI= golang.zx2c4.com/wireguard v0.0.0-20230325221338-052af4a8072b h1:J1CaxgLerRR5lgx3wnr6L04cJFbWoceSK9JWBdglINo= golang.zx2c4.com/wireguard v0.0.0-20230325221338-052af4a8072b/go.mod h1:tqur9LnfstdR9ep2LaJT4lFUl0EjlHtge+gAjmsHUG4= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1039,7 +679,6 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= @@ -1050,12 +689,6 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gvisor.dev/gvisor v0.0.0-20221203005347-703fd9b7fbc0 h1:Wobr37noukisGxpKo5jAsLREcpj61RxrWYzD8uwveOY= gvisor.dev/gvisor v0.0.0-20221203005347-703fd9b7fbc0/go.mod h1:Dn5idtptoW1dIos9U6A2rpebLs/MtTwFacjKb8jLdQA= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= lukechampine.com/blake3 v1.1.7 h1:GgRMhmdsuK8+ii6UZFDL8Nb+VyMwadAgcJyfYHxG6n0= lukechampine.com/blake3 v1.1.7/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= maunium.net/go/mautrix v0.12.0 h1:jyT1TkJBIRJ7+OW7NhmMHmnEEBLsQe9ml+FYwSLhlaU= @@ -1069,8 +702,6 @@ mellium.im/xmlstream v0.15.4/go.mod h1:yXaCW2++fmVO4L9piKVkyLDqnCmictVYF7FDQW8pr mellium.im/xmpp v0.21.4 h1:hhAGFC/mGt2Bbmx46vPn+kQT0pJec7uaq+9xckkr9uI= mellium.im/xmpp v0.21.4/go.mod h1:Emo7bXXyEEgH2hdTO9zp9eGJoc9yK5dAlG0/YVJlh+U= mvdan.cc/xurls/v2 v2.2.0/go.mod h1:EV1RMtya9D6G5DMYPGD8zTQzaHet6Jh8gFlRgGRJeO8= -mvdan.cc/xurls/v2 v2.4.0 h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc= mvdan.cc/xurls/v2 v2.4.0/go.mod h1:+GEjq9uNjqs8LQfM9nVnM8rff0OQ5Iash5rzX+N1CSg= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +mvdan.cc/xurls/v2 v2.5.0 h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8= +mvdan.cc/xurls/v2 v2.5.0/go.mod h1:yQgaGQ1rFtJUzkmKiHYSSfuQxqfYmd//X6PxvholpeE= diff --git a/wayback.go b/wayback.go index f5900d7e..351ccd23 100644 --- a/wayback.go +++ b/wayback.go @@ -115,6 +115,7 @@ func (i IS) Wayback(_ reduxer.Reduxer) string { func (i IP) Wayback(rdx reduxer.Reduxer) string { opts := []ipfs.PinningOption{ ipfs.Mode(ipfs.Remote), + ipfs.Client(client), } if i.cfg.IPFSMode() == "daemon" { opts = []ipfs.PinningOption{ @@ -131,7 +132,7 @@ func (i IP) Wayback(rdx reduxer.Reduxer) string { secret := i.cfg.IPFSSecret() opts = append(opts, ipfs.Uses(target), ipfs.Apikey(apikey), ipfs.Secret(secret)) } - arc := &ip.Shaft{Hold: ipfs.Options(opts...)} + arc := &ip.Shaft{Hold: ipfs.Options(opts...), Client: client} uri := i.URL.String() ctx := i.ctx From cf384cd68b4b7ef4a07e1ec48dc655c0560d6005 Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Tue, 9 May 2023 05:36:27 +0000 Subject: [PATCH 03/21] Alway specify client timeout --- wayback.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wayback.go b/wayback.go index 351ccd23..4cb8c01e 100644 --- a/wayback.go +++ b/wayback.go @@ -308,12 +308,12 @@ func duration(ctx context.Context) time.Duration { // NewClient sets a http client. // TODO: refactoring func NewClient(opts *config.Options) { - if opts.WireGuardConfig() != "" && client != nil { + client.Timeout = opts.WaybackTimeout() * 90 / 100 + if opts.WireGuardConfig() != "" { r := strings.NewReader(opts.WireGuardConfig()) proxy := proxier.NewClient(client) if _, er := proxy.ViaWireGuard(r); er == nil { client = proxy.Client - client.Timeout = opts.WaybackTimeout() * 90 / 100 if opts.HasDebugMode() { for { resp, err := client.Get("https://www.zx2c4.com/ip") From e7cfc6b5e0c9ed4c307d4362c1979118fc337ca6 Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Tue, 9 May 2023 13:13:01 +0000 Subject: [PATCH 04/21] Remove client timeout --- wayback.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/wayback.go b/wayback.go index 4cb8c01e..7093ee79 100644 --- a/wayback.go +++ b/wayback.go @@ -5,7 +5,6 @@ package wayback // import "github.com/wabarc/wayback" import ( - "bytes" "context" "fmt" "io" @@ -34,9 +33,7 @@ import ( ) // TODO: find a better way to handle it -var client = &http.Client{ - Timeout: 30 * time.Second, -} +var client = http.DefaultClient // Collect results that archived, Arc is name of the archive service, // Dst mapping the original URL and archived destination URL, @@ -308,25 +305,29 @@ func duration(ctx context.Context) time.Duration { // NewClient sets a http client. // TODO: refactoring func NewClient(opts *config.Options) { - client.Timeout = opts.WaybackTimeout() * 90 / 100 if opts.WireGuardConfig() != "" { r := strings.NewReader(opts.WireGuardConfig()) proxy := proxier.NewClient(client) if _, er := proxy.ViaWireGuard(r); er == nil { client = proxy.Client if opts.HasDebugMode() { + endpoint := "https://icanhazip.com" for { - resp, err := client.Get("https://www.zx2c4.com/ip") + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + req, _ := http.NewRequestWithContext(ctx, http.MethodGet, endpoint, nil) + resp, err := client.Do(req) if err != nil { logger.Error("request error: %v", err) + cancel() continue } + cancel() body, err := io.ReadAll(resp.Body) if err != nil { logger.Error("read body error: %v", err) continue } - logger.Debug("client handshake: %s", bytes.ReplaceAll(body, []byte("\n"), []byte(" "))) + logger.Debug("client handshake: %s", body) resp.Body.Close() time.Sleep(time.Minute) } From aaa3ac7fee25d80b51f83f51c2033aae7358c284 Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Fri, 12 May 2023 09:46:00 +0100 Subject: [PATCH 05/21] Use proxy instead --- .github/workflows/testing.yml | 2 +- README.md | 2 +- cmd/wayback/serve.go | 2 +- config/config_test.go | 51 +++++++++++++---------------------- config/options.go | 10 +++---- config/parser.go | 4 +-- go.mod | 18 ++++++------- go.sum | 35 ++++++++++++------------ wayback.1 | 4 +-- wayback.conf | 1 + wayback.go | 31 +++++++++++---------- 11 files changed, 72 insertions(+), 88 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 02e9476f..0fec1dca 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -44,7 +44,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - go: [ "1.20" ] + go: [ "1.18", "1.19", "1.20" ] include: # only update test coverage stats with the most recent go version on linux - go: 1.x diff --git a/README.md b/README.md index 3a6fdaae..4a91bbea 100644 --- a/README.md +++ b/README.md @@ -228,7 +228,7 @@ You can also specify configuration options either via command flags or via envir | - | `WAYBACK_LISTEN_ADDR` | `0.0.0.0:8964` | The listen address for the HTTP server | | - | `CHROME_BIN` | - | Preferred to sets the path to the Chrome executable | | - | `CHROME_REMOTE_ADDR` | - | Chrome/Chromium remote debugging address, for screenshot, format: `host:port`, `wss://domain.tld` | -| - | `WIREGUARD_CONFIG` | - | WireGuard proxy client config | +| - | `WAYBACK_PROXY` | - | Proxy address, e.g. `socks5://127.0.0.1:1080` | | - | `WAYBACK_POOLING_SIZE` | `3` | Number of worker pool for wayback at once | | - | `WAYBACK_BOLT_PATH` | `./wayback.db` | File path of bolt database | | - | `WAYBACK_STORAGE_DIR` | - | Directory to store binary file, e.g. PDF, html file | diff --git a/cmd/wayback/serve.go b/cmd/wayback/serve.go index f48e2480..7ddd2649 100644 --- a/cmd/wayback/serve.go +++ b/cmd/wayback/serve.go @@ -44,7 +44,7 @@ func serve(_ *cobra.Command, opts *config.Options, _ []string) { go pool.Roll() // Set global client - go wayback.NewClient(opts) + wayback.SetClient(ctx, opts) pub := publish.New(ctx, opts) go pub.Start() diff --git a/config/config_test.go b/config/config_test.go index 3ef73623..fa00ada3 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -3071,52 +3071,39 @@ func TestEnableServices(t *testing.T) { } } -func TestWireGuardConfig(t *testing.T) { +func TestProxy(t *testing.T) { t.Parallel() var tests = []struct { - config string + address string expected string }{ { - config: "", - expected: defWireGuardConfig, + address: "", + expected: defProxy, }, { - config: "[Interface]\nPrivateKey = cHjrT4AVXJBkufpQxfWFKbLGeKAykzJ6SitAXRRZKmU=\nAddress = 10.0.0.2/32\n\n[Peer]\nPublicKey = qEfR4bOboFVaavdICJoSujBmdJ2LOvjDZItWBqDh8HM=\nEndpoint = example.com:51820\nAllowedIPs = 0.0.0.0/0, ::/0", - expected: `[Interface] -PrivateKey = cHjrT4AVXJBkufpQxfWFKbLGeKAykzJ6SitAXRRZKmU= -Address = 10.0.0.2/32 - -[Peer] -PublicKey = qEfR4bOboFVaavdICJoSujBmdJ2LOvjDZItWBqDh8HM= -Endpoint = example.com:51820 -AllowedIPs = 0.0.0.0/0, ::/0`, + address: "http://127.0.0.1", + expected: `http://127.0.0.1`, }, { - config: `[Interface] -PrivateKey = cHjrT4AVXJBkufpQxfWFKbLGeKAykzJ6SitAXRRZKmU= -Address = 10.0.0.2/32 - -[Peer] -PublicKey = qEfR4bOboFVaavdICJoSujBmdJ2LOvjDZItWBqDh8HM= -Endpoint = example.com:51820 -AllowedIPs = 0.0.0.0/0, ::/0`, - expected: `[Interface] -PrivateKey = cHjrT4AVXJBkufpQxfWFKbLGeKAykzJ6SitAXRRZKmU= -Address = 10.0.0.2/32 - -[Peer] -PublicKey = qEfR4bOboFVaavdICJoSujBmdJ2LOvjDZItWBqDh8HM= -Endpoint = example.com:51820 -AllowedIPs = 0.0.0.0/0, ::/0`, + address: "http://127.0.0.1:1080", + expected: `http://127.0.0.1:1080`, + }, + { + address: "https://127.0.0.1:1080", + expected: `https://127.0.0.1:1080`, + }, + { + address: "socks5://127.0.0.1:1080", + expected: `socks5://127.0.0.1:1080`, }, } for i, test := range tests { t.Run(strconv.Itoa(i), func(t *testing.T) { os.Clearenv() - os.Setenv("WIREGUARD_CONFIG", test.config) + os.Setenv("WAYBACK_PROXY", test.address) parser := NewParser() opts, err := parser.ParseEnvironmentVariables() @@ -3124,9 +3111,9 @@ AllowedIPs = 0.0.0.0/0, ::/0`, t.Fatalf(`Parsing environment variables failed: %v`, err) } - got := opts.WireGuardConfig() + got := opts.Proxy() if got != test.expected { - t.Fatalf(`Unexpected get WireGuard config, got %s instead of %s`, got, test.expected) + t.Fatalf(`Unexpected get proxy, got %s instead of %s`, got, test.expected) } }) } diff --git a/config/options.go b/config/options.go index 729f0858..e89917b7 100644 --- a/config/options.go +++ b/config/options.go @@ -92,7 +92,7 @@ const ( defWaybackMaxRetries = 2 defWaybackUserAgent = "WaybackArchiver/1.0" defWaybackFallback = false - defWireGuardConfig = "" + defProxy = "" defWaybackMeiliEndpoint = "" defWaybackMeiliIndexing = "capsules" @@ -144,7 +144,7 @@ type Options struct { poolingSize int storageDir string maxMediaSize string - wireguardConfig string + proxy string waybackTimeout int waybackMaxRetries int waybackUserAgent string @@ -913,7 +913,7 @@ func (o *Options) HTTPdEnabled() bool { return o.isEnabled(ServiceHTTPd) } -// WireGuardConfig returns the WireGuard configuration. -func (o *Options) WireGuardConfig() string { - return breakLine(o.wireguardConfig) +// Proxy returns the proxy server address. +func (o *Options) Proxy() string { + return o.proxy } diff --git a/config/parser.go b/config/parser.go index d73bb897..ef600e5b 100644 --- a/config/parser.go +++ b/config/parser.go @@ -93,8 +93,8 @@ func (p *Parser) parseLines(lines []string) (err error) { case "CHROME_REMOTE_ADDR": p.opts.enabledChromeRemote = hasValue(val, defEnabledChromeRemote) p.opts.chromeRemoteAddr = parseString(val, defChromeRemoteAddr) - case "WIREGUARD_CONFIG": - p.opts.wireguardConfig = parseString(val, defWireGuardConfig) + case "WAYBACK_PROXY": + p.opts.proxy = parseString(val, defProxy) case "WAYBACK_IPFS_HOST": p.opts.ipfs.host = parseString(val, defIPFSHost) case "WAYBACK_IPFS_PORT": diff --git a/go.mod b/go.mod index 4e5f34da..d1824501 100644 --- a/go.mod +++ b/go.mod @@ -43,13 +43,13 @@ require ( github.com/wabarc/ipfs-pinner v1.1.1-0.20230502052510-dc378f9e202b github.com/wabarc/logger v0.0.0-20210730133522-86bd3f31e792 github.com/wabarc/playback v0.0.0-20230331122619-84484ab4d599 - github.com/wabarc/proxier v0.0.0-20230331160507-4294c0d4f82c + github.com/wabarc/proxier v0.0.0-20230511195500-477b79d84aff github.com/wabarc/rivet v0.1.4-0.20230505152228-2c5c81b4bd10 github.com/wabarc/screenshot v1.6.1-0.20230315004517-7587f8bc14e0 github.com/wabarc/telegra.ph v0.0.0-20230318134541-a0922e1ace3a github.com/wabarc/warcraft v0.3.1-0.20230308125707-3daa5592ba52 go.etcd.io/bbolt v1.3.6 - golang.org/x/net v0.9.0 + golang.org/x/net v0.10.0 golang.org/x/sync v0.1.0 gopkg.in/telebot.v3 v3.0.0-20220130115853-f0291132d3c3 maunium.net/go/mautrix v0.12.0 @@ -62,6 +62,7 @@ require ( github.com/MercuryEngineering/CookieMonster v0.0.0-20180304172713-1584578b3403 // indirect github.com/SaveTheRbtz/generic-sync-map-go v0.0.0-20230201052002-6c5833b989be // indirect github.com/VividCortex/ewma v1.2.0 // indirect + github.com/andybalholm/brotli v1.0.5 // indirect github.com/andybalholm/cascadia v1.3.2 // indirect github.com/benbjohnson/clock v1.3.3 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -84,7 +85,7 @@ require ( github.com/dop251/goja v0.0.0-20221115122301-6c0d9883792e // indirect github.com/fatih/color v1.15.0 // indirect github.com/fortytw2/leaktest v1.3.0 // indirect - github.com/go-ini/ini v1.67.0 // indirect + github.com/gaukas/godicttls v0.0.3 // indirect github.com/go-shiori/dom v0.0.0-20210627111528-4e4722cd0d65 // indirect github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect github.com/gobwas/httphead v0.1.0 // indirect @@ -92,7 +93,6 @@ require ( github.com/gobwas/ws v1.1.0 // indirect github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/btree v1.0.1 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/uuid v1.3.0 // indirect github.com/iawia002/lia v0.0.0-20221116085912-1f653221be4b // indirect @@ -107,6 +107,7 @@ require ( github.com/kallydev/telegraph-go v1.0.1-0.20230318133700-df034d9eed50 // indirect github.com/kennygrant/sanitize v1.2.4 // indirect github.com/kkdai/youtube/v2 v2.7.18 // indirect + github.com/klauspost/compress v1.16.5 // indirect github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/kr/pretty v0.3.0 // indirect github.com/kr/text v0.2.0 // indirect @@ -134,6 +135,7 @@ require ( github.com/oliamb/cutter v0.2.2 // indirect github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/procfs v0.9.0 // indirect + github.com/refraction-networking/utls v1.3.2 // indirect github.com/rivo/uniseg v0.4.3 // indirect github.com/robertkrimen/otto v0.0.0-20211024170158-b87d35c0b86f // indirect github.com/rogpeppe/go-internal v1.10.0 // indirect @@ -150,19 +152,15 @@ require ( github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b // indirect github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect github.com/ybbus/httpretry v1.0.2 // indirect - golang.org/x/crypto v0.8.0 // indirect + golang.org/x/crypto v0.9.0 // indirect golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 // indirect golang.org/x/mod v0.10.0 // indirect - golang.org/x/sys v0.7.0 // indirect + golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect - golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect golang.org/x/tools v0.7.0 // indirect - golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect - golang.zx2c4.com/wireguard v0.0.0-20230325221338-052af4a8072b // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/sourcemap.v1 v1.0.5 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gvisor.dev/gvisor v0.0.0-20221203005347-703fd9b7fbc0 // indirect lukechampine.com/blake3 v1.1.7 // indirect mellium.im/reader v0.1.0 // indirect mvdan.cc/xurls/v2 v2.5.0 // indirect diff --git a/go.sum b/go.sum index fb116405..3b150271 100644 --- a/go.sum +++ b/go.sum @@ -14,6 +14,8 @@ github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAU github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= +github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/andybalholm/cascadia v1.2.0/go.mod h1:YCyR8vOZT9aZ1CHEd8ap0gMVm2aFgxBp0T0eFw1RUQY= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= @@ -134,9 +136,9 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= +github.com/gaukas/godicttls v0.0.3 h1:YNDIf0d9adcxOijiLrEzpfZGAkNwLRzPaG6OjU7EITk= +github.com/gaukas/godicttls v0.0.3/go.mod h1:l6EenT4TLWgTdwslVb4sEMOCf7Bv0JAK67deKr9/NCI= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= -github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= @@ -185,8 +187,6 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -261,6 +261,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/kkdai/youtube/v2 v2.7.18 h1:bVP60bULmCZg5H9GsLLeBx0ONHEsZwdSrzPrVCVWJ1k= github.com/kkdai/youtube/v2 v2.7.18/go.mod h1:CeUYFc227iiNNpEaipwmJIYPNsuH6rb/8H3HpWEG63U= +github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= +github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= @@ -370,6 +372,7 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/h2conn v0.0.0-20180911140238-13e7df33ed15 h1:N2JoDX2KIfZlzcMuTqPTeeMXi8GwdwJHgZ8sXqe73Ds= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= @@ -387,6 +390,8 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/refraction-networking/utls v1.3.2 h1:o+AkWB57mkcoW36ET7uJ002CpBWHu0KPxi6vzxvPnv8= +github.com/refraction-networking/utls v1.3.2/go.mod h1:fmoaOww2bxzzEpIKOebIsnBvjQpqP7L2vcm/9KUfm/E= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw= @@ -490,8 +495,8 @@ github.com/wabarc/memento v0.0.0-20221023035729-e42d0fe1cefb h1:mi8kE7ET/CLeMCzQ github.com/wabarc/memento v0.0.0-20221023035729-e42d0fe1cefb/go.mod h1:qP6GisnqoSDc5Ivj34yV+Qar3B6tYyLDKx42oCDX1zY= github.com/wabarc/playback v0.0.0-20230331122619-84484ab4d599 h1:5L4QkS8MzMQNSDQ36VIaMEu7eSox0c9D5080pyJSZMM= github.com/wabarc/playback v0.0.0-20230331122619-84484ab4d599/go.mod h1:7Bs329a9s+wwKvINBacECHMN13VhQLGOQcJAT7gtS74= -github.com/wabarc/proxier v0.0.0-20230331160507-4294c0d4f82c h1:99TLxQ+XuDF6GPOc2Fn2/XjeofTZj19hBiU0BCRy2Jg= -github.com/wabarc/proxier v0.0.0-20230331160507-4294c0d4f82c/go.mod h1:04UOGGKErS7VR/9S6em6hlWoQwLLfXi/Co6uWh80qhA= +github.com/wabarc/proxier v0.0.0-20230511195500-477b79d84aff h1:iYFrUax0puGvHmoO25rQIOhOnY3SrCNdTcV0lTvJvKU= +github.com/wabarc/proxier v0.0.0-20230511195500-477b79d84aff/go.mod h1:6fy1Vq25/cm5xXTf8fNiujx/aLUb4mB3lheiajTixUM= github.com/wabarc/rivet v0.1.4-0.20230505152228-2c5c81b4bd10 h1:d1lm7aXwtuVcUjHMW9Cm8CZIhoQtZCpvF2kXNEB2RGs= github.com/wabarc/rivet v0.1.4-0.20230505152228-2c5c81b4bd10/go.mod h1:fAjDHISxh7louWQ06lipWB0Dz7eYvQTzOOI86Mj+KiQ= github.com/wabarc/screenshot v1.6.1-0.20230315004517-7587f8bc14e0 h1:H7Ufx43fg3khCS7s39mfHHbpRFoo5GBJS846QhxfClo= @@ -525,8 +530,8 @@ golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5 golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= +golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o= golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -560,8 +565,9 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -610,8 +616,9 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= @@ -627,8 +634,6 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220609170525-579cf78fd858 h1:Dpdu/EMxGMFgq0CeYMh4fazTD2vtlZRYE7wyynxJb9U= -golang.org/x/time v0.0.0-20220609170525-579cf78fd858/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -641,10 +646,6 @@ golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeunTOisW56dUokqW/FOteYJJ/yg= -golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI= -golang.zx2c4.com/wireguard v0.0.0-20230325221338-052af4a8072b h1:J1CaxgLerRR5lgx3wnr6L04cJFbWoceSK9JWBdglINo= -golang.zx2c4.com/wireguard v0.0.0-20230325221338-052af4a8072b/go.mod h1:tqur9LnfstdR9ep2LaJT4lFUl0EjlHtge+gAjmsHUG4= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -686,8 +687,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gvisor.dev/gvisor v0.0.0-20221203005347-703fd9b7fbc0 h1:Wobr37noukisGxpKo5jAsLREcpj61RxrWYzD8uwveOY= -gvisor.dev/gvisor v0.0.0-20221203005347-703fd9b7fbc0/go.mod h1:Dn5idtptoW1dIos9U6A2rpebLs/MtTwFacjKb8jLdQA= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= lukechampine.com/blake3 v1.1.7 h1:GgRMhmdsuK8+ii6UZFDL8Nb+VyMwadAgcJyfYHxG6n0= lukechampine.com/blake3 v1.1.7/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= diff --git a/wayback.1 b/wayback.1 index c4677a54..8fd9716d 100644 --- a/wayback.1 +++ b/wayback.1 @@ -123,8 +123,8 @@ Log level, supported level are "debug", "info", "warn", "error", "fatal", defaul .B ENABLE_METRICS Enable metrics collector\&. .TP -.B WIREGUARD_CONFIG -WireGuard proxy client config.\&. +.B WAYBACK_PROXY +Proxy address.\&. .TP .B WAYBACK_LISTEN_ADDR The listen address for the HTTP server. default "0.0.0.0:8964"\&. diff --git a/wayback.conf b/wayback.conf index 922454bb..998be45b 100644 --- a/wayback.conf +++ b/wayback.conf @@ -66,6 +66,7 @@ WAYBACK_MEDIA_SITES= WAYBACK_TIMEOUT=300 WAYBACK_USERAGENT=WaybackArchiver/1.0 WAYBACK_FALLBACK=off +WAYBACK_PROXY= # ipfs slot: infura, pinata # doc: https://github.com/wabarc/ipfs-pinner#supported-pinning-services diff --git a/wayback.go b/wayback.go index 7093ee79..1f3645ff 100644 --- a/wayback.go +++ b/wayback.go @@ -5,13 +5,13 @@ package wayback // import "github.com/wabarc/wayback" import ( + "bytes" "context" "fmt" "io" "net/http" "net/url" "os" - "strings" "sync" "time" @@ -304,16 +304,19 @@ func duration(ctx context.Context) time.Duration { // NewClient sets a http client. // TODO: refactoring -func NewClient(opts *config.Options) { - if opts.WireGuardConfig() != "" { - r := strings.NewReader(opts.WireGuardConfig()) - proxy := proxier.NewClient(client) - if _, er := proxy.ViaWireGuard(r); er == nil { - client = proxy.Client - if opts.HasDebugMode() { - endpoint := "https://icanhazip.com" +func SetClient(ctx context.Context, opts *config.Options) { + var err error + if opts.Proxy() != "" { + client.Transport, err = proxier.NewUTLSRoundTripper(proxier.Proxy("socks5://127.0.0.1:25344")) + if err != nil { + logger.Error("create utls round tripper failed: %v", err) + return + } + if opts.HasDebugMode() { + endpoint := "https://icanhazip.com" + go func() { for { - ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + ctx, cancel := context.WithTimeout(ctx, 30*time.Second) req, _ := http.NewRequestWithContext(ctx, http.MethodGet, endpoint, nil) resp, err := client.Do(req) if err != nil { @@ -327,15 +330,11 @@ func NewClient(opts *config.Options) { logger.Error("read body error: %v", err) continue } - logger.Debug("client handshake: %s", body) + logger.Debug("client handshake: %s", bytes.TrimSpace(body)) resp.Body.Close() time.Sleep(time.Minute) } - } - } else { - logger.Fatal("new client error: %v", er) + }() } } - - select {} } From e2682cc8d3ccd76a655a1f54c575c63bca163120 Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Fri, 12 May 2023 10:36:47 +0100 Subject: [PATCH 06/21] Use proxy address from configuration --- wayback.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wayback.go b/wayback.go index 1f3645ff..f23c79fe 100644 --- a/wayback.go +++ b/wayback.go @@ -307,7 +307,7 @@ func duration(ctx context.Context) time.Duration { func SetClient(ctx context.Context, opts *config.Options) { var err error if opts.Proxy() != "" { - client.Transport, err = proxier.NewUTLSRoundTripper(proxier.Proxy("socks5://127.0.0.1:25344")) + client.Transport, err = proxier.NewUTLSRoundTripper(proxier.Proxy(opts.Proxy())) if err != nil { logger.Error("create utls round tripper failed: %v", err) return From 18c82918f05cdd1d102136287dfbb87f6db56bac Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Fri, 12 May 2023 10:47:35 +0100 Subject: [PATCH 07/21] Do not change default client --- wayback.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wayback.go b/wayback.go index f23c79fe..53a275e3 100644 --- a/wayback.go +++ b/wayback.go @@ -33,7 +33,7 @@ import ( ) // TODO: find a better way to handle it -var client = http.DefaultClient +var client = &http.Client{} // Collect results that archived, Arc is name of the archive service, // Dst mapping the original URL and archived destination URL, From 128dffa42d0d2c537f6e289a1cd74577da4e2fed Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Fri, 12 May 2023 10:56:10 +0100 Subject: [PATCH 08/21] Fix linter --- wayback.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wayback.go b/wayback.go index 53a275e3..c13fc621 100644 --- a/wayback.go +++ b/wayback.go @@ -305,8 +305,11 @@ func duration(ctx context.Context) time.Duration { // NewClient sets a http client. // TODO: refactoring func SetClient(ctx context.Context, opts *config.Options) { - var err error if opts.Proxy() != "" { + var ( + err error + cancel context.CancelFunc + ) client.Transport, err = proxier.NewUTLSRoundTripper(proxier.Proxy(opts.Proxy())) if err != nil { logger.Error("create utls round tripper failed: %v", err) @@ -316,8 +319,8 @@ func SetClient(ctx context.Context, opts *config.Options) { endpoint := "https://icanhazip.com" go func() { for { - ctx, cancel := context.WithTimeout(ctx, 30*time.Second) - req, _ := http.NewRequestWithContext(ctx, http.MethodGet, endpoint, nil) + ctx, cancel = context.WithTimeout(ctx, 30*time.Second) + req, _ := http.NewRequestWithContext(ctx, http.MethodGet, endpoint, nil) // nolint:errcheck resp, err := client.Do(req) if err != nil { logger.Error("request error: %v", err) From ad70217caa3c85b71c7f6826f9d097bc1e51307f Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Fri, 12 May 2023 17:17:26 +0100 Subject: [PATCH 09/21] Remove rivet client --- wayback.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wayback.go b/wayback.go index c13fc621..b47f1737 100644 --- a/wayback.go +++ b/wayback.go @@ -112,7 +112,6 @@ func (i IS) Wayback(_ reduxer.Reduxer) string { func (i IP) Wayback(rdx reduxer.Reduxer) string { opts := []ipfs.PinningOption{ ipfs.Mode(ipfs.Remote), - ipfs.Client(client), } if i.cfg.IPFSMode() == "daemon" { opts = []ipfs.PinningOption{ @@ -129,7 +128,7 @@ func (i IP) Wayback(rdx reduxer.Reduxer) string { secret := i.cfg.IPFSSecret() opts = append(opts, ipfs.Uses(target), ipfs.Apikey(apikey), ipfs.Secret(secret)) } - arc := &ip.Shaft{Hold: ipfs.Options(opts...), Client: client} + arc := &ip.Shaft{Hold: ipfs.Options(opts...)} uri := i.URL.String() ctx := i.ctx From 31d0759eb623caec438ec4669bfaddfd736f586f Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Mon, 15 May 2023 19:43:02 +0100 Subject: [PATCH 10/21] Move client to ingress module --- cmd/wayback/serve.go | 8 +-- go.mod | 2 +- go.sum | 4 +- ingress/doc.go | 5 +- ingress/http.go | 83 +++++++++++++++++++++++++++++++ ingress/init.go | 14 ++++++ ingress/{ => register}/publish.go | 0 ingress/{ => register}/service.go | 0 publish/notion/notion.go | 10 +++- reduxer/reduxer.go | 7 ++- wayback.go | 54 ++------------------ 11 files changed, 123 insertions(+), 64 deletions(-) create mode 100644 ingress/http.go create mode 100644 ingress/init.go rename ingress/{ => register}/publish.go (100%) rename ingress/{ => register}/service.go (100%) diff --git a/cmd/wayback/serve.go b/cmd/wayback/serve.go index 7ddd2649..40a49ba4 100644 --- a/cmd/wayback/serve.go +++ b/cmd/wayback/serve.go @@ -11,15 +11,15 @@ import ( "github.com/spf13/cobra" "github.com/wabarc/logger" - "github.com/wabarc/wayback" "github.com/wabarc/wayback/config" + "github.com/wabarc/wayback/ingress" "github.com/wabarc/wayback/pooling" "github.com/wabarc/wayback/publish" "github.com/wabarc/wayback/service" "github.com/wabarc/wayback/storage" "github.com/wabarc/wayback/systemd" - _ "github.com/wabarc/wayback/ingress" + _ "github.com/wabarc/wayback/ingress/register" ) // Create channel to listen for signals. @@ -43,8 +43,8 @@ func serve(_ *cobra.Command, opts *config.Options, _ []string) { pool := pooling.New(ctx, cfg...) go pool.Roll() - // Set global client - wayback.SetClient(ctx, opts) + // Ingress initialize + ingress.Init(opts) pub := publish.New(ctx, opts) go pub.Start() diff --git a/go.mod b/go.mod index d1824501..39141d48 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( github.com/wabarc/playback v0.0.0-20230331122619-84484ab4d599 github.com/wabarc/proxier v0.0.0-20230511195500-477b79d84aff github.com/wabarc/rivet v0.1.4-0.20230505152228-2c5c81b4bd10 - github.com/wabarc/screenshot v1.6.1-0.20230315004517-7587f8bc14e0 + github.com/wabarc/screenshot v1.6.1-0.20230515153404-ed9208cc295b github.com/wabarc/telegra.ph v0.0.0-20230318134541-a0922e1ace3a github.com/wabarc/warcraft v0.3.1-0.20230308125707-3daa5592ba52 go.etcd.io/bbolt v1.3.6 diff --git a/go.sum b/go.sum index 3b150271..14d3ebf6 100644 --- a/go.sum +++ b/go.sum @@ -499,8 +499,8 @@ github.com/wabarc/proxier v0.0.0-20230511195500-477b79d84aff h1:iYFrUax0puGvHmoO github.com/wabarc/proxier v0.0.0-20230511195500-477b79d84aff/go.mod h1:6fy1Vq25/cm5xXTf8fNiujx/aLUb4mB3lheiajTixUM= github.com/wabarc/rivet v0.1.4-0.20230505152228-2c5c81b4bd10 h1:d1lm7aXwtuVcUjHMW9Cm8CZIhoQtZCpvF2kXNEB2RGs= github.com/wabarc/rivet v0.1.4-0.20230505152228-2c5c81b4bd10/go.mod h1:fAjDHISxh7louWQ06lipWB0Dz7eYvQTzOOI86Mj+KiQ= -github.com/wabarc/screenshot v1.6.1-0.20230315004517-7587f8bc14e0 h1:H7Ufx43fg3khCS7s39mfHHbpRFoo5GBJS846QhxfClo= -github.com/wabarc/screenshot v1.6.1-0.20230315004517-7587f8bc14e0/go.mod h1:iQ6N8Myjc1XCR7Vh/1ihsWGZQY/vXAMneHwUmKRitxE= +github.com/wabarc/screenshot v1.6.1-0.20230515153404-ed9208cc295b h1:LOpFnWJEgQ99Hv/DEK/bgO5oJDaiKfc3yodDcd9Rn84= +github.com/wabarc/screenshot v1.6.1-0.20230515153404-ed9208cc295b/go.mod h1:iQ6N8Myjc1XCR7Vh/1ihsWGZQY/vXAMneHwUmKRitxE= github.com/wabarc/telegra.ph v0.0.0-20230318134541-a0922e1ace3a h1:W1gb0ww1oIARudOfXEMoXkZU1gqk0JERkIvVEgtuzq4= github.com/wabarc/telegra.ph v0.0.0-20230318134541-a0922e1ace3a/go.mod h1:n+wNWjpzSvzIw8l5JbpeRzJqkOnSsXSgmI45635MUC4= github.com/wabarc/warcraft v0.3.1-0.20230308125707-3daa5592ba52 h1:ys1ltR7cKqATsLeqXBCp7kPCItIDxwyOjAFj0btH0wQ= diff --git a/ingress/doc.go b/ingress/doc.go index 20f79c0c..b41760ea 100644 --- a/ingress/doc.go +++ b/ingress/doc.go @@ -13,9 +13,10 @@ such as register, as shown in the following example: package main import ( - _ "github.com/wabarc/wayback/ingress" + "github.com/wabarc/wayback/ingress" "github.com/wabarc/wayback/publish" "github.com/wabarc/wayback/service" + _ "github.com/wabarc/wayback/ingress/register" ) func main() { @@ -26,6 +27,8 @@ such as register, as shown in the following example: go pub.Start() defer pub.Stop() + ingress.Init(opts) + // Use the publish service to publish data. // ... diff --git a/ingress/http.go b/ingress/http.go new file mode 100644 index 00000000..94bb43b6 --- /dev/null +++ b/ingress/http.go @@ -0,0 +1,83 @@ +// Copyright 2023 Wayback Archiver. All rights reserved. +// Use of this source code is governed by the GNU GPL v3 +// license that can be found in the LICENSE file. + +package ingress // import "github.com/wabarc/wayback/ingress" + +import ( + "bytes" + "context" + "io" + "net" + "net/http" + "net/url" + "time" + + "github.com/wabarc/logger" + "github.com/wabarc/proxier" + "github.com/wabarc/wayback/config" +) + +var ( + client = &http.Client{} + endpoint = "https://icanhazip.com" +) + +func initClient(opts *config.Options) { + if opts.Proxy() != "" { + u, err := url.Parse(opts.Proxy()) + if err != nil { + logger.Error("proxy format invalid: %v", err) + return + } + if !canConnect(u.Hostname(), u.Port()) { + logger.Warn("proxy %s can't connect", u) + return + } + + client.Transport, err = proxier.NewUTLSRoundTripper(proxier.Proxy(opts.Proxy())) + if err != nil { + logger.Error("create utls round tripper failed: %v", err) + } + if opts.HasDebugMode() { + go func() { + for { + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + req, _ := http.NewRequestWithContext(ctx, http.MethodGet, endpoint, nil) // nolint:errcheck + resp, err := client.Do(req) + if err != nil { + logger.Error("request error: %v", err) + cancel() + continue + } + cancel() + body, err := io.ReadAll(resp.Body) + if err != nil { + logger.Error("read body error: %v", err) + continue + } + logger.Debug("client handshake: %s", bytes.TrimSpace(body)) + resp.Body.Close() + time.Sleep(time.Minute) + } + }() + } + } +} + +func canConnect(host, port string) bool { + addr := net.JoinHostPort(host, port) + conn, err := net.DialTimeout("tcp", addr, time.Second) + if err != nil { + return false + } + if conn != nil { + return true + } + return false +} + +// Client returns http.Client +func Client() *http.Client { + return client +} diff --git a/ingress/init.go b/ingress/init.go new file mode 100644 index 00000000..df9074be --- /dev/null +++ b/ingress/init.go @@ -0,0 +1,14 @@ +// Copyright 2023 Wayback Archiver. All rights reserved. +// Use of this source code is governed by the GNU GPL v3 +// license that can be found in the LICENSE file. + +package ingress // import "github.com/wabarc/wayback/ingress" + +import ( + "github.com/wabarc/wayback/config" +) + +// Init initializes functions with the given configuration options. +func Init(opts *config.Options) { + initClient(opts) +} diff --git a/ingress/publish.go b/ingress/register/publish.go similarity index 100% rename from ingress/publish.go rename to ingress/register/publish.go diff --git a/ingress/service.go b/ingress/register/service.go similarity index 100% rename from ingress/service.go rename to ingress/register/service.go diff --git a/publish/notion/notion.go b/publish/notion/notion.go index ba8bb002..887eaa0e 100644 --- a/publish/notion/notion.go +++ b/publish/notion/notion.go @@ -23,6 +23,7 @@ import ( "github.com/wabarc/wayback" "github.com/wabarc/wayback/config" "github.com/wabarc/wayback/errors" + "github.com/wabarc/wayback/ingress" "github.com/wabarc/wayback/metrics" "github.com/wabarc/wayback/publish" "github.com/wabarc/wayback/reduxer" @@ -188,7 +189,7 @@ func (no *Notion) params(cols []wayback.Collect, head, body string) (notion.Crea } if doc, err := goquery.NewDocumentFromReader(strings.NewReader(body)); err == nil { - nodes := traverseNodes(doc.Contents(), imgbb.NewImgBB(nil, "")) + nodes := traverseNodes(doc.Contents(), imgbb.NewImgBB(ingress.Client(), "")) children = append(children, nodes...) } @@ -321,7 +322,12 @@ func download(u *url.URL) (path string, err error) { } defer fd.Close() - resp, err := http.Get(u.String()) // nosemgrep: gitlab.gosec.G104-1.G107-1, gitlab.gosec.G107-1, gitlab.gosec.G108-1 + client := ingress.Client() + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + + req, err := http.NewRequestWithContext(ctx, http.MethodGet, u.String(), nil) + resp, err := client.Do(req) // nosemgrep: gitlab.gosec.G104-1.G107-1, gitlab.gosec.G107-1, gitlab.gosec.G108-1 if err != nil { return path, err } diff --git a/reduxer/reduxer.go b/reduxer/reduxer.go index 85432243..a6a5f753 100644 --- a/reduxer/reduxer.go +++ b/reduxer/reduxer.go @@ -9,7 +9,6 @@ import ( "context" "fmt" "io" - "net/http" "net/url" "os" "path/filepath" @@ -27,6 +26,7 @@ import ( "github.com/wabarc/warcraft" "github.com/wabarc/wayback/config" "github.com/wabarc/wayback/errors" + "github.com/wabarc/wayback/ingress" "golang.org/x/sync/errgroup" ) @@ -306,9 +306,8 @@ func remotely(ctx context.Context, artifact *Artifact) (err error) { &artifact.Media, } - c := &http.Client{Timeout: timeout} - cat := catbox.New(c) - anon := anonfile.NewAnonfile(c) + cat := catbox.New(ingress.Client()) + anon := anonfile.NewAnonfile(ingress.Client()) g, _ := errgroup.WithContext(ctx) var mu sync.Mutex diff --git a/wayback.go b/wayback.go index b47f1737..b71bc71b 100644 --- a/wayback.go +++ b/wayback.go @@ -5,11 +5,8 @@ package wayback // import "github.com/wabarc/wayback" import ( - "bytes" "context" "fmt" - "io" - "net/http" "net/url" "os" "sync" @@ -17,10 +14,10 @@ import ( "github.com/wabarc/logger" "github.com/wabarc/playback" - "github.com/wabarc/proxier" "github.com/wabarc/rivet/ipfs" "github.com/wabarc/wayback/config" "github.com/wabarc/wayback/errors" + "github.com/wabarc/wayback/ingress" "github.com/wabarc/wayback/reduxer" "golang.org/x/sync/errgroup" @@ -32,9 +29,6 @@ import ( pinner "github.com/wabarc/ipfs-pinner" ) -// TODO: find a better way to handle it -var client = &http.Client{} - // Collect results that archived, Arc is name of the archive service, // Dst mapping the original URL and archived destination URL, // Ext is extra descriptions. @@ -84,7 +78,7 @@ type Waybacker interface { // Wayback implements the standard Waybacker interface: // it reads URL from the IA and returns archived URL as a string. func (i IA) Wayback(_ reduxer.Reduxer) string { - arc := &ia.Archiver{Client: client} + arc := &ia.Archiver{Client: ingress.Client()} dst, err := arc.Wayback(i.ctx, i.URL) if err != nil { logger.Error("wayback %s to Internet Archive failed: %v", i.URL.String(), err) @@ -96,7 +90,7 @@ func (i IA) Wayback(_ reduxer.Reduxer) string { // Wayback implements the standard Waybacker interface: // it reads URL from the IS and returns archived URL as a string. func (i IS) Wayback(_ reduxer.Reduxer) string { - arc := is.NewArchiver(client) + arc := is.NewArchiver(ingress.Client()) defer arc.CloseTor() dst, err := arc.Wayback(i.ctx, i.URL) @@ -153,7 +147,7 @@ func (i IP) Wayback(rdx reduxer.Reduxer) string { // Wayback implements the standard Waybacker interface: // it reads URL from the PH and returns archived URL as a string. func (i PH) Wayback(rdx reduxer.Reduxer) string { - arc := ph.New(client) + arc := ph.New(ingress.Client()) uri := i.URL.String() ctx := i.ctx @@ -300,43 +294,3 @@ func duration(ctx context.Context) time.Duration { return time.Duration(safeTime) * time.Second } - -// NewClient sets a http client. -// TODO: refactoring -func SetClient(ctx context.Context, opts *config.Options) { - if opts.Proxy() != "" { - var ( - err error - cancel context.CancelFunc - ) - client.Transport, err = proxier.NewUTLSRoundTripper(proxier.Proxy(opts.Proxy())) - if err != nil { - logger.Error("create utls round tripper failed: %v", err) - return - } - if opts.HasDebugMode() { - endpoint := "https://icanhazip.com" - go func() { - for { - ctx, cancel = context.WithTimeout(ctx, 30*time.Second) - req, _ := http.NewRequestWithContext(ctx, http.MethodGet, endpoint, nil) // nolint:errcheck - resp, err := client.Do(req) - if err != nil { - logger.Error("request error: %v", err) - cancel() - continue - } - cancel() - body, err := io.ReadAll(resp.Body) - if err != nil { - logger.Error("read body error: %v", err) - continue - } - logger.Debug("client handshake: %s", bytes.TrimSpace(body)) - resp.Body.Close() - time.Sleep(time.Minute) - } - }() - } - } -} From 617151902eff6032eefe9d016e12c1ff53abfcb1 Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Tue, 16 May 2023 12:54:11 +0100 Subject: [PATCH 11/21] Correct package name --- ingress/register/publish.go | 2 +- ingress/register/service.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ingress/register/publish.go b/ingress/register/publish.go index 73a661be..d7b07d08 100644 --- a/ingress/register/publish.go +++ b/ingress/register/publish.go @@ -2,7 +2,7 @@ // Use of this source code is governed by the GNU GPL v3 // license that can be found in the LICENSE file. -package ingress // import "github.com/wabarc/wayback/ingress" +package register // import "github.com/wabarc/wayback/ingress/register" import ( _ "github.com/wabarc/wayback/publish/discord" diff --git a/ingress/register/service.go b/ingress/register/service.go index 372216eb..1851ce7d 100644 --- a/ingress/register/service.go +++ b/ingress/register/service.go @@ -2,7 +2,7 @@ // Use of this source code is governed by the GNU GPL v3 // license that can be found in the LICENSE file. -package ingress // import "github.com/wabarc/wayback/ingress" +package register // import "github.com/wabarc/wayback/ingress/register" import ( _ "github.com/wabarc/wayback/service/discord" From 9b95733bee6572285ef8747d29868b3c3bdfb2cf Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Thu, 18 May 2023 18:57:59 +0100 Subject: [PATCH 12/21] Allows to access proxy.Dialer --- go.mod | 2 +- go.sum | 4 ++-- ingress/http.go | 16 +++++++++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 39141d48..830f916b 100644 --- a/go.mod +++ b/go.mod @@ -43,7 +43,7 @@ require ( github.com/wabarc/ipfs-pinner v1.1.1-0.20230502052510-dc378f9e202b github.com/wabarc/logger v0.0.0-20210730133522-86bd3f31e792 github.com/wabarc/playback v0.0.0-20230331122619-84484ab4d599 - github.com/wabarc/proxier v0.0.0-20230511195500-477b79d84aff + github.com/wabarc/proxier v0.0.0-20230517230719-3e0b9fa22471 github.com/wabarc/rivet v0.1.4-0.20230505152228-2c5c81b4bd10 github.com/wabarc/screenshot v1.6.1-0.20230515153404-ed9208cc295b github.com/wabarc/telegra.ph v0.0.0-20230318134541-a0922e1ace3a diff --git a/go.sum b/go.sum index 14d3ebf6..e1a3bda4 100644 --- a/go.sum +++ b/go.sum @@ -495,8 +495,8 @@ github.com/wabarc/memento v0.0.0-20221023035729-e42d0fe1cefb h1:mi8kE7ET/CLeMCzQ github.com/wabarc/memento v0.0.0-20221023035729-e42d0fe1cefb/go.mod h1:qP6GisnqoSDc5Ivj34yV+Qar3B6tYyLDKx42oCDX1zY= github.com/wabarc/playback v0.0.0-20230331122619-84484ab4d599 h1:5L4QkS8MzMQNSDQ36VIaMEu7eSox0c9D5080pyJSZMM= github.com/wabarc/playback v0.0.0-20230331122619-84484ab4d599/go.mod h1:7Bs329a9s+wwKvINBacECHMN13VhQLGOQcJAT7gtS74= -github.com/wabarc/proxier v0.0.0-20230511195500-477b79d84aff h1:iYFrUax0puGvHmoO25rQIOhOnY3SrCNdTcV0lTvJvKU= -github.com/wabarc/proxier v0.0.0-20230511195500-477b79d84aff/go.mod h1:6fy1Vq25/cm5xXTf8fNiujx/aLUb4mB3lheiajTixUM= +github.com/wabarc/proxier v0.0.0-20230517230719-3e0b9fa22471 h1:4kvMoaeqQGSZw1wzWFc38zk10rMAPrjjNXRcAb1d6BU= +github.com/wabarc/proxier v0.0.0-20230517230719-3e0b9fa22471/go.mod h1:6fy1Vq25/cm5xXTf8fNiujx/aLUb4mB3lheiajTixUM= github.com/wabarc/rivet v0.1.4-0.20230505152228-2c5c81b4bd10 h1:d1lm7aXwtuVcUjHMW9Cm8CZIhoQtZCpvF2kXNEB2RGs= github.com/wabarc/rivet v0.1.4-0.20230505152228-2c5c81b4bd10/go.mod h1:fAjDHISxh7louWQ06lipWB0Dz7eYvQTzOOI86Mj+KiQ= github.com/wabarc/screenshot v1.6.1-0.20230515153404-ed9208cc295b h1:LOpFnWJEgQ99Hv/DEK/bgO5oJDaiKfc3yodDcd9Rn84= diff --git a/ingress/http.go b/ingress/http.go index 94bb43b6..98ba79fa 100644 --- a/ingress/http.go +++ b/ingress/http.go @@ -16,9 +16,12 @@ import ( "github.com/wabarc/logger" "github.com/wabarc/proxier" "github.com/wabarc/wayback/config" + "golang.org/x/net/proxy" ) var ( + dialer proxy.Dialer + client = &http.Client{} endpoint = "https://icanhazip.com" ) @@ -35,10 +38,13 @@ func initClient(opts *config.Options) { return } - client.Transport, err = proxier.NewUTLSRoundTripper(proxier.Proxy(opts.Proxy())) + rt, err := proxier.NewUTLSRoundTripper(proxier.Proxy(opts.Proxy())) if err != nil { logger.Error("create utls round tripper failed: %v", err) } + dialer = rt.(*proxier.UTLSRoundTripper).Dialer() + client.Transport = rt + if opts.HasDebugMode() { go func() { for { @@ -81,3 +87,11 @@ func canConnect(host, port string) bool { func Client() *http.Client { return client } + +// Dialer returns proxy.Dailer +func Dialer() proxy.Dialer { + if dialer == nil { + return proxy.Direct + } + return dialer +} From 03a60af1e344863b3e2334457c2af1d05fa05df6 Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Thu, 18 May 2023 22:57:33 +0100 Subject: [PATCH 13/21] Proxy connection to IRC server * Change `github.com/thoj/go-ircevent` to `gopkg.in/irc.v4` * Fix `daemon` flag not working when value is `irc` * Add support for playback from IRC * Add support for place IRC name * Styling IRC message --- README.md | 1 + config/config_test.go | 26 ++ config/options.go | 13 +- config/parser.go | 2 + go.mod | 2 + go.sum | 5 + publish/publish.go | 5 +- publish/relaychat/relaychat.go | 75 +++--- reduxer/reduxer.go | 2 +- service/relaychat/relaychat.go | 228 ++++++++++++----- service/relaychat/relaychat_test.go | 372 +++++++++++++++------------- service/service.go | 2 + template/render/relaychat.go | 47 +++- template/render/relaychat_test.go | 9 +- template/render/render.go | 8 + wayback.1 | 15 ++ wayback.conf | 1 + 17 files changed, 535 insertions(+), 278 deletions(-) diff --git a/README.md b/README.md index 4a91bbea..c0187ab6 100644 --- a/README.md +++ b/README.md @@ -269,6 +269,7 @@ You can also specify configuration options either via command flags or via envir | - | `WAYBACK_TWITTER_ACCESS_TOKEN` | - | The access token of your Twitter application | | - | `WAYBACK_TWITTER_ACCESS_SECRET` | - | The access secret of your Twitter application | | - | `WAYBACK_IRC_NICK` | - | IRC nick | +| - | `WAYBACK_IRC_NAME` | - | IRC name | | - | `WAYBACK_IRC_PASSWORD` | - | IRC password | | - | `WAYBACK_IRC_CHANNEL` | - | IRC channel | | - | `WAYBACK_IRC_SERVER` | `irc.libera.chat:6697` | IRC server, required TLS | diff --git a/config/config_test.go b/config/config_test.go index fa00ada3..4e5f0cdf 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -1443,6 +1443,32 @@ func TestIRC(t *testing.T) { }, want: "foo", }, + { + name: "default irc name", + envs: map[string]string{ + "WAYBACK_IRC_NAME": "", + }, + call: func(t *testing.T, opts *Options, want string) { + called := opts.IRCName() + if called != want { + t.Errorf(`Unexpected get the irc name, got %v instead of %s`, called, want) + } + }, + want: defIRCName, + }, + { + name: "specified irc name", + envs: map[string]string{ + "WAYBACK_IRC_NAME": "foo", + }, + call: func(t *testing.T, opts *Options, want string) { + called := opts.IRCName() + if called != want { + t.Errorf(`Unexpected get the irc name, got %v instead of %s`, called, want) + } + }, + want: "foo", + }, { name: "default irc password", envs: map[string]string{ diff --git a/config/options.go b/config/options.go index e89917b7..4e342822 100644 --- a/config/options.go +++ b/config/options.go @@ -61,6 +61,7 @@ const ( defSlackHelptext = "Hi there." defIRCNick = "" + defIRCName = "" defIRCPassword = "" defIRCChannel = "" defIRCServer = "irc.libera.chat:6697" @@ -224,6 +225,7 @@ type nostr struct { type irc struct { nick string + name string password string channel string server string @@ -331,6 +333,7 @@ func NewOptions() *Options { }, irc: &irc{ nick: defIRCNick, + name: defIRCName, password: defIRCPassword, channel: defIRCChannel, server: defIRCServer, @@ -361,7 +364,7 @@ func (o *Options) EnableServices(s ...string) { o.services.Store(ServiceMastodon, true) case ServiceMatrix.String(): o.services.Store(ServiceMatrix, true) - case ServiceIRC.String(): + case ServiceIRC.String(), "irc": o.services.Store(ServiceIRC, true) case ServiceSlack.String(): o.services.Store(ServiceSlack, true) @@ -597,6 +600,14 @@ func (o *Options) IRCNick() string { return o.irc.nick } +// IRCName returns name of IRC +func (o *Options) IRCName() string { + if o.irc.name != "" { + return o.irc.name + } + return o.irc.nick +} + // IRCPassword returns password of IRC func (o *Options) IRCPassword() string { return o.irc.password diff --git a/config/parser.go b/config/parser.go index ef600e5b..fb98a03e 100644 --- a/config/parser.go +++ b/config/parser.go @@ -151,6 +151,8 @@ func (p *Parser) parseLines(lines []string) (err error) { p.opts.notion.databaseID = parseString(val, defNotionDatabaseID) case "WAYBACK_IRC_NICK": p.opts.irc.nick = parseString(val, defIRCNick) + case "WAYBACK_IRC_NAME": + p.opts.irc.name = parseString(val, defIRCName) case "WAYBACK_IRC_PASSWORD": p.opts.irc.password = parseString(val, defIRCPassword) case "WAYBACK_IRC_CHANNEL": diff --git a/go.mod b/go.mod index 830f916b..0f57fd8a 100644 --- a/go.mod +++ b/go.mod @@ -51,6 +51,7 @@ require ( go.etcd.io/bbolt v1.3.6 golang.org/x/net v0.10.0 golang.org/x/sync v0.1.0 + gopkg.in/irc.v4 v4.0.0 gopkg.in/telebot.v3 v3.0.0-20220130115853-f0291132d3c3 maunium.net/go/mautrix v0.12.0 mellium.im/sasl v0.3.1 @@ -157,6 +158,7 @@ require ( golang.org/x/mod v0.10.0 // indirect golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect + golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect golang.org/x/tools v0.7.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/sourcemap.v1 v1.0.5 // indirect diff --git a/go.sum b/go.sum index e1a3bda4..f3d3d8aa 100644 --- a/go.sum +++ b/go.sum @@ -442,6 +442,7 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.4/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tdewolff/parse/v2 v2.5.27/go.mod h1:WzaJpRSbwq++EIQHYIRTpbYKNA3gn9it1Ik++q4zyho= @@ -634,6 +635,8 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 h1:ftMN5LMiBFjbzleLqtoBZk7KdJwhuybIU+FckUHgoyQ= +golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -669,6 +672,8 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/irc.v4 v4.0.0 h1:5jsLkU2Tg+R2nGNqmkGCrciasyi4kNkDXhyZD+C31yY= +gopkg.in/irc.v4 v4.0.0/go.mod h1:BfjDz9MmuWW6OZY7iq4naOhudO8+QQCdO4Ko18jcsRE= gopkg.in/readline.v1 v1.0.0-20160726135117-62c6fe619375/go.mod h1:lNEQeAhU009zbRxng+XOj5ITVgY24WcbNnQopyfKoYQ= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/sourcemap.v1 v1.0.5 h1:inv58fC9f9J3TK2Y2R1NPntXEn3/wjWHkonhIUODNTI= diff --git a/publish/publish.go b/publish/publish.go index b7c922dc..b8e3cae3 100644 --- a/publish/publish.go +++ b/publish/publish.go @@ -130,11 +130,14 @@ func (p *Publish) Stop() { // Spread accepts calls from services that with collections and various parameters. // It prepare all available publishers and put them into pooling. -func (p *Publish) Spread(_ context.Context, rdx reduxer.Reduxer, cols []wayback.Collect, from Flag, args ...string) { +func (p *Publish) Spread(ctx context.Context, rdx reduxer.Reduxer, cols []wayback.Collect, from Flag, args ...string) { + v := ctx.Value(from) + exec(func(mod *Module) { bucket := pooling.Bucket{ Request: func(ctx context.Context) error { logger.Info("requesting publishing from [%s] to [%s]...", from, mod.Flag) + ctx = context.WithValue(ctx, from, v) err := mod.Publish(ctx, rdx, cols, args...) if err != nil { logger.Error("requesting publishing from [%s] to [%s] failed: %v", from, mod.Flag, err) diff --git a/publish/relaychat/relaychat.go b/publish/relaychat/relaychat.go index acd23bd6..1153c307 100644 --- a/publish/relaychat/relaychat.go +++ b/publish/relaychat/relaychat.go @@ -6,7 +6,7 @@ package relaychat // import "github.com/wabarc/wayback/publish/relaychat" import ( "context" - "crypto/tls" + "strings" "github.com/wabarc/logger" "github.com/wabarc/wayback" @@ -16,45 +16,40 @@ import ( "github.com/wabarc/wayback/publish" "github.com/wabarc/wayback/reduxer" "github.com/wabarc/wayback/template/render" - - irc "github.com/thoj/go-ircevent" + "gopkg.in/irc.v4" ) // Interface guard var _ publish.Publisher = (*IRC)(nil) type IRC struct { - conn *irc.Connection + conn *irc.Client opts *config.Options } // New returns a IRC struct -func New(conn *irc.Connection, opts *config.Options) *IRC { +func New(c *irc.Client, opts *config.Options) *IRC { if !opts.PublishToIRCChannel() { logger.Debug("Missing required environment variable, abort.") return nil } - if conn == nil { - conn = irc.IRC(opts.IRCNick(), opts.IRCNick()) - conn.Password = opts.IRCPassword() - conn.VerboseCallbackHandler = opts.HasDebugMode() - conn.Debug = opts.HasDebugMode() - conn.UseTLS = true - conn.TLSConfig = &tls.Config{InsecureSkipVerify: false, MinVersion: tls.VersionTLS12} - } - server := opts.IRCServer() - if err := conn.Connect(server); err != nil { - logger.Error("connect to %s failed: %v", server, err) - return nil - } - - return &IRC{conn: conn, opts: opts} + return &IRC{opts: opts} } // Publish publish text to IRC channel of given cols and args. // A context should contain a `reduxer.Reduxer` via `publish.PubBundle` struct. func (i *IRC) Publish(ctx context.Context, _ reduxer.Reduxer, cols []wayback.Collect, args ...string) error { + // Most IRC server supports establish one connection, + // this value accessed from service module. + if i.conn == nil { + v := ctx.Value(publish.FlagIRC) + conn, ok := v.(*irc.Client) + if ok { + i.conn = conn + } + } + metrics.IncrementPublish(metrics.PublishIRC, metrics.StatusRequest) if len(cols) == 0 { @@ -62,8 +57,8 @@ func (i *IRC) Publish(ctx context.Context, _ reduxer.Reduxer, cols []wayback.Col return errors.New("publish to irc: collects empty") } - var txt = render.ForPublish(&render.Relaychat{Cols: cols}).String() - if i.toChannel(ctx, txt) { + txt := strings.Split(render.ForPublish(&render.Relaychat{Cols: cols}).String(), "\n") + if i.toChannel(ctx, txt...) { metrics.IncrementPublish(metrics.PublishIRC, metrics.StatusSuccess) return nil } @@ -71,27 +66,47 @@ func (i *IRC) Publish(ctx context.Context, _ reduxer.Reduxer, cols []wayback.Col return errors.New("publish to irc failed") } -func (i *IRC) toChannel(_ context.Context, text string) bool { +func (i *IRC) toChannel(_ context.Context, text ...string) bool { if !i.opts.PublishToIRCChannel() || i.conn == nil { logger.Warn("Do not publish to IRC channel.") return false } - if text == "" { + if len(text) == 0 { logger.Warn("IRC validation failed: Text can't be blank") return false } - go func() { - // i.conn.Join(o.opts.IRCChannel()) - i.conn.Privmsg(i.opts.IRCChannel(), text) - }() + err := i.reply(i.opts.IRCChannel(), text...) + if err != nil { + logger.Error("publish to IRC channel failed: %v", err) + return false + } return true } // Shutdown shuts down the IRC publish service. func (i *IRC) Shutdown() error { - i.conn.Quit() - return nil } + +func (i *IRC) reply(name string, messages ...string) (err error) { + if i.conn == nil { + return errors.New("irc connection is missing") + } + + for _, text := range messages { + text = strings.ReplaceAll(text, "\n", " ") + msg := &irc.Message{ + Command: "PRIVMSG", + Params: []string{ + name, + text, + }, + } + if e := i.conn.WriteMessage(msg); e != nil { + err = errors.Wrap(err, e.Error()) + } + } + return err +} diff --git a/reduxer/reduxer.go b/reduxer/reduxer.go index a6a5f753..849b1a66 100644 --- a/reduxer/reduxer.go +++ b/reduxer/reduxer.go @@ -268,7 +268,7 @@ func capture(ctx context.Context, cfg *config.Options, uri *url.URL, dir string) logger.Debug("reduxer using remote browser") browser, er := screenshot.NewChromeRemoteScreenshoter[screenshot.Path](remote) if er != nil { - logger.Error("screenshot dial failed: %v", er) + logger.Warn("screenshot dial failed: %v", er) return fallback() } shot, err = browser.Screenshot(ctx, uri, opts...) diff --git a/service/relaychat/relaychat.go b/service/relaychat/relaychat.go index a5d49726..79a69ebb 100644 --- a/service/relaychat/relaychat.go +++ b/service/relaychat/relaychat.go @@ -7,12 +7,16 @@ package relaychat // import "github.com/wabarc/wayback/service/relaychat" import ( "context" "crypto/tls" + "net/url" + "strings" "sync" + "time" "github.com/wabarc/logger" "github.com/wabarc/wayback" "github.com/wabarc/wayback/config" "github.com/wabarc/wayback/errors" + "github.com/wabarc/wayback/ingress" "github.com/wabarc/wayback/metrics" "github.com/wabarc/wayback/pooling" "github.com/wabarc/wayback/publish" @@ -20,8 +24,7 @@ import ( "github.com/wabarc/wayback/service" "github.com/wabarc/wayback/storage" "github.com/wabarc/wayback/template/render" - - irc "github.com/thoj/go-ircevent" + "gopkg.in/irc.v4" ) // Interface guard @@ -37,7 +40,7 @@ type IRC struct { ctx context.Context opts *config.Options pool *pooling.Pool - conn *irc.Connection + conn *irc.Client store *storage.Storage pub *publish.Publish } @@ -51,17 +54,8 @@ func New(ctx context.Context, opts service.Options) (*IRC, error) { ctx = context.Background() } - // TODO: support SASL authenticate - conn := irc.IRC(opts.Config.IRCNick(), opts.Config.IRCNick()) - conn.Password = opts.Config.IRCPassword() - conn.VerboseCallbackHandler = opts.Config.HasDebugMode() - conn.Debug = opts.Config.HasDebugMode() - conn.UseTLS = true - conn.TLSConfig = &tls.Config{InsecureSkipVerify: false, MinVersion: tls.VersionTLS12} - return &IRC{ ctx: ctx, - conn: conn, store: opts.Storage, opts: opts.Config, pool: opts.Pool, @@ -72,87 +66,185 @@ func New(ctx context.Context, opts service.Options) (*IRC, error) { // Serve loop request direct messages from the IRC server. // Serve returns an error. func (i *IRC) Serve() error { - if i.conn == nil { - return errors.New("Must initialize IRC connection.") - } - logger.Info("Serving IRC instance: %s", i.opts.IRCServer()) + // TODO: support SASL authenticate + config := irc.ClientConfig{ + Nick: i.opts.IRCNick(), + User: i.opts.IRCNick(), + Name: i.opts.IRCName(), + Pass: i.opts.IRCPassword(), + Handler: irc.HandlerFunc(func(c *irc.Client, m *irc.Message) { + logger.Debug("received message: %#v", m) + + if m.Command == "ERROR" { + logger.Error("failed to handle irc request: %s", m) + return + } - if i.opts.IRCChannel() != "" { - i.conn.AddCallback("001", func(ev *irc.Event) { i.conn.Join(i.opts.IRCChannel()) }) - } - i.conn.AddCallback("PRIVMSG", func(ev *irc.Event) { - go func(ev *irc.Event) { - metrics.IncrementWayback(metrics.ServiceIRC, metrics.StatusRequest) - bucket := pooling.Bucket{ - Request: func(ctx context.Context) error { - if err := i.process(ctx, ev); err != nil { - logger.Error("process failure, message: %s, error: %v", ev.Message(), err) - return err - } - metrics.IncrementWayback(metrics.ServiceIRC, metrics.StatusSuccess) - return nil - }, - Fallback: func(_ context.Context) error { - i.conn.Privmsg(ev.Nick, service.MsgWaybackTimeout) - metrics.IncrementWayback(metrics.ServiceIRC, metrics.StatusFailure) - return nil - }, + if m.Command == "001" && i.opts.IRCChannel() != "" { + if err := c.Writef("JOIN %s", i.opts.IRCChannel()); err != nil { + logger.Error("failed to join %q channel: %v", err) + } + return + } + + if m.Command == "NOTICE" && m.Prefix.Name == "NickServ" && strings.Contains(m.Trailing(), "dentified") { + logger.Debug("received command %q skipped", m.Command) + return } - i.pool.Put(bucket) - }(ev) - }) - err := i.conn.Connect(i.opts.IRCServer()) + + if m.Command != "PRIVMSG" { + logger.Debug("received command %q, skipped", m.Command) + return + } + + if c.FromChannel(m) { + logger.Debug("received message from channel, skipped") + return + } + + if err := i.process(m); err != nil { + logger.Error("process failure, message: %s, error: %v", m, err) + return + } + }), + PingFrequency: 3 * time.Second, + PingTimeout: time.Minute, + SendLimit: 500 * time.Millisecond, + } + + srv, err := url.Parse("//" + i.opts.IRCServer()) if err != nil { - logger.Error("Get conversations failure, error: %v", err) - return err + return errors.Wrap(err, "failed to parse irc server") } - go func() { - i.conn.Loop() - }() + dialer := ingress.Dialer() + conn, err := dialer.Dial("tcp", i.opts.IRCServer()) + if err != nil { + return errors.Wrap(err, "failed to establish connection") + } + conn = tls.Client(conn, &tls.Config{MinVersion: tls.VersionTLS12, ServerName: srv.Hostname()}) + i.conn = irc.NewClient(conn, config) + logger.Info("Serving IRC server: %s, nick: %s", i.opts.IRCServer(), i.conn.CurrentNick()) - // Block until context cone - <-i.ctx.Done() + // Block until context done + err = i.conn.RunContext(i.ctx) + if err != nil { + logger.Error("failed to run, error: %v", err) + return errors.Wrap(err, "failed to run irc bot") + } return ErrServiceClosed } -// Shutdown shuts down the IRC service, it always retuan a nil error. +// Shutdown shuts down the IRC service, it always return a nil error. func (i *IRC) Shutdown() error { - if i.conn != nil { - i.conn.Quit() - } - return nil } -func (i *IRC) process(ctx context.Context, ev *irc.Event) error { - if ev.Nick == "" || ev.Message() == "" { - logger.Warn("without nick or empty message") - return errors.New("IRC: without nick or enpty message") - } +func (i *IRC) process(m *irc.Message) error { + text := m.Trailing() + urls := service.MatchURL(i.opts, text) + logger.Debug("message body: %s", text) - text := ev.MessageWithoutFormat() - logger.Debug("from: %s message: %s", ev.Nick, text) + switch { + case strings.HasPrefix(text, service.CommandHelp): + return i.reply(m.Name, i.helper()...) - urls := service.MatchURL(i.opts, text) - if len(urls) == 0 { + case len(urls) == 0: + metrics.IncrementWayback(metrics.ServiceIRC, metrics.StatusRequest) logger.Warn("archives failure, URL no found.") - return errors.New("IRC: URL no found") + i.reply(m.Name, "URL no found") // nolint:errcheck + + case strings.HasPrefix(text, service.CommandPlayback): + return i.playback(m, urls) + + default: + metrics.IncrementWayback(metrics.ServiceIRC, metrics.StatusRequest) + i.reply(m.Name, "I'll help you archive the URL and return the results promptly.") // nolint:errcheck + bucket := pooling.Bucket{ + Request: func(ctx context.Context) error { + if err := i.wayback(ctx, m, urls); err != nil { + return errors.Wrap(err, "archives failed") + } + metrics.IncrementWayback(metrics.ServiceIRC, metrics.StatusSuccess) + return nil + }, + Fallback: func(_ context.Context) error { + i.reply(m.Name, service.MsgWaybackTimeout) // nolint:errcheck + metrics.IncrementWayback(metrics.ServiceIRC, metrics.StatusFailure) + return nil + }, + } + i.pool.Put(bucket) } + return nil +} + +func (i *IRC) wayback(ctx context.Context, m *irc.Message, urls []*url.URL) error { do := func(cols []wayback.Collect, rdx reduxer.Reduxer) error { logger.Debug("reduxer: %#v", rdx) - replyText := render.ForReply(&render.Relaychat{Cols: cols}).String() - - // Reply result to sender - i.conn.Privmsg(ev.Nick, replyText) + txt := strings.Split(render.ForReply(&render.Relaychat{Cols: cols}).String(), "\n") - // Reply and publish toot as public + ctx = context.WithValue(ctx, publish.FlagIRC, i.conn) i.pub.Spread(ctx, rdx, cols, publish.FlagIRC) - return nil + + return i.reply(m.Name, txt...) } return service.Wayback(ctx, i.opts, urls, do) } + +func (i *IRC) playback(m *irc.Message, urls []*url.URL) error { + metrics.IncrementPlayback(metrics.ServiceIRC, metrics.StatusRequest) + cols, err := wayback.Playback(i.ctx, i.opts, urls...) + if err != nil { + metrics.IncrementPlayback(metrics.ServiceIRC, metrics.StatusFailure) + return errors.Wrap(err, "playback failed") + } + logger.Debug("playback collections: %#v", cols) + + txt := strings.Split(render.ForReply(&render.Relaychat{Cols: cols}).String(), "\n") + if err = i.reply(m.Name, txt...); err != nil { + logger.Error("send playback results failed: %v", err) + return err + } + metrics.IncrementPlayback(metrics.ServiceTelegram, metrics.StatusSuccess) + return nil +} + +func (i *IRC) reply(name string, messages ...string) (err error) { + for _, text := range messages { + text = strings.ReplaceAll(text, "\n", " ") + msg := &irc.Message{ + Command: "PRIVMSG", + Params: []string{ + name, + text, + }, + } + if e := i.conn.WriteMessage(msg); e != nil { + err = errors.Wrap(err, e.Error()) + } + } + return err +} + +func (i *IRC) helper() []string { + return []string{ + "***** List of Help *****", + " ", + "I'm a šŸ¤– to help you archive webpages more easily.", + "Send me any text containing the URL and I'll give you the result back šŸ˜€", + " ", + "Examples:", + " /msg " + i.conn.CurrentNick() + " https://example.com", + " /msg " + i.conn.CurrentNick() + " playback https://example.com", + " ", + "Documentation:", + " https://docs.wabarc.eu.org", + " ", + "***** End of Help *****", + } +} diff --git a/service/relaychat/relaychat_test.go b/service/relaychat/relaychat_test.go index 3a3fedd8..1bc6c4d8 100644 --- a/service/relaychat/relaychat_test.go +++ b/service/relaychat/relaychat_test.go @@ -2,26 +2,25 @@ // Use of this source code is governed by the GNU GPL v3 // license that can be found in the LICENSE file. -//go:build !race -// +build !race - package relaychat // import "github.com/wabarc/wayback/service/relaychat" import ( + "bytes" "context" - "crypto/tls" + "errors" + "io" "os" - "strings" + "reflect" "testing" "time" - irc "github.com/thoj/go-ircevent" "github.com/wabarc/helper" "github.com/wabarc/wayback/config" "github.com/wabarc/wayback/pooling" "github.com/wabarc/wayback/publish" "github.com/wabarc/wayback/service" "github.com/wabarc/wayback/storage" + "gopkg.in/irc.v4" ) var ( @@ -32,123 +31,192 @@ var ( debug = false ) -func conn(nick string) *irc.Connection { - i := irc.IRC(nick, nick) - i.UseTLS = true - i.VerboseCallbackHandler = debug - i.Debug = debug - i.TLSConfig = &tls.Config{InsecureSkipVerify: false} - - return i +type TestHandler struct { + messages []*irc.Message + delay time.Duration } -// Bash: echo -e 'USER wabarc-sender guest * *\nNICK wabarc-sender\nPRIVMSG wabarc-receiver :Hello, World!\nQUIT\n' \ | nc irc.freenode.net 6667 -func TestProcess(t *testing.T) { - if testing.Short() { - t.Skip("Skip test in short mode.") +func (th *TestHandler) Handle(c *irc.Client, m *irc.Message) { + th.messages = append(th.messages, m) + if th.delay > 0 { + time.Sleep(th.delay) } +} - os.Setenv("WAYBACK_IRC_NICK", "wabarc-process") - os.Setenv("WAYBACK_IRC_SERVER", server) - os.Setenv("WAYBACK_IRC_CHANNEL", channel) - os.Setenv("WAYBACK_ENABLE_IA", "true") +func (th *TestHandler) Messages() []*irc.Message { + ret := th.messages + th.messages = nil + return ret +} - parser := config.NewParser() - opts, err := parser.ParseEnvironmentVariables() - if err != nil { - t.Fatalf("Parse environment variables or flags failed, error: %v", err) - } +var errorWriterErr = errors.New("errorWriter: error") - sendConn := conn(sender) - recvConn := conn(receiver) - done := make(chan bool, 1) - - // Send privmsg if receiver connected - recvConn.AddCallback("001", func(ev *irc.Event) { - go func() { - tick := time.NewTicker(3 * time.Second) - i := 10 - for { - select { - case <-tick.C: - sendConn.Privmsg(receiver, "privmsg from sender https://example.com") - if i == 0 { - t.Errorf("Timeout while wating for test message from the other thread.") - recvConn.Quit() - sendConn.Quit() - return - } - case <-done: - tick.Stop() - } - i -= 1 - } - }() - }) +type errorWriter struct{} - cfg := []pooling.Option{ - pooling.Capacity(opts.PoolingSize()), - pooling.Timeout(opts.WaybackTimeout()), - pooling.MaxRetries(opts.WaybackMaxRetries()), +func (ew *errorWriter) Write([]byte) (int, error) { + return 0, errorWriterErr +} + +type readWriteCloser struct { + io.Reader + io.Writer + io.Closer +} + +type testReadWriteCloser struct { + client *bytes.Buffer + server *bytes.Buffer +} + +type testReadWriter struct { + writeErrorChan chan error + writeChan chan string + readErrorChan chan error + readChan chan string + readEmptyChan chan struct{} + exiting chan struct{} + clientDone chan struct{} + closed bool + serverBuffer bytes.Buffer +} + +func (rw *testReadWriter) maybeBroadcastEmpty() { + if rw.serverBuffer.Len() == 0 { + select { + case rw.readEmptyChan <- struct{}{}: + default: + } } - ctx := context.Background() - pool := pooling.New(ctx, cfg...) - go pool.Roll() - defer pool.Close() +} - pub := publish.New(ctx, opts) - defer pub.Stop() +func (rw *testReadWriter) Read(buf []byte) (int, error) { + // Check for a read error first + select { + case err := <-rw.readErrorChan: + return 0, err + default: + } - o := service.ParseOptions(service.Config(opts), service.Storage(&storage.Storage{}), service.Pool(pool), service.Publish(pub)) - // Receive privmsg from sender - recvConn.AddCallback("PRIVMSG", func(ev *irc.Event) { - if ev.Nick == sender { - done <- true - i, _ := New(context.Background(), o) - // Replace IRC connection to receive connection - i.conn = recvConn - if err = i.process(context.Background(), ev); err != nil { - t.Error(err) - } - recvConn.Quit() + // If there's data left in the buffer, we want to use that first. + if rw.serverBuffer.Len() > 0 { + s, err := rw.serverBuffer.Read(buf) + if errors.Is(err, io.EOF) { + err = nil } - }) + rw.maybeBroadcastEmpty() + return s, err + } - // Receive response from receiver - sendConn.AddCallback("PRIVMSG", func(ev *irc.Event) { - if ev.Nick == receiver { - if !strings.Contains(ev.Message(), config.SlotName("ia")) { - t.Errorf("Unexpected message: %s", ev.Message()) - } - sendConn.Quit() + // Read from server. We're waiting for this whole test to finish, data to + // come in from the server buffer, or for an error. We expect only one read + // to be happening at once. + select { + case err := <-rw.readErrorChan: + return 0, err + case data := <-rw.readChan: + rw.serverBuffer.WriteString(data) + s, err := rw.serverBuffer.Read(buf) + if errors.Is(err, io.EOF) { + err = nil } - }) + rw.maybeBroadcastEmpty() + return s, err + case <-rw.exiting: + return 0, io.EOF + } +} - err = recvConn.Connect(server) - if err != nil { - t.Errorf("Can't connect to freenode, error: %v", err) +func (rw *testReadWriter) Write(buf []byte) (int, error) { + select { + case err := <-rw.writeErrorChan: + return 0, err + default: } - err = sendConn.Connect(server) - if err != nil { - t.Errorf("Can't connect to freenode, error: %v", err) + + // Write to server. We can cheat with this because we know things + // will be written a line at a time. + select { + default: + return len(buf), nil + case rw.writeChan <- string(buf): + return len(buf), nil + case <-rw.exiting: + return 0, errors.New("Connection closed") } +} - go recvConn.Loop() - sendConn.Loop() +func (rw *testReadWriter) Close() error { + select { + case <-rw.exiting: + return errors.New("Connection closed") + default: + // Ensure no double close + if !rw.closed { + rw.closed = true + close(rw.exiting) + } + return nil + } } -func TestToIRCChannel(t *testing.T) { - if testing.Short() { - t.Skip("Skip test in short mode.") +func newTestReadWriter() *testReadWriter { + return &testReadWriter{ + writeErrorChan: make(chan error, 1), + writeChan: make(chan string), + readErrorChan: make(chan error, 1), + readChan: make(chan string), + readEmptyChan: make(chan struct{}, 1), + exiting: make(chan struct{}), + clientDone: make(chan struct{}), + } +} + +func runClientTest( + t *testing.T, + cc irc.ClientConfig, + expectedErr error, + setup func(c *irc.Client), +) *irc.Client { + t.Helper() + + rw := newTestReadWriter() + c := irc.NewClient(rw, cc) + + if setup != nil { + setup(c) } - conn := func(nick string) *irc.Connection { - i := irc.IRC(nick, nick) - i.UseTLS = true - i.VerboseCallbackHandler = debug - i.Debug = debug - i.TLSConfig = &tls.Config{InsecureSkipVerify: false} - return i + go func(t *testing.T) { + err := c.Run() + if !reflect.DeepEqual(expectedErr, err) { + // t.Fatalf("unexpected error, got %v instead of %v", err, expectedErr) + } + close(rw.clientDone) + }(t) + + runTest(t, rw) + + return c +} + +func runTest(t *testing.T, rw *testReadWriter) { + t.Helper() + + // Ask everything to shut down + rw.Close() + + // Wait for the client to stop + select { + case <-rw.clientDone: + case <-time.After(1 * time.Second): + t.Fatal("Timeout in client shutdown") + } +} + +// Bash: echo -e 'USER wabarc-sender guest * *\nNICK wabarc-sender\nPRIVMSG wabarc-receiver :Hello, World!\nQUIT\n' \ | nc irc.freenode.net 6667 +func TestProcess(t *testing.T) { + if testing.Short() { + t.Skip("Skip test in short mode.") } os.Setenv("WAYBACK_IRC_NICK", "wabarc-process") @@ -161,36 +229,7 @@ func TestToIRCChannel(t *testing.T) { if err != nil { t.Fatalf("Parse environment variables or flags failed, error: %v", err) } - - sendConn := conn(sender) - recvConn := conn(receiver) - done := make(chan bool, 1) - - sendConn.AddCallback("001", func(ev *irc.Event) { sendConn.Join(channel) }) - recvConn.AddCallback("001", func(ev *irc.Event) { recvConn.Join(channel) }) - - // Send privmsg if receiver connected - recvConn.AddCallback("001", func(ev *irc.Event) { - go func() { - tick := time.NewTicker(3 * time.Second) - i := 10 - for { - select { - case <-tick.C: - sendConn.Privmsg(receiver, "privmsg from sender https://example.com") - if i == 0 { - t.Errorf("Timeout while wating for test message from the other thread.") - recvConn.Quit() - sendConn.Quit() - return - } - case <-done: - tick.Stop() - } - i -= 1 - } - }() - }) + opts.EnableServices(config.ServiceIRC.String()) cfg := []pooling.Option{ pooling.Capacity(opts.PoolingSize()), @@ -205,44 +244,43 @@ func TestToIRCChannel(t *testing.T) { pub := publish.New(ctx, opts) defer pub.Stop() - o := service.ParseOptions(service.Config(opts), service.Storage(&storage.Storage{}), service.Pool(pool), service.Publish(pub)) - // Receive privmsg from sender - recvConn.AddCallback("PRIVMSG", func(ev *irc.Event) { - if ev.Nick == sender { - done <- true - ctx := context.Background() - i, _ := New(ctx, o) - // Replace IRC connection to receive connection - i.conn = recvConn - if err = i.process(ctx, ev); err != nil { - t.Error(err) - } - recvConn.Quit() - } - }) - - // Receive response from channel - sendConn.AddCallback("PRIVMSG", func(ev *irc.Event) { - if len(ev.Arguments) == 0 { - t.Fatal("Unexpected got IRC event") - } - if ev.Arguments[0] == channel { - if !strings.Contains(ev.Message(), config.SlotName("ia")) { - t.Errorf("Unexpected message: %s", ev.Message()) - } - sendConn.Quit() - } - }) + cc := irc.ClientConfig{ + Nick: opts.IRCNick(), + User: opts.IRCNick(), + Name: opts.IRCName(), + Pass: opts.IRCPassword(), + } + rw := newTestReadWriter() + c := irc.NewClient(rw, cc) - err = recvConn.Connect(server) + o := service.ParseOptions(service.Config(opts), service.Storage(&storage.Storage{}), service.Pool(pool), service.Publish(pub)) + i, err := New(context.Background(), o) if err != nil { - t.Errorf("Can't connect to freenode, error: %v", err) + t.Fatalf("unexpected to new an irc client: %v", err) } - err = sendConn.Connect(server) - if err != nil { - t.Errorf("Can't connect to freenode, error: %v", err) + i.conn = c + defer i.Shutdown() + + tests := []struct { + desc string + text string + want error + }{ + {"test help command", "help", nil}, + {"test wayback without url", ":foo bar", nil}, + {"test wayback with url", ":foo bar https://example.com", nil}, + {"test playback without url", ":playback", nil}, + {"test playback with url", ":playback https://example.com", nil}, } - go recvConn.Loop() - sendConn.Loop() + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + m := irc.MustParseMessage("privmsg " + tt.text) + err = i.process(m) + if !reflect.DeepEqual(err, tt.want) { + // TODO: assert error + t.Fatal(err) + } + }) + } } diff --git a/service/service.go b/service/service.go index 8adb7985..70f04c2b 100644 --- a/service/service.go +++ b/service/service.go @@ -26,6 +26,8 @@ const ( MsgWaybackTimeout = "wayback timeout, please try later." ) +var ErrMissingURL = fmt.Errorf("URL no found") + type doFunc func(cols []wayback.Collect, rdx reduxer.Reduxer) error // Servicer is the interface that wraps Serve and Shutdown method. diff --git a/template/render/relaychat.go b/template/render/relaychat.go index dc6424a1..1ac10cf2 100644 --- a/template/render/relaychat.go +++ b/template/render/relaychat.go @@ -10,6 +10,7 @@ import ( "github.com/wabarc/logger" "github.com/wabarc/wayback" + "github.com/wabarc/wayback/reduxer" ) var _ Renderer = (*Relaychat)(nil) @@ -17,33 +18,61 @@ var _ Renderer = (*Relaychat)(nil) // Relaychat represents a Relaychat template data for render. type Relaychat struct { Cols []wayback.Collect - Data interface{} + Data reduxer.Reduxer } // ForReply implements the standard Renderer interface: // it returns a Render from the ForPublish. func (i *Relaychat) ForReply() *Render { - return i.ForPublish() + buf := i.join(i.main()) + + return &Render{buf: *buf} } // ForPublish implements the standard Renderer interface: // it reads `[]wayback.Collect` from the Relaychat and returns a *Render. func (i *Relaychat) ForPublish() *Render { - var tmplBytes bytes.Buffer + tmplBytes := &bytes.Buffer{} + + if title := Title(i.Cols, i.Data); title != "" { + tmplBytes.WriteString(`ā€¹ `) + tmplBytes.WriteString(title) + tmplBytes.WriteString(" ā€ŗ") + tmplBytes.WriteString("\n \n") + } + // tmplBytes.WriteString("Source:") + // tmplBytes.WriteString("ā€¢ ") + // tmplBytes.WriteString("\n \n") + tmplBytes.Write(i.join(i.main()).Bytes()) + + return &Render{buf: *tmplBytes} +} + +func (i *Relaychat) main() *bytes.Buffer { + tmplBytes := new(bytes.Buffer) - const tmpl = `{{range $ := .}}{{ $.Arc | name }}:- ā€¢ {{ $.Dst }}, {{end}}` + const tmpl = "{{range $ := .}}{{ $.Arc | name }}:\nā€¢ {{ $.Dst }}\n{{end}}" tpl, err := template.New("relaychat").Funcs(funcMap()).Parse(tmpl) if err != nil { logger.Error("parse IRC template failed, %v", err) - return new(Render) + return new(bytes.Buffer) } - if err := tpl.Execute(&tmplBytes, i.Cols); err != nil { + if err := tpl.Execute(tmplBytes, i.Cols); err != nil { logger.Error("execute IRC template failed, %v", err) - return new(Render) + return new(bytes.Buffer) } - tmplBytes = *bytes.NewBuffer(bytes.TrimRight(tmplBytes.Bytes(), `, `)) - return &Render{buf: tmplBytes} + return bytes.NewBuffer(bytes.TrimRight(tmplBytes.Bytes(), "\n")) +} + +func (i *Relaychat) join(buf *bytes.Buffer) *bytes.Buffer { + tmplBytes := &bytes.Buffer{} + tmplBytes.WriteString("***** List of Archives *****") + tmplBytes.WriteString("\n \n") // blank line + tmplBytes.Write(buf.Bytes()) + tmplBytes.WriteString("\n \n") // blank line + tmplBytes.WriteString("***** End of Archives *****") + return tmplBytes } diff --git a/template/render/relaychat_test.go b/template/render/relaychat_test.go index af4256bb..5c2c3c9d 100644 --- a/template/render/relaychat_test.go +++ b/template/render/relaychat_test.go @@ -9,7 +9,14 @@ import ( ) func TestRenderForIRC(t *testing.T) { - expected := `Internet Archive:- ā€¢ https://web.archive.org/web/20211000000001/https://example.com/, archive.today:- ā€¢ http://archive.today/abcdE, IPFS:- ā€¢ https://ipfs.io/ipfs/QmTbDmpvQ3cPZG6TA5tnar4ZG6q9JMBYVmX2n3wypMQMtr, Telegraph:- ā€¢ http://telegra.ph/title-01-01` + expected := `Internet Archive: +ā€¢ https://web.archive.org/web/20211000000001/https://example.com/ +archive.today: +ā€¢ http://archive.today/abcdE +IPFS: +ā€¢ https://ipfs.io/ipfs/QmTbDmpvQ3cPZG6TA5tnar4ZG6q9JMBYVmX2n3wypMQMtr +Telegraph: +ā€¢ http://telegra.ph/title-01-01` got := ForPublish(&Relaychat{Cols: collects, Data: bundleExample}).String() if got != expected { diff --git a/template/render/render.go b/template/render/render.go index a4eae14e..59f59ffa 100644 --- a/template/render/render.go +++ b/template/render/render.go @@ -58,6 +58,14 @@ func (r *Render) String() string { return "" } +// Bytes returns a []byte from the Render. +func (r *Render) Bytes() []byte { + if r != nil { + return r.buf.Bytes() + } + return nil +} + func funcMap() template.FuncMap { cache := "https://webcache.googleusercontent.com/search?q=cache:" return template.FuncMap{ diff --git a/wayback.1 b/wayback.1 index 8fd9716d..cdd5d7a7 100644 --- a/wayback.1 +++ b/wayback.1 @@ -267,6 +267,21 @@ Connect to XMPP server without TLS\&. .B WAYBACK_XMPP_HELPTEXT The help text for XMPP command\&. .TP +.B WAYBACK_IRC_NICK +IRC nick\&. +.TP +.B WAYBACK_IRC_NAME +IRC name\&. +.TP +.B WAYBACK_IRC_PASSWORD +IRC password\&. +.TP +.B WAYBACK_IRC_CHANNEL +IRC channel\&. +.TP +.B WAYBACK_IRC_SERVER +IRC server, defaults to `irc.libera.chat:6697`\&. +.TP .B WAYBACK_GITHUB_TOKEN GitHub Personal Access Token, required the `repo` scope\&. .TP diff --git a/wayback.conf b/wayback.conf index 998be45b..b5e86d70 100644 --- a/wayback.conf +++ b/wayback.conf @@ -27,6 +27,7 @@ WAYBACK_TWITTER_CONSUMER_SECRE= WAYBACK_TWITTER_ACCESS_TOKEN= WAYBACK_TWITTER_ACCESS_SECRET= WAYBACK_IRC_NICK= +WAYBACK_IRC_NAME= WAYBACK_IRC_PASSWORD= WAYBACK_IRC_CHANNEL= WAYBACK_IRC_SERVER=irc.libera.chat:6697 From 66ff4dace33bf0e9e3a899fe8016c900460ee5c7 Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Fri, 19 May 2023 17:00:09 +0100 Subject: [PATCH 14/21] Fix testing --- template/render/relaychat_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/template/render/relaychat_test.go b/template/render/relaychat_test.go index 5c2c3c9d..d4f704b4 100644 --- a/template/render/relaychat_test.go +++ b/template/render/relaychat_test.go @@ -9,14 +9,20 @@ import ( ) func TestRenderForIRC(t *testing.T) { - expected := `Internet Archive: + expected := `ā€¹ Example ā€ŗ + +***** List of Archives ***** + +Internet Archive: ā€¢ https://web.archive.org/web/20211000000001/https://example.com/ archive.today: ā€¢ http://archive.today/abcdE IPFS: ā€¢ https://ipfs.io/ipfs/QmTbDmpvQ3cPZG6TA5tnar4ZG6q9JMBYVmX2n3wypMQMtr Telegraph: -ā€¢ http://telegra.ph/title-01-01` +ā€¢ http://telegra.ph/title-01-01 + +***** End of Archives *****` got := ForPublish(&Relaychat{Cols: collects, Data: bundleExample}).String() if got != expected { From e21e5abe2ca6bb438ae9daf534851ac6a1426847 Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Fri, 19 May 2023 17:18:41 +0100 Subject: [PATCH 15/21] Refine message template --- template/render/mastodon_test.go | 4 ++-- template/render/nostr_test.go | 4 ++-- template/render/relaychat.go | 12 ++++++------ template/render/relaychat_test.go | 25 +++++++++++++++---------- template/render/render.go | 4 ++-- template/render/twitter_test.go | 4 ++-- 6 files changed, 29 insertions(+), 24 deletions(-) diff --git a/template/render/mastodon_test.go b/template/render/mastodon_test.go index adea9124..74709cc0 100644 --- a/template/render/mastodon_test.go +++ b/template/render/mastodon_test.go @@ -15,9 +15,9 @@ import ( func TestRenderMastodon(t *testing.T) { const toot = `ā€¹ Example ā€ŗ -ā€¢ source +ā€¢ Source > https://example.com/ - + ā€”ā€”ā€”ā€” ā€¢ Internet Archive diff --git a/template/render/nostr_test.go b/template/render/nostr_test.go index e2c319e9..10af5aaf 100644 --- a/template/render/nostr_test.go +++ b/template/render/nostr_test.go @@ -15,9 +15,9 @@ func TestRenderNostrForReply(t *testing.T) { func TestRenderNostrForPublish(t *testing.T) { expected := `ā€¹ Example ā€ŗ -ā€¢ source +ā€¢ Source > https://example.com/ - + ā€”ā€”ā€”ā€” ā€¢ Internet Archive diff --git a/template/render/relaychat.go b/template/render/relaychat.go index 1ac10cf2..5f4040d6 100644 --- a/template/render/relaychat.go +++ b/template/render/relaychat.go @@ -40,18 +40,18 @@ func (i *Relaychat) ForPublish() *Render { tmplBytes.WriteString(" ā€ŗ") tmplBytes.WriteString("\n \n") } - // tmplBytes.WriteString("Source:") - // tmplBytes.WriteString("ā€¢ ") - // tmplBytes.WriteString("\n \n") - tmplBytes.Write(i.join(i.main()).Bytes()) + // tmplBytes.WriteString("Source:\n") + tmplBytes.WriteString(original(i.Cols)) + tmplBytes.WriteString(" \n") + tmplBytes.Write(i.main().Bytes()) - return &Render{buf: *tmplBytes} + return &Render{buf: *i.join(tmplBytes)} } func (i *Relaychat) main() *bytes.Buffer { tmplBytes := new(bytes.Buffer) - const tmpl = "{{range $ := .}}{{ $.Arc | name }}:\nā€¢ {{ $.Dst }}\n{{end}}" + const tmpl = "{{range $ := .}}ā€¢ {{ $.Arc | name }}:\n> {{ $.Dst }}\n{{end}}" tpl, err := template.New("relaychat").Funcs(funcMap()).Parse(tmpl) if err != nil { diff --git a/template/render/relaychat_test.go b/template/render/relaychat_test.go index d4f704b4..bd968c99 100644 --- a/template/render/relaychat_test.go +++ b/template/render/relaychat_test.go @@ -9,18 +9,23 @@ import ( ) func TestRenderForIRC(t *testing.T) { - expected := `ā€¹ Example ā€ŗ + expected := `***** List of Archives ***** -***** List of Archives ***** +ā€¹ Example ā€ŗ -Internet Archive: -ā€¢ https://web.archive.org/web/20211000000001/https://example.com/ -archive.today: -ā€¢ http://archive.today/abcdE -IPFS: -ā€¢ https://ipfs.io/ipfs/QmTbDmpvQ3cPZG6TA5tnar4ZG6q9JMBYVmX2n3wypMQMtr -Telegraph: -ā€¢ http://telegra.ph/title-01-01 +ā€¢ Source +> https://example.com/ + +ā€”ā€”ā€”ā€” + +ā€¢ Internet Archive: +> https://web.archive.org/web/20211000000001/https://example.com/ +ā€¢ archive.today: +> http://archive.today/abcdE +ā€¢ IPFS: +> https://ipfs.io/ipfs/QmTbDmpvQ3cPZG6TA5tnar4ZG6q9JMBYVmX2n3wypMQMtr +ā€¢ Telegraph: +> http://telegra.ph/title-01-01 ***** End of Archives *****` diff --git a/template/render/render.go b/template/render/render.go index 59f59ffa..a45c9c85 100644 --- a/template/render/render.go +++ b/template/render/render.go @@ -234,11 +234,11 @@ func original(v interface{}) (o string) { }) var sb strings.Builder - sb.WriteString("ā€¢ source\n") + sb.WriteString("ā€¢ Source\n") for _, kv := range ss { sb.WriteString(`> `) sb.WriteString(kv.Key) - sb.WriteString("\n") + sb.WriteString("\n ") } sb.WriteString("\nā€”ā€”ā€”ā€”\n") diff --git a/template/render/twitter_test.go b/template/render/twitter_test.go index b68f9290..49c57075 100644 --- a/template/render/twitter_test.go +++ b/template/render/twitter_test.go @@ -29,9 +29,9 @@ func TestRenderTwitterForReply(t *testing.T) { func TestRenderTwitterForPublish(t *testing.T) { const tweet = `ā€¹ Example ā€ŗ -ā€¢ source +ā€¢ Source > https://example.com/ - + ā€”ā€”ā€”ā€” ā€¢ Internet Archive From 479789bb4b73351cccb8cb81747b75b59e3d8ab3 Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Wed, 21 Feb 2024 15:04:21 +0000 Subject: [PATCH 16/21] Support for dial non-TLS connection --- config/config_test.go | 46 ++++++++++++++++++++++++++++++++++ config/options.go | 8 ++++++ config/parser.go | 2 ++ service/relaychat/relaychat.go | 4 ++- 4 files changed, 59 insertions(+), 1 deletion(-) diff --git a/config/config_test.go b/config/config_test.go index 4e5f0cdf..8973152f 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -1630,6 +1630,52 @@ func TestIRC(t *testing.T) { tt.call(t, opts, tt.want) }) } + + testsBool := []struct { + name string + envs map[string]bool + call func(*testing.T, *Options, bool) + want bool + }{ + { + name: "default irc secure", + envs: map[string]bool{ + "WAYBACK_IRC_SECURE": true, + }, + call: func(t *testing.T, opts *Options, want bool) { + called := opts.IRCSecure() + if called != want { + t.Errorf(`Unexpected get the irc secure, got %v instead of %v`, called, want) + } + }, + want: defIRCSecure, + }, + { + name: "specified irc secure", + envs: map[string]bool{ + "WAYBACK_IRC_SECURE": false, + }, + call: func(t *testing.T, opts *Options, want bool) { + called := opts.IRCSecure() + if called != want { + t.Errorf(`Unexpected get the irc secure, got %v instead of %v`, called, want) + } + }, + want: false, + }, + } + for _, tt := range testsBool { + t.Run(tt.name, func(t *testing.T) { + for key, val := range tt.envs { + t.Setenv(key, strconv.FormatBool(val)) + } + opts, err := NewParser().ParseEnvironmentVariables() + if err != nil { + t.Fatalf(`Parsing environment variables failed: %v`, err) + } + tt.call(t, opts, tt.want) + }) + } } func TestMatrix(t *testing.T) { diff --git a/config/options.go b/config/options.go index 4e342822..bb43443a 100644 --- a/config/options.go +++ b/config/options.go @@ -65,6 +65,7 @@ const ( defIRCPassword = "" defIRCChannel = "" defIRCServer = "irc.libera.chat:6697" + defIRCSecure = true defXMPPUsername = "" defXMPPPassword = "" @@ -229,6 +230,7 @@ type irc struct { password string channel string server string + secure bool } type onion struct { @@ -337,6 +339,7 @@ func NewOptions() *Options { password: defIRCPassword, channel: defIRCChannel, server: defIRCServer, + secure: defIRCSecure, }, onion: &onion{ localPort: defOnionLocalPort, @@ -629,6 +632,11 @@ func (o *Options) IRCServer() string { return o.irc.server } +// IRCSecure returns whether use TLS for IRC connection. +func (o *Options) IRCSecure() bool { + return o.irc.secure +} + // PublishToIRCChannel returns whether publish results to IRC channel. func (o *Options) PublishToIRCChannel() bool { return o.irc.nick != "" && o.irc.channel != "" diff --git a/config/parser.go b/config/parser.go index fb98a03e..5aa77a35 100644 --- a/config/parser.go +++ b/config/parser.go @@ -159,6 +159,8 @@ func (p *Parser) parseLines(lines []string) (err error) { p.opts.irc.channel = parseString(val, defIRCChannel) case "WAYBACK_IRC_SERVER": p.opts.irc.server = parseString(val, defIRCServer) + case "WAYBACK_IRC_SECURE": + p.opts.irc.secure = parseBool(val, defIRCSecure) case "WAYBACK_MATRIX_HOMESERVER": p.opts.matrix.homeserver = parseString(val, defMatrixHomeserver) case "WAYBACK_MATRIX_USERID": diff --git a/service/relaychat/relaychat.go b/service/relaychat/relaychat.go index 79a69ebb..e325755c 100644 --- a/service/relaychat/relaychat.go +++ b/service/relaychat/relaychat.go @@ -122,7 +122,9 @@ func (i *IRC) Serve() error { if err != nil { return errors.Wrap(err, "failed to establish connection") } - conn = tls.Client(conn, &tls.Config{MinVersion: tls.VersionTLS12, ServerName: srv.Hostname()}) + if i.opts.IRCSecure() { + conn = tls.Client(conn, &tls.Config{MinVersion: tls.VersionTLS12, ServerName: srv.Hostname()}) + } i.conn = irc.NewClient(conn, config) logger.Info("Serving IRC server: %s, nick: %s", i.opts.IRCServer(), i.conn.CurrentNick()) From 43d629a31944db09e9440e8e0aaf04dddd4f8841 Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Thu, 22 Feb 2024 12:56:48 +0000 Subject: [PATCH 17/21] Revert "Support for dial non-TLS connection" This reverts commit 479789bb4b73351cccb8cb81747b75b59e3d8ab3. --- config/config_test.go | 46 ---------------------------------- config/options.go | 8 ------ config/parser.go | 2 -- service/relaychat/relaychat.go | 4 +-- 4 files changed, 1 insertion(+), 59 deletions(-) diff --git a/config/config_test.go b/config/config_test.go index 8973152f..4e5f0cdf 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -1630,52 +1630,6 @@ func TestIRC(t *testing.T) { tt.call(t, opts, tt.want) }) } - - testsBool := []struct { - name string - envs map[string]bool - call func(*testing.T, *Options, bool) - want bool - }{ - { - name: "default irc secure", - envs: map[string]bool{ - "WAYBACK_IRC_SECURE": true, - }, - call: func(t *testing.T, opts *Options, want bool) { - called := opts.IRCSecure() - if called != want { - t.Errorf(`Unexpected get the irc secure, got %v instead of %v`, called, want) - } - }, - want: defIRCSecure, - }, - { - name: "specified irc secure", - envs: map[string]bool{ - "WAYBACK_IRC_SECURE": false, - }, - call: func(t *testing.T, opts *Options, want bool) { - called := opts.IRCSecure() - if called != want { - t.Errorf(`Unexpected get the irc secure, got %v instead of %v`, called, want) - } - }, - want: false, - }, - } - for _, tt := range testsBool { - t.Run(tt.name, func(t *testing.T) { - for key, val := range tt.envs { - t.Setenv(key, strconv.FormatBool(val)) - } - opts, err := NewParser().ParseEnvironmentVariables() - if err != nil { - t.Fatalf(`Parsing environment variables failed: %v`, err) - } - tt.call(t, opts, tt.want) - }) - } } func TestMatrix(t *testing.T) { diff --git a/config/options.go b/config/options.go index bb43443a..4e342822 100644 --- a/config/options.go +++ b/config/options.go @@ -65,7 +65,6 @@ const ( defIRCPassword = "" defIRCChannel = "" defIRCServer = "irc.libera.chat:6697" - defIRCSecure = true defXMPPUsername = "" defXMPPPassword = "" @@ -230,7 +229,6 @@ type irc struct { password string channel string server string - secure bool } type onion struct { @@ -339,7 +337,6 @@ func NewOptions() *Options { password: defIRCPassword, channel: defIRCChannel, server: defIRCServer, - secure: defIRCSecure, }, onion: &onion{ localPort: defOnionLocalPort, @@ -632,11 +629,6 @@ func (o *Options) IRCServer() string { return o.irc.server } -// IRCSecure returns whether use TLS for IRC connection. -func (o *Options) IRCSecure() bool { - return o.irc.secure -} - // PublishToIRCChannel returns whether publish results to IRC channel. func (o *Options) PublishToIRCChannel() bool { return o.irc.nick != "" && o.irc.channel != "" diff --git a/config/parser.go b/config/parser.go index 5aa77a35..fb98a03e 100644 --- a/config/parser.go +++ b/config/parser.go @@ -159,8 +159,6 @@ func (p *Parser) parseLines(lines []string) (err error) { p.opts.irc.channel = parseString(val, defIRCChannel) case "WAYBACK_IRC_SERVER": p.opts.irc.server = parseString(val, defIRCServer) - case "WAYBACK_IRC_SECURE": - p.opts.irc.secure = parseBool(val, defIRCSecure) case "WAYBACK_MATRIX_HOMESERVER": p.opts.matrix.homeserver = parseString(val, defMatrixHomeserver) case "WAYBACK_MATRIX_USERID": diff --git a/service/relaychat/relaychat.go b/service/relaychat/relaychat.go index e325755c..79a69ebb 100644 --- a/service/relaychat/relaychat.go +++ b/service/relaychat/relaychat.go @@ -122,9 +122,7 @@ func (i *IRC) Serve() error { if err != nil { return errors.Wrap(err, "failed to establish connection") } - if i.opts.IRCSecure() { - conn = tls.Client(conn, &tls.Config{MinVersion: tls.VersionTLS12, ServerName: srv.Hostname()}) - } + conn = tls.Client(conn, &tls.Config{MinVersion: tls.VersionTLS12, ServerName: srv.Hostname()}) i.conn = irc.NewClient(conn, config) logger.Info("Serving IRC server: %s, nick: %s", i.opts.IRCServer(), i.conn.CurrentNick()) From bd608b8ac50509886368af60357a3730c8e1fa71 Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Thu, 22 Feb 2024 13:56:12 +0000 Subject: [PATCH 18/21] Fallback to non-TLS server --- service/relaychat/relaychat.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/service/relaychat/relaychat.go b/service/relaychat/relaychat.go index 79a69ebb..b32330d1 100644 --- a/service/relaychat/relaychat.go +++ b/service/relaychat/relaychat.go @@ -12,6 +12,7 @@ import ( "sync" "time" + "github.com/gookit/color" "github.com/wabarc/logger" "github.com/wabarc/wayback" "github.com/wabarc/wayback/config" @@ -117,18 +118,30 @@ func (i *IRC) Serve() error { return errors.Wrap(err, "failed to parse irc server") } + secure := true dialer := ingress.Dialer() +conn: conn, err := dialer.Dial("tcp", i.opts.IRCServer()) if err != nil { return errors.Wrap(err, "failed to establish connection") } - conn = tls.Client(conn, &tls.Config{MinVersion: tls.VersionTLS12, ServerName: srv.Hostname()}) + if secure { + conn = tls.Client(conn, &tls.Config{MinVersion: tls.VersionTLS12, ServerName: srv.Hostname()}) + } i.conn = irc.NewClient(conn, config) - logger.Info("Serving IRC server: %s, nick: %s", i.opts.IRCServer(), i.conn.CurrentNick()) + logger.Info("Serving IRC server: %s, nick: %s", i.opts.IRCServer(), color.Blue.Sprint(i.conn.CurrentNick())) // Block until context done err = i.conn.RunContext(i.ctx) if err != nil { + switch { + case err.Error() == "EOF", err.Error() == "ping timeout": + goto conn + case strings.HasPrefix(err.Error(), "tls:"): + secure = false + logger.Info("Serving IRC server with TLS failed, fallback to non-TLS") + goto conn + } logger.Error("failed to run, error: %v", err) return errors.Wrap(err, "failed to run irc bot") } From 25cb233b779e7cf8dfbd89cadd933315e37208e9 Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Thu, 22 Feb 2024 13:56:24 +0000 Subject: [PATCH 19/21] Update changelog.md --- docs/changelog.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index d920fafb..cff533df 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -24,6 +24,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Refactoring HTTP client for better consistency and maintainability ([#401](https://github.com/wabarc/wayback/pull/401)) - ci: bump action version for page workflow - Replace meilisearch actions with `wabarc/.github/meilisearch` instead ([#491](https://github.com/wabarc/wayback/pull/491)) +- Proxy connection to IRC server ([#402](https://github.com/wabarc/wayback/pull/402)) + - Change `github.com/thoj/go-ircevent` to `gopkg.in/irc.v4` + - Fix `daemon` flag not working when value is `irc` + - Add support for playback from IRC + - Add support for place IRC name + - Fallback to non-TLS server + - Styling IRC message ## [0.19.1] - 2023-03-21 From b055291ccc00ea060fe2640109d6ffb17a99f232 Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Thu, 22 Feb 2024 15:00:14 +0000 Subject: [PATCH 20/21] Fix golang linter --- service/relaychat/relaychat.go | 70 ++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/service/relaychat/relaychat.go b/service/relaychat/relaychat.go index b32330d1..e4eb0194 100644 --- a/service/relaychat/relaychat.go +++ b/service/relaychat/relaychat.go @@ -74,39 +74,7 @@ func (i *IRC) Serve() error { Name: i.opts.IRCName(), Pass: i.opts.IRCPassword(), Handler: irc.HandlerFunc(func(c *irc.Client, m *irc.Message) { - logger.Debug("received message: %#v", m) - - if m.Command == "ERROR" { - logger.Error("failed to handle irc request: %s", m) - return - } - - if m.Command == "001" && i.opts.IRCChannel() != "" { - if err := c.Writef("JOIN %s", i.opts.IRCChannel()); err != nil { - logger.Error("failed to join %q channel: %v", err) - } - return - } - - if m.Command == "NOTICE" && m.Prefix.Name == "NickServ" && strings.Contains(m.Trailing(), "dentified") { - logger.Debug("received command %q skipped", m.Command) - return - } - - if m.Command != "PRIVMSG" { - logger.Debug("received command %q, skipped", m.Command) - return - } - - if c.FromChannel(m) { - logger.Debug("received message from channel, skipped") - return - } - - if err := i.process(m); err != nil { - logger.Error("process failure, message: %s, error: %v", m, err) - return - } + i.handle(c, m) }), PingFrequency: 3 * time.Second, PingTimeout: time.Minute, @@ -154,6 +122,42 @@ func (i *IRC) Shutdown() error { return nil } +func (i *IRC) handle(c *irc.Client, m *irc.Message) { + logger.Debug("received message: %#v", m) + + if m.Command == "ERROR" { + logger.Error("failed to handle irc request: %s", m) + return + } + + if m.Command == "001" && i.opts.IRCChannel() != "" { + if err := c.Writef("JOIN %s", i.opts.IRCChannel()); err != nil { + logger.Error("failed to join %q channel: %v", err) + } + return + } + + if m.Command == "NOTICE" && m.Prefix.Name == "NickServ" && strings.Contains(m.Trailing(), "dentified") { + logger.Debug("received command %q skipped", m.Command) + return + } + + if m.Command != "PRIVMSG" { + logger.Debug("received command %q, skipped", m.Command) + return + } + + if c.FromChannel(m) { + logger.Debug("received message from channel, skipped") + return + } + + if err := i.process(m); err != nil { + logger.Error("process failure, message: %s, error: %v", m, err) + return + } +} + func (i *IRC) process(m *irc.Message) error { text := m.Trailing() urls := service.MatchURL(i.opts, text) From 01db0591c7cf133644161b8d4655573575331b3c Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Fri, 23 Feb 2024 03:12:26 +0000 Subject: [PATCH 21/21] Fallback to non-TLS trigger warning instead of info logging --- service/relaychat/relaychat.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/relaychat/relaychat.go b/service/relaychat/relaychat.go index e4eb0194..7bf6ea1e 100644 --- a/service/relaychat/relaychat.go +++ b/service/relaychat/relaychat.go @@ -107,7 +107,7 @@ conn: goto conn case strings.HasPrefix(err.Error(), "tls:"): secure = false - logger.Info("Serving IRC server with TLS failed, fallback to non-TLS") + logger.Warn("Serving IRC server with TLS failed, fallback to non-TLS") goto conn } logger.Error("failed to run, error: %v", err)