diff --git a/app/app.go b/app/app.go index 2d040be..a0d6062 100644 --- a/app/app.go +++ b/app/app.go @@ -9,8 +9,8 @@ import ( "cwtch.im/cwtch/storage" "cwtch.im/tapir/primitives" "fmt" - "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/connectivity" + "git.openprivacy.ca/openprivacy/log" "io/ioutil" "os" "path" diff --git a/app/appBridge.go b/app/appBridge.go index 28235a5..2e661c6 100644 --- a/app/appBridge.go +++ b/app/appBridge.go @@ -1,7 +1,7 @@ package app import "cwtch.im/cwtch/event" -import "git.openprivacy.ca/openprivacy/libricochet-go/log" +import "git.openprivacy.ca/openprivacy/log" const ( // DestApp should be used as a destination for IPC messages that are for the application itself an not a peer diff --git a/app/appClient.go b/app/appClient.go index 50f9c5d..14a52ea 100644 --- a/app/appClient.go +++ b/app/appClient.go @@ -6,7 +6,7 @@ import ( "cwtch.im/cwtch/peer" "cwtch.im/cwtch/storage" "fmt" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "path" "strconv" "sync" diff --git a/app/appService.go b/app/appService.go index 3afa5b2..3437f62 100644 --- a/app/appService.go +++ b/app/appService.go @@ -7,8 +7,8 @@ import ( "cwtch.im/cwtch/protocol/connections" "cwtch.im/cwtch/storage" "cwtch.im/tapir/primitives" - "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/connectivity" + "git.openprivacy.ca/openprivacy/log" "path" "strconv" "sync" diff --git a/app/applets.go b/app/applets.go index 1dc0339..c0993a9 100644 --- a/app/applets.go +++ b/app/applets.go @@ -2,8 +2,8 @@ package app import ( "cwtch.im/cwtch/event" - "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/connectivity" + "git.openprivacy.ca/openprivacy/log" "sync" "cwtch.im/cwtch/app/plugins" diff --git a/app/bots/servermon/main.go b/app/bots/servermon/main.go index 59785a1..51526f4 100644 --- a/app/bots/servermon/main.go +++ b/app/bots/servermon/main.go @@ -7,7 +7,7 @@ import ( "cwtch.im/cwtch/protocol/connections" "errors" "fmt" - "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" + "git.openprivacy.ca/openprivacy/connectivity/tor" "os" "time" ) @@ -41,7 +41,7 @@ func main() { serverAddr := os.Args[1] - acn, err := connectivity.StartTor(".", "") + acn, err := tor.NewTorACN(".", "") if err != nil { fmt.Printf("Could not start tor: %v\n", err) os.Exit(1) diff --git a/app/cli/main.go b/app/cli/main.go index 55b257c..f09cb07 100644 --- a/app/cli/main.go +++ b/app/cli/main.go @@ -8,8 +8,8 @@ import ( "bytes" "cwtch.im/cwtch/model" "fmt" - "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/connectivity/tor" + "git.openprivacy.ca/openprivacy/log" "github.com/c-bata/go-prompt" "golang.org/x/crypto/ssh/terminal" "os" @@ -281,7 +281,7 @@ func main() { os.Exit(1) } - acn, err := connectivity.StartTor(path.Join(usr.HomeDir, ".cwtch"), "") + acn, err := tor.NewTorACN(path.Join(usr.HomeDir, ".cwtch"), "") if err != nil { log.Errorf("\nError connecting to Tor: %v\n", err) os.Exit(1) diff --git a/app/cwtchutil/main.go b/app/cwtchutil/main.go index 08a13df..e1acda3 100644 --- a/app/cwtchutil/main.go +++ b/app/cwtchutil/main.go @@ -3,7 +3,7 @@ package main import ( "errors" "fmt" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "os" //"bufio" //"cwtch.im/cwtch/storage" diff --git a/app/peer/alice/alice.go b/app/peer/alice/alice.go index b234ce3..b51264f 100644 --- a/app/peer/alice/alice.go +++ b/app/peer/alice/alice.go @@ -4,8 +4,8 @@ import ( app2 "cwtch.im/cwtch/app" "cwtch.im/cwtch/app/utils" "cwtch.im/cwtch/event" - "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/connectivity/tor" + "git.openprivacy.ca/openprivacy/log" "os" "path" ) @@ -16,7 +16,7 @@ func main() { log.AddEverythingFromPattern("peer/alice") log.SetLevel(log.LevelDebug) - acn, err := connectivity.StartTor(path.Join(".", ".cwtch"), "") + acn, err := tor.NewTorACN(path.Join(".", ".cwtch"), "") if err != nil { log.Errorf("\nError connecting to Tor: %v\n", err) os.Exit(1) diff --git a/app/peer/bob/bob.go b/app/peer/bob/bob.go index a7bbd1f..998b92f 100644 --- a/app/peer/bob/bob.go +++ b/app/peer/bob/bob.go @@ -3,8 +3,8 @@ package main import ( app2 "cwtch.im/cwtch/app" "cwtch.im/cwtch/app/utils" - "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/connectivity/tor" + "git.openprivacy.ca/openprivacy/log" "os" "path" "time" @@ -15,7 +15,7 @@ func main() { // System Boilerplate, We need Tor Up and Running log.AddEverythingFromPattern("peer/bob") log.SetLevel(log.LevelDebug) - acn, err := connectivity.StartTor(path.Join(".", ".cwtch"), "") + acn, err := tor.NewTorACN(path.Join(".", ".cwtch"), "") if err != nil { log.Errorf("\nError connecting to Tor: %v\n", err) os.Exit(1) diff --git a/app/plugins/networkCheck.go b/app/plugins/networkCheck.go index 6f569f5..8b52ab6 100644 --- a/app/plugins/networkCheck.go +++ b/app/plugins/networkCheck.go @@ -3,9 +3,9 @@ package plugins import ( "cwtch.im/cwtch/event" "cwtch.im/cwtch/protocol/connections" - "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/connectivity" "git.openprivacy.ca/openprivacy/libricochet-go/policies" + "git.openprivacy.ca/openprivacy/log" "sync" "time" ) diff --git a/app/plugins/plugin.go b/app/plugins/plugin.go index 93d4358..01f2375 100644 --- a/app/plugins/plugin.go +++ b/app/plugins/plugin.go @@ -2,7 +2,7 @@ package plugins import ( "cwtch.im/cwtch/event" - "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" + "git.openprivacy.ca/openprivacy/connectivity" ) // PluginID is used as an ID for signaling plugin activities diff --git a/event/bridge/pipeBridge.go b/event/bridge/pipeBridge.go index dff6ab8..e60bf17 100644 --- a/event/bridge/pipeBridge.go +++ b/event/bridge/pipeBridge.go @@ -8,7 +8,7 @@ import ( "encoding/base64" "encoding/binary" "encoding/json" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "os" "sync" "syscall" diff --git a/event/bridge/pipeBridge_test.go b/event/bridge/pipeBridge_test.go index 1c5bbb7..46fd7f1 100644 --- a/event/bridge/pipeBridge_test.go +++ b/event/bridge/pipeBridge_test.go @@ -2,7 +2,7 @@ package bridge import ( "cwtch.im/cwtch/event" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "os" "testing" "time" diff --git a/event/eventmanager_test.go b/event/eventmanager_test.go index 337082e..3111267 100644 --- a/event/eventmanager_test.go +++ b/event/eventmanager_test.go @@ -1,7 +1,7 @@ package event import ( - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "sync" "testing" "time" diff --git a/go.mod b/go.mod index 0be4bf1..e0f47c5 100644 --- a/go.mod +++ b/go.mod @@ -1,17 +1,18 @@ module cwtch.im/cwtch require ( - cwtch.im/tapir v0.1.14 - git.openprivacy.ca/openprivacy/libricochet-go v1.0.10 + cwtch.im/tapir v0.1.15 + git.openprivacy.ca/openprivacy/connectivity v1.1.1 + git.openprivacy.ca/openprivacy/libricochet-go v1.0.11 + git.openprivacy.ca/openprivacy/log v1.0.0 github.com/c-bata/go-prompt v0.2.3 github.com/golang/protobuf v1.3.3 github.com/mattn/go-runewidth v0.0.8 // indirect github.com/mattn/go-tty v0.0.3 // indirect github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942 // indirect github.com/struCoder/pidusage v0.1.3 - golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d + golang.org/x/crypto v0.0.0-20200210191831-6ca56c2f2e2b golang.org/x/net v0.0.0-20200202094626-16171245cfb2 - golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 // indirect ) go 1.13 diff --git a/go.sum b/go.sum index cff8adb..fa9104b 100644 --- a/go.sum +++ b/go.sum @@ -1,18 +1,23 @@ -cwtch.im/tapir v0.1.14 h1:lg+reZNT998l++4Q4RQBLXYv3ukqWffhI0Wed9RSjuA= -cwtch.im/tapir v0.1.14/go.mod h1:QwERb982YIes9UOxDqIthm1HZ1xy0YQetD2+XxDbg9Y= -git.openprivacy.ca/openprivacy/libricochet-go v1.0.4/go.mod h1:yMSG1gBaP4f1U+RMZXN85d29D39OK5s8aTpyVRoH5FY= -git.openprivacy.ca/openprivacy/libricochet-go v1.0.10 h1:yxEqFJH4EdacPwGuOXx+QieYqIPDyzWP50H27EI7fxI= -git.openprivacy.ca/openprivacy/libricochet-go v1.0.10/go.mod h1:jJdxIwYDCcM4w4HAydeHuksPRTirUnyERAloPL0qtic= +cwtch.im/tapir v0.1.15 h1:XSCWOvjmNkzMT2IceFgTBXWGKtYfr3a8o+La1s10OhE= +cwtch.im/tapir v0.1.15/go.mod h1:HzezugpEx+nZ3LdyDsl0w6n45IJYnOt8uqldkLWmaqs= +git.openprivacy.ca/openprivacy/connectivity v1.1.0 h1:9PEeKuPdoIRYeA62BUkBW2BfK4KqKEXz1fvUxZoP4xs= +git.openprivacy.ca/openprivacy/connectivity v1.1.0/go.mod h1:4P8mirZZslKbo2zBrXXVjgEdqGwHo/6qoFBwFQW6d6E= +git.openprivacy.ca/openprivacy/connectivity v1.1.1 h1:hKxBOmxP7Jdu3K1BJ93mRtKNiWUoP6YHt/o2snE2Z0w= +git.openprivacy.ca/openprivacy/connectivity v1.1.1/go.mod h1:4P8mirZZslKbo2zBrXXVjgEdqGwHo/6qoFBwFQW6d6E= +git.openprivacy.ca/openprivacy/libricochet-go v1.0.11 h1:C7QFFzG0p5XKu0zcOIdLGwEpA9uU0BceBM7CfVK5D40= +git.openprivacy.ca/openprivacy/libricochet-go v1.0.11/go.mod h1:yTMps/ZpYS+BNBBvANsNAft28FXrBvFHQauMYNWPrwE= +git.openprivacy.ca/openprivacy/log v1.0.0 h1:Rvqm1weUdR4AOnJ79b1upHCc9vC/QF1rhSD2Um7sr1Y= +git.openprivacy.ca/openprivacy/log v1.0.0/go.mod h1:gGYK8xHtndRLDymFtmjkG26GaMQNgyhioNS82m812Iw= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= github.com/c-bata/go-prompt v0.2.3 h1:jjCS+QhG/sULBhAaBdjb2PlMRVaKXQgn+4yzaauvs2s= github.com/c-bata/go-prompt v0.2.3/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= -github.com/cretz/bine v0.1.0 h1:1/fvhLE+fk0bPzjdO5Ci+0ComYxEMuB1JhM4X5skT3g= -github.com/cretz/bine v0.1.0/go.mod h1:6PF6fWAvYtwjRGkAuDEJeWNOv3a2hUouSP/yRYXmvHw= github.com/cretz/bine v0.1.1-0.20200124154328-f9f678b84cca h1:Q2r7AxHdJwWfLtBZwvW621M3sPqxPc6ITv2j1FGsYpw= github.com/cretz/bine v0.1.1-0.20200124154328-f9f678b84cca/go.mod h1:6PF6fWAvYtwjRGkAuDEJeWNOv3a2hUouSP/yRYXmvHw= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -25,6 +30,11 @@ github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= @@ -45,26 +55,23 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/struCoder/pidusage v0.1.3 h1:pZcSa6asBE38TJtW0Nui6GeCjLTpaT/jAnNP7dUTLSQ= github.com/struCoder/pidusage v0.1.3/go.mod h1:pWBlW3YuSwRl6h7R5KbvA4N8oOqe9LjaKW5CwT1SPjI= go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -golang.org/x/crypto v0.0.0-20190128193316-c7b33c32a30b h1:Ib/yptP38nXZFMwqWSip+OKuMP9OkyDe3p+DssP8n9w= -golang.org/x/crypto v0.0.0-20190128193316-c7b33c32a30b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d h1:9FCpayM9Egr1baVnV1SX0H87m+XB0B8S0hAMi99X/3U= -golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d h1:9FCpayM9Egr1baVnV1SX0H87m+XB0B8S0hAMi99X/3U= -golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 h1:ulvT7fqt0yHWzpJwI57MezWnYDVpCAYBVuYst/L+fAY= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200206161412-a0c6ece9d31a h1:aczoJ0HPNE92XKa7DrIzkNN6esOKO2TBwiiYoKcINhA= +golang.org/x/crypto v0.0.0-20200206161412-a0c6ece9d31a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200210191831-6ca56c2f2e2b h1:at/SwedEdvIO7WPO4V9Yn1a3MqdSqAo0p6trBocu5aA= +golang.org/x/crypto v0.0.0-20200210191831-6ca56c2f2e2b/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -76,3 +83,9 @@ golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfru golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/model/group.go b/model/group.go index b0cd5aa..49d7cb2 100644 --- a/model/group.go +++ b/model/group.go @@ -5,8 +5,8 @@ import ( "cwtch.im/cwtch/protocol" "errors" "fmt" - "git.openprivacy.ca/openprivacy/libricochet-go/log" - "git.openprivacy.ca/openprivacy/libricochet-go/utils" + "git.openprivacy.ca/openprivacy/connectivity/tor" + "git.openprivacy.ca/openprivacy/log" "github.com/golang/protobuf/proto" "golang.org/x/crypto/nacl/secretbox" "io" @@ -38,7 +38,7 @@ func NewGroup(server string) (*Group, error) { group := new(Group) group.LocalID = GenerateRandomID() - if utils.IsValidHostname(server) == false { + if tor.IsValidHostname(server) == false { return nil, errors.New("Server is not a valid v3 onion") } diff --git a/model/profile.go b/model/profile.go index d631012..75312a8 100644 --- a/model/profile.go +++ b/model/profile.go @@ -7,6 +7,7 @@ import ( "encoding/hex" "encoding/json" "errors" + "git.openprivacy.ca/openprivacy/connectivity/tor" "git.openprivacy.ca/openprivacy/libricochet-go/utils" "github.com/golang/protobuf/proto" "golang.org/x/crypto/ed25519" @@ -82,7 +83,7 @@ func GenerateNewProfile(name string) *Profile { pub, priv, _ := ed25519.GenerateKey(rand.Reader) p.Ed25519PublicKey = pub p.Ed25519PrivateKey = priv - p.Onion = utils.GetTorV3Hostname(pub) + p.Onion = tor.GetTorV3Hostname(pub) p.Contacts = make(map[string]*PublicProfile) p.Contacts[p.Onion] = &p.PublicProfile diff --git a/peer/cwtch_peer.go b/peer/cwtch_peer.go index 26d8496..d35bd07 100644 --- a/peer/cwtch_peer.go +++ b/peer/cwtch_peer.go @@ -8,7 +8,7 @@ import ( "encoding/base64" "encoding/json" "errors" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "strings" "sync" "time" diff --git a/protocol/connections/connectionsmanager.go b/protocol/connections/connectionsmanager.go index 1b917f1..b9c465b 100644 --- a/protocol/connections/connectionsmanager.go +++ b/protocol/connections/connectionsmanager.go @@ -2,8 +2,8 @@ package connections import ( "cwtch.im/cwtch/protocol" - "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/connectivity" + "git.openprivacy.ca/openprivacy/log" "sync" ) diff --git a/protocol/connections/connectsmanager_test.go b/protocol/connections/connectsmanager_test.go index dcb9312..80540d8 100644 --- a/protocol/connections/connectsmanager_test.go +++ b/protocol/connections/connectsmanager_test.go @@ -1,11 +1,11 @@ package connections import ( - "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" + "git.openprivacy.ca/openprivacy/connectivity" "testing" ) func TestConnectionsManager(t *testing.T) { // TODO We need to encapsulate connections behind a well defined interface for tesintg - NewConnectionsManager(connectivity.LocalProvider()) + NewConnectionsManager(connectivity.NewLocalACN()) } diff --git a/protocol/connections/engine.go b/protocol/connections/engine.go index 5a1c7e1..ec17133 100644 --- a/protocol/connections/engine.go +++ b/protocol/connections/engine.go @@ -8,9 +8,9 @@ import ( "cwtch.im/tapir/networks/tor" "cwtch.im/tapir/primitives" "errors" - "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" - "git.openprivacy.ca/openprivacy/libricochet-go/log" - "git.openprivacy.ca/openprivacy/libricochet-go/utils" + "git.openprivacy.ca/openprivacy/connectivity" + torProdider "git.openprivacy.ca/openprivacy/connectivity/tor" + "git.openprivacy.ca/openprivacy/log" "golang.org/x/crypto/ed25519" "sync" "time" @@ -111,14 +111,14 @@ func (e *engine) eventHandler() { case event.StatusRequest: e.eventManager.Publish(event.Event{EventType: event.ProtocolEngineStatus, EventID: ev.EventID}) case event.PeerRequest: - if utils.IsValidHostname(ev.Data[event.RemotePeer]) { + if torProdider.IsValidHostname(ev.Data[event.RemotePeer]) { e.blocked.Store(ev.Data[event.RemotePeer], false) go e.peerWithOnion(ev.Data[event.RemotePeer]) } case event.RetryPeerRequest: // This event allows engine to treat (automated) retry peering requests differently to user-specified // peer events - if utils.IsValidHostname(ev.Data[event.RemotePeer]) { + if torProdider.IsValidHostname(ev.Data[event.RemotePeer]) { go e.peerWithOnion(ev.Data[event.RemotePeer]) } case event.InvitePeerToGroup: diff --git a/protocol/connections/peerapp.go b/protocol/connections/peerapp.go index c795fa4..5a2f9e4 100644 --- a/protocol/connections/peerapp.go +++ b/protocol/connections/peerapp.go @@ -5,7 +5,7 @@ import ( "cwtch.im/tapir" "cwtch.im/tapir/applications" "encoding/json" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" ) // PeerApp encapsulates the behaviour of a Cwtch Peer diff --git a/protocol/connections/peerserverconnection.go b/protocol/connections/peerserverconnection.go index 55be614..f150bc9 100644 --- a/protocol/connections/peerserverconnection.go +++ b/protocol/connections/peerserverconnection.go @@ -12,7 +12,7 @@ import ( "git.openprivacy.ca/openprivacy/libricochet-go/channels" "git.openprivacy.ca/openprivacy/libricochet-go/connection" "git.openprivacy.ca/openprivacy/libricochet-go/identity" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "golang.org/x/crypto/ed25519" "sync" "time" diff --git a/protocol/connections/peerserverconnection_test.go b/protocol/connections/peerserverconnection_test.go index c7b28d6..645b560 100644 --- a/protocol/connections/peerserverconnection_test.go +++ b/protocol/connections/peerserverconnection_test.go @@ -6,10 +6,10 @@ import ( "cwtch.im/cwtch/server/fetch" "cwtch.im/cwtch/server/send" "cwtch.im/tapir/primitives" + "git.openprivacy.ca/openprivacy/connectivity" "git.openprivacy.ca/openprivacy/libricochet-go" "git.openprivacy.ca/openprivacy/libricochet-go/channels" "git.openprivacy.ca/openprivacy/libricochet-go/connection" - "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" identityOld "git.openprivacy.ca/openprivacy/libricochet-go/identity" "golang.org/x/crypto/ed25519" "net" @@ -78,7 +78,7 @@ func TestPeerServerConnection(t *testing.T) { onionAddr := identity.Hostname() manager := event.NewEventManager() - engine := NewProtocolEngine(identity, priv, connectivity.LocalProvider(), manager, nil, nil) + engine := NewProtocolEngine(identity, priv, connectivity.NewLocalACN(), manager, nil, nil) psc := NewPeerServerConnection(engine, "127.0.0.1:5451|"+onionAddr) numcalls := 0 diff --git a/server/app/main.go b/server/app/main.go index 6bff3a5..406af21 100644 --- a/server/app/main.go +++ b/server/app/main.go @@ -2,8 +2,8 @@ package main import ( cwtchserver "cwtch.im/cwtch/server" - "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/connectivity/tor" + "git.openprivacy.ca/openprivacy/log" "os" "path" ) @@ -19,7 +19,7 @@ func main() { serverConfig := cwtchserver.LoadConfig(configDir, serverConfigFile) - acn, err := connectivity.StartTor(path.Join(configDir, "tor"), "") + acn, err := tor.NewTorACN(path.Join(configDir, "tor"), "") if err != nil { log.Errorf("\nError connecting to Tor: %v\n", err) os.Exit(1) diff --git a/server/metrics/monitors.go b/server/metrics/monitors.go index 8a1f1bd..90f8ede 100644 --- a/server/metrics/monitors.go +++ b/server/metrics/monitors.go @@ -4,7 +4,7 @@ import ( "bufio" "fmt" "git.openprivacy.ca/openprivacy/libricochet-go/application" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "github.com/struCoder/pidusage" "os" "path" diff --git a/server/send/server_send_channel.go b/server/send/server_send_channel.go index 55a2b43..01aea8d 100644 --- a/server/send/server_send_channel.go +++ b/server/send/server_send_channel.go @@ -5,8 +5,8 @@ import ( "cwtch.im/cwtch/protocol/connections/spam" "errors" "git.openprivacy.ca/openprivacy/libricochet-go/channels" - "git.openprivacy.ca/openprivacy/libricochet-go/log" "git.openprivacy.ca/openprivacy/libricochet-go/wire/control" + "git.openprivacy.ca/openprivacy/log" "github.com/golang/protobuf/proto" ) diff --git a/server/server.go b/server/server.go index 435c942..3ef283e 100644 --- a/server/server.go +++ b/server/server.go @@ -6,12 +6,11 @@ import ( "cwtch.im/cwtch/server/metrics" "cwtch.im/cwtch/server/send" "cwtch.im/cwtch/server/storage" + "git.openprivacy.ca/openprivacy/connectivity" + "git.openprivacy.ca/openprivacy/connectivity/tor" "git.openprivacy.ca/openprivacy/libricochet-go/application" "git.openprivacy.ca/openprivacy/libricochet-go/channels" - "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" - "git.openprivacy.ca/openprivacy/libricochet-go/utils" - - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "os" "strconv" "time" @@ -71,7 +70,7 @@ func (s *Server) Run(acn connectivity.ACN, serverConfig Config) { } }) - addressIdentity := utils.GetTorV3Hostname(s.config.PublicKey) + addressIdentity := tor.GetTorV3Hostname(s.config.PublicKey) cwtchserver.Init(acn, "cwtch server for "+addressIdentity, s.config.Identity(), af, new(application.AcceptAllContactManager)) port := strconv.Itoa(application.RicochetPort) log.Infof("cwtch server running on cwtch:%s\n", addressIdentity+".onion:"+port) diff --git a/server/serverConfig.go b/server/serverConfig.go index 4d9bcca..f5bc4e9 100644 --- a/server/serverConfig.go +++ b/server/serverConfig.go @@ -4,7 +4,7 @@ import ( "crypto/rand" "encoding/json" "git.openprivacy.ca/openprivacy/libricochet-go/identity" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "golang.org/x/crypto/ed25519" "io/ioutil" "path" diff --git a/server/storage/message_store.go b/server/storage/message_store.go index 7ad154f..174a405 100644 --- a/server/storage/message_store.go +++ b/server/storage/message_store.go @@ -6,7 +6,7 @@ import ( "cwtch.im/cwtch/server/metrics" "encoding/json" "fmt" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "os" "path" "sync" diff --git a/storage/profile_store.go b/storage/profile_store.go index 3a840d3..fe384fc 100644 --- a/storage/profile_store.go +++ b/storage/profile_store.go @@ -5,7 +5,7 @@ import ( "cwtch.im/cwtch/model" "cwtch.im/cwtch/storage/v0" "cwtch.im/cwtch/storage/v1" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "io/ioutil" "path" "strconv" diff --git a/storage/profile_store_test.go b/storage/profile_store_test.go index afb4658..d4c2463 100644 --- a/storage/profile_store_test.go +++ b/storage/profile_store_test.go @@ -6,7 +6,7 @@ import ( "cwtch.im/cwtch/event" "cwtch.im/cwtch/storage/v0" "fmt" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "os" "testing" "time" diff --git a/storage/v0/file_enc.go b/storage/v0/file_enc.go index 7a12896..5b885bd 100644 --- a/storage/v0/file_enc.go +++ b/storage/v0/file_enc.go @@ -3,7 +3,7 @@ package v0 import ( "crypto/rand" "errors" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "golang.org/x/crypto/nacl/secretbox" "golang.org/x/crypto/pbkdf2" "golang.org/x/crypto/sha3" diff --git a/storage/v0/stream_store.go b/storage/v0/stream_store.go index 5e2895d..e6d0dd2 100644 --- a/storage/v0/stream_store.go +++ b/storage/v0/stream_store.go @@ -4,7 +4,7 @@ import ( "cwtch.im/cwtch/model" "encoding/json" "fmt" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "io/ioutil" "os" "path" diff --git a/storage/v1/file_enc.go b/storage/v1/file_enc.go index 592dfc1..a4e1870 100644 --- a/storage/v1/file_enc.go +++ b/storage/v1/file_enc.go @@ -3,7 +3,7 @@ package v1 import ( "crypto/rand" "errors" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "golang.org/x/crypto/nacl/secretbox" "golang.org/x/crypto/pbkdf2" "golang.org/x/crypto/sha3" diff --git a/storage/v1/file_store.go b/storage/v1/file_store.go index 2c3e28d..5145db3 100644 --- a/storage/v1/file_store.go +++ b/storage/v1/file_store.go @@ -1,7 +1,7 @@ package v1 import ( - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "io/ioutil" "os" "path" diff --git a/storage/v1/profile_store.go b/storage/v1/profile_store.go index 1d9006c..aa47663 100644 --- a/storage/v1/profile_store.go +++ b/storage/v1/profile_store.go @@ -4,7 +4,7 @@ import ( "cwtch.im/cwtch/event" "cwtch.im/cwtch/model" "encoding/json" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "io/ioutil" "os" "path" diff --git a/storage/v1/stream_store.go b/storage/v1/stream_store.go index 96a0f98..e964146 100644 --- a/storage/v1/stream_store.go +++ b/storage/v1/stream_store.go @@ -4,7 +4,7 @@ import ( "cwtch.im/cwtch/model" "encoding/json" "fmt" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/log" "io/ioutil" "os" "path" diff --git a/testing/cwtch_peer_server_integration_test.go b/testing/cwtch_peer_server_integration_test.go index 5264728..72a089e 100644 --- a/testing/cwtch_peer_server_integration_test.go +++ b/testing/cwtch_peer_server_integration_test.go @@ -10,8 +10,8 @@ import ( "cwtch.im/cwtch/protocol/connections" cwtchserver "cwtch.im/cwtch/server" "fmt" - "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" - "git.openprivacy.ca/openprivacy/libricochet-go/log" + "git.openprivacy.ca/openprivacy/connectivity/tor" + "git.openprivacy.ca/openprivacy/log" "golang.org/x/net/proxy" "os" "os/user" @@ -114,7 +114,7 @@ func TestCwtchPeerIntegration(t *testing.T) { log.ExcludeFromPattern("pipeBridge") log.ExcludeFromPattern("tapir") os.RemoveAll("tor") - acn, err := connectivity.StartTor(".", "") + acn, err := tor.NewTorACN(".", "") if err != nil { t.Fatalf("Could not start Tor: %v", err) } @@ -233,6 +233,9 @@ func TestCwtchPeerIntegration(t *testing.T) { } } + fmt.Println("Waiting for Bob to join connect to group server...") + waitForPeerGroupConnection(t, bob, groupID) + numGoRoutinesPostServerConnect := runtime.NumGoroutine() // ***** Conversation *****