diff --git a/Makefile b/Makefile index fa16cf702e..0e8b8cde7e 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ RFC_3339 := "+%Y-%m-%dT%H:%M:%SZ" COMMIT := $(shell git rev-list -1 HEAD) PROJECT_BASE := github.com/skycoin/skywire -SKYWIRE_UTILITIES_BASE := github.com/skycoin/skywire-utilities +SKYWIRE_UTILITIES_BASE := github.com/skycoin/skywire/pkg/skywire-utilities ifeq ($(OS),Windows_NT) SHELL := pwsh OPTS?=powershell -Command setx GO111MODULE on; diff --git a/README.md b/README.md index f5cbf795c1..fe31b652c4 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,21 @@ Visor apps are not executed directly by the user, but hosted by the visor proces Further documentation can be found in the [skywire wiki](https://github.com/skycoin/skywire/wiki). +## `go install` or `go run` Skywire + +If you have golang set up - including setting GOPATH, GOBIN, and appending GOBIN to your PATH reenvironmental variable, skywire may be installed to your GOBIN as follows: + +``` +_skywire="github.com/skycoin/skywire" go install -ldflags=" -X ${_skywire}/pkg/skywire-utilities/pkg/buildinfo.golist=$(go list -mod=mod -m -json ${_skywire}@develop)" ${_skywire}/cmd/skywire@develop +``` + +`-ldflags` compiles the version into the binary, so that the visor will be eligible for rewards. + +It's also possible to `go run` skywire from outside the source code, but this is generally not recommended: +``` +_skywire="github.com/skycoin/skywire" go run -ldflags=" -X ${_skywire}/pkg/skywire-utilities/pkg/buildinfo.golist=$(go list -mod=mod -m -json ${_skywire}@develop)" ${_skywire}/cmd/skywire@develop +``` + ## Installing Skywire from Release Releases for windows & macOS are available from the [release section](https://github.com/skycoin/skywire/releases/) diff --git a/go.mod b/go.mod index bece9b13c6..d510e205a4 100644 --- a/go.mod +++ b/go.mod @@ -34,10 +34,10 @@ require ( github.com/pterm/pterm v0.12.79 github.com/robert-nix/ansihtml v1.0.1 github.com/sirupsen/logrus v1.9.3 - github.com/skycoin/dmsg v1.3.29-0.20241019182716-022283c93835 + github.com/skycoin/dmsg v1.3.29-0.20241217193208-d32ec623e670 github.com/skycoin/skycoin v0.28.1-0.20241105130348-39b49a2d0a7f - github.com/skycoin/skycoin-service-discovery v1.3.29-0.20241019190420-233c2d68bce0 - github.com/skycoin/skywire-services v1.3.29-0.20241105123837-b4869a32c8db + github.com/skycoin/skycoin-service-discovery v1.3.29-0.20241217194518-634b05d94b2e + github.com/skycoin/skywire-services v1.3.29-0.20241217194941-6269f3c618c3 github.com/skycoin/systray v1.10.0 github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 github.com/spf13/cobra v1.8.1 @@ -140,7 +140,6 @@ require ( github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/shopspring/decimal v1.4.0 // indirect github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6 // indirect - github.com/skycoin/skywire-utilities v1.3.25 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect @@ -186,16 +185,18 @@ require ( //replace github.com/skycoin/dmsg => ../dmsg //replace github.com/skycoin/skywire-services => ../skywire-services //replace github.com/skycoin/skycoin-service-discovery => ../skycoin-service-discovery -//replace github.com/skycoin/skywire-utilities => ../skywire-utilities -// Uncomment to update other skywire deps to specific commit hash. +// To update other skywire deps to specific commit hash: // run `go mod tidy ; go mod vendor` // copy the changed line to the correct place in the above // then, re-comment the line before saving. +// replace github.com/skycoin/skycoin => github.com/skycoin/skycoin // replace github.com/skycoin/dmsg => github.com/skycoin/dmsg // replace github.com/skycoin/skywire-services => github.com/skycoin/skywire-services -//replace github.com/skycoin/skywire-services => github.com/skycoin/skywire-services -// replace github.com/skycoin/skycoin => github.com/skycoin/skycoin - // replace github.com/skycoin/skycoin-service-discovery => github.com/skycoin/skycoin-service-discovery -// replace github.com/skycoin/skywire-utilities => github.com/skycoin/skywire-utilities + +// Below should reflect the current versions of the following deps +// replace github.com/skycoin/skycoin => github.com/skycoin/skycoin v0.28.1-0.20241105130348-39b49a2d0a7f +// replace github.com/skycoin/dmsg => github.com/skycoin/dmsg v1.3.29-0.20241217193208-d32ec623e670 +// replace github.com/skycoin/skywire-services => github.com/skycoin/skywire-services v1.3.29-0.20241217194941-6269f3c618c3 +// replace github.com/skycoin/skycoin-service-discovery => github.com/skycoin/skycoin-service-discovery v1.3.29-0.20241217194518-634b05d94b2e diff --git a/go.sum b/go.sum index b2b8c6d676..aa5ff8da58 100644 --- a/go.sum +++ b/go.sum @@ -629,20 +629,18 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/skycoin/dmsg v1.3.29-0.20241019182716-022283c93835 h1:29jU+cxqQGJCWoxGsrgk3nIF+JDipvJsQU89x6FKSZw= -github.com/skycoin/dmsg v1.3.29-0.20241019182716-022283c93835/go.mod h1:hFJtHnX+pDC6v5Z81QPbpVktMMfMNzL/kgcZmCKu3Bg= +github.com/skycoin/dmsg v1.3.29-0.20241217193208-d32ec623e670 h1:4RUr5DtDwsvpT6NIgRsWy6zffiljW42aP3PsEBBazhc= +github.com/skycoin/dmsg v1.3.29-0.20241217193208-d32ec623e670/go.mod h1:BU69yZysa088J/wV+9Z2Kbwq4Auup2tcvFiAlEle74M= github.com/skycoin/encodertest v0.0.0-20190217072920-14c2e31898b9 h1:DElGw1Fhj4amuW1KM5q8Xowosb3RiOQce0lDJw0Qv0Y= github.com/skycoin/encodertest v0.0.0-20190217072920-14c2e31898b9/go.mod h1:OQz8NXVJUWEw7PWYASZ/1BIw5GXgVMTGvrCGDlZa9+k= github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6 h1:1Nc5EBY6pjfw1kwW0duwyG+7WliWz5u9kgk1h5MnLuA= github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:UXghlricA7J3aRD/k7p/zBObQfmBawwCxIVPVjz2Q3o= github.com/skycoin/skycoin v0.28.1-0.20241105130348-39b49a2d0a7f h1:isCGulVHahQfFoS37B7JT3rb8n4Ih2o9oMg2p25D7o8= github.com/skycoin/skycoin v0.28.1-0.20241105130348-39b49a2d0a7f/go.mod h1:1iZLomiHUOEvmJaBNrzE+Tllf09uhrCZ5JLL3cHdKKQ= -github.com/skycoin/skycoin-service-discovery v1.3.29-0.20241019190420-233c2d68bce0 h1:2F9JSOHefkyTLsREj8bMMXk1z13fJhnVa0R/XCxbUwM= -github.com/skycoin/skycoin-service-discovery v1.3.29-0.20241019190420-233c2d68bce0/go.mod h1:3/WomvXyOLcjEMV4GiLv8b+bueohWa9ceoNwtQSB9KI= -github.com/skycoin/skywire-services v1.3.29-0.20241105123837-b4869a32c8db h1:Uo9I2qYuM4njAS8ZFNKprUlaFx78S8Fz62OkLVXKRns= -github.com/skycoin/skywire-services v1.3.29-0.20241105123837-b4869a32c8db/go.mod h1:Q3s3Ea+tcT3M4zkMT89ywk5NmLCdXZWHRsPhNBEo7Zw= -github.com/skycoin/skywire-utilities v1.3.25 h1:mk8dUonFdhVopFF3d9wbOyXXoiuAO+mN1y+ve6SzgX4= -github.com/skycoin/skywire-utilities v1.3.25/go.mod h1:yFKWpL1bDRPKU3uK+cTF4PnYUMe+eyIj5N2bk4sF5Cw= +github.com/skycoin/skycoin-service-discovery v1.3.29-0.20241217194518-634b05d94b2e h1:0IknW9LPP0Ct7aIzG3K9mR90txhe4KkNLrO6AaIgkU4= +github.com/skycoin/skycoin-service-discovery v1.3.29-0.20241217194518-634b05d94b2e/go.mod h1:nRAM1h+k3TPe22Ga5wwKqM2ZLzoYuobD9K+f5GT6aEM= +github.com/skycoin/skywire-services v1.3.29-0.20241217194941-6269f3c618c3 h1:p+0xzdepWJw0yzsj0XHGpuQV1ooscGUjDm5wRuC3Q6o= +github.com/skycoin/skywire-services v1.3.29-0.20241217194941-6269f3c618c3/go.mod h1:AxxX+4dxIU/NGNFFzi5z4dXGEADlVEb0FXJdLKEp5QY= github.com/skycoin/systray v1.10.0 h1:fQZJHMylpVvfmOOTLvUssfyHVDoC8Idx6Ba2BlLEuGg= github.com/skycoin/systray v1.10.0/go.mod h1:/i17Eni5GxFiboIZceeamY5LktDSFFRCvd3fBMerQ+4= github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 h1:TG/diQgUe0pntT/2D9tmUCz4VNwm9MfrtPr0SU2qSX8= diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsg-discovery/commands/dmsg-discovery.go b/vendor/github.com/skycoin/dmsg/cmd/dmsg-discovery/commands/dmsg-discovery.go index 3f60d4ed3f..efa31a9f64 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsg-discovery/commands/dmsg-discovery.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsg-discovery/commands/dmsg-discovery.go @@ -15,11 +15,11 @@ import ( proxyproto "github.com/pires/go-proxyproto" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" "github.com/spf13/cobra" "github.com/skycoin/dmsg/internal/discmetrics" diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsg-server/commands/root.go b/vendor/github.com/skycoin/dmsg/cmd/dmsg-server/commands/root.go index 2c64cc0c60..da11d3bdef 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsg-server/commands/root.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsg-server/commands/root.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" "github.com/spf13/cobra" "github.com/skycoin/dmsg/cmd/dmsg-server/commands/config" diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsg-server/commands/start/root.go b/vendor/github.com/skycoin/dmsg/cmd/dmsg-server/commands/start/root.go index 7217670a4c..8a4b76d4bd 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsg-server/commands/start/root.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsg-server/commands/start/root.go @@ -13,10 +13,10 @@ import ( chi "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" "github.com/spf13/cobra" "github.com/skycoin/dmsg/internal/dmsg-server/api" diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsg-socks5/commands/dmsg-socks5.go b/vendor/github.com/skycoin/dmsg/cmd/dmsg-socks5/commands/dmsg-socks5.go index e7eac5c748..05d6b3d77b 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsg-socks5/commands/dmsg-socks5.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsg-socks5/commands/dmsg-socks5.go @@ -15,9 +15,9 @@ import ( socks5 "github.com/confiant-inc/go-socks5" "github.com/skycoin/skywire" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/spf13/cobra" "github.com/skycoin/dmsg/pkg/disc" diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsgcurl/commands/dmsgcurl.go b/vendor/github.com/skycoin/dmsg/cmd/dmsgcurl/commands/dmsgcurl.go index b5397090fe..4f0b736306 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsgcurl/commands/dmsgcurl.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsgcurl/commands/dmsgcurl.go @@ -19,10 +19,10 @@ import ( "github.com/sirupsen/logrus" "github.com/skycoin/skywire" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/spf13/cobra" "github.com/skycoin/dmsg/pkg/disc" diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsghttp/commands/dmsghttp.go b/vendor/github.com/skycoin/dmsg/cmd/dmsghttp/commands/dmsghttp.go index 292957fc6c..cd86b346f2 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsghttp/commands/dmsghttp.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsghttp/commands/dmsghttp.go @@ -14,10 +14,10 @@ import ( "strings" "time" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/spf13/cobra" "github.com/skycoin/dmsg/pkg/disc" diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsgip/commands/dmsgip.go b/vendor/github.com/skycoin/dmsg/cmd/dmsgip/commands/dmsgip.go index 7a875d8e15..e6b1caea6b 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsgip/commands/dmsgip.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsgip/commands/dmsgip.go @@ -10,10 +10,10 @@ import ( "path/filepath" "strings" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/spf13/cobra" "github.com/skycoin/dmsg/pkg/disc" diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-cli/commands/root.go b/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-cli/commands/root.go index 811b7b2360..a4c517fdb6 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-cli/commands/root.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-cli/commands/root.go @@ -10,8 +10,8 @@ import ( "path/filepath" "strings" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" "github.com/spf13/cobra" dmsg "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-cli/commands/whitelist.go b/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-cli/commands/whitelist.go index 4d0e7e96c2..1208ce70ac 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-cli/commands/whitelist.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-cli/commands/whitelist.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/spf13/cobra" ) diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-host/commands/root.go b/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-host/commands/root.go index 753ff3beb2..6e89fbfa59 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-host/commands/root.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-host/commands/root.go @@ -15,10 +15,10 @@ import ( jsoniter "github.com/json-iterator/go" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/spf13/cobra" "github.com/skycoin/dmsg/pkg/disc" diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-ui/commands/dmsgpty-ui.go b/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-ui/commands/dmsgpty-ui.go index 140a2312ed..6659443391 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-ui/commands/dmsgpty-ui.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-ui/commands/dmsgpty-ui.go @@ -11,7 +11,7 @@ import ( "time" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" "github.com/spf13/cobra" "github.com/skycoin/dmsg/pkg/dmsgpty" diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsgweb/commands/dmsgweb.go b/vendor/github.com/skycoin/dmsg/cmd/dmsgweb/commands/dmsgweb.go index d7f94cee25..e8dab29391 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsgweb/commands/dmsgweb.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsgweb/commands/dmsgweb.go @@ -21,10 +21,10 @@ import ( "github.com/chen3feng/safecast" "github.com/confiant-inc/go-socks5" "github.com/gin-gonic/gin" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/spf13/cobra" "golang.org/x/net/proxy" diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsgweb/commands/dmsgwebsrv.go b/vendor/github.com/skycoin/dmsg/cmd/dmsgweb/commands/dmsgwebsrv.go index 181d426ad4..19401d2ffe 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsgweb/commands/dmsgwebsrv.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsgweb/commands/dmsgwebsrv.go @@ -18,9 +18,9 @@ import ( "github.com/bitfield/script" "github.com/chen3feng/safecast" "github.com/gin-gonic/gin" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/spf13/cobra" "github.com/skycoin/dmsg/pkg/disc" diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsgweb/commands/root.go b/vendor/github.com/skycoin/dmsg/cmd/dmsgweb/commands/root.go index 38d1e75805..6cdebdf1e5 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsgweb/commands/root.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsgweb/commands/root.go @@ -17,8 +17,8 @@ import ( "github.com/bitfield/script" "github.com/chen3feng/safecast" "github.com/gin-gonic/gin" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/dmsg/pkg/disc" dmsg "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/vendor/github.com/skycoin/dmsg/internal/discmetrics/victoria_metrics.go b/vendor/github.com/skycoin/dmsg/internal/discmetrics/victoria_metrics.go index 777318a25f..854afadb46 100644 --- a/vendor/github.com/skycoin/dmsg/internal/discmetrics/victoria_metrics.go +++ b/vendor/github.com/skycoin/dmsg/internal/discmetrics/victoria_metrics.go @@ -2,7 +2,7 @@ package discmetrics import ( - "github.com/skycoin/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" ) // VictoriaMetrics implements `Metrics` using `VictoriaMetrics`. diff --git a/vendor/github.com/skycoin/dmsg/internal/dmsg-discovery/api/api.go b/vendor/github.com/skycoin/dmsg/internal/dmsg-discovery/api/api.go index 1c2432fae1..48cfd4d107 100644 --- a/vendor/github.com/skycoin/dmsg/internal/dmsg-discovery/api/api.go +++ b/vendor/github.com/skycoin/dmsg/internal/dmsg-discovery/api/api.go @@ -12,12 +12,12 @@ import ( "github.com/go-chi/chi/v5/middleware" jsoniter "github.com/json-iterator/go" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/httputil" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" - "github.com/skycoin/skywire-utilities/pkg/networkmonitor" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/networkmonitor" "github.com/skycoin/dmsg/internal/discmetrics" "github.com/skycoin/dmsg/internal/dmsg-discovery/store" diff --git a/vendor/github.com/skycoin/dmsg/internal/dmsg-discovery/store/redis.go b/vendor/github.com/skycoin/dmsg/internal/dmsg-discovery/store/redis.go index ce2203a123..a514a77f8f 100644 --- a/vendor/github.com/skycoin/dmsg/internal/dmsg-discovery/store/redis.go +++ b/vendor/github.com/skycoin/dmsg/internal/dmsg-discovery/store/redis.go @@ -8,9 +8,9 @@ import ( "github.com/go-redis/redis/v8" jsoniter "github.com/json-iterator/go" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/netutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil" "github.com/skycoin/dmsg/pkg/disc" dmsg "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/vendor/github.com/skycoin/dmsg/internal/dmsg-discovery/store/storer.go b/vendor/github.com/skycoin/dmsg/internal/dmsg-discovery/store/storer.go index 61fbee3d74..12cb9a82c8 100644 --- a/vendor/github.com/skycoin/dmsg/internal/dmsg-discovery/store/storer.go +++ b/vendor/github.com/skycoin/dmsg/internal/dmsg-discovery/store/storer.go @@ -6,8 +6,8 @@ import ( "errors" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/dmsg/pkg/disc" ) diff --git a/vendor/github.com/skycoin/dmsg/internal/dmsg-discovery/store/testing.go b/vendor/github.com/skycoin/dmsg/internal/dmsg-discovery/store/testing.go index e619c3f845..7809b4e102 100644 --- a/vendor/github.com/skycoin/dmsg/internal/dmsg-discovery/store/testing.go +++ b/vendor/github.com/skycoin/dmsg/internal/dmsg-discovery/store/testing.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/skycoin/dmsg/pkg/disc" ) diff --git a/vendor/github.com/skycoin/dmsg/internal/dmsg-server/api/api.go b/vendor/github.com/skycoin/dmsg/internal/dmsg-server/api/api.go index 4467bda5dc..1276f431b9 100644 --- a/vendor/github.com/skycoin/dmsg/internal/dmsg-server/api/api.go +++ b/vendor/github.com/skycoin/dmsg/internal/dmsg-server/api/api.go @@ -14,10 +14,10 @@ import ( "github.com/go-chi/chi/v5" "github.com/pires/go-proxyproto" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/httputil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/dmsg/internal/servermetrics" dmsg "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/vendor/github.com/skycoin/dmsg/internal/servermetrics/victoria_metrics.go b/vendor/github.com/skycoin/dmsg/internal/servermetrics/victoria_metrics.go index 900acedf5a..b02f8673cc 100644 --- a/vendor/github.com/skycoin/dmsg/internal/servermetrics/victoria_metrics.go +++ b/vendor/github.com/skycoin/dmsg/internal/servermetrics/victoria_metrics.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/VictoriaMetrics/metrics" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" ) // VictoriaMetrics implements `Metrics` using `VictoriaMetrics`. diff --git a/vendor/github.com/skycoin/dmsg/pkg/direct/client.go b/vendor/github.com/skycoin/dmsg/pkg/direct/client.go index 2939b7ed53..9e878426ea 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/direct/client.go +++ b/vendor/github.com/skycoin/dmsg/pkg/direct/client.go @@ -5,8 +5,8 @@ import ( "context" "sync" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/dmsg/pkg/disc" ) diff --git a/vendor/github.com/skycoin/dmsg/pkg/direct/direct.go b/vendor/github.com/skycoin/dmsg/pkg/direct/direct.go index 3c1310baeb..ba8f7bcfb9 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/direct/direct.go +++ b/vendor/github.com/skycoin/dmsg/pkg/direct/direct.go @@ -5,8 +5,8 @@ import ( "context" "sync" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/dmsg/pkg/disc" dmsg "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/vendor/github.com/skycoin/dmsg/pkg/direct/entries.go b/vendor/github.com/skycoin/dmsg/pkg/direct/entries.go index 1f146d1d99..407f5521cb 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/direct/entries.go +++ b/vendor/github.com/skycoin/dmsg/pkg/direct/entries.go @@ -2,7 +2,7 @@ package direct import ( - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/skycoin/dmsg/pkg/disc" ) diff --git a/vendor/github.com/skycoin/dmsg/pkg/disc/client.go b/vendor/github.com/skycoin/dmsg/pkg/disc/client.go index a74be3be43..5403d7bb55 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/disc/client.go +++ b/vendor/github.com/skycoin/dmsg/pkg/disc/client.go @@ -11,8 +11,8 @@ import ( "time" jsoniter "github.com/json-iterator/go" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) var json = jsoniter.ConfigFastest diff --git a/vendor/github.com/skycoin/dmsg/pkg/disc/entry.go b/vendor/github.com/skycoin/dmsg/pkg/disc/entry.go index 365b270ced..705b4b3732 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/disc/entry.go +++ b/vendor/github.com/skycoin/dmsg/pkg/disc/entry.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) const ( diff --git a/vendor/github.com/skycoin/dmsg/pkg/disc/testing.go b/vendor/github.com/skycoin/dmsg/pkg/disc/testing.go index 9ced8bd51f..d1e3e2b156 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/disc/testing.go +++ b/vendor/github.com/skycoin/dmsg/pkg/disc/testing.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) // MockClient is an APIClient mock. The mock doesn't reply with the same errors as the diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsg/client.go b/vendor/github.com/skycoin/dmsg/pkg/dmsg/client.go index 9b3fd8c991..99271f72b6 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsg/client.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsg/client.go @@ -10,9 +10,9 @@ import ( "sync" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/netutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil" "github.com/skycoin/dmsg/pkg/disc" ) diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsg/client_session.go b/vendor/github.com/skycoin/dmsg/pkg/dmsg/client_session.go index ba3cfff3ab..3a4f2edad8 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsg/client_session.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsg/client_session.go @@ -7,8 +7,8 @@ import ( "time" "github.com/hashicorp/yamux" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/netutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil" ) // ClientSession represents a session from the perspective of a dmsg client. diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsg/entity_common.go b/vendor/github.com/skycoin/dmsg/pkg/dmsg/entity_common.go index 4779984ee8..fe1ff56b87 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsg/entity_common.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsg/entity_common.go @@ -9,9 +9,9 @@ import ( "time" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/netutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil" "github.com/skycoin/dmsg/pkg/disc" ) diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsg/listener.go b/vendor/github.com/skycoin/dmsg/pkg/dmsg/listener.go index 292d37d212..24d01ce723 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsg/listener.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsg/listener.go @@ -7,7 +7,7 @@ import ( "sync" "sync/atomic" - "github.com/skycoin/skywire-utilities/pkg/netutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil" ) // Listener listens for remote-initiated streams. diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsg/server.go b/vendor/github.com/skycoin/dmsg/pkg/dmsg/server.go index 9c8c461d70..77105b83cf 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsg/server.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsg/server.go @@ -7,9 +7,9 @@ import ( "sync" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/netutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil" "github.com/skycoin/dmsg/internal/servermetrics" "github.com/skycoin/dmsg/pkg/disc" diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsg/server_session.go b/vendor/github.com/skycoin/dmsg/pkg/dmsg/server_session.go index 4b8376eec9..e92aa28b59 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsg/server_session.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsg/server_session.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/yamux" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/netutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil" "github.com/skycoin/dmsg/internal/servermetrics" "github.com/skycoin/dmsg/pkg/noise" diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsg/session_common.go b/vendor/github.com/skycoin/dmsg/pkg/dmsg/session_common.go index d38afd1a79..69903a1064 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsg/session_common.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsg/session_common.go @@ -12,7 +12,7 @@ import ( "github.com/chen3feng/safecast" "github.com/hashicorp/yamux" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/skycoin/dmsg/pkg/noise" ) diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsg/stream.go b/vendor/github.com/skycoin/dmsg/pkg/dmsg/stream.go index 6bc61f1a28..69f1dfed9a 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsg/stream.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsg/stream.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/yamux" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/skycoin/dmsg/pkg/noise" ) diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsg/types.go b/vendor/github.com/skycoin/dmsg/pkg/dmsg/types.go index 9fbb2ca3c7..d98ed29112 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsg/types.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsg/types.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) const ( diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/dmsgcurl.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/dmsgcurl.go index 5a32d63f9c..785c471d12 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/dmsgcurl.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/dmsgcurl.go @@ -14,8 +14,8 @@ import ( jsoniter "github.com/json-iterator/go" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/dmsg/pkg/disc" dmsg "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/flags.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/flags.go index 4a5264c61f..79849afff4 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/flags.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/flags.go @@ -6,7 +6,7 @@ import ( "flag" "github.com/skycoin/skywire" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" ) // ExecName contains the execution name. diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsghttp/http.go b/vendor/github.com/skycoin/dmsg/pkg/dmsghttp/http.go index 95ed68a611..40f93f2c71 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsghttp/http.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsghttp/http.go @@ -7,8 +7,8 @@ import ( "net/http" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/dmsg/pkg/disc" dmsg "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsghttp/util.go b/vendor/github.com/skycoin/dmsg/pkg/dmsghttp/util.go index a3ac740fdd..e3565bfe72 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsghttp/util.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsghttp/util.go @@ -6,7 +6,7 @@ import ( "net/http" "time" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/dmsg/pkg/disc" "github.com/skycoin/dmsg/pkg/dmsg" diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/cli.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/cli.go index eb9ca02255..cba7022288 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/cli.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/cli.go @@ -12,8 +12,8 @@ import ( "syscall" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) // CLI connects with and has ownership over a dmsgpty.Host. diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/host.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/host.go index 7ebaa9200b..7e583a8409 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/host.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/host.go @@ -13,8 +13,8 @@ import ( "sync/atomic" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" dmsg "github.com/skycoin/dmsg/pkg/dmsg" ) diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/pty_client.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/pty_client.go index d6e10063b1..058c757a32 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/pty_client.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/pty_client.go @@ -8,8 +8,8 @@ import ( "sync" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) // PtyClient represents the client end of a dmsgpty session. diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/ui.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/ui.go index ba30e1ad23..42a0b1b634 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/ui.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/ui.go @@ -14,8 +14,8 @@ import ( "github.com/coder/websocket" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/httputil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) const ( diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/whitelist.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/whitelist.go index a944d23b37..a8bcfb4fb3 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/whitelist.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/whitelist.go @@ -12,7 +12,7 @@ import ( "sync" jsoniter "github.com/json-iterator/go" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) var ( diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/whitelist_client.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/whitelist_client.go index 7a7382e04e..47b12416a9 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/whitelist_client.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/whitelist_client.go @@ -5,7 +5,7 @@ import ( "io" "net/rpc" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) // WhitelistClient interacts with a whitelist's API. diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/whitelist_gateway.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/whitelist_gateway.go index 0bd7354669..b3c5527c24 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/whitelist_gateway.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/whitelist_gateway.go @@ -2,7 +2,7 @@ package dmsgpty import ( - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) // WhitelistGateway is the configuration gateway. diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgserver/config.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgserver/config.go index 396c625804..e6daff4bfb 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgserver/config.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgserver/config.go @@ -7,7 +7,7 @@ import ( "time" "github.com/skycoin/skycoin/src/util/logging" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/skycoin/dmsg/pkg/dmsg" ) diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgtest/env.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgtest/env.go index 9a294ea849..5f4cf23431 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgtest/env.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgtest/env.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "golang.org/x/net/nettest" "github.com/skycoin/dmsg/pkg/disc" diff --git a/vendor/github.com/skycoin/dmsg/pkg/ioutil/logging.go b/vendor/github.com/skycoin/dmsg/pkg/ioutil/logging.go index c6235e46f8..36c4ce3997 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/ioutil/logging.go +++ b/vendor/github.com/skycoin/dmsg/pkg/ioutil/logging.go @@ -2,7 +2,7 @@ package ioutil import ( - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) var log = logging.MustGetLogger("ioutil") diff --git a/vendor/github.com/skycoin/dmsg/pkg/noise/net.go b/vendor/github.com/skycoin/dmsg/pkg/noise/net.go index 87f2561c6c..4080fa0e1f 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/noise/net.go +++ b/vendor/github.com/skycoin/dmsg/pkg/noise/net.go @@ -9,7 +9,7 @@ import ( "time" "github.com/skycoin/noise" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) var ( diff --git a/vendor/github.com/skycoin/dmsg/pkg/noise/noise.go b/vendor/github.com/skycoin/dmsg/pkg/noise/noise.go index aa35d668f1..66550f73fa 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/noise/noise.go +++ b/vendor/github.com/skycoin/dmsg/pkg/noise/noise.go @@ -8,8 +8,8 @@ import ( "fmt" "github.com/skycoin/noise" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) var noiseLogger = logging.MustGetLogger("noise") diff --git a/vendor/github.com/skycoin/dmsg/pkg/noise/read_writer.go b/vendor/github.com/skycoin/dmsg/pkg/noise/read_writer.go index a393266a12..c728eef6dd 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/noise/read_writer.go +++ b/vendor/github.com/skycoin/dmsg/pkg/noise/read_writer.go @@ -12,7 +12,7 @@ import ( "time" "github.com/chen3feng/safecast" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/skycoin/dmsg/pkg/ioutil" ) diff --git a/vendor/github.com/skycoin/skycoin-service-discovery/cmd/service-discovery/commands/root.go b/vendor/github.com/skycoin/skycoin-service-discovery/cmd/service-discovery/commands/root.go index 3ae0836829..67e3b1e656 100644 --- a/vendor/github.com/skycoin/skycoin-service-discovery/cmd/service-discovery/commands/root.go +++ b/vendor/github.com/skycoin/skycoin-service-discovery/cmd/service-discovery/commands/root.go @@ -12,14 +12,14 @@ import ( "github.com/skycoin/dmsg/pkg/direct" "github.com/skycoin/dmsg/pkg/dmsg" "github.com/skycoin/dmsg/pkg/dmsghttp" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/httpauth" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" - "github.com/skycoin/skywire-utilities/pkg/storeconfig" - "github.com/skycoin/skywire-utilities/pkg/tcpproxy" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httpauth" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/storeconfig" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/tcpproxy" "github.com/spf13/cobra" "gorm.io/gorm" diff --git a/vendor/github.com/skycoin/skycoin-service-discovery/internal/sdmetrics/victoria_metrics.go b/vendor/github.com/skycoin/skycoin-service-discovery/internal/sdmetrics/victoria_metrics.go index acbe6cd759..42e46dc298 100644 --- a/vendor/github.com/skycoin/skycoin-service-discovery/internal/sdmetrics/victoria_metrics.go +++ b/vendor/github.com/skycoin/skycoin-service-discovery/internal/sdmetrics/victoria_metrics.go @@ -1,7 +1,7 @@ package sdmetrics import ( - "github.com/skycoin/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" ) // VictoriaMetrics implements `Metrics` using `VictoriaMetrics`. diff --git a/vendor/github.com/skycoin/skycoin-service-discovery/pkg/service-discovery/api/api.go b/vendor/github.com/skycoin/skycoin-service-discovery/pkg/service-discovery/api/api.go index 5f76e72476..0ebfe1b0ac 100644 --- a/vendor/github.com/skycoin/skycoin-service-discovery/pkg/service-discovery/api/api.go +++ b/vendor/github.com/skycoin/skycoin-service-discovery/pkg/service-discovery/api/api.go @@ -16,14 +16,14 @@ import ( "github.com/go-chi/chi/middleware" "github.com/go-chi/cors" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/geo" - "github.com/skycoin/skywire-utilities/pkg/httpauth" - "github.com/skycoin/skywire-utilities/pkg/httputil" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" - "github.com/skycoin/skywire-utilities/pkg/networkmonitor" "github.com/skycoin/skywire/pkg/servicedisc" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/geo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httpauth" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/networkmonitor" "github.com/skycoin/skycoin-service-discovery/internal/sdmetrics" "github.com/skycoin/skycoin-service-discovery/pkg/service-discovery/store" diff --git a/vendor/github.com/skycoin/skycoin-service-discovery/pkg/service-discovery/store/postgres_store.go b/vendor/github.com/skycoin/skycoin-service-discovery/pkg/service-discovery/store/postgres_store.go index d112b11c21..bf7656c5d3 100644 --- a/vendor/github.com/skycoin/skycoin-service-discovery/pkg/service-discovery/store/postgres_store.go +++ b/vendor/github.com/skycoin/skycoin-service-discovery/pkg/service-discovery/store/postgres_store.go @@ -10,9 +10,9 @@ import ( "github.com/chen3feng/safecast" "github.com/lib/pq" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/geo" - "github.com/skycoin/skywire-utilities/pkg/logging" "github.com/skycoin/skywire/pkg/servicedisc" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/geo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "gorm.io/gorm" ) diff --git a/vendor/github.com/skycoin/skycoin-service-discovery/pkg/service-discovery/store/store.go b/vendor/github.com/skycoin/skycoin-service-discovery/pkg/service-discovery/store/store.go index e5edf55d13..fda9b5759d 100644 --- a/vendor/github.com/skycoin/skycoin-service-discovery/pkg/service-discovery/store/store.go +++ b/vendor/github.com/skycoin/skycoin-service-discovery/pkg/service-discovery/store/store.go @@ -4,8 +4,8 @@ import ( "context" "io" - "github.com/skycoin/skywire-utilities/pkg/logging" "github.com/skycoin/skywire/pkg/servicedisc" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "gorm.io/gorm" ) diff --git a/vendor/github.com/skycoin/skywire-services/cmd/address-resolver/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/address-resolver/commands/root.go index dea96d2afb..662a936857 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/address-resolver/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/address-resolver/commands/root.go @@ -13,14 +13,14 @@ import ( "github.com/skycoin/dmsg/pkg/direct" "github.com/skycoin/dmsg/pkg/dmsg" "github.com/skycoin/dmsg/pkg/dmsghttp" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/httpauth" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" - "github.com/skycoin/skywire-utilities/pkg/storeconfig" - "github.com/skycoin/skywire-utilities/pkg/tcpproxy" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httpauth" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/storeconfig" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/tcpproxy" "github.com/spf13/cobra" "github.com/xtaci/kcp-go" diff --git a/vendor/github.com/skycoin/skywire-services/cmd/config-bootstrapper/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/config-bootstrapper/commands/root.go index bf43495ba1..0dedad5ccc 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/config-bootstrapper/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/config-bootstrapper/commands/root.go @@ -14,11 +14,11 @@ import ( "github.com/skycoin/dmsg/pkg/direct" "github.com/skycoin/dmsg/pkg/dmsg" "github.com/skycoin/dmsg/pkg/dmsghttp" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/tcpproxy" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/tcpproxy" "github.com/spf13/cobra" "github.com/skycoin/skywire-services/pkg/config-bootstrapper/api" diff --git a/vendor/github.com/skycoin/skywire-services/cmd/keys-gen/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/keys-gen/commands/root.go index c03e124949..30a6f2cbf9 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/keys-gen/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/keys-gen/commands/root.go @@ -8,8 +8,8 @@ import ( "path/filepath" "strings" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/spf13/cobra" ) diff --git a/vendor/github.com/skycoin/skywire-services/cmd/route-finder/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/route-finder/commands/root.go index 669f7aae0a..66fd9e0be0 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/route-finder/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/route-finder/commands/root.go @@ -13,13 +13,13 @@ import ( "github.com/skycoin/dmsg/pkg/direct" "github.com/skycoin/dmsg/pkg/dmsg" "github.com/skycoin/dmsg/pkg/dmsghttp" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" - "github.com/skycoin/skywire-utilities/pkg/storeconfig" - "github.com/skycoin/skywire-utilities/pkg/tcpproxy" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/storeconfig" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/tcpproxy" "github.com/spf13/cobra" "gorm.io/gorm" diff --git a/vendor/github.com/skycoin/skywire-services/cmd/skywire-services/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/skywire-services/commands/root.go index 580d85f52e..0233fbdd46 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/skywire-services/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/skywire-services/commands/root.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" "github.com/spf13/cobra" ar "github.com/skycoin/skywire-services/cmd/address-resolver/commands" diff --git a/vendor/github.com/skycoin/skywire-services/cmd/sw-env/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/sw-env/commands/root.go index f9283b368b..756cfd95e0 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/sw-env/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/sw-env/commands/root.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" "github.com/spf13/cobra" cfg "github.com/skycoin/skywire-services/internal/config" diff --git a/vendor/github.com/skycoin/skywire-services/cmd/transport-discovery/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/transport-discovery/commands/root.go index 68152474da..553d6dff8a 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/transport-discovery/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/transport-discovery/commands/root.go @@ -15,14 +15,14 @@ import ( "github.com/skycoin/dmsg/pkg/dmsg" "github.com/skycoin/dmsg/pkg/dmsghttp" "github.com/skycoin/skywire" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/httpauth" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" - "github.com/skycoin/skywire-utilities/pkg/storeconfig" - "github.com/skycoin/skywire-utilities/pkg/tcpproxy" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httpauth" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/storeconfig" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/tcpproxy" "github.com/spf13/cobra" "gorm.io/gorm" diff --git a/vendor/github.com/skycoin/skywire-services/cmd/transport-setup/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/transport-setup/commands/root.go index d22716a02d..454316598c 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/transport-setup/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/transport-setup/commands/root.go @@ -13,9 +13,9 @@ import ( "github.com/bitfield/script" "github.com/google/uuid" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/spf13/cobra" "github.com/tidwall/pretty" diff --git a/vendor/github.com/skycoin/skywire-services/cmd/uptime-tracker/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/uptime-tracker/commands/root.go index 6fb3cbfff4..3e32079127 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/uptime-tracker/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/uptime-tracker/commands/root.go @@ -13,15 +13,15 @@ import ( "github.com/skycoin/dmsg/pkg/direct" "github.com/skycoin/dmsg/pkg/dmsg" "github.com/skycoin/dmsg/pkg/dmsghttp" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/cmdutil" - "github.com/skycoin/skywire-utilities/pkg/geo" - "github.com/skycoin/skywire-utilities/pkg/httpauth" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" - "github.com/skycoin/skywire-utilities/pkg/storeconfig" - "github.com/skycoin/skywire-utilities/pkg/tcpproxy" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cmdutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/geo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httpauth" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/storeconfig" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/tcpproxy" "github.com/spf13/cobra" "gorm.io/gorm" diff --git a/vendor/github.com/skycoin/skywire-services/internal/armetrics/victoria_metrics.go b/vendor/github.com/skycoin/skywire-services/internal/armetrics/victoria_metrics.go index 30e53c1fac..1d20629131 100644 --- a/vendor/github.com/skycoin/skywire-services/internal/armetrics/victoria_metrics.go +++ b/vendor/github.com/skycoin/skywire-services/internal/armetrics/victoria_metrics.go @@ -1,7 +1,7 @@ package armetrics import ( - "github.com/skycoin/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" ) // VictoriaMetrics implements `Metrics` using `VictoriaMetrics`. diff --git a/vendor/github.com/skycoin/skywire-services/internal/config/env.go b/vendor/github.com/skycoin/skywire-services/internal/config/env.go index 5a6cd38ded..4f468a85ed 100644 --- a/vendor/github.com/skycoin/skywire-services/internal/config/env.go +++ b/vendor/github.com/skycoin/skywire-services/internal/config/env.go @@ -4,7 +4,7 @@ import ( "encoding/json" "log" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) // EnvConfig defines configuration of skywire environment diff --git a/vendor/github.com/skycoin/skywire-services/internal/config/skywire.go b/vendor/github.com/skycoin/skywire-services/internal/config/skywire.go index dc4c17287e..a9c3c5fdb4 100644 --- a/vendor/github.com/skycoin/skywire-services/internal/config/skywire.go +++ b/vendor/github.com/skycoin/skywire-services/internal/config/skywire.go @@ -2,9 +2,9 @@ package config import ( msg "github.com/skycoin/dmsg/pkg/dmsgserver" - "github.com/skycoin/skywire-utilities/pkg/cipher" "github.com/skycoin/skywire/pkg/dmsgc" "github.com/skycoin/skywire/pkg/router" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) const ( diff --git a/vendor/github.com/skycoin/skywire-services/internal/config/visors.go b/vendor/github.com/skycoin/skywire-services/internal/config/visors.go index 240de99834..63b76d61b1 100644 --- a/vendor/github.com/skycoin/skywire-services/internal/config/visors.go +++ b/vendor/github.com/skycoin/skywire-services/internal/config/visors.go @@ -6,9 +6,9 @@ import ( "log" "text/template" - "github.com/skycoin/skywire-utilities/pkg/cipher" "github.com/skycoin/skywire/pkg/app/appserver" "github.com/skycoin/skywire/pkg/dmsgc" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/skycoin/skywire/pkg/visor/visorconfig" ) diff --git a/vendor/github.com/skycoin/skywire-services/internal/tpdiscmetrics/victoria_metrics.go b/vendor/github.com/skycoin/skywire-services/internal/tpdiscmetrics/victoria_metrics.go index 265aae146c..25285a8180 100644 --- a/vendor/github.com/skycoin/skywire-services/internal/tpdiscmetrics/victoria_metrics.go +++ b/vendor/github.com/skycoin/skywire-services/internal/tpdiscmetrics/victoria_metrics.go @@ -3,7 +3,7 @@ package tpdiscmetrics import ( "sync" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" "github.com/skycoin/skywire/pkg/transport/network" ) diff --git a/vendor/github.com/skycoin/skywire-services/internal/utmetrics/victoria_metrics.go b/vendor/github.com/skycoin/skywire-services/internal/utmetrics/victoria_metrics.go index 76e9dae37a..32c799a7b3 100644 --- a/vendor/github.com/skycoin/skywire-services/internal/utmetrics/victoria_metrics.go +++ b/vendor/github.com/skycoin/skywire-services/internal/utmetrics/victoria_metrics.go @@ -1,7 +1,7 @@ package utmetrics import ( - "github.com/skycoin/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" ) // VictoriaMetrics implements `Metrics` using `VictoriaMetrics`. diff --git a/vendor/github.com/skycoin/skywire-services/pkg/address-resolver/api/api.go b/vendor/github.com/skycoin/skywire-services/pkg/address-resolver/api/api.go index 7c56f1d6cb..4a4916dc91 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/address-resolver/api/api.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/address-resolver/api/api.go @@ -16,14 +16,14 @@ import ( "github.com/go-chi/chi/v5/middleware" "github.com/sirupsen/logrus" "github.com/skycoin/dmsg/pkg/dmsg" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/httpauth" - "github.com/skycoin/skywire-utilities/pkg/httputil" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" - "github.com/skycoin/skywire-utilities/pkg/netutil" - "github.com/skycoin/skywire-utilities/pkg/networkmonitor" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httpauth" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/networkmonitor" "github.com/skycoin/skywire/pkg/transport/network" "github.com/skycoin/skywire/pkg/transport/network/addrresolver" "github.com/skycoin/skywire/pkg/transport/network/handshake" diff --git a/vendor/github.com/skycoin/skywire-services/pkg/address-resolver/store/memory_store.go b/vendor/github.com/skycoin/skywire-services/pkg/address-resolver/store/memory_store.go index c4145e373c..2dbb1acd8e 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/address-resolver/store/memory_store.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/address-resolver/store/memory_store.go @@ -4,7 +4,7 @@ import ( "context" "sync" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/skycoin/skywire/pkg/transport/network" "github.com/skycoin/skywire/pkg/transport/network/addrresolver" ) diff --git a/vendor/github.com/skycoin/skywire-services/pkg/address-resolver/store/redis_store.go b/vendor/github.com/skycoin/skywire-services/pkg/address-resolver/store/redis_store.go index 71d68f3aba..d609e0cb07 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/address-resolver/store/redis_store.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/address-resolver/store/redis_store.go @@ -8,9 +8,9 @@ import ( "strings" "github.com/go-redis/redis/v8" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/netutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil" "github.com/skycoin/skywire/pkg/transport/network" "github.com/skycoin/skywire/pkg/transport/network/addrresolver" ) diff --git a/vendor/github.com/skycoin/skywire-services/pkg/address-resolver/store/store.go b/vendor/github.com/skycoin/skywire-services/pkg/address-resolver/store/store.go index 4e8f587c25..cccc7a6930 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/address-resolver/store/store.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/address-resolver/store/store.go @@ -4,9 +4,9 @@ import ( "context" "errors" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/storeconfig" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/storeconfig" "github.com/skycoin/skywire/pkg/transport/network" "github.com/skycoin/skywire/pkg/transport/network/addrresolver" ) diff --git a/vendor/github.com/skycoin/skywire-services/pkg/config-bootstrapper/api/api.go b/vendor/github.com/skycoin/skywire-services/pkg/config-bootstrapper/api/api.go index 9851c15ad5..ebcd13fc6e 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/config-bootstrapper/api/api.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/config-bootstrapper/api/api.go @@ -14,10 +14,10 @@ import ( "github.com/go-chi/chi/v5/middleware" "github.com/sirupsen/logrus" "github.com/skycoin/skywire" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/httputil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/skywire/pkg/visor/visorconfig" ) diff --git a/vendor/github.com/skycoin/skywire-services/pkg/route-finder/api/api.go b/vendor/github.com/skycoin/skywire-services/pkg/route-finder/api/api.go index 0ade0a8047..9095b3ce43 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/route-finder/api/api.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/route-finder/api/api.go @@ -10,12 +10,12 @@ import ( "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/httputil" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" "github.com/skycoin/skywire/pkg/routefinder/rfclient" "github.com/skycoin/skywire/pkg/routing" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" routeFinder "github.com/skycoin/skywire-services/pkg/route-finder/store" "github.com/skycoin/skywire-services/pkg/transport-discovery/store" diff --git a/vendor/github.com/skycoin/skywire-services/pkg/route-finder/store/dijkstra.go b/vendor/github.com/skycoin/skywire-services/pkg/route-finder/store/dijkstra.go index 6775d3589c..0ab4e60c21 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/route-finder/store/dijkstra.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/route-finder/store/dijkstra.go @@ -7,8 +7,8 @@ import ( "errors" "sort" - "github.com/skycoin/skywire-utilities/pkg/cipher" "github.com/skycoin/skywire/pkg/routing" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" ) // package level errors diff --git a/vendor/github.com/skycoin/skywire-services/pkg/route-finder/store/mark_and_sweep.go b/vendor/github.com/skycoin/skywire-services/pkg/route-finder/store/mark_and_sweep.go index f72645f0ef..8253a986ed 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/route-finder/store/mark_and_sweep.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/route-finder/store/mark_and_sweep.go @@ -3,7 +3,7 @@ package store import ( "context" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/skycoin/skywire/pkg/transport" "github.com/skycoin/skywire-services/pkg/transport-discovery/store" diff --git a/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/api/api.go b/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/api/api.go index 74cff6eeda..b5e423e1c6 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/api/api.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/api/api.go @@ -11,12 +11,12 @@ import ( "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/httpauth" - "github.com/skycoin/skywire-utilities/pkg/httputil" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" - "github.com/skycoin/skywire-utilities/pkg/networkmonitor" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httpauth" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/networkmonitor" "github.com/skycoin/skywire-services/internal/tpdiscmetrics" "github.com/skycoin/skywire-services/pkg/transport-discovery/store" diff --git a/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/api/endpoints.go b/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/api/endpoints.go index b64323163c..b722190dff 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/api/endpoints.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/api/endpoints.go @@ -9,10 +9,10 @@ import ( "github.com/go-chi/chi/v5" "github.com/google/uuid" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/httpauth" - "github.com/skycoin/skywire-utilities/pkg/httputil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httpauth" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil" "github.com/skycoin/skywire/pkg/transport" "github.com/skycoin/skywire-services/pkg/transport-discovery/store" diff --git a/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/store/memory_store.go b/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/store/memory_store.go index 57dee61a87..9dd8215954 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/store/memory_store.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/store/memory_store.go @@ -7,7 +7,7 @@ import ( "sync" "github.com/google/uuid" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/skycoin/skywire/pkg/transport" "github.com/skycoin/skywire/pkg/transport/network" ) diff --git a/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/store/postgres_store.go b/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/store/postgres_store.go index 10d00d8596..7d0fae7c9f 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/store/postgres_store.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/store/postgres_store.go @@ -5,8 +5,8 @@ import ( "time" "github.com/google/uuid" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/skywire/pkg/transport" "github.com/skycoin/skywire/pkg/transport/network" "gorm.io/gorm" diff --git a/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/store/store.go b/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/store/store.go index 925b1b6ae9..c4402e1ea2 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/store/store.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/transport-discovery/store/store.go @@ -5,8 +5,8 @@ import ( "errors" "github.com/google/uuid" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/skywire/pkg/transport" "github.com/skycoin/skywire/pkg/transport/network" "gorm.io/gorm" diff --git a/vendor/github.com/skycoin/skywire-services/pkg/transport-setup/api/api.go b/vendor/github.com/skycoin/skywire-services/pkg/transport-setup/api/api.go index eb89a18eb1..978f906157 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/transport-setup/api/api.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/transport-setup/api/api.go @@ -9,8 +9,8 @@ import ( "github.com/go-playground/validator/v10" "github.com/skycoin/dmsg/pkg/disc" "github.com/skycoin/dmsg/pkg/dmsg" - "github.com/skycoin/skywire-utilities/pkg/httputil" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "github.com/skycoin/skywire-services/pkg/transport-setup/config" ) diff --git a/vendor/github.com/skycoin/skywire-services/pkg/transport-setup/api/endpoints.go b/vendor/github.com/skycoin/skywire-services/pkg/transport-setup/api/endpoints.go index 01f5c0470f..9204a50040 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/transport-setup/api/endpoints.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/transport-setup/api/endpoints.go @@ -7,7 +7,7 @@ import ( "github.com/go-chi/chi/v5" "github.com/google/uuid" - "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" "github.com/skycoin/skywire/pkg/transport/network" "github.com/skycoin/skywire/pkg/transport/setup" ) diff --git a/vendor/github.com/skycoin/skywire-services/pkg/transport-setup/api/utils.go b/vendor/github.com/skycoin/skywire-services/pkg/transport-setup/api/utils.go index 0a678e05fe..a6d77bd5d0 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/transport-setup/api/utils.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/transport-setup/api/utils.go @@ -11,9 +11,9 @@ import ( "github.com/sirupsen/logrus" "github.com/skycoin/dmsg/pkg/dmsg" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/httputil" "github.com/skycoin/skywire/pkg/skyenv" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil" ) // visor RPC helpers diff --git a/vendor/github.com/skycoin/skywire-services/pkg/transport-setup/config/config.go b/vendor/github.com/skycoin/skywire-services/pkg/transport-setup/config/config.go index 3ef0584c28..e8dc3eed67 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/transport-setup/config/config.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/transport-setup/config/config.go @@ -6,9 +6,9 @@ import ( "io" "os" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/logging" "github.com/skycoin/skywire/pkg/dmsgc" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) // Config defines configuration for transport setup diff --git a/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/api/api.go b/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/api/api.go index c0b8882909..79c20baecb 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/api/api.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/api/api.go @@ -21,14 +21,14 @@ import ( "github.com/go-echarts/go-echarts/v2/charts" "github.com/go-echarts/go-echarts/v2/opts" "github.com/sirupsen/logrus" - "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/geo" - "github.com/skycoin/skywire-utilities/pkg/httpauth" - "github.com/skycoin/skywire-utilities/pkg/httputil" - "github.com/skycoin/skywire-utilities/pkg/logging" - "github.com/skycoin/skywire-utilities/pkg/metricsutil" - "github.com/skycoin/skywire-utilities/pkg/netutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/geo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httpauth" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/httputil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/metricsutil" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/netutil" "github.com/skycoin/skywire-services/internal/utmetrics" "github.com/skycoin/skywire-services/pkg/uptime-tracker/store" diff --git a/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/store/memory_store.go b/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/store/memory_store.go index e0430d3368..e187070024 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/store/memory_store.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/store/memory_store.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "github.com/skycoin/skywire-utilities/pkg/geo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/geo" ) type memStore struct { diff --git a/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/store/postgres_store.go b/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/store/postgres_store.go index a94f589b05..a5203c41b6 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/store/postgres_store.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/store/postgres_store.go @@ -8,8 +8,8 @@ import ( "sync" "time" - "github.com/skycoin/skywire-utilities/pkg/geo" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/geo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "gorm.io/gorm" ) diff --git a/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/store/store.go b/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/store/store.go index 5ab10e757b..12706154e0 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/store/store.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/store/store.go @@ -3,8 +3,8 @@ package store import ( "time" - "github.com/skycoin/skywire-utilities/pkg/geo" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/geo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" "gorm.io/gorm" ) diff --git a/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/store/visors_response.go b/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/store/visors_response.go index c162440560..2ff6c5f897 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/store/visors_response.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/uptime-tracker/store/visors_response.go @@ -4,8 +4,8 @@ import ( "math" "net" - "github.com/skycoin/skywire-utilities/pkg/geo" - "github.com/skycoin/skywire-utilities/pkg/logging" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/geo" + "github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging" ) var log = logging.MustGetLogger("uptime_store") diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/buildinfo/buildinfo.go b/vendor/github.com/skycoin/skywire-utilities/pkg/buildinfo/buildinfo.go deleted file mode 100644 index 4c4ade6052..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/buildinfo/buildinfo.go +++ /dev/null @@ -1,53 +0,0 @@ -// Package buildinfo pkg/buildinfo/buildinfo.go -package buildinfo - -import ( - "fmt" - "io" -) - -const unknown = "unknown" - -var ( - version = unknown - commit = unknown - date = unknown -) - -// Version returns version from git describe. -func Version() string { - return version -} - -// Commit returns commit hash. -func Commit() string { - return commit -} - -// Date returns date of build in RFC3339 format. -func Date() string { - return date -} - -// Get returns build info summary. -func Get() *Info { - return &Info{ - Version: Version(), - Commit: Commit(), - Date: Date(), - } -} - -// Info is build info summary. -type Info struct { - Version string `json:"version"` - Commit string `json:"commit"` - Date string `json:"date"` -} - -// WriteTo writes build info summary to io.Writer. -func (info *Info) WriteTo(w io.Writer) (int64, error) { - msg := fmt.Sprintf("Version %q built on %q against commit %q\n", info.Version, info.Date, info.Commit) - n, err := w.Write([]byte(msg)) - return int64(n), err -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cipher/cipher.go b/vendor/github.com/skycoin/skywire-utilities/pkg/cipher/cipher.go deleted file mode 100644 index 9b140badfb..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/cipher/cipher.go +++ /dev/null @@ -1,266 +0,0 @@ -// Package cipher implements common golang encoding interfaces for -// github.com/skycoin/skycoin/src/cipher -package cipher - -import ( - "bytes" - "fmt" - "math/big" - "strings" - - "github.com/skycoin/skycoin/src/cipher" -) - -func init() { - cipher.DebugLevel2 = false // DebugLevel2 causes ECDH to be really slow -} - -// GenerateKeyPair creates key pair -func GenerateKeyPair() (PubKey, SecKey) { - pk, sk := cipher.GenerateKeyPair() - return PubKey(pk), SecKey(sk) -} - -// GenerateDeterministicKeyPair generates deterministic key pair -func GenerateDeterministicKeyPair(seed []byte) (PubKey, SecKey, error) { - pk, sk, err := cipher.GenerateDeterministicKeyPair(seed) - return PubKey(pk), SecKey(sk), err -} - -// NewPubKey converts []byte to a PubKey -func NewPubKey(b []byte) (PubKey, error) { - pk, err := cipher.NewPubKey(b) - return PubKey(pk), err -} - -// PubKey is a wrapper type for cipher.PubKey that implements common -// golang interfaces. -type PubKey cipher.PubKey - -// Hex returns a hex encoded PubKey string -func (pk PubKey) Hex() string { - return cipher.PubKey(pk).Hex() -} - -// Null returns true if PubKey is the null PubKey -func (pk PubKey) Null() bool { - return cipher.PubKey(pk).Null() -} - -// String implements fmt.Stringer for PubKey. Returns Hex representation. -func (pk PubKey) String() string { - return pk.Hex() -} - -// Big returns the big.Int representation of the public key. -func (pk PubKey) Big() *big.Int { - return new(big.Int).SetBytes(pk[:]) -} - -// Set implements pflag.Value for PubKey. -func (pk *PubKey) Set(s string) error { - cPK, err := cipher.PubKeyFromHex(s) - if err != nil { - return err - } - *pk = PubKey(cPK) - return nil -} - -// Type implements pflag.Value for PubKey. -func (pk PubKey) Type() string { - return "cipher.PubKey" -} - -// MarshalText implements encoding.TextMarshaler. -func (pk PubKey) MarshalText() ([]byte, error) { - return []byte(pk.Hex()), nil -} - -// UnmarshalText implements encoding.TextUnmarshaler. -func (pk *PubKey) UnmarshalText(data []byte) error { - if bytes.Count(data, []byte("0")) == len(data) { - return nil - } - - dPK, err := cipher.PubKeyFromHex(string(data)) - if err == nil { - *pk = PubKey(dPK) - } - return err -} - -// MarshalBinary implements encoding.BinaryMarshaler. -func (pk PubKey) MarshalBinary() ([]byte, error) { - return pk[:], nil -} - -// UnmarshalBinary implements encoding.BinaryUnmarshaler. -func (pk *PubKey) UnmarshalBinary(data []byte) error { - dPK, err := cipher.NewPubKey(data) - if err == nil { - *pk = PubKey(dPK) - } - return err -} - -// PubKeys represents a slice of PubKeys. -type PubKeys []PubKey - -// String implements stringer for PubKeys. -func (p PubKeys) String() string { - res := "public keys:\n" - for _, pk := range p { - res += fmt.Sprintf("\t%s\n", pk) - } - return res -} - -// Set implements pflag.Value for PubKeys. -func (p *PubKeys) Set(list string) error { - *p = PubKeys{} - for _, s := range strings.Split(list, ",") { - var pk PubKey - if err := pk.Set(strings.TrimSpace(s)); err != nil { - return err - } - *p = append(*p, pk) - } - return nil -} - -// Type implements pflag.Value for PubKeys. -func (p PubKeys) Type() string { - return "cipher.PubKeys" -} - -// SecKey is a wrapper type for cipher.SecKey that implements common -// golang interfaces. -type SecKey cipher.SecKey - -// Hex returns a hex encoded SecKey string -func (sk SecKey) Hex() string { - return cipher.SecKey(sk).Hex() -} - -// Null returns true if SecKey is the null SecKey. -func (sk SecKey) Null() bool { - return cipher.SecKey(sk).Null() -} - -// String implements fmt.Stringer for SecKey. Returns Hex representation. -func (sk SecKey) String() string { - return sk.Hex() -} - -// Set implements pflag.Value for SecKey. -func (sk *SecKey) Set(s string) error { - cSK, err := cipher.SecKeyFromHex(s) - if err != nil { - return err - } - *sk = SecKey(cSK) - return nil -} - -// Type implements pflag.Value for SecKey. -func (sk *SecKey) Type() string { - return "cipher.SecKey" -} - -// MarshalText implements encoding.TextMarshaler. -func (sk SecKey) MarshalText() ([]byte, error) { - return []byte(sk.Hex()), nil -} - -// UnmarshalText implements encoding.TextUnmarshaler. -func (sk *SecKey) UnmarshalText(data []byte) error { - dSK, err := cipher.SecKeyFromHex(string(data)) - if err == nil { - *sk = SecKey(dSK) - } - return err -} - -// MarshalBinary implements encoding.BinaryMarshaler. -func (sk SecKey) MarshalBinary() ([]byte, error) { - return sk[:], nil -} - -// UnmarshalBinary implements encoding.BinaryUnmarshaler. -func (sk *SecKey) UnmarshalBinary(data []byte) error { - dSK, err := cipher.NewSecKey(data) - if err == nil { - *sk = SecKey(dSK) - } - return err -} - -// PubKey recovers the public key for a secret key -func (sk SecKey) PubKey() (PubKey, error) { - pk, err := cipher.PubKeyFromSecKey(cipher.SecKey(sk)) - return PubKey(pk), err -} - -// Sig is a wrapper type for cipher.Sig that implements common golang interfaces. -type Sig cipher.Sig - -// Hex returns a hex encoded Sig string -func (sig Sig) Hex() string { - return cipher.Sig(sig).Hex() -} - -// String implements fmt.Stringer for Sig. Returns Hex representation. -func (sig Sig) String() string { - return sig.Hex() -} - -// Null returns true if Sig is a null Sig -func (sig Sig) Null() bool { - return sig == Sig{} -} - -// MarshalText implements encoding.TextMarshaler. -func (sig Sig) MarshalText() ([]byte, error) { - return []byte(sig.Hex()), nil -} - -// UnmarshalText implements encoding.TextUnmarshaler. -func (sig *Sig) UnmarshalText(data []byte) error { - dSig, err := cipher.SigFromHex(string(data)) - if err == nil { - *sig = Sig(dSig) - } - return err -} - -// SignPayload creates Sig for payload using SHA256 -func SignPayload(payload []byte, sec SecKey) (Sig, error) { - sig, err := cipher.SignHash(cipher.SumSHA256(payload), cipher.SecKey(sec)) - return Sig(sig), err -} - -// VerifyPubKeySignedPayload verifies that SHA256 hash of the payload was signed by PubKey -func VerifyPubKeySignedPayload(pubkey PubKey, sig Sig, payload []byte) error { - return cipher.VerifyPubKeySignedHash(cipher.PubKey(pubkey), cipher.Sig(sig), cipher.SumSHA256(payload)) -} - -// RandByte returns rand N bytes -func RandByte(n int) []byte { - return cipher.RandByte(n) -} - -// SHA256 is a wrapper type for cipher.SHA256 that implements common -// golang interfaces. -type SHA256 cipher.SHA256 - -// SHA256FromBytes converts []byte to SHA256 -func SHA256FromBytes(b []byte) (SHA256, error) { - h, err := cipher.SHA256FromBytes(b) - return SHA256(h), err -} - -// SumSHA256 sum sha256 -func SumSHA256(b []byte) SHA256 { - return SHA256(cipher.SumSHA256(b)) -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cipher/utils_pubkey.go b/vendor/github.com/skycoin/skywire-utilities/pkg/cipher/utils_pubkey.go deleted file mode 100644 index aa694719b3..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/cipher/utils_pubkey.go +++ /dev/null @@ -1,24 +0,0 @@ -// Package cipher pkg/cipher/ustils_pubkey.go -package cipher - -// SamePubKeys returns true when the provided public key slices have the same keys. -// The slices do not need to be in the same order. -// It is assumed that there are no duplicate elements within the slices. -func SamePubKeys(pks1, pks2 []PubKey) bool { - if len(pks1) != len(pks2) { - return false - } - - m := make(map[PubKey]struct{}, len(pks1)) - for _, pk := range pks1 { - m[pk] = struct{}{} - } - - for _, pk := range pks2 { - if _, ok := m[pk]; !ok { - return false - } - } - - return true -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/catch.go b/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/catch.go deleted file mode 100644 index baa140de31..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/catch.go +++ /dev/null @@ -1,38 +0,0 @@ -// Package cmdutil pkg/cmdutil/catch.go -package cmdutil - -import ( - "fmt" - "os" - "strings" - - "github.com/sirupsen/logrus" -) - -// Catch panics on any non-nil error. -func Catch(v ...interface{}) { - CatchWithMsg("", v...) -} - -// CatchWithMsg panics on any non-nil error with the provided message (if any). -func CatchWithMsg(msg string, v ...interface{}) { - for _, val := range v { - if err, ok := val.(error); ok && err != nil { - if msg == "" { - panic(err) - } - msg = strings.TrimSuffix(strings.TrimSpace(msg), ":") - panic(fmt.Errorf("%s: %v", msg, err)) - } - } -} - -// CatchWithLog calls Fatal() on any non-nil error. -func CatchWithLog(log logrus.FieldLogger, msg string, v ...interface{}) { - for _, val := range v { - if err, ok := val.(error); ok && err != nil { - log.WithError(err).Fatal(msg) - os.Exit(1) - } - } -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/cmd_name.go b/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/cmd_name.go deleted file mode 100644 index 68cf026a47..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/cmd_name.go +++ /dev/null @@ -1,12 +0,0 @@ -// Package cmdutil pkg/cmdutil/cmd_name.go -package cmdutil - -import ( - "os" - "path" -) - -// RootCmdName returns the root command name. -func RootCmdName() string { - return path.Base(os.Args[0]) -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/service_flags.go b/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/service_flags.go deleted file mode 100644 index c8a8d7c98d..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/service_flags.go +++ /dev/null @@ -1,242 +0,0 @@ -// Package cmdutil pkg/cmdutil/service_flags.go -package cmdutil - -import ( - "errors" - "fmt" - "io" - "os" - "strings" - "unicode" - - jsoniter "github.com/json-iterator/go" - "github.com/spf13/cobra" - - "github.com/skycoin/skywire-utilities/pkg/logging" -) - -// Associated errors. -var ( - ErrTagCannotBeEmpty = errors.New("tag cannot be empty") - ErrTagHasInvalidChars = errors.New("tag can only contain alphanumeric values and underscore") - ErrTagHasMisplacedUnderscores = errors.New("tag cannot start or end with an underscore or have two underscores back-to-back") - ErrInvalidLogString = errors.New("failed to convert string to log level") - ErrInvalidSyslogNet = errors.New("network type is unsupported for syslog") -) - -var json = jsoniter.ConfigFastest - -const ( - stdinConfig = "stdin" -) - -// ServiceFlags represents common flags which are shared across services. -type ServiceFlags struct { - MetricsAddr string - Syslog string - SyslogNet string - LogLevel string - Tag string - Config string - Stdin bool - - // state - checkDone bool - loggerDone bool - - logger *logging.Logger -} - -// Init initiates the service flags. -// The following are performed: -// - Ensure 'defaultTag' is provided and valid. -// - Set "library" defaults. -// - Set "exec" defaults - provided by 'defaultTag' and 'defaultConf'. -// - Add flags to 'rootCmd'. -func (sf *ServiceFlags) Init(rootCmd *cobra.Command, defaultTag, defaultConf string) { - if err := ValidTag(defaultTag); err != nil { - panic(err) - } - - // "library" defaults - if sf.SyslogNet == "" { - // TODO (evanlinjin): Consider using tcp as syslog udp is legacy. - sf.SyslogNet = "udp" - } - if sf.LogLevel == "" { - sf.LogLevel = "debug" - } - - // "exec" defaults - if defaultTag != "" { - sf.Tag = defaultTag - } - if defaultConf != "" { - sf.Config = defaultConf - } - - // flags - rootCmd.Flags().StringVarP(&sf.MetricsAddr, "metrics", "m", sf.MetricsAddr, "address to serve metrics API from") - rootCmd.Flags().StringVar(&sf.Syslog, "syslog", sf.Syslog, "address in which to dial to syslog server") - rootCmd.Flags().StringVar(&sf.SyslogNet, "syslog-net", sf.SyslogNet, "network in which to dial to syslog server") - rootCmd.Flags().StringVar(&sf.LogLevel, "syslog-lvl", sf.LogLevel, "minimum log level to report") - rootCmd.Flags().StringVar(&sf.Tag, "tag", sf.Tag, "tag used for logging and metrics") - - // only enable config flags if 'defaultConf' is set - if defaultConf != "" { - rootCmd.Flags().StringVarP(&sf.Config, "config", "c", sf.Config, "location of config file (STDIN to read from standard input)") - rootCmd.Flags().BoolVar(&sf.Stdin, "stdin", sf.Stdin, "whether to read config via stdin") - } -} - -// Check checks service flags. -func (sf *ServiceFlags) Check() error { - if alreadyDone(&sf.checkDone) { - return nil - } - - if sf.Syslog != "" { - switch sf.SyslogNet { - case "tcp", "udp", "unix": - default: - return fmt.Errorf("%w: %s", ErrInvalidSyslogNet, sf.SyslogNet) - } - } - - if _, _, err := LevelFromString(sf.LogLevel); err != nil { - return fmt.Errorf("%w: %s", ErrInvalidLogString, sf.LogLevel) - } - - if err := ValidTag(sf.Tag); err != nil { - return fmt.Errorf("%w: %s", err, sf.Tag) - } - - return nil -} - -// Logger returns the logger as specified by the service flags. -func (sf *ServiceFlags) Logger() *logging.Logger { - if alreadyDone(&sf.loggerDone) { - return sf.logger - } - - log := logging.MustGetLogger(sf.Tag) - sf.logger = log - - logLvl, sysLvl, err := LevelFromString(sf.LogLevel) - if err != nil { - panic(err) // should not happen as we have already checked earlier on - } - logging.SetLevel(logLvl) - - if sf.Syslog != "" { - sf.sysLogHook(log, sysLvl) - } - - return log -} - -// ParseConfig parses config from service tags. -// If checkArgs is set, we additionally parse os.Args to find a config path. -func (sf *ServiceFlags) ParseConfig(args []string, checkArgs bool, v interface{}, genDefaultFunc func() (io.ReadCloser, error)) error { - r, err := sf.obtainConfigReader(args, checkArgs, genDefaultFunc) - if err != nil { - return err - } - defer func() { - if err = r.Close(); err != nil { - sf.logger.WithError(err).Warn("Failed to close config source.") - } - }() - - b, err := io.ReadAll(r) - if err != nil { - return fmt.Errorf("failed to read from config source: %w", err) - } - - if err = json.Unmarshal(b, v); err != nil { - return fmt.Errorf("failed to decode config file: %w", err) - } - - j, err := json.MarshalIndent(v, "", " ") - if err != nil { - panic(err) // should not happen - } - sf.logger.Infof("Read config: %s", string(j)) - - return nil -} - -func (sf *ServiceFlags) obtainConfigReader(args []string, checkArgs bool, genDefaultFunc func() (io.ReadCloser, error)) (io.ReadCloser, error) { - switch { - case sf.Stdin || strings.ToLower(sf.Config) == stdinConfig: - stdin := io.NopCloser(os.Stdin) // ensure stdin is not closed - return stdin, nil - - case checkArgs: - if len(args) == 1 { - return genDefaultFunc() - } - - for i, arg := range args { - if strings.HasSuffix(arg, ".json") && i > 0 && !strings.HasPrefix(args[i-1], "-") { - var f io.ReadCloser - var err error - f, err = os.Open(arg) //nolint:gosec - if err != nil { - return nil, fmt.Errorf("failed to open config file: %w", err) - } - return f, nil - } - } - - case sf.Config != "": - f, err := os.Open(sf.Config) - if err != nil { - return nil, fmt.Errorf("failed to open config file: %w", err) - } - return f, nil - - } - - return nil, errors.New("no config location specified") -} - -// ValidTag returns an error if the tag is invalid. -func ValidTag(tag string) error { - if tag == "" { - return ErrTagCannotBeEmpty - } - - // check: valid characters - for _, c := range tag { - ranges := []*unicode.RangeTable{unicode.Letter, unicode.Number} - if unicode.IsOneOf(ranges, c) || c == '_' { - continue - } - return ErrTagHasInvalidChars - } - - // check: correct positioning of characters - for i, c := range tag { - if i == 0 || i == len(tag)-1 { - if c == '_' { - return ErrTagHasMisplacedUnderscores - } - continue - } - if c == '_' && (tag[i-1] == '_' || tag[i+1] == '_') { - return ErrTagHasMisplacedUnderscores - } - } - - return nil -} - -func alreadyDone(done *bool) bool { - if *done { - return true - } - *done = true - return false -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/signal_context.go b/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/signal_context.go deleted file mode 100644 index 343c522d80..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/signal_context.go +++ /dev/null @@ -1,35 +0,0 @@ -// Package cmdutil pkg/cmdutil/signal_context.go -package cmdutil - -import ( - "context" - "os" - "os/signal" - - "github.com/sirupsen/logrus" -) - -// SignalContext returns a context that cancels on given syscall signals. -func SignalContext(ctx context.Context, log logrus.FieldLogger) (context.Context, context.CancelFunc) { - if log == nil { - log = logrus.New() - } - - ctx, cancel := context.WithCancel(ctx) - - ch := make(chan os.Signal, 1) - listenSigs := listenSignals() - signal.Notify(ch, listenSigs...) - - go func() { - select { - case sig := <-ch: - log.WithField("signal", sig). - Info("Closing with received signal.") - case <-ctx.Done(): - } - cancel() - }() - - return ctx, cancel -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/signal_unix.go b/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/signal_unix.go deleted file mode 100644 index 473d3bf210..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/signal_unix.go +++ /dev/null @@ -1,15 +0,0 @@ -//go:build !windows -// +build !windows - -// Package cmdutil pkg/cmdutil/signal_unix.go -package cmdutil - -import ( - "os" - - "golang.org/x/sys/unix" -) - -func listenSignals() []os.Signal { - return []os.Signal{unix.SIGINT, unix.SIGTERM, unix.SIGQUIT} -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/signal_windows.go b/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/signal_windows.go deleted file mode 100644 index df05d8c4ac..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/signal_windows.go +++ /dev/null @@ -1,15 +0,0 @@ -//go:build windows -// +build windows - -// Package cmdutil pkg/cmdutil/signal_windows.go -package cmdutil - -import ( - "os" - - "golang.org/x/sys/windows" -) - -func listenSignals() []os.Signal { - return []os.Signal{os.Interrupt, windows.SIGINT, windows.SIGTERM, windows.SIGQUIT} -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/sysloghook_unix.go b/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/sysloghook_unix.go deleted file mode 100644 index 0a90281097..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/sysloghook_unix.go +++ /dev/null @@ -1,46 +0,0 @@ -//go:build !windows -// +build !windows - -// Package cmdutil pkg/cmdutil/sysloghook_unix.go -package cmdutil - -import ( - "log/syslog" - "strings" - - "github.com/sirupsen/logrus" - logrussyslog "github.com/sirupsen/logrus/hooks/syslog" - - "github.com/skycoin/skywire-utilities/pkg/logging" -) - -func (sf *ServiceFlags) sysLogHook(log *logging.Logger, sysLvl int) { - hook, err := logrussyslog.NewSyslogHook(sf.SyslogNet, sf.Syslog, syslog.Priority(sysLvl), sf.Tag) - if err != nil { - log.WithError(err). - WithField("net", sf.SyslogNet). - WithField("addr", sf.Syslog). - Fatal("Failed to connect to syslog daemon.") - } - logging.AddHook(hook) -} - -// LevelFromString returns a logrus.Level and syslog.Priority from a string identifier. -func LevelFromString(s string) (logrus.Level, int, error) { - switch strings.ToLower(s) { - case "debug": - return logrus.DebugLevel, int(syslog.LOG_DEBUG), nil - case "info", "notice": - return logrus.InfoLevel, int(syslog.LOG_INFO), nil - case "warn", "warning": - return logrus.WarnLevel, int(syslog.LOG_WARNING), nil - case "error": - return logrus.ErrorLevel, int(syslog.LOG_ERR), nil - case "fatal", "critical": - return logrus.FatalLevel, int(syslog.LOG_CRIT), nil - case "panic": - return logrus.PanicLevel, int(syslog.LOG_EMERG), nil - default: - return logrus.DebugLevel, int(syslog.LOG_DEBUG), ErrInvalidLogString - } -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/sysloghook_windows.go b/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/sysloghook_windows.go deleted file mode 100644 index 83ddf4f8d5..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/cmdutil/sysloghook_windows.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build windows -// +build windows - -// Package cmdutil pkg/cmdutil/sysloghook_windows.go -package cmdutil - -import ( - "strings" - - "github.com/sirupsen/logrus" - - "github.com/skycoin/skywire-utilities/pkg/logging" -) - -func (sf *ServiceFlags) sysLogHook(_ *logging.Logger, _ int) { -} - -// LevelFromString returns a logrus.Level and syslog.Priority from a string identifier. -func LevelFromString(s string) (logrus.Level, int, error) { - switch strings.ToLower(s) { - case "debug": - return logrus.DebugLevel, 0, nil - case "info", "notice": - return logrus.InfoLevel, 0, nil - case "warn", "warning": - return logrus.WarnLevel, 0, nil - case "error": - return logrus.ErrorLevel, 0, nil - case "fatal", "critical": - return logrus.FatalLevel, 0, nil - case "panic": - return logrus.PanicLevel, 0, nil - default: - return logrus.DebugLevel, 0, ErrInvalidLogString - } -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/geo/geo.go b/vendor/github.com/skycoin/skywire-utilities/pkg/geo/geo.go deleted file mode 100644 index 1d8cdac63d..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/geo/geo.go +++ /dev/null @@ -1,94 +0,0 @@ -// Package geo pkg/geo/geo.go -package geo - -import ( - "encoding/json" - "errors" - "fmt" - "math" - "net" - "net/http" - - "github.com/sirupsen/logrus" - - "github.com/skycoin/skywire-utilities/pkg/logging" - - "github.com/skycoin/skywire-utilities/pkg/netutil" -) - -// Errors associated with geo calls. -var ( - ErrIPIsNotPublic = errors.New("ip address is not public") - ErrCannotObtainLocFromIP = errors.New("cannot obtain location from IP") -) - -const ( - reqURL = "http://ip.skycoin.com/?ip=%s" -) - -// LocationData represents a geolocation point. -type LocationData struct { - Lat float64 `json:"lat,omitempty"` - Lon float64 `json:"lon,omitempty"` - Country string `json:"country,omitempty"` - Region string `json:"region,omitempty"` -} - -// LocationDetails represents a function that obtains geolocation from a given IP. -type LocationDetails func(ip net.IP) (*LocationData, error) - -// MakeIPDetails returns a GeoFunc. -func MakeIPDetails(log logrus.FieldLogger, _ string) LocationDetails { - // Just in case. - if log == nil { - log = logging.MustGetLogger("geo") - } - - return func(ip net.IP) (*LocationData, error) { - // Check if IP is public IP. - if !netutil.IsPublicIP(ip) { - return nil, ErrIPIsNotPublic - } - - // Get Geo from IP. - var ( - resp *http.Response - err error - ) - - resp, err = http.Get(fmt.Sprintf(reqURL, ip.String())) - if err != nil { - return nil, err - } - defer func() { _ = resp.Body.Close() }() //nolint:errcheck - - // Get body. - j := struct { - CountryCode string `json:"country_code"` - Region string `json:"region_code"` - Lat float64 `json:"latitude"` - Lon float64 `json:"longitude"` - }{} - if err := json.NewDecoder(resp.Body).Decode(&j); err != nil { - return nil, err - } - if j.CountryCode == "" && j.Region == "" && j.Lat == 0 && j.Lon == 0 { - return nil, fmt.Errorf("call to ip.skycoin.com returned empty: %s", ErrCannotObtainLocFromIP) - } - - // Prepare output. - out := LocationData{ - Lat: roundTwoDigits(j.Lat), - Lon: roundTwoDigits(j.Lon), - Country: j.CountryCode, - Region: j.Region, - } - log.WithField("geo", out).Info() - - return &out, nil - } -} - -func roundTwoDigits(value float64) float64 { - return math.Round(value*100) / 100 -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/httpauth/auth.go b/vendor/github.com/skycoin/skywire-utilities/pkg/httpauth/auth.go deleted file mode 100644 index 2f2d99fd4f..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/httpauth/auth.go +++ /dev/null @@ -1,120 +0,0 @@ -// Package httpauth pkg/httpauth/auth.go -package httpauth - -import ( - "bytes" - "errors" - "fmt" - "io" - "net/http" - "strconv" - - "github.com/skycoin/skywire-utilities/pkg/cipher" -) - -// Auth holds authentication mandatory values -type Auth struct { - Key cipher.PubKey - Nonce Nonce - Sig cipher.Sig -} - -// AuthFromHeaders attempts to extract auth from request header -func AuthFromHeaders(hdr http.Header, shouldVerifyAuth bool) (*Auth, error) { - a := &Auth{} - v := hdr.Get("SW-Public") - - if v == "" { - return nil, errors.New("SW-Public missing") - } - - key := cipher.PubKey{} - if err := key.UnmarshalText([]byte(v)); err != nil { - return nil, fmt.Errorf("error parsing SW-Public: %w", err) - } - - a.Key = key - - if shouldVerifyAuth { - if v = hdr.Get("SW-Sig"); v == "" { - return nil, errors.New("SW-Sig missing") - } - - sig := cipher.Sig{} - if err := sig.UnmarshalText([]byte(v)); err != nil { - return nil, fmt.Errorf("error parsing SW-Sig:'%s': %w", v, err) - } - - a.Sig = sig - } - - nonceStr := hdr.Get("SW-Nonce") - if nonceStr == "" { - return nil, errors.New("SW-Nonce missing") - } - - nonceUint, err := strconv.ParseUint(nonceStr, 10, 64) - if err != nil { - if numErr, ok := err.(*strconv.NumError); ok { - return nil, fmt.Errorf("error parsing SW-Nonce: %w", numErr.Err) - } - - return nil, fmt.Errorf("error parsing SW-Nonce: %w", err) - } - - a.Nonce = Nonce(nonceUint) - - return a, nil -} - -// Verify verifies signature of a payload. -func (a *Auth) Verify(in []byte) error { - return Verify(in, a.Nonce, a.Key, a.Sig) -} - -// verifyAuth verifies Request's signature. -func verifyAuth(store NonceStore, r *http.Request, auth *Auth) error { - cur, err := store.Nonce(r.Context(), auth.Key) - if err != nil { - return err - } - - if auth.Nonce != cur { - fmt.Printf("SW-Nonce mismatch, want %q, got %q, key=%q, sig=%q\n", - cur.String(), auth.Nonce.String(), auth.Key.String(), auth.Sig.String()) - - return errors.New("SW-Nonce does not match") - } - - var buf bytes.Buffer - body := io.TeeReader(r.Body, &buf) - - payload, err := io.ReadAll(body) - if err != nil { - return err - } - - // close the original body cause it will be replaced - if err := r.Body.Close(); err != nil { - return err - } - - r.Body = io.NopCloser(&buf) - - return auth.Verify(payload) -} - -// PayloadWithNonce returns the concatenation of payload and nonce. -func PayloadWithNonce(payload []byte, nonce Nonce) []byte { - return []byte(fmt.Sprintf("%s%d", string(payload), nonce)) -} - -// Sign signs the Hash of payload and nonce -func Sign(payload []byte, nonce Nonce, sec cipher.SecKey) (cipher.Sig, error) { - return cipher.SignPayload(PayloadWithNonce(payload, nonce), sec) -} - -// Verify verifies the signature of the hash of payload and nonce -func Verify(payload []byte, nonce Nonce, pub cipher.PubKey, sig cipher.Sig) error { - return cipher.VerifyPubKeySignedPayload(pub, sig, PayloadWithNonce(payload, nonce)) -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/httpauth/handler.go b/vendor/github.com/skycoin/skywire-utilities/pkg/httpauth/handler.go deleted file mode 100644 index cd1e1ee0ba..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/httpauth/handler.go +++ /dev/null @@ -1,221 +0,0 @@ -// Package httpauth pkg/httpauth/handler.go -package httpauth - -import ( - "bufio" - "context" - "errors" - "net" - "net/http" - "net/url" - "strings" - - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/httputil" - "github.com/skycoin/skywire-utilities/pkg/logging" -) - -var ( - logger = logging.MustGetLogger("Auth") - - // ContextAuthKey stores authenticated PubKey in Context . - ContextAuthKey = struct{}{} - // LogAuthKey stores authentication PubKey in log entry - LogAuthKey = "PK" -) - -// HTTPResponse represents the http response struct -type HTTPResponse struct { - Error *HTTPError `json:"error,omitempty"` - Data interface{} `json:"data,omitempty"` -} - -// HTTPError is included in an HTTPResponse -type HTTPError struct { - Message string `json:"message"` - Code int `json:"code"` -} - -// implements http.ResponseWriter -type statusWriter struct { - http.ResponseWriter - http.Hijacker - status int -} - -func (w *statusWriter) WriteHeader(status int) { - w.status = status - w.ResponseWriter.WriteHeader(status) -} - -func (w *statusWriter) Write(b []byte) (int, error) { - if w.status == 0 { - w.status = 200 - } - - n, err := w.ResponseWriter.Write(b) - - return n, err -} - -func (w *statusWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { - hijacker, ok := w.ResponseWriter.(http.Hijacker) - if !ok { - return nil, nil, errors.New("http.ResponseWriter does not implement http.Hijacker") - } - - return hijacker.Hijack() -} - -// WithAuth wraps a http.Handler and adds authentication logic. -// The original http.Handler is responsible for setting the status code. -// The middleware logic should only increment the security nonce if the status code -// from the original http.Handler is of 2xx value (representing success). -// Any http.Handler that is wrapped with this function will have available the authenticated -// public key from it's context, stored in the value ContextAuthKey. -func WithAuth(store NonceStore, original http.Handler, shouldVerifyAuth bool) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - auth, err := AuthFromHeaders(r.Header, shouldVerifyAuth) - if err != nil { - httputil.WriteJSON(w, r, http.StatusUnauthorized, - NewHTTPErrorResponse(http.StatusUnauthorized, - err.Error())) - return - } - - if shouldVerifyAuth { - err = verifyAuth(store, r, auth) - if err != nil { - httputil.WriteJSON(w, r, http.StatusUnauthorized, - NewHTTPErrorResponse(http.StatusUnauthorized, - err.Error())) - return - } - } - - sw := statusWriter{ResponseWriter: w} - httputil.LogEntrySetField(r, LogAuthKey, auth.Key) - original.ServeHTTP(&sw, r.WithContext(context.WithValue( - r.Context(), ContextAuthKey, auth.Key))) - - if sw.status == http.StatusOK { - _, err := store.IncrementNonce(r.Context(), auth.Key) - if err != nil { - logger.Error(err) - } - } - }) -} - -func makeMiddleware(store NonceStore, shouldVerifyAuth bool) func(next http.Handler) http.Handler { - return func(next http.Handler) http.Handler { - return WithAuth(store, next, shouldVerifyAuth) - } -} - -// MakeMiddleware is a convenience function that calls WithAuth. -func MakeMiddleware(store NonceStore) func(next http.Handler) http.Handler { - return makeMiddleware(store, true) -} - -// PKFromCtx is a convenience function to obtain PK from ctx. -func PKFromCtx(ctx context.Context) cipher.PubKey { - pk, _ := ctx.Value(ContextAuthKey).(cipher.PubKey) - return pk -} - -// MakeLoadTestingMiddleware is the same as `MakeMiddleware` but omits auth checks to simplify load testing. -func MakeLoadTestingMiddleware(store NonceStore) func(next http.Handler) http.Handler { - return makeMiddleware(store, false) -} - -// NextNonceResponse represents a ServeHTTP response for json encoding -type NextNonceResponse struct { - Edge cipher.PubKey `json:"edge"` - NextNonce Nonce `json:"next_nonce"` -} - -// NonceHandler provides server-side logic for Skywire-related RESTFUL authorization and authentication. -type NonceHandler struct { - Store NonceStore -} - -// ServeHTTP implements http Handler -// Use this in endpoint: -// mux.Handle("/security/nonces/", &NonceHandler{Store}) -func (as *NonceHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - remotePK, err := retrievePkFromURL(r.URL) - if err != nil { - httputil.WriteJSON(w, r, http.StatusBadRequest, - NewHTTPErrorResponse(http.StatusBadRequest, - err.Error())) - - return - } - - var nilPK cipher.PubKey - - if remotePK == nilPK { - httputil.WriteJSON(w, r, http.StatusBadRequest, - NewHTTPErrorResponse(http.StatusBadRequest, - "Invalid public key")) - - return - } - - nonce, err := as.Store.Nonce(r.Context(), remotePK) - if err != nil { - httputil.WriteJSON(w, r, http.StatusInternalServerError, - NewHTTPErrorResponse(http.StatusInternalServerError, - err.Error())) - - return - } - - httputil.WriteJSON(w, r, http.StatusOK, NextNonceResponse{Edge: remotePK, NextNonce: nonce}) -} - -// NewHTTPErrorResponse returns an HTTPResponse with the Error field populated -func NewHTTPErrorResponse(code int, msg string) HTTPResponse { - if msg == "" { - msg = http.StatusText(code) - } - - return HTTPResponse{ - Error: &HTTPError{ - Code: code, - Message: msg, - }, - } -} - -// retrievePkFromURL returns the id used on endpoints of the form path/:pk -// it doesn't checks if the endpoint has this form and can fail with other -// endpoint forms -func retrievePkFromURL(url *url.URL) (cipher.PubKey, error) { - splitPath := strings.Split(url.EscapedPath(), "/") - v := splitPath[len(splitPath)-1] - pk := cipher.PubKey{} - err := pk.UnmarshalText([]byte(v)) - return pk, err -} - -// GetRemoteAddr gets the remote address from the request -// in case of dmsghttp the RemoteAddress is a pk so it gets the RemoteAddr -// from the header instead -func GetRemoteAddr(r *http.Request) string { - var pk cipher.PubKey - - // remove the port incase of an IP or a PK - host, _, err := net.SplitHostPort(r.RemoteAddr) - if err != nil { - host = r.RemoteAddr - } - - err = pk.Set(host) - if err == nil { - return r.Header.Get("SW-PublicIP") - } - - return host -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/httpauth/memory_store.go b/vendor/github.com/skycoin/skywire-utilities/pkg/httpauth/memory_store.go deleted file mode 100644 index b0b4151dc0..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/httpauth/memory_store.go +++ /dev/null @@ -1,62 +0,0 @@ -// Package httpauth pkg/httpauth/memory_store.go -package httpauth - -import ( - "context" - "sync" - - "github.com/skycoin/skywire-utilities/pkg/cipher" -) - -type memStore struct { - nonces map[cipher.PubKey]Nonce - - err error - mu sync.Mutex -} - -func newMemoryStore() *memStore { - return &memStore{ - nonces: make(map[cipher.PubKey]Nonce), - } -} - -func (s *memStore) SetError(err error) { - s.mu.Lock() - s.err = err - s.mu.Unlock() -} - -func (s *memStore) Nonce(_ context.Context, pk cipher.PubKey) (Nonce, error) { - s.mu.Lock() - defer s.mu.Unlock() - - if s.err != nil { - return 0, s.err - } - - return s.nonces[pk], nil -} - -func (s *memStore) IncrementNonce(_ context.Context, pk cipher.PubKey) (Nonce, error) { - s.mu.Lock() - defer s.mu.Unlock() - - if s.err != nil { - return 0, s.err - } - - s.nonces[pk]++ - return s.nonces[pk], nil -} - -func (s *memStore) Count(_ context.Context) (n int, err error) { - s.mu.Lock() - defer s.mu.Unlock() - - if s.err != nil { - return 0, s.err - } - - return len(s.nonces), nil -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/httpauth/nonce-storer.go b/vendor/github.com/skycoin/skywire-utilities/pkg/httpauth/nonce-storer.go deleted file mode 100644 index e2f8fe7bb7..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/httpauth/nonce-storer.go +++ /dev/null @@ -1,43 +0,0 @@ -// Package httpauth pkg/httpauth/nonce-storer.go -package httpauth - -import ( - "context" - "fmt" - - "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/storeconfig" -) - -// Nonce is used to sign requests in order to avoid replay attack -type Nonce uint64 - -func (n Nonce) String() string { return fmt.Sprintf("%d", n) } - -// NonceStore stores Incrementing Security Nonces. -type NonceStore interface { - - // IncrementNonce increments the nonce associated with the specified remote entity. - // It returns the next expected nonce after it has been incremented and returns error on failure. - IncrementNonce(ctx context.Context, remotePK cipher.PubKey) (nonce Nonce, err error) - - // Nonce obtains the next expected nonce for a given remote entity (represented by public key). - // It returns error on failure. - Nonce(ctx context.Context, remotePK cipher.PubKey) (nonce Nonce, err error) - - // Count obtains the number of entries stored in the underlying database. - Count(ctx context.Context) (n int, err error) -} - -// NewNonceStore returns a new nonce storer of the given kind that connects to given Store's url. -// Nonce count should not be shared between services, so it should be stored in a unique key for every service. -func NewNonceStore(ctx context.Context, config storeconfig.Config, prefix string) (NonceStore, error) { - switch config.Type { - case storeconfig.Redis: - return newRedisStore(ctx, config.URL, config.Password, prefix) - case storeconfig.Memory: - return newMemoryStore(), nil - } - - return nil, fmt.Errorf("kind has to be either redis or memory") -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/httpauth/redis-store.go b/vendor/github.com/skycoin/skywire-utilities/pkg/httpauth/redis-store.go deleted file mode 100644 index 4d9d0d13f2..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/httpauth/redis-store.go +++ /dev/null @@ -1,89 +0,0 @@ -// Package httpauth pkg/httpauth/redis-store.go -package httpauth - -import ( - "context" - "fmt" - "log" - "strconv" - "time" - - "github.com/go-redis/redis/v8" - - "github.com/skycoin/skywire-utilities/pkg/cipher" -) - -type redisStore struct { - client *redis.Client - prefix string -} - -func newRedisStore(ctx context.Context, addr, password, prefix string) (*redisStore, error) { - opt, err := redis.ParseURL(addr) - if err != nil { - return nil, fmt.Errorf("addr: %w", err) - } - - opt.Password = password - opt.ReadTimeout = time.Minute - opt.WriteTimeout = 5 * time.Second - opt.PoolTimeout = 10 * time.Second - opt.IdleCheckFrequency = 5 * time.Second - opt.PoolSize = 200 - - if prefix != "" { - prefix += ":" - } - - redisCl := redis.NewClient(opt) - if err := redisCl.Ping(ctx).Err(); err != nil { - log.Fatalf("Failed to connect to Redis cluster: %v", err) - } - - store := &redisStore{ - client: redisCl, - prefix: prefix, - } - - return store, nil -} - -func (s *redisStore) key(v string) string { - return s.prefix + v -} - -func (s *redisStore) Nonce(ctx context.Context, remotePK cipher.PubKey) (Nonce, error) { - nonce, err := s.client.Get(ctx, s.key(fmt.Sprintf("nonces:%s", remotePK))).Result() - if err != nil { - return 0, nil - } - - n, err := strconv.Atoi(nonce) - if err != nil { - return 0, fmt.Errorf("malformed nonce: %s", nonce) - } - return Nonce(n), nil -} - -func (s *redisStore) IncrementNonce(ctx context.Context, remotePK cipher.PubKey) (Nonce, error) { - nonce, err := s.client.Incr(ctx, s.key(fmt.Sprintf("nonces:%s", remotePK))).Result() - if err != nil { - return 0, fmt.Errorf("redis: %w", err) - } - - _, err = s.client.SAdd(ctx, s.key("nonces"), remotePK).Result() - if err != nil { - return 0, fmt.Errorf("redis: %w", err) - } - - return Nonce(nonce), nil -} - -func (s *redisStore) Count(ctx context.Context) (n int, err error) { - size, err := s.client.SCard(ctx, s.key("nonces")).Result() - if err != nil { - return 0, fmt.Errorf("redis: %w", err) - } - - return int(size), nil -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/dmsghttp.go b/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/dmsghttp.go deleted file mode 100644 index c2a1b59446..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/dmsghttp.go +++ /dev/null @@ -1,21 +0,0 @@ -// Package httputil pkg/httputil/dmsghttp.go -package httputil - -// DMSGHTTPConf is struct of /dmsghttp endpoint of config bootstrap -type DMSGHTTPConf struct { - DMSGServers []DMSGServersConf `json:"dmsg_servers"` - DMSGDiscovery string `json:"dmsg_discovery"` - TranspordDiscovery string `json:"transport_discovery"` - AddressResolver string `json:"address_resolver"` - RouteFinder string `json:"route_finder"` - UptimeTracker string `json:"uptime_tracker"` - ServiceDiscovery string `json:"service_discovery"` -} - -// DMSGServersConf is struct of dmsg servers list on /dmsghttp endpoint -type DMSGServersConf struct { - Static string `json:"static"` - Server struct { - Address string `json:"address"` - } `json:"server"` -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/error.go b/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/error.go deleted file mode 100644 index 38e5c94165..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/error.go +++ /dev/null @@ -1,61 +0,0 @@ -// Package httputil pkg/httputil/error.go -package httputil - -import ( - "bytes" - "fmt" - "io" - "net/http" -) - -// HTTPError represents an http error associated with a server response. -type HTTPError struct { - Status int - Body string -} - -// Error is the object returned to the client when there's an error. -type Error struct { - Error string `json:"error"` -} - -// ErrorFromResp creates an HTTPError from a given server response. -func ErrorFromResp(resp *http.Response) error { - status := resp.StatusCode - if status >= 200 && status < 300 { - return nil - } - msg, err := io.ReadAll(resp.Body) - if err != nil && len(msg) == 0 { - msg = []byte(fmt.Sprintf("failed to read HTTP response body: %v", err)) - } - return &HTTPError{Status: status, Body: string(bytes.TrimSpace(msg))} -} - -// Error returns the error message. -func (e *HTTPError) Error() string { - return fmt.Sprintf("%d %s: %v", e.Status, http.StatusText(e.Status), e.Body) -} - -// Timeout implements net.Error -func (e *HTTPError) Timeout() bool { - switch e.Status { - case http.StatusGatewayTimeout, http.StatusRequestTimeout: - return true - default: - return false - } -} - -// Temporary implements net.Error -func (e *HTTPError) Temporary() bool { - if e.Timeout() { - return true - } - switch e.Status { - case http.StatusServiceUnavailable, http.StatusTooManyRequests: - return true - default: - return false - } -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/health.go b/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/health.go deleted file mode 100644 index 015071d7e3..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/health.go +++ /dev/null @@ -1,45 +0,0 @@ -// Package httputil pkg/httputil/health.go -package httputil - -import ( - "context" - "net/http" - "time" - - "github.com/skycoin/skywire-utilities/pkg/buildinfo" -) - -var path = "/health" - -// HealthCheckResponse is struct of /health endpoint -type HealthCheckResponse struct { - BuildInfo *buildinfo.Info `json:"build_info,omitempty"` - StartedAt time.Time `json:"started_at"` - DmsgAddr string `json:"dmsg_address,omitempty"` - DmsgServers []string `json:"dmsg_servers,omitempty"` -} - -// GetServiceHealth gets the response from the given service url -func GetServiceHealth(_ context.Context, url string) (health *HealthCheckResponse, err error) { - resp, err := http.Get(url + path) - if err != nil { - return nil, err - } - if resp != nil { - defer func() { - if cErr := resp.Body.Close(); cErr != nil && err == nil { - err = cErr - } - }() - } - if resp.StatusCode != http.StatusOK { - var hErr HTTPError - if err = json.NewDecoder(resp.Body).Decode(&hErr); err != nil { - return nil, err - } - return nil, &hErr - } - err = json.NewDecoder(resp.Body).Decode(&health) - - return health, nil -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/httputil.go b/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/httputil.go deleted file mode 100644 index f63b08baaf..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/httputil.go +++ /dev/null @@ -1,105 +0,0 @@ -// Package httputil pkg/httputil/httputil.go -package httputil - -import ( - "context" - "fmt" - "net/http" - "strconv" - "strings" - - "github.com/go-chi/chi/v5/middleware" - jsoniter "github.com/json-iterator/go" - "github.com/sirupsen/logrus" - - "github.com/skycoin/skywire-utilities/pkg/logging" -) - -var json = jsoniter.ConfigFastest - -var log = logging.MustGetLogger("httputil") - -// WriteJSON writes a json object on a http.ResponseWriter with the given code, -// panics on marshaling error -func WriteJSON(w http.ResponseWriter, r *http.Request, code int, v interface{}) { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(code) - enc := json.NewEncoder(w) - pretty, err := BoolFromQuery(r, "pretty", false) - if err != nil { - log.WithError(err).Warn("Failed to get bool from query") - } - if pretty { - enc.SetIndent("", " ") - } - if err, ok := v.(error); ok { - v = map[string]interface{}{"error": err.Error()} - } - if err := json.NewEncoder(w).Encode(v); err != nil { - panic(err) - } -} - -// ReadJSON reads the request body to a json object. -func ReadJSON(r *http.Request, v interface{}) error { - dec := json.NewDecoder(r.Body) - dec.DisallowUnknownFields() - return dec.Decode(v) -} - -// BoolFromQuery obtains a boolean from a query entry. -func BoolFromQuery(r *http.Request, key string, defaultVal bool) (bool, error) { - switch q := r.URL.Query().Get(key); q { - case "true", "on", "1": - return true, nil - case "false", "off", "0": - return false, nil - case "": - return defaultVal, nil - default: - return false, fmt.Errorf("invalid '%s' query value of '%s'", key, q) - } -} - -// SplitRPCAddr returns host and port and whatever error results from parsing the rpc address interface -func SplitRPCAddr(rpcAddr string) (host string, port uint16, err error) { - addrToken := strings.Split(rpcAddr, ":") - uint64port, err := strconv.ParseUint(addrToken[1], 10, 16) - if err != nil { - return - } - - return addrToken[0], uint16(uint64port), nil -} - -type ctxKeyLogger int - -// LoggerKey defines logger HTTP context key. -const LoggerKey ctxKeyLogger = -1 - -// GetLogger returns logger from HTTP context. -func GetLogger(r *http.Request) logrus.FieldLogger { - if log, ok := r.Context().Value(LoggerKey).(logrus.FieldLogger); ok && log != nil { - return log - } - - return logging.NewMasterLogger() -} - -// todo: investigate if it's used throughout the services (didn't work properly for UT) -// remove and use structured logging - -// SetLoggerMiddleware sets logger to context of HTTP requests. -func SetLoggerMiddleware(log logrus.FieldLogger) func(next http.Handler) http.Handler { - return func(next http.Handler) http.Handler { - fn := func(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() - - if reqID := middleware.GetReqID(ctx); reqID != "" && log != nil { - ctx = context.WithValue(ctx, LoggerKey, log.WithField("RequestID", reqID)) - } - next.ServeHTTP(w, r.WithContext(ctx)) - } - return http.HandlerFunc(fn) - } -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/log.go b/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/log.go deleted file mode 100644 index c6d1900432..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/httputil/log.go +++ /dev/null @@ -1,57 +0,0 @@ -// Package httputil pkg/httputil/log.go -package httputil - -import ( - "context" - "net/http" - "time" - - "github.com/go-chi/chi/v5/middleware" - "github.com/sirupsen/logrus" -) - -type structuredLogger struct { - logger logrus.FieldLogger -} - -// NewLogMiddleware creates a new instance of logging middleware. This will allow -// adding log fields in the handler and any further middleware. At the end of request, this -// log entry will be printed at Info level via passed logger -func NewLogMiddleware(logger logrus.FieldLogger) func(http.Handler) http.Handler { - return func(next http.Handler) http.Handler { - fn := func(w http.ResponseWriter, r *http.Request) { - sl := &structuredLogger{logger} - start := time.Now() - var requestID string - if reqID := r.Context().Value(middleware.RequestIDKey); reqID != nil { - requestID = reqID.(string) - } - ww := middleware.NewWrapResponseWriter(w, r.ProtoMajor) - newContext := context.WithValue(r.Context(), middleware.LogEntryCtxKey, sl) - next.ServeHTTP(ww, r.WithContext(newContext)) - latency := time.Since(start) - fields := logrus.Fields{ - "status": ww.Status(), - "took": latency, - "remote": r.RemoteAddr, - "request": r.RequestURI, - "method": r.Method, - } - if requestID != "" { - fields["request_id"] = requestID - } - sl.logger.WithFields(fields).Info() - - } - return http.HandlerFunc(fn) - } -} - -// LogEntrySetField adds new key-value pair to current (request scoped) log entry. This pair will be -// printed along with all other pairs when the request is served. -// This requires log middleware from this package to be installed in the chain -func LogEntrySetField(r *http.Request, key string, value interface{}) { - if sl, ok := r.Context().Value(middleware.LogEntryCtxKey).(*structuredLogger); ok { - sl.logger = sl.logger.WithField(key, value) - } -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/logging/formatter.go b/vendor/github.com/skycoin/skywire-utilities/pkg/logging/formatter.go deleted file mode 100644 index 60b998045e..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/logging/formatter.go +++ /dev/null @@ -1,449 +0,0 @@ -// Package logging pkg/logging/formatter.go -package logging - -import ( - "bytes" - "fmt" - "io" - "os" - "sort" - "strings" - "sync" - "time" - - "github.com/mgutz/ansi" - "github.com/sirupsen/logrus" - "golang.org/x/term" -) - -const defaultTimestampFormat = time.RFC3339 - -var ( - baseTimestamp = time.Now() - defaultColorScheme = &ColorScheme{ - InfoLevelStyle: "green", - WarnLevelStyle: "yellow", - ErrorLevelStyle: "red", - FatalLevelStyle: "red", - PanicLevelStyle: "red", - DebugLevelStyle: "blue", - TraceLevelStyle: "black", - PrefixStyle: "cyan", - TimestampStyle: "black+h", - CallContextStyle: "black+h", - CriticalStyle: "magenta+h", - } - noColorsColorScheme = &compiledColorScheme{ - InfoLevelColor: ansi.ColorFunc(""), - WarnLevelColor: ansi.ColorFunc(""), - ErrorLevelColor: ansi.ColorFunc(""), - FatalLevelColor: ansi.ColorFunc(""), - PanicLevelColor: ansi.ColorFunc(""), - DebugLevelColor: ansi.ColorFunc(""), - TraceLevelColor: ansi.ColorFunc(""), - PrefixColor: ansi.ColorFunc(""), - TimestampColor: ansi.ColorFunc(""), - CallContextColor: ansi.ColorFunc(""), - CriticalColor: ansi.ColorFunc(""), - } - defaultCompiledColorScheme = compileColorScheme(defaultColorScheme) -) - -func miniTS() int { - return int(time.Since(baseTimestamp) / time.Second) -} - -// ColorScheme configures the logging output colors -type ColorScheme struct { - InfoLevelStyle string - WarnLevelStyle string - ErrorLevelStyle string - FatalLevelStyle string - PanicLevelStyle string - DebugLevelStyle string - TraceLevelStyle string - PrefixStyle string - TimestampStyle string - CallContextStyle string - CriticalStyle string -} - -type compiledColorScheme struct { - InfoLevelColor func(string) string - WarnLevelColor func(string) string - ErrorLevelColor func(string) string - FatalLevelColor func(string) string - PanicLevelColor func(string) string - DebugLevelColor func(string) string - TraceLevelColor func(string) string - PrefixColor func(string) string - TimestampColor func(string) string - CallContextColor func(string) string - CriticalColor func(string) string -} - -// TextFormatter formats log output -type TextFormatter struct { - // Set to true to bypass checking for a TTY before outputting colors. - ForceColors bool - - // Force disabling colors. For a TTY colors are enabled by default. - DisableColors bool - - // Force formatted layout, even for non-TTY output. - ForceFormatting bool - - // Disable timestamp logging. useful when output is redirected to logging - // system that already adds timestamps. - DisableTimestamp bool - - // Disable the conversion of the log levels to uppercase - DisableUppercase bool - - // Enable logging the full timestamp when a TTY is attached instead of just - // the time passed since beginning of execution. - FullTimestamp bool - - // Timestamp format to use for display when a full timestamp is printed. - TimestampFormat string - - // The fields are sorted by default for a consistent output. For applications - // that log extremely frequently and don't use the JSON formatter this may not - // be desired. - DisableSorting bool - - // Wrap empty fields in quotes if true. - QuoteEmptyFields bool - - // Can be set to the override the default quoting character " - // with something else. For example: ', or `. - QuoteCharacter string - - // Pad msg field with spaces on the right for display. - // The value for this parameter will be the size of padding. - // Its default value is zero, which means no padding will be applied for msg. - SpacePadding int - - // Always use quotes for string values (except for empty fields) - AlwaysQuoteStrings bool - - // Color scheme to use. - colorScheme *compiledColorScheme - - // Whether the logger's out is to a terminal. - isTerminal bool - - sync.Once -} - -func getCompiledColor(main string, fallback string) func(string) string { - var style string - if main != "" { - style = main - } else { - style = fallback - } - return ansi.ColorFunc(style) -} - -func compileColorScheme(s *ColorScheme) *compiledColorScheme { - return &compiledColorScheme{ - InfoLevelColor: getCompiledColor(s.InfoLevelStyle, defaultColorScheme.InfoLevelStyle), - WarnLevelColor: getCompiledColor(s.WarnLevelStyle, defaultColorScheme.WarnLevelStyle), - ErrorLevelColor: getCompiledColor(s.ErrorLevelStyle, defaultColorScheme.ErrorLevelStyle), - FatalLevelColor: getCompiledColor(s.FatalLevelStyle, defaultColorScheme.FatalLevelStyle), - PanicLevelColor: getCompiledColor(s.PanicLevelStyle, defaultColorScheme.PanicLevelStyle), - DebugLevelColor: getCompiledColor(s.DebugLevelStyle, defaultColorScheme.DebugLevelStyle), - TraceLevelColor: getCompiledColor(s.TraceLevelStyle, defaultColorScheme.TraceLevelStyle), - PrefixColor: getCompiledColor(s.PrefixStyle, defaultColorScheme.PrefixStyle), - TimestampColor: getCompiledColor(s.TimestampStyle, defaultColorScheme.TimestampStyle), - CallContextColor: getCompiledColor(s.CallContextStyle, defaultColorScheme.CallContextStyle), - CriticalColor: getCompiledColor(s.CriticalStyle, defaultColorScheme.CriticalStyle), - } -} - -func (f *TextFormatter) init(entry *logrus.Entry) { - if len(f.QuoteCharacter) == 0 { - f.QuoteCharacter = "\"" - } - if entry.Logger != nil { - f.isTerminal = f.checkIfTerminal(entry.Logger.Out) - } -} - -func (f *TextFormatter) checkIfTerminal(w io.Writer) bool { - switch v := w.(type) { - case *os.File: - return term.IsTerminal(int(v.Fd())) - default: - return false - } -} - -// SetColorScheme sets the TextFormatter's color scheme configuration -func (f *TextFormatter) SetColorScheme(colorScheme *ColorScheme) { - f.colorScheme = compileColorScheme(colorScheme) -} - -// Format formats a logrus.Entry -func (f *TextFormatter) Format(entry *logrus.Entry) ([]byte, error) { - var b *bytes.Buffer - keys := make([]string, 0, len(entry.Data)) - for k := range entry.Data { - keys = append(keys, k) - } - lastKeyIdx := len(keys) - 1 - - if !f.DisableSorting { - sort.Strings(keys) - } - if entry.Buffer != nil { - b = entry.Buffer - } else { - b = &bytes.Buffer{} - } - - f.Do(func() { f.init(entry) }) - - isFormatted := f.ForceFormatting || f.isTerminal - - timestampFormat := f.TimestampFormat - if timestampFormat == "" { - timestampFormat = defaultTimestampFormat - } - if isFormatted { - isColored := (f.ForceColors || f.isTerminal) && !f.DisableColors - var colorScheme *compiledColorScheme - if isColored { - if f.colorScheme == nil { - colorScheme = defaultCompiledColorScheme - } else { - colorScheme = f.colorScheme - } - } else { - colorScheme = noColorsColorScheme - } - f.printColored(b, entry, keys, timestampFormat, colorScheme) - } else { - if !f.DisableTimestamp { - f.appendKeyValue(b, "time", entry.Time.Format(timestampFormat), true) - } - f.appendKeyValue(b, "level", entry.Level.String(), true) - if entry.Message != "" { - f.appendKeyValue(b, "msg", entry.Message, lastKeyIdx >= 0) - } - for i, key := range keys { - f.appendKeyValue(b, key, entry.Data[key], lastKeyIdx != i) - } - } - - b.WriteByte('\n') //nolint:gosec - return b.Bytes(), nil -} - -func (f *TextFormatter) printColored(b *bytes.Buffer, entry *logrus.Entry, keys []string, timestampFormat string, colorScheme *compiledColorScheme) { - var levelColor func(string) string - var levelText string - switch entry.Level { - case logrus.InfoLevel: - levelColor = colorScheme.InfoLevelColor - case logrus.WarnLevel: - levelColor = colorScheme.WarnLevelColor - case logrus.ErrorLevel: - levelColor = colorScheme.ErrorLevelColor - case logrus.FatalLevel: - levelColor = colorScheme.FatalLevelColor - case logrus.PanicLevel: - levelColor = colorScheme.PanicLevelColor - case logrus.TraceLevel: - levelColor = colorScheme.TraceLevelColor - default: - levelColor = colorScheme.DebugLevelColor - } - - priority, ok := entry.Data[logPriorityKey] - hasPriority := ok && priority == logPriorityCritical - - if entry.Level != logrus.WarnLevel { - levelText = entry.Level.String() - } else { - levelText = "warn" - } - - if !f.DisableUppercase { - levelText = strings.ToUpper(levelText) - } - - level := levelColor(levelText) - message := entry.Message - prefix := "" - - prefixText := extractPrefix(entry) - if prefixText != "" { - prefixText = " " + prefixText + ":" - prefix = colorScheme.PrefixColor(prefixText) - } - - messageFormat := "%s" - if f.SpacePadding != 0 { - messageFormat = fmt.Sprintf("%%-%ds", f.SpacePadding) - } - if message != "" { - messageFormat = " " + messageFormat - } - - callContextParts := []string{} - if ifile, ok := entry.Data["file"]; ok { - if sfile, ok := ifile.(string); ok && sfile != "" { - callContextParts = append(callContextParts, sfile) - } - } - if ifunc, ok := entry.Data["func"]; ok { - if sfunc, ok := ifunc.(string); ok && sfunc != "" { - callContextParts = append(callContextParts, sfunc) - } - } - if iline, ok := entry.Data["line"]; ok { - sline := "" - switch iline := iline.(type) { - case string: - sline = iline - case int, uint, int32, int64, uint32, uint64: - sline = fmt.Sprint(iline) - } - if sline != "" { - callContextParts = append(callContextParts, fmt.Sprint(sline)) - } - } - callContextText := strings.Join(callContextParts, ":") - callContext := colorScheme.CallContextColor(callContextText) - if callContext != "" { - callContext = " " + callContext - } - - if f.DisableTimestamp { - if hasPriority { - str := fmt.Sprintf("%s%s%s"+messageFormat, levelText, callContextText, prefixText, message) - fmt.Fprint(b, colorScheme.CriticalColor(str)) - } else { - fmt.Fprintf(b, "%s%s%s"+messageFormat, level, callContext, prefix, message) - } - } else { - var timestamp string - if !f.FullTimestamp { - timestamp = fmt.Sprintf("[%04d]", miniTS()) - } else { - timestamp = fmt.Sprintf("[%s]", entry.Time.Format(timestampFormat)) - } - - coloredTimestamp := colorScheme.TimestampColor(timestamp) - - if hasPriority { - str := fmt.Sprintf("%s %s%s%s"+messageFormat, timestamp, levelText, callContextText, prefixText, message) - fmt.Fprint(b, colorScheme.CriticalColor(str)) - } else { - fmt.Fprintf(b, "%s %s%s%s"+messageFormat, coloredTimestamp, level, callContext, prefix, message) - } - } - - for _, k := range keys { - if k != "prefix" && k != "file" && k != "func" && k != "line" && k != logPriorityKey && k != logModuleKey { - v := entry.Data[k] - fmt.Fprintf(b, " %s", f.formatKeyValue(levelColor(k), v)) - } - } -} - -func (f *TextFormatter) needsQuoting(text string) bool { - if len(text) == 0 { - return f.QuoteEmptyFields - } - - if f.AlwaysQuoteStrings { - return true - } - - for _, ch := range text { - if !((ch >= 'a' && ch <= 'z') || - (ch >= 'A' && ch <= 'Z') || - (ch >= '0' && ch <= '9') || - ch == '-' || ch == '.') { - return true - } - } - - return false -} - -func extractPrefix(e *logrus.Entry) string { - var module string - if iModule, ok := e.Data[logModuleKey]; ok { - module, _ = iModule.(string) - } - - var priority string - if iPriority, ok := e.Data[logPriorityKey]; ok { - priority, _ = iPriority.(string) - } - - switch { - case priority == "": - return fmt.Sprintf("[%s]", module) - case module == "": - return fmt.Sprintf("[%s]", priority) - default: - return fmt.Sprintf("[%s:%s]", module, priority) - } -} - -func (f *TextFormatter) formatKeyValue(key string, value interface{}) string { - return fmt.Sprintf("%s=%s", key, f.formatValue(value)) -} - -func (f *TextFormatter) formatValue(value interface{}) string { - switch value := value.(type) { - case string: - if f.needsQuoting(value) { - return fmt.Sprintf("%s%+v%s", f.QuoteCharacter, value, f.QuoteCharacter) - } - return value - case error: - errmsg := value.Error() - if f.needsQuoting(errmsg) { - return fmt.Sprintf("%s%+v%s", f.QuoteCharacter, errmsg, f.QuoteCharacter) - } - return errmsg - default: - return fmt.Sprintf("%+v", value) - } -} - -func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}, appendSpace bool) { - b.WriteString(key) //nolint:gosec - b.WriteByte('=') //nolint:gosec - f.appendValue(b, value) //nolint:gosec - - if appendSpace { - b.WriteByte(' ') //nolint:gosec - } -} - -func (f *TextFormatter) appendValue(b *bytes.Buffer, value interface{}) { - switch value := value.(type) { - case string: - if f.needsQuoting(value) { - fmt.Fprintf(b, "%s%+v%s", f.QuoteCharacter, value, f.QuoteCharacter) - } else { - b.WriteString(value) //nolint:gosec - } - case error: - errmsg := value.Error() - if f.needsQuoting(errmsg) { - fmt.Fprintf(b, "%s%+v%s", f.QuoteCharacter, errmsg, f.QuoteCharacter) - } else { - b.WriteString(errmsg) //nolint:gosec - } - default: - fmt.Fprint(b, value) - } -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/logging/hooks.go b/vendor/github.com/skycoin/skywire-utilities/pkg/logging/hooks.go deleted file mode 100644 index 8a74fbf2b6..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/logging/hooks.go +++ /dev/null @@ -1,45 +0,0 @@ -// Package logging pkg/logging/hooks.go -package logging - -import ( - "io" - - "github.com/sirupsen/logrus" -) - -// WriteHook is a logrus.Hook that logs to an io.Writer -type WriteHook struct { - w io.Writer - formatter logrus.Formatter -} - -// NewWriteHook returns a new WriteHook -func NewWriteHook(w io.Writer) *WriteHook { - return &WriteHook{ - w: w, - formatter: &TextFormatter{ - DisableColors: true, - FullTimestamp: true, - AlwaysQuoteStrings: true, - QuoteEmptyFields: true, - ForceFormatting: true, - }, - } -} - -// Levels returns Levels accepted by the WriteHook. -// All logrus.Levels are returned. -func (f *WriteHook) Levels() []logrus.Level { - return logrus.AllLevels -} - -// Fire writes a logrus.Entry to the file -func (f *WriteHook) Fire(e *logrus.Entry) error { - b, err := f.formatter.Format(e) - if err != nil { - return err - } - - _, err = f.w.Write(b) - return err -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/logging/logger.go b/vendor/github.com/skycoin/skywire-utilities/pkg/logging/logger.go deleted file mode 100644 index 5f2f3f13a4..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/logging/logger.go +++ /dev/null @@ -1,69 +0,0 @@ -// Package logging pkg/logging/logger.go -package logging - -import ( - "os" - "time" - - "github.com/sirupsen/logrus" -) - -// Logger wraps logrus.FieldLogger -type Logger struct { - logrus.FieldLogger -} - -// Critical adds special critical-level fields for specially highlighted logging, -// since logrus lacks a distinct critical field and does not have configurable log levels -func (logger *Logger) Critical() logrus.FieldLogger { - return logger.WithField(logPriorityKey, logPriorityCritical) -} - -// WithTime overrides time, used by logger. -func (logger *Logger) WithTime(t time.Time) *logrus.Entry { - return logger.WithFields(logrus.Fields{}).WithTime(t) -} - -// MasterLogger wraps logrus.Logger and is able to create new package-aware loggers -type MasterLogger struct { - *logrus.Logger -} - -// NewMasterLogger creates a new package-aware logger with formatting string -func NewMasterLogger() *MasterLogger { - hooks := make(logrus.LevelHooks) - - return &MasterLogger{ - Logger: &logrus.Logger{ - Out: os.Stdout, - Formatter: &TextFormatter{ - FullTimestamp: true, - AlwaysQuoteStrings: true, - QuoteEmptyFields: true, - ForceFormatting: true, - DisableColors: false, - ForceColors: false, - TimestampFormat: "2006-01-02T15:04:05.999999999Z07:00", - }, - Hooks: hooks, - Level: logrus.DebugLevel, - }, - } -} - -// PackageLogger instantiates a package-aware logger -func (logger *MasterLogger) PackageLogger(moduleName string) *Logger { - return &Logger{ - FieldLogger: logger.WithField(logModuleKey, moduleName), - } -} - -// EnableColors enables colored logging -func (logger *MasterLogger) EnableColors() { - logger.Formatter.(*TextFormatter).DisableColors = false -} - -// DisableColors disables colored logging -func (logger *MasterLogger) DisableColors() { - logger.Formatter.(*TextFormatter).DisableColors = true -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/logging/logging.go b/vendor/github.com/skycoin/skywire-utilities/pkg/logging/logging.go deleted file mode 100644 index cd0d2a352e..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/logging/logging.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Package logging provides application logging utilities -*/ -package logging - -import ( - "errors" - "io" - "strings" - - "github.com/sirupsen/logrus" -) - -var log = NewMasterLogger() - -const ( - // logModuleKey is the key used for the module name data entry - logModuleKey = "_module" - // logPriorityKey is the log entry key for priority log statements - logPriorityKey = "_priority" - // logPriorityCritical is the log entry value for priority log statements - logPriorityCritical = "CRITICAL" -) - -// LevelFromString returns a logrus.Level from a string identifier -func LevelFromString(s string) (logrus.Level, error) { - switch strings.ToLower(s) { - case "debug": - return logrus.DebugLevel, nil - case "info", "notice": - return logrus.InfoLevel, nil - case "warn", "warning": - return logrus.WarnLevel, nil - case "error": - return logrus.ErrorLevel, nil - case "fatal", "critical": - return logrus.FatalLevel, nil - case "panic": - return logrus.PanicLevel, nil - case "trace": - return logrus.TraceLevel, nil - default: - return logrus.DebugLevel, errors.New("could not convert string to log level") - } -} - -// MustGetLogger returns a package-aware logger from the master logger -func MustGetLogger(module string) *Logger { - return log.PackageLogger(module) -} - -// AddHook adds a hook to the global logger -func AddHook(hook logrus.Hook) { - log.AddHook(hook) -} - -// EnableColors enables colored logging -func EnableColors() { - log.EnableColors() -} - -// DisableColors disables colored logging -func DisableColors() { - log.DisableColors() -} - -// SetLevel sets the logger's minimum log level -func SetLevel(level logrus.Level) { - log.SetLevel(level) -} - -// GetLevel returns the logger level -func GetLevel() logrus.Level { - return log.GetLevel() -} - -// SetOutputTo sets the logger's output to an io.Writer -func SetOutputTo(w io.Writer) { - log.Out = w -} - -// Disable disables the logger completely -func Disable() { - log.Out = io.Discard -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/http.go b/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/http.go deleted file mode 100644 index 2515cdabf7..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/http.go +++ /dev/null @@ -1,39 +0,0 @@ -// Package metricsutil pkg/metricsutil/http.go -package metricsutil - -import ( - "net/http" - - "github.com/VictoriaMetrics/metrics" - "github.com/go-chi/chi/v5" - "github.com/go-chi/chi/v5/middleware" - "github.com/sirupsen/logrus" -) - -// AddMetricsHandler adds a prometheus-format Handle at '/metrics' to the provided serve mux. -func AddMetricsHandler(mux *chi.Mux) { - mux.HandleFunc("/metrics", func(w http.ResponseWriter, r *http.Request) { - metrics.WritePrometheus(w, true) - }) -} - -// ServeHTTPMetrics starts serving metrics on a given `addr`. -func ServeHTTPMetrics(log logrus.FieldLogger, addr string) { - if addr == "" { - return - } - - r := chi.NewRouter() - - r.Use(middleware.RequestID) - r.Use(middleware.RealIP) - r.Use(middleware.Logger) - r.Use(middleware.Recoverer) - - AddMetricsHandler(r) - - log.WithField("addr", addr).Info("Serving metrics.") - go func() { - log.Fatal(http.ListenAndServe(addr, r)) //nolint - }() -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/request_duration_middleware.go b/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/request_duration_middleware.go deleted file mode 100644 index 050c7878cc..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/request_duration_middleware.go +++ /dev/null @@ -1,26 +0,0 @@ -// Package metricsutil pkg/metricsutil/request_duration_middleware.go -package metricsutil - -import ( - "fmt" - "net/http" - "time" - - "github.com/VictoriaMetrics/metrics" -) - -// RequestDurationMiddleware is a request duration tracking middleware. -func RequestDurationMiddleware(next http.Handler) http.Handler { - fn := func(w http.ResponseWriter, r *http.Request) { - srw := NewStatusResponseWriter(w) - - reqStart := time.Now() - next.ServeHTTP(srw, r) - reqDuration := time.Since(reqStart) - - hName := fmt.Sprintf("vm_request_duration{code=\"%d\", method=\"%s\"}", srw.StatusCode(), r.Method) - metrics.GetOrCreateHistogram(hName).Update(reqDuration.Seconds()) - } - - return http.HandlerFunc(fn) -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/requests_in_flight_count_middleware.go b/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/requests_in_flight_count_middleware.go deleted file mode 100644 index 204edae914..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/requests_in_flight_count_middleware.go +++ /dev/null @@ -1,30 +0,0 @@ -// Package metricsutil pkg/metricsutil/requests_in_flight_count_middleware.go -package metricsutil - -import ( - "net/http" -) - -// RequestsInFlightCountMiddleware is a middleware to track current requests-in-flight count. -type RequestsInFlightCountMiddleware struct { - reqsInFlightGauge *VictoriaMetricsIntGaugeWrapper -} - -// NewRequestsInFlightCountMiddleware constructs `RequestsInFlightCountMiddleware`. -func NewRequestsInFlightCountMiddleware() *RequestsInFlightCountMiddleware { - return &RequestsInFlightCountMiddleware{ - reqsInFlightGauge: NewVictoriaMetricsIntGauge("vm_request_ongoing_count"), - } -} - -// Handle adds to the requests count during request serving. -func (m *RequestsInFlightCountMiddleware) Handle(next http.Handler) http.Handler { - fn := func(w http.ResponseWriter, r *http.Request) { - m.reqsInFlightGauge.Inc() - defer m.reqsInFlightGauge.Dec() - - next.ServeHTTP(w, r) - } - - return http.HandlerFunc(fn) -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/status_response_writer.go b/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/status_response_writer.go deleted file mode 100644 index 578de43170..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/status_response_writer.go +++ /dev/null @@ -1,35 +0,0 @@ -// Package metricsutil pkg/metricsutil/status_response_writer.go -package metricsutil - -import "net/http" - -// StatusResponseWriter wraps `http.ResponseWriter` but stores status code -// on call to `WriteHeader`. -type StatusResponseWriter struct { - http.ResponseWriter - statusCode int -} - -// NewStatusResponseWriter wraps `http.ResponseWriter` constructing `StatusResponseWriter`. -func NewStatusResponseWriter(w http.ResponseWriter) *StatusResponseWriter { - return &StatusResponseWriter{ - ResponseWriter: w, - } -} - -// WriteHeader implements `http.ResponseWriter` storing the written status code. -func (w *StatusResponseWriter) WriteHeader(statusCode int) { - w.statusCode = statusCode - w.ResponseWriter.WriteHeader(statusCode) -} - -// StatusCode gets status code from the writer. -func (w *StatusResponseWriter) StatusCode() int { - if w.statusCode == 0 { - // this is case when `WriteHeader` wasn't called explicitly, - // so we consider it 200 - return http.StatusOK - } - - return w.statusCode -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/victoria_metrics_int_gauge_wrapper.go b/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/victoria_metrics_int_gauge_wrapper.go deleted file mode 100644 index 27f46b0bb9..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/victoria_metrics_int_gauge_wrapper.go +++ /dev/null @@ -1,46 +0,0 @@ -// Package metricsutil pkg/metricsutil/victoria_metrics_int_gauge_wrapper.go -package metricsutil - -import ( - "sync/atomic" - - "github.com/VictoriaMetrics/metrics" -) - -// VictoriaMetricsIntGaugeWrapper wraps Victoria Metrics int gauge encapsulating all the -// needed logic to control the value. -type VictoriaMetricsIntGaugeWrapper struct { - val int64 - gauge *metrics.Gauge -} - -// NewVictoriaMetricsIntGauge constructs new wrapper for Victoria Metric int gauge with -// the name `name`. -func NewVictoriaMetricsIntGauge(name string) *VictoriaMetricsIntGaugeWrapper { - var w VictoriaMetricsIntGaugeWrapper - w.gauge = metrics.GetOrCreateGauge(name, func() float64 { - return float64(w.Val()) - }) - - return &w -} - -// Inc increments gauge value. -func (w *VictoriaMetricsIntGaugeWrapper) Inc() { - atomic.AddInt64(&w.val, 1) -} - -// Dec decrements gauge value. -func (w *VictoriaMetricsIntGaugeWrapper) Dec() { - atomic.AddInt64(&w.val, -1) -} - -// Set sets gauge value. -func (w *VictoriaMetricsIntGaugeWrapper) Set(val int64) { - atomic.StoreInt64(&w.val, val) -} - -// Val gets gauge value. -func (w *VictoriaMetricsIntGaugeWrapper) Val() int64 { - return atomic.LoadInt64(&w.val) -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/victoria_metrics_uint_gauge_wrapper.go b/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/victoria_metrics_uint_gauge_wrapper.go deleted file mode 100644 index 42254f1ce9..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/metricsutil/victoria_metrics_uint_gauge_wrapper.go +++ /dev/null @@ -1,46 +0,0 @@ -// Package metricsutil pkg/metricsutil/victoria_metrics_uint_gauge_wrapper.go -package metricsutil - -import ( - "sync/atomic" - - "github.com/VictoriaMetrics/metrics" -) - -// VictoriaMetricsUintGaugeWrapper wraps Victoria Metrics int gauge encapsulating all the -// needed logic to control the value. -type VictoriaMetricsUintGaugeWrapper struct { - val uint64 - gauge *metrics.Gauge -} - -// NewVictoriaMetricsUintGauge constructs new wrapper for Victoria Metric int gauge with -// the name `name`. -func NewVictoriaMetricsUintGauge(name string) *VictoriaMetricsUintGaugeWrapper { - var w VictoriaMetricsUintGaugeWrapper - w.gauge = metrics.GetOrCreateGauge(name, func() float64 { - return float64(w.Val()) - }) - - return &w -} - -// Inc increments gauge value. -func (w *VictoriaMetricsUintGaugeWrapper) Inc() { - atomic.AddUint64(&w.val, 1) -} - -// Dec decrements gauge value. -func (w *VictoriaMetricsUintGaugeWrapper) Dec() { - atomic.AddUint64(&w.val, ^uint64(0)) -} - -// Set sets gauge value. -func (w *VictoriaMetricsUintGaugeWrapper) Set(val uint64) { - atomic.StoreUint64(&w.val, val) -} - -// Val gets gauge value. -func (w *VictoriaMetricsUintGaugeWrapper) Val() uint64 { - return atomic.LoadUint64(&w.val) -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/copy.go b/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/copy.go deleted file mode 100644 index 0fd7dbb43e..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/copy.go +++ /dev/null @@ -1,37 +0,0 @@ -// Package netutil pkg/netutil/copy.go -package netutil - -import ( - "io" -) - -// CopyReadWriteCloser copies reads and writes between two connections. -// It returns when a connection returns an error. -func CopyReadWriteCloser(conn1, conn2 io.ReadWriteCloser) error { - errCh1 := make(chan error, 1) - go func() { - _, err := io.Copy(conn2, conn1) - errCh1 <- err - close(errCh1) - }() - - errCh2 := make(chan error, 1) - go func() { - _, err := io.Copy(conn1, conn2) - errCh2 <- err - close(errCh2) - }() - - select { - case err := <-errCh1: - _ = conn1.Close() //nolint:errcheck - _ = conn2.Close() //nolint:errcheck - <-errCh2 - return err - case err := <-errCh2: - _ = conn2.Close() //nolint:errcheck - _ = conn1.Close() //nolint:errcheck - <-errCh1 - return err - } -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net.go b/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net.go deleted file mode 100644 index f629b999e7..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net.go +++ /dev/null @@ -1,176 +0,0 @@ -// Package netutil pkg/netutil/net.go -package netutil - -import ( - "fmt" - "io" - "net" - "net/http" -) - -// LocalNetworkInterfaceIPs gets IPs of all local interfaces. -func LocalNetworkInterfaceIPs() ([]net.IP, error) { - ips, _, err := localNetworkInterfaceIPs("") - return ips, err -} - -// NetworkInterfaceIPs gets IPs of network interface with name `name`. -func NetworkInterfaceIPs(name string) ([]net.IP, error) { - _, ifcIPs, err := localNetworkInterfaceIPs(name) - return ifcIPs, err -} - -// localNetworkInterfaceIPs gets IPs of all local interfaces. Separately returns list of IPs -// of interface `ifcName`. -func localNetworkInterfaceIPs(ifcName string) ([]net.IP, []net.IP, error) { - var ifcIPs []net.IP - - ifaces, err := net.Interfaces() - if err != nil { - return nil, nil, fmt.Errorf("error getting network interfaces: %w", err) - } - - var ips []net.IP - for _, iface := range ifaces { - if iface.Flags&net.FlagUp == 0 { - continue // interface down - } - if iface.Flags&net.FlagLoopback != 0 { - continue // loopback interface - } - - addrs, err := iface.Addrs() - if err != nil { - return nil, nil, fmt.Errorf("error getting addresses for interface %s: %w", iface.Name, err) - } - - for _, addr := range addrs { - var ip net.IP - switch v := addr.(type) { - case *net.IPNet: - ip = v.IP - case *net.IPAddr: - ip = v.IP - } - - if ip == nil || ip.IsLoopback() { - continue - } - - ip = ip.To4() - if ip == nil { - continue // not an ipv4 address - } - - ips = append(ips, ip) - - if ifcName != "" && iface.Name == ifcName { - ifcIPs = append(ifcIPs, ip) - } - } - } - - return ips, ifcIPs, nil -} - -// IsPublicIP returns true if the provided IP is public. -// Obtained from: https://stackoverflow.com/questions/41670155/get-public-ip-in-golang -func IsPublicIP(IP net.IP) bool { - if IP.IsLoopback() || IP.IsLinkLocalMulticast() || IP.IsLinkLocalUnicast() { - return false - } - if ip4 := IP.To4(); ip4 != nil { - switch { - case ip4[0] == 10: - return false - case ip4[0] == 172 && ip4[1] >= 16 && ip4[1] <= 31: - return false - case ip4[0] == 192 && ip4[1] == 168: - return false - default: - return true - } - } - return false -} - -// DefaultNetworkInterfaceIPs returns IP addresses for the default network interface -func DefaultNetworkInterfaceIPs() ([]net.IP, error) { - networkIfc, err := DefaultNetworkInterface() - if err != nil { - return nil, fmt.Errorf("failed to get default network interface: %w", err) - } - localIPs, err := NetworkInterfaceIPs(networkIfc) - if err != nil { - return nil, fmt.Errorf("failed to get IPs of %s: %w", networkIfc, err) - } - return localIPs, nil -} - -// HasPublicIP returns true if this machine has at least one -// publically available IP address -func HasPublicIP() (bool, error) { - localIPs, err := LocalNetworkInterfaceIPs() - if err != nil { - return false, err - } - for _, IP := range localIPs { - if IsPublicIP(IP) { - return true, nil - } - } - return false, nil -} - -// ExtractPort returns port of the given UDP or TCP address -func ExtractPort(addr net.Addr) (uint16, error) { - switch address := addr.(type) { - case *net.TCPAddr: - return uint16(address.Port), nil - case *net.UDPAddr: - return uint16(address.Port), nil - default: - return 0, fmt.Errorf("extract port: invalid address: %s", addr.String()) - } -} - -// LocalAddresses returns a list of all local addresses -func LocalAddresses() ([]string, error) { - result := make([]string, 0) - - addresses, err := net.InterfaceAddrs() - if err != nil { - return nil, err - } - - for _, addr := range addresses { - switch v := addr.(type) { - case *net.IPNet: - if v.IP.IsGlobalUnicast() || v.IP.IsLoopback() { - result = append(result, v.IP.String()) - } - case *net.IPAddr: - if v.IP.IsGlobalUnicast() || v.IP.IsLoopback() { - result = append(result, v.IP.String()) - } - } - } - - return result, nil -} - -// LocalProtocol check a condition to use dmsghttp or direct url -func LocalProtocol() bool { - resp, err := http.Get("https://ipinfo.io/country") - if err != nil { - return false - } - respBody, err := io.ReadAll(resp.Body) - if err != nil { - return false - } - if string(respBody)[:2] == "CN" { - return true - } - return false -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net_darwin.go b/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net_darwin.go deleted file mode 100644 index aaf2bd554f..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net_darwin.go +++ /dev/null @@ -1,28 +0,0 @@ -//go:build darwin -// +build darwin - -// Package netutil pkg/netutil/net_darwin.go -package netutil - -import ( - "bytes" - "fmt" - "os/exec" -) - -const ( - defaultNetworkInterfaceCMD = "route -n get default | awk 'FNR == 5 {print $2}'" -) - -// DefaultNetworkInterface fetches default network interface name. -func DefaultNetworkInterface() (string, error) { - outputBytes, err := exec.Command("sh", "-c", defaultNetworkInterfaceCMD).Output() - if err != nil { - return "", fmt.Errorf("error running command %s: %w", defaultNetworkInterfaceCMD, err) - } - - // just in case - outputBytes = bytes.TrimRight(outputBytes, "\n") - - return string(outputBytes), nil -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net_linux.go b/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net_linux.go deleted file mode 100644 index a913df824a..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net_linux.go +++ /dev/null @@ -1,28 +0,0 @@ -//go:build linux -// +build linux - -// Package netutil pkg/netutil/net_linux.go -package netutil - -import ( - "bytes" - "fmt" - "os/exec" -) - -const ( - defaultNetworkInterfaceCMD = "ip r | awk '$1 == \"default\" {print $5}'" -) - -// DefaultNetworkInterface fetches default network interface name. -func DefaultNetworkInterface() (string, error) { - outputBytes, err := exec.Command("sh", "-c", defaultNetworkInterfaceCMD).Output() - if err != nil { - return "", fmt.Errorf("error running command %s: %w", defaultNetworkInterfaceCMD, err) - } - - // just in case - outputBytes = bytes.TrimRight(outputBytes, "\n") - - return string(outputBytes), nil -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net_windows.go b/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net_windows.go deleted file mode 100644 index 0217fbb78f..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/net_windows.go +++ /dev/null @@ -1,58 +0,0 @@ -//go:build windows -// +build windows - -// Package netutil pkg/netutil/net_windows.go -package netutil - -import ( - "errors" - "fmt" - "net" - "os/exec" - "regexp" - "strings" -) - -const ( - defaultNetworkInterfaceCMD = `netsh int ip show config | findstr /r "IP Address.*([0-9]{1,3}\.|){4}"` -) - -// DefaultNetworkInterface fetches default network interface name. -func DefaultNetworkInterface() (string, error) { - cmd := exec.Command("powershell", defaultNetworkInterfaceCMD) - output, err := cmd.Output() - if err != nil { - return "", err - } - // parse output - splitLines := strings.Split(string(output), "\n") - var ips []string - - if len(splitLines) > 0 { - re := regexp.MustCompile(`\s+`) - for _, line := range splitLines { - ipAddr := re.Split(strings.TrimSpace(line), -1) - - if len(ipAddr) > 2 { - ip := net.ParseIP(ipAddr[2]) - if ip != nil && !ip.IsLoopback() { - ips = append(ips, ipAddr[2]) - } - } - } - } - - if len(ips) == 0 { - return "", errors.New("no active ip found") - } - - // get default network interface based on its ip - findInterfaceCmd := fmt.Sprintf("Get-NetIpAddress -IPAddress '%s' | %%{$_.InterfaceAlias}", ips[0]) - cmd = exec.Command("powershell", findInterfaceCmd) // nolint:gosec - output, err = cmd.Output() - if err != nil { - return "", fmt.Errorf("unable to get default interface: %v", err) - } - - return strings.TrimSpace(string(output)), nil -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/porter.go b/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/porter.go deleted file mode 100644 index 031d7853a5..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/porter.go +++ /dev/null @@ -1,200 +0,0 @@ -// Package netutil pkg/netutil/porter.go -package netutil - -import ( - "context" - "io" - "sync" - - "github.com/sirupsen/logrus" -) - -const ( - // PorterMinEphemeral is the default minimum ephemeral port. - PorterMinEphemeral = uint16(49152) -) - -// PorterValue associates a port value alongside it's children. -type PorterValue struct { - Value interface{} - Children map[uint16]interface{} -} - -// Porter reserves ports. -type Porter struct { - sync.RWMutex - eph uint16 // current ephemeral value - minEph uint16 // minimal ephemeral port value - ports map[uint16]PorterValue -} - -// NewPorter creates a new Porter with a given minimum ephemeral port value. -func NewPorter(minEph uint16) *Porter { - ports := make(map[uint16]PorterValue) - ports[0] = PorterValue{} // port 0 is invalid - - return &Porter{ - eph: minEph, - minEph: minEph, - ports: ports, - } -} - -// Reserve a given port. -// It returns a boolean informing whether the port is reserved, and a function to clear the reservation. -func (p *Porter) Reserve(port uint16, v interface{}) (bool, func()) { - p.Lock() - defer p.Unlock() - - if _, ok := p.ports[port]; ok { - return false, nil - } - p.ports[port] = PorterValue{ - Value: v, - } - return true, p.makePortFreer(port) -} - -// ReserveChild reserves a child. -func (p *Porter) ReserveChild(port, subPort uint16, v interface{}) (bool, func()) { - p.Lock() - defer p.Unlock() - - pv, ok := p.ports[port] - if !ok { - return false, nil - } - if pv.Children == nil { - pv.Children = make(map[uint16]interface{}, 1) - } else if _, ok := pv.Children[subPort]; ok { - return false, nil - } - - pv.Children[subPort] = v - p.ports[port] = pv - return true, p.makeChildFreer(port, subPort) -} - -// ReserveEphemeral reserves a new ephemeral port. -// It returns the reserved ephemeral port, a function to clear the reservation and an error (if any). -func (p *Porter) ReserveEphemeral(ctx context.Context, v interface{}) (uint16, func(), error) { - p.Lock() - defer p.Unlock() - - for { - p.eph++ - if p.eph < p.minEph { - p.eph = p.minEph - } - if _, ok := p.ports[p.eph]; ok { - select { - case <-ctx.Done(): - return 0, nil, ctx.Err() - default: - continue - } - } - p.ports[p.eph] = PorterValue{Value: v} - return p.eph, p.makePortFreer(p.eph), nil - } -} - -// PortValue returns the value stored under a given port. -func (p *Porter) PortValue(port uint16) (interface{}, bool) { - p.RLock() - defer p.RUnlock() - - v, ok := p.ports[port] - return v.Value, ok -} - -// RangePortValues ranges all ports that are currently reserved. -func (p *Porter) RangePortValues(fn func(port uint16, v interface{}) (next bool)) { - p.RLock() - defer p.RUnlock() - - for port, v := range p.ports { - if next := fn(port, v.Value); !next { - return - } - } -} - -// RangePortValuesAndChildren ranges port values and it's contained children. -func (p *Porter) RangePortValuesAndChildren(fn func(port uint16, v PorterValue) (next bool)) { - p.RLock() - defer p.RUnlock() - - for port, v := range p.ports { - if next := fn(port, v); !next { - return - } - } -} - -// This returns a function that frees a given port (if there are no children). -// It is ensured that the function's action is only performed once. -func (p *Porter) makePortFreer(port uint16) func() { - once := new(sync.Once) - - action := func() { - p.Lock() - defer p.Unlock() - - // If port still has children, only clear the port value. - if v, ok := p.ports[port]; ok && len(v.Children) > 0 { - v.Value = nil - p.ports[port] = v - return - } - - delete(p.ports, port) - } - - return func() { once.Do(action) } -} - -func (p *Porter) makeChildFreer(port, subPort uint16) func() { - once := new(sync.Once) - - action := func() { - p.Lock() - defer p.Unlock() - - if v, ok := p.ports[port]; ok && v.Children != nil { - delete(v.Children, subPort) - - // Also delete the ensure port entry if port value is nil and there is no more children. - if v.Value == nil && len(v.Children) == 0 { - delete(p.ports, port) - } - } - } - - return func() { once.Do(action) } -} - -// CloseAll closes all contained variables that implement io.Closer -func (p *Porter) CloseAll(log logrus.FieldLogger) { - if log == nil { - log = logrus.New() - } - - wg := new(sync.WaitGroup) - p.Lock() - for _, v := range p.ports { - if c, ok := v.Value.(io.Closer); ok { - - wg.Add(1) - go func(c io.Closer) { - if err := c.Close(); err != nil { - log.WithError(err). - Debug("On (*netutil.Porter).CloseAll(), closing contained value resulted in error.") - } - wg.Done() - }(c) - } - } - p.Unlock() - wg.Wait() -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/retrier.go b/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/retrier.go deleted file mode 100644 index a3648fac8f..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/netutil/retrier.go +++ /dev/null @@ -1,101 +0,0 @@ -// Package netutil pkg/netutil/retrier.go -package netutil - -import ( - "context" - "errors" - "fmt" - "time" - - "github.com/sirupsen/logrus" -) - -// Package errors -var ( - ErrMaximumRetriesReached = errors.New("maximum retries attempted without success") -) - -// Default values for retrier. -const ( - DefaultInitBackoff = time.Second - DefaultMaxBackoff = time.Second * 20 - DefaultTries = int64(0) - DefaultFactor = float64(1.3) -) - -// RetryFunc is a function used as argument of (*Retrier).Do(), which will retry on error unless it is whitelisted -type RetryFunc func() error - -// Retrier holds a configuration for how retries should be performed -type Retrier struct { - initBO time.Duration // initial backoff duration - maxBO time.Duration // maximum backoff duration - tries int64 // number of times the given function is to be retried until success, if 0 it will be retried forever until success - factor float64 // multiplier for the backoff duration that is applied on every retry - errWl map[error]struct{} // list of errors which will always trigger retirer to return - log logrus.FieldLogger -} - -// NewRetrier returns a retrier that is ready to call Do() method -func NewRetrier(log logrus.FieldLogger, initBO, maxBO time.Duration, tries int64, factor float64) *Retrier { - if log != nil { - log = log.WithField("func", "retrier") - } - return &Retrier{ - initBO: initBO, - maxBO: maxBO, - tries: tries, - factor: factor, - errWl: make(map[error]struct{}), - log: log, - } -} - -// NewDefaultRetrier creates a retrier with default values. -func NewDefaultRetrier(log logrus.FieldLogger) *Retrier { - return NewRetrier(log, DefaultInitBackoff, DefaultMaxBackoff, DefaultTries, DefaultFactor) -} - -// WithErrWhitelist sets a list of errors into the retrier, if the RetryFunc provided to Do() fails with one of them it will return inmediatelly with such error. Calling -// this function is not thread-safe, and is advised to only use it when initializing the Retrier -func (r *Retrier) WithErrWhitelist(errors ...error) *Retrier { - for _, err := range errors { - r.errWl[err] = struct{}{} - } - return r -} - -// Do takes a RetryFunc and attempts to execute it. -// If it fails with an error it will be retried a maximum of given times with an initBO -// until it returns nil or an error that is whitelisted -func (r *Retrier) Do(ctx context.Context, f RetryFunc) error { - bo := r.initBO - - t := time.NewTimer(bo) - defer t.Stop() - - for i := int64(0); r.tries == 0 || i < r.tries; i++ { - if err := f(); err != nil { - if _, ok := r.errWl[err]; ok { - return err - } - if newBO := time.Duration(float64(bo) * r.factor); r.maxBO == 0 || newBO <= r.maxBO { - bo = newBO - } - select { - case <-t.C: - if r.log != nil { - r.log.WithError(err).WithField("current_backoff", bo).Warn("Retrying...") - } else { - fmt.Printf("func = retrier, current_backoff = %v Retrying...\n", bo) - } - t.Reset(bo) - continue - case <-ctx.Done(): - return ctx.Err() - } - } - return nil - } - return ErrMaximumRetriesReached -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/networkmonitor/networkmonitor.go b/vendor/github.com/skycoin/skywire-utilities/pkg/networkmonitor/networkmonitor.go deleted file mode 100644 index fc246166fa..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/networkmonitor/networkmonitor.go +++ /dev/null @@ -1,21 +0,0 @@ -// Package networkmonitor pkg/networkmonitor/networkmonitor.go -package networkmonitor - -// WhitelistPKs store whitelisted keys of network monitor -type WhitelistPKs map[string]struct{} - -// GetWhitelistPKs returns the stuct WhitelistPKs -func GetWhitelistPKs() WhitelistPKs { - return make(WhitelistPKs) -} - -// Set sets the whitelist with the given pk in the struct -func (wl WhitelistPKs) Set(nmPkString string) { - wl[nmPkString] = struct{}{} -} - -// Get gets the pk from the whitelist -func (wl WhitelistPKs) Get(nmPkString string) bool { - _, ok := wl[nmPkString] - return ok -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/storeconfig/storeconfig.go b/vendor/github.com/skycoin/skywire-utilities/pkg/storeconfig/storeconfig.go deleted file mode 100644 index 8924398e80..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/storeconfig/storeconfig.go +++ /dev/null @@ -1,39 +0,0 @@ -// Package storeconfig pkg/storeconfig/storeconfig.go -package storeconfig - -import "os" - -// Type is a config type. -type Type int - -// Type may be either in-memory or Redis. -const ( - Memory Type = iota - Redis -) - -// Config defines a store configuration. -type Config struct { - Type Type - URL string `json:"url"` - Password string `json:"password"` - PoolSize int `json:"pool_size"` -} - -const redisPasswordEnvName = "REDIS_PASSWORD" - -const ( - pgUser = "PG_USER" - pgPassword = "PG_PASSWORD" - pgDatabase = "PG_DATABASE" -) - -// RedisPassword returns Redis password which is read from an environment variable. -func RedisPassword() string { - return os.Getenv(redisPasswordEnvName) -} - -// PostgresCredential return prostgres credential needed on services -func PostgresCredential() (string, string, string) { - return os.Getenv(pgUser), os.Getenv(pgPassword), os.Getenv(pgDatabase) -} diff --git a/vendor/github.com/skycoin/skywire-utilities/pkg/tcpproxy/http.go b/vendor/github.com/skycoin/skywire-utilities/pkg/tcpproxy/http.go deleted file mode 100644 index 51ce30c923..0000000000 --- a/vendor/github.com/skycoin/skywire-utilities/pkg/tcpproxy/http.go +++ /dev/null @@ -1,24 +0,0 @@ -// Package tcpproxy pkg/tcpproxy/tcpproxy.go -package tcpproxy - -import ( - "net" - "net/http" - - proxyproto "github.com/pires/go-proxyproto" -) - -// ListenAndServe starts http server with tcp proxy support -func ListenAndServe(addr string, handler http.Handler) error { - srv := &http.Server{Addr: addr, Handler: handler} //nolint - if addr == "" { - addr = ":http" - } - ln, err := net.Listen("tcp", addr) - if err != nil { - return err - } - proxyListener := &proxyproto.Listener{Listener: ln} - defer proxyListener.Close() // nolint:errcheck - return srv.Serve(proxyListener) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 2c3ff26507..2837e4e69a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -523,8 +523,8 @@ github.com/shopspring/decimal ## explicit; go 1.13 github.com/sirupsen/logrus github.com/sirupsen/logrus/hooks/syslog -# github.com/skycoin/dmsg v1.3.29-0.20241019182716-022283c93835 -## explicit; go 1.22 +# github.com/skycoin/dmsg v1.3.29-0.20241217193208-d32ec623e670 +## explicit; go 1.23 github.com/skycoin/dmsg/cmd/dmsg-discovery/commands github.com/skycoin/dmsg/cmd/dmsg-server/commands github.com/skycoin/dmsg/cmd/dmsg-server/commands/config @@ -617,15 +617,15 @@ github.com/skycoin/skycoin/src/wallet/bip44wallet github.com/skycoin/skycoin/src/wallet/collection github.com/skycoin/skycoin/src/wallet/deterministic github.com/skycoin/skycoin/src/wallet/xpubwallet -# github.com/skycoin/skycoin-service-discovery v1.3.29-0.20241019190420-233c2d68bce0 -## explicit; go 1.22.0 +# github.com/skycoin/skycoin-service-discovery v1.3.29-0.20241217194518-634b05d94b2e +## explicit; go 1.23 github.com/skycoin/skycoin-service-discovery/cmd/service-discovery/commands github.com/skycoin/skycoin-service-discovery/internal/pg github.com/skycoin/skycoin-service-discovery/internal/sdmetrics github.com/skycoin/skycoin-service-discovery/pkg/service-discovery/api github.com/skycoin/skycoin-service-discovery/pkg/service-discovery/store -# github.com/skycoin/skywire-services v1.3.29-0.20241105123837-b4869a32c8db -## explicit; go 1.22.0 +# github.com/skycoin/skywire-services v1.3.29-0.20241217194941-6269f3c618c3 +## explicit; go 1.23 github.com/skycoin/skywire-services/cmd/address-resolver/commands github.com/skycoin/skywire-services/cmd/config-bootstrapper/commands github.com/skycoin/skywire-services/cmd/keys-gen/commands @@ -651,20 +651,6 @@ github.com/skycoin/skywire-services/pkg/transport-setup/api github.com/skycoin/skywire-services/pkg/transport-setup/config github.com/skycoin/skywire-services/pkg/uptime-tracker/api github.com/skycoin/skywire-services/pkg/uptime-tracker/store -# github.com/skycoin/skywire-utilities v1.3.25 -## explicit; go 1.21 -github.com/skycoin/skywire-utilities/pkg/buildinfo -github.com/skycoin/skywire-utilities/pkg/cipher -github.com/skycoin/skywire-utilities/pkg/cmdutil -github.com/skycoin/skywire-utilities/pkg/geo -github.com/skycoin/skywire-utilities/pkg/httpauth -github.com/skycoin/skywire-utilities/pkg/httputil -github.com/skycoin/skywire-utilities/pkg/logging -github.com/skycoin/skywire-utilities/pkg/metricsutil -github.com/skycoin/skywire-utilities/pkg/netutil -github.com/skycoin/skywire-utilities/pkg/networkmonitor -github.com/skycoin/skywire-utilities/pkg/storeconfig -github.com/skycoin/skywire-utilities/pkg/tcpproxy # github.com/skycoin/systray v1.10.0 ## explicit; go 1.17 github.com/skycoin/systray