Update deps and go version (#202)

This commit is contained in:
Antonio Navarro Perez 2023-09-05 17:05:27 +02:00 committed by GitHub
parent e54a501278
commit 8e5fc6d6fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 290 additions and 987 deletions

View file

@ -18,10 +18,10 @@ jobs:
matrix:
include:
- arch: armv7
go: 1.17.5
go: 1.20.7
go_arch: armv6l
- arch: aarch64
go: 1.17.5
go: 1.20.7
go_arch: arm64
steps:
- uses: actions/checkout@v3

View file

@ -39,7 +39,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ^1.17
go-version: ^1.20
- name: Install Libraries on Linux
shell: bash

121
go.mod
View file

@ -1,59 +1,63 @@
module github.com/distribyted/distribyted
go 1.17
go 1.20
require (
github.com/RoaringBitmap/roaring v0.9.4 // indirect
github.com/anacrolix/dht/v2 v2.15.0
github.com/anacrolix/log v0.10.0
github.com/anacrolix/missinggo/v2 v2.5.2
github.com/anacrolix/multiless v0.3.0 // indirect
github.com/anacrolix/torrent v1.40.0
github.com/RoaringBitmap/roaring v1.5.0 // indirect
github.com/anacrolix/dht/v2 v2.20.0
github.com/anacrolix/log v0.14.2 // indirect
github.com/anacrolix/missinggo/v2 v2.7.2
github.com/anacrolix/multiless v0.3.1-0.20221221005021-2d12701f83f7 // indirect
github.com/anacrolix/torrent v1.52.6-0.20230905090324-873da77cca69
github.com/billziss-gh/cgofuse v1.5.0
github.com/bodgit/sevenzip v1.1.1
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/dgraph-io/badger/v3 v3.2103.2
github.com/fsnotify/fsnotify v1.5.1
github.com/fsnotify/fsnotify v1.5.4
github.com/gin-gonic/gin v1.7.7
github.com/go-playground/validator/v10 v10.9.0 // indirect
github.com/goccy/go-yaml v1.9.4
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/mattn/go-colorable v0.1.12
github.com/nwaples/rardecode/v2 v2.0.0-beta.2
github.com/pion/dtls/v2 v2.2.4 // indirect
github.com/pion/mdns v0.0.5 // indirect
github.com/pion/rtp v1.7.4 // indirect
github.com/pion/sctp v1.8.2 // indirect
github.com/pion/dtls/v2 v2.2.7 // indirect
github.com/pion/mdns v0.0.8 // indirect
github.com/pion/rtp v1.8.1 // indirect
github.com/pion/sctp v1.8.8 // indirect
github.com/rs/zerolog v1.26.1
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.8.4
github.com/urfave/cli/v2 v2.3.0
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/net v0.7.0
golang.org/x/sys v0.5.0 // indirect
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/net v0.14.0
golang.org/x/sys v0.12.0 // indirect
golang.org/x/time v0.3.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1
)
require (
crawshaw.io/sqlite v0.3.3-0.20220618202545-d1964889ea3c // indirect
github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0 // indirect
github.com/alecthomas/atomic v0.1.0-alpha2 // indirect
github.com/anacrolix/chansync v0.3.0 // indirect
github.com/anacrolix/confluence v1.10.0 // indirect
github.com/anacrolix/envpprof v1.1.1 // indirect
github.com/anacrolix/go-libutp v1.1.0 // indirect
github.com/anacrolix/envpprof v1.3.0 // indirect
github.com/anacrolix/generics v0.0.0-20230816105729-c755655aee45 // indirect
github.com/anacrolix/go-libutp v1.3.1 // indirect
github.com/anacrolix/missinggo v1.3.0 // indirect
github.com/anacrolix/missinggo/perf v1.0.0 // indirect
github.com/anacrolix/mmsg v1.0.0 // indirect
github.com/anacrolix/stm v0.3.0 // indirect
github.com/anacrolix/stm v0.5.0 // indirect
github.com/anacrolix/sync v0.4.0 // indirect
github.com/anacrolix/upnp v0.1.2 // indirect
github.com/anacrolix/utp v0.1.0 // indirect
github.com/benbjohnson/immutable v0.3.0 // indirect
github.com/bits-and-blooms/bitset v1.2.1 // indirect
github.com/anacrolix/upnp v0.1.3-0.20220123035249-922794e51c96 // indirect
github.com/anacrolix/utp v0.2.0 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/benbjohnson/immutable v0.4.3 // indirect
github.com/bits-and-blooms/bitset v1.8.0 // indirect
github.com/bodgit/plumbing v1.1.0 // indirect
github.com/bodgit/windows v1.0.0 // indirect
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 // indirect
@ -62,10 +66,14 @@ require (
github.com/connesc/cipherio v0.2.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgraph-io/ristretto v0.1.1-0.20211108053508-297c39e6640f // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/edsrzf/mmap-go v1.1.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-llsqlite/adapter v0.0.0-20230905083127-a7568332b3ac // indirect
github.com/go-llsqlite/crawshaw v0.0.0-20230904103556-219a9360a2c0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
@ -73,48 +81,53 @@ require (
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/flatbuffers v2.0.0+incompatible // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/lispad/go-generics-tools v1.1.0 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mschoch/smat v0.2.0 // indirect
github.com/pion/datachannel v1.5.2 // indirect
github.com/pion/ice/v2 v2.1.18 // indirect
github.com/pion/interceptor v0.1.4 // indirect
github.com/pion/datachannel v1.5.5 // indirect
github.com/pion/ice/v3 v3.0.0 // indirect
github.com/pion/interceptor v0.1.18 // indirect
github.com/pion/logging v0.2.2 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/rtcp v1.2.9 // indirect
github.com/pion/sdp/v3 v3.0.4 // indirect
github.com/pion/srtp/v2 v2.0.5 // indirect
github.com/pion/stun v0.3.5 // indirect
github.com/pion/transport v0.13.0 // indirect
github.com/pion/transport/v2 v2.0.0 // indirect
github.com/pion/turn/v2 v2.0.6 // indirect
github.com/pion/udp v0.1.4 // indirect
github.com/pion/webrtc/v3 v3.1.13 // indirect
github.com/pion/rtcp v1.2.10 // indirect
github.com/pion/sdp/v3 v3.0.6 // indirect
github.com/pion/srtp/v3 v3.0.0 // indirect
github.com/pion/stun v0.6.1 // indirect
github.com/pion/transport/v2 v2.2.3 // indirect
github.com/pion/transport/v3 v3.0.1 // indirect
github.com/pion/turn/v3 v3.0.0 // indirect
github.com/pion/webrtc/v3 v3.2.18 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417 // indirect
github.com/rs/dnscache v0.0.0-20230804202142-fc85eb664529 // indirect
github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 // indirect
github.com/tidwall/btree v1.6.0 // indirect
github.com/ugorji/go/codec v1.2.6 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.opencensus.io v0.23.0 // indirect
go.opentelemetry.io/otel v1.17.0 // indirect
go.opentelemetry.io/otel/metric v1.17.0 // indirect
go.opentelemetry.io/otel/trace v1.17.0 // indirect
go4.org v0.0.0-20201209231011-d4a079459e60 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.27.1 // indirect
modernc.org/libc v1.13.2 // indirect
modernc.org/mathutil v1.4.1 // indirect
modernc.org/memory v1.0.5 // indirect
modernc.org/sqlite v1.14.3 // indirect
zombiezen.com/go/sqlite v0.8.0 // indirect
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
google.golang.org/protobuf v1.28.0 // indirect
modernc.org/libc v1.21.5 // indirect
modernc.org/mathutil v1.5.0 // indirect
modernc.org/memory v1.4.0 // indirect
modernc.org/sqlite v1.20.0 // indirect
zombiezen.com/go/sqlite v0.12.0 // indirect
)

1123
go.sum

File diff suppressed because it is too large Load diff

View file

@ -5,22 +5,15 @@ import (
"github.com/rs/zerolog"
)
var _ log.LoggerImpl = &Torrent{}
var _ log.Handler = &Torrent{}
type Torrent struct {
L zerolog.Logger
}
func (l *Torrent) Log(m log.Msg) {
level, ok := m.GetLevel()
func (l *Torrent) Handle(r log.Record) {
e := l.L.Info()
if !ok {
level = log.Debug
}
switch level {
switch r.Level {
case log.Debug:
e = l.L.Debug()
case log.Info:
@ -31,9 +24,9 @@ func (l *Torrent) Log(m log.Msg) {
e = l.L.Warn().Str("error-type", "error")
case log.Critical:
e = l.L.Warn().Str("error-type", "critical")
case log.Fatal:
e = l.L.Warn().Str("error-type", "fatal")
}
e.Msgf(m.String())
// TODO set log values somehow
e.Msgf(r.Text())
}

View file

@ -8,9 +8,10 @@ import (
tlog "github.com/anacrolix/log"
"github.com/anacrolix/torrent"
"github.com/anacrolix/torrent/storage"
"github.com/rs/zerolog/log"
"github.com/distribyted/distribyted/config"
dlog "github.com/distribyted/distribyted/log"
"github.com/rs/zerolog/log"
)
func NewClient(st storage.ClientImpl, fis bep44.Store, cfg *config.TorrentGlobal, id [20]byte) (*torrent.Client, error) {
@ -22,7 +23,10 @@ func NewClient(st storage.ClientImpl, fis bep44.Store, cfg *config.TorrentGlobal
torrentCfg.DisableIPv6 = cfg.DisableIPv6
l := log.Logger.With().Str("component", "torrent-client").Logger()
torrentCfg.Logger = tlog.Logger{LoggerImpl: &dlog.Torrent{L: l}}
tl := tlog.NewLogger()
tl.SetHandlers(&dlog.Torrent{L: l})
torrentCfg.Logger = tl
torrentCfg.ConfigureAnacrolixDhtServer = func(cfg *dht.ServerConfig) {
cfg.Store = fis