Merge pull request 'use new Cwtch ActiveEngines' (#101) from activateEngine into trunk
continuous-integration/drone/push Build is pending
Details
continuous-integration/drone/push Build is pending
Details
Reviewed-on: #101
This commit is contained in:
commit
d28d0db77c
2
go.mod
2
go.mod
|
@ -3,7 +3,7 @@ module git.openprivacy.ca/cwtch.im/libcwtch-go
|
|||
go 1.17
|
||||
|
||||
require (
|
||||
cwtch.im/cwtch v0.18.4
|
||||
cwtch.im/cwtch v0.18.5
|
||||
git.openprivacy.ca/cwtch.im/server v1.4.5
|
||||
git.openprivacy.ca/openprivacy/connectivity v1.8.6
|
||||
git.openprivacy.ca/openprivacy/log v1.0.3
|
||||
|
|
2
go.sum
2
go.sum
|
@ -3,6 +3,8 @@ cwtch.im/cwtch v0.18.3 h1:3zBvC4buII6pWQ+OOVUR6WuAwQDKCxSrj0ZOYKEeB6I=
|
|||
cwtch.im/cwtch v0.18.3/go.mod h1:StheazFFY7PKqBbEyDVLhzWW6WOat41zV0ckC240c5Y=
|
||||
cwtch.im/cwtch v0.18.4 h1:Oht7rEDVJjVWDOKg0xqDgXvY/H059HMJlOPt/nBGqxk=
|
||||
cwtch.im/cwtch v0.18.4/go.mod h1:h8S7EgEM+8pE1k+XLB5jAFdIPlOzwoXEY0GH5mQye5A=
|
||||
cwtch.im/cwtch v0.18.5 h1:yqDns4flbowsbaWjMiUm7Em4IAlM8kkgm79CCcXV1GE=
|
||||
cwtch.im/cwtch v0.18.5/go.mod h1:h8S7EgEM+8pE1k+XLB5jAFdIPlOzwoXEY0GH5mQye5A=
|
||||
filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
|
||||
filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek=
|
||||
filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
|
||||
|
|
1
lib.go
1
lib.go
|
@ -238,6 +238,7 @@ func buildACN(settings utils.GlobalSettings, torPath string, appDir string) conn
|
|||
}
|
||||
|
||||
torrc := tor.NewTorrc().WithSocksPort(socksPort).WithOnionTrafficOnly().WithControlPort(controlPort).WithHashedPassword(base64.StdEncoding.EncodeToString(key))
|
||||
// torrc.WithLog(path.Join(appDir, "tor", "tor.log"), tor.TorLogLevelNotice)
|
||||
if settings.UseCustomTorrc {
|
||||
customTorrc := settings.CustomTorrc
|
||||
torrc.WithCustom(strings.Split(customTorrc, "\n"))
|
||||
|
|
|
@ -100,15 +100,11 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string {
|
|||
if newAcnStatus == 100 {
|
||||
if acnStatus != 100 {
|
||||
// just came online
|
||||
for _, onion := range eh.app.ListProfiles() {
|
||||
// launch a listen thread (internally this does a check that the protocol engine is not listening)
|
||||
// and as such is safe to call.
|
||||
doServers := false
|
||||
if _, err := groups.ExperimentGate(ReadGlobalSettings().Experiments); err == nil {
|
||||
doServers = true
|
||||
}
|
||||
eh.app.ActivePeerEngine(onion, true, true, doServers)
|
||||
doServers := false
|
||||
if _, err := groups.ExperimentGate(ReadGlobalSettings().Experiments); err == nil {
|
||||
doServers = true
|
||||
}
|
||||
eh.app.ActivateEngines(true, true, doServers)
|
||||
eh.api.LaunchServers()
|
||||
}
|
||||
} else {
|
||||
|
@ -144,8 +140,8 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string {
|
|||
}
|
||||
|
||||
profile.SetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants2.PeerOnline, event.False)
|
||||
eh.app.AddPeerPlugin(onion, plugins.CONNECTIONRETRY)
|
||||
eh.app.AddPeerPlugin(onion, plugins.NETWORKCHECK)
|
||||
// disabeling network check for connection attempt reservation, needs rework
|
||||
//eh.app.AddPeerPlugin(onion, plugins.NETWORKCHECK)
|
||||
eh.app.AddPeerPlugin(onion, plugins.ANTISPAM)
|
||||
|
||||
// If the user has chosen to block unknown profiles
|
||||
|
@ -164,7 +160,7 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string {
|
|||
if _, err := groups.ExperimentGate(ReadGlobalSettings().Experiments); err == nil {
|
||||
doServers = true
|
||||
}
|
||||
eh.app.ActivePeerEngine(onion, true, true, doServers)
|
||||
eh.app.ActivatePeerEngine(onion, true, true, doServers)
|
||||
}
|
||||
|
||||
online, _ := profile.GetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants2.PeerOnline)
|
||||
|
|
Reference in New Issue