From eac5a99314c47ccc460e8a95130be3266e67dd3d Mon Sep 17 00:00:00 2001 From: Andrew Martinez Date: Wed, 3 Feb 2021 17:04:51 -0500 Subject: [PATCH 1/6] spelling --- common/enrollment/enroll.go | 4 ++-- ziti-enroller/subcmd/root.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/enrollment/enroll.go b/common/enrollment/enroll.go index 06f76443c..53fe1a17c 100644 --- a/common/enrollment/enroll.go +++ b/common/enrollment/enroll.go @@ -92,9 +92,9 @@ func NewEnrollCommand() *cobra.Command { var keyDesc = "" engines := certtools.ListEngines() if len(engines) > 0 { - keyDesc = fmt.Sprintf("The key to use with the certifcate. Optionally specify the engine to use. supported engines: %v", engines) + keyDesc = fmt.Sprintf("The key to use with the certificate. Optionally specify the engine to use. supported engines: %v", engines) } else { - keyDesc = fmt.Sprintf("The key to use with the certifcate.") + keyDesc = fmt.Sprintf("The key to use with the certificate.") } enrollSubCmd.Flags().StringVarP(&keyPath, "key", "k", "", keyDesc) diff --git a/ziti-enroller/subcmd/root.go b/ziti-enroller/subcmd/root.go index 1547dc66d..61ee594fc 100644 --- a/ziti-enroller/subcmd/root.go +++ b/ziti-enroller/subcmd/root.go @@ -53,9 +53,9 @@ func init() { var keyDesc = "" engines := certtools.ListEngines() if len(engines) > 0 { - keyDesc = fmt.Sprintf("The key to use with the certifcate. Optionally specify the engine to use. supported engines: %v", engines) + keyDesc = fmt.Sprintf("The key to use with the certificate. Optionally specify the engine to use. supported engines: %v", engines) } else { - keyDesc = fmt.Sprintf("The key to use with the certifcate.") + keyDesc = fmt.Sprintf("The key to use with the certificate.") } rootCmd.Flags().StringVarP(&keyPath, "key", "k", "", keyDesc) From f08b75660cb7d6d33c65b9d36c31cc8ac650659f Mon Sep 17 00:00:00 2001 From: Curt Tudor Date: Thu, 4 Feb 2021 06:54:09 -0500 Subject: [PATCH 2/6] edge router enhancements for browZer support (#289) --- CHANGELOG.md | 22 ++++++++++++++++++++++ go.mod | 4 ++-- ziti-router/main.go | 2 ++ ziti-router/subcmd/enrollgw.go | 6 +++++- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4030187b0..7e3ff2078 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ +# Release 0.18.8 + +## What's New + +* Websocket binding in Edge Router to support connections from BrowZer-based apps that use the `ziti-sdk-js`. Edge Routers support various configurations including a single `tls` binding, a single `ws` binding, or having both `tls` and `ws` bindings simultaneously. If both binding types are used, they must be specified with different ports. + +``` +# Example Edge Router config snippet (note new `ws` address type): + +listeners: + - binding: edge + address: ws:0.0.0.0:3021 + options: + advertise: curt-edge-ws-router:3021 + - binding: edge + address: tls:0.0.0.0:3022 + options: + advertise: curt-edge-ws-router:3022 +``` + + # Release 0.18.7 ## What's New @@ -37,6 +58,7 @@ There is a new controller config file setting: * `ctrlChanLatencyIntervalSeconds` which controls how often the latency probe is sent. Default value: 10 + # Release 0.18.6 ## What's New diff --git a/go.mod b/go.mod index 20e787b9e..87f7af5a4 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ go 1.15 //replace github.com/openziti/sdk-golang => ../sdk-golang -//replace github.com/openziti/edge => ../edge +// replace github.com/openziti/edge => ../edge require ( github.com/Jeffail/gabs v1.4.0 @@ -24,7 +24,7 @@ require ( github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19 github.com/michaelquigley/pfxlog v0.3.6 - github.com/openziti/edge v0.17.56 + github.com/openziti/edge v0.17.57 github.com/openziti/fabric v0.15.18 github.com/openziti/foundation v0.15.10 github.com/openziti/sdk-golang v0.15.13 diff --git a/ziti-router/main.go b/ziti-router/main.go index d20203cbd..f99bce3f4 100644 --- a/ziti-router/main.go +++ b/ziti-router/main.go @@ -24,6 +24,7 @@ import ( "github.com/openziti/foundation/transport/tcp" "github.com/openziti/foundation/transport/tls" "github.com/openziti/foundation/transport/transwarp" + "github.com/openziti/foundation/transport/ws" "github.com/openziti/foundation/transport/wss" "github.com/openziti/ziti/common/version" "github.com/openziti/ziti/ziti-router/subcmd" @@ -38,6 +39,7 @@ func init() { transport.AddAddressParser(tls.AddressParser{}) transport.AddAddressParser(tcp.AddressParser{}) transport.AddAddressParser(transwarp.AddressParser{}) + transport.AddAddressParser(ws.AddressParser{}) transport.AddAddressParser(wss.AddressParser{}) build.InitBuildInfo(version.GetCmdBuildInfo()) diff --git a/ziti-router/subcmd/enrollgw.go b/ziti-router/subcmd/enrollgw.go index 10f20634d..162a56a28 100644 --- a/ziti-router/subcmd/enrollgw.go +++ b/ziti-router/subcmd/enrollgw.go @@ -20,16 +20,20 @@ import ( "github.com/michaelquigley/pfxlog" "github.com/openziti/edge/router/enroll" "github.com/openziti/fabric/router" + "github.com/openziti/sdk-golang/ziti/config" "github.com/spf13/cobra" "io/ioutil" ) var jwtPath *string var engine *string +var keyAlg config.KeyAlgVar func init() { jwtPath = enrollEdgeRouterCmd.Flags().StringP("jwt", "j", "", "The path to a JWT file") engine = enrollEdgeRouterCmd.Flags().StringP("engine", "e", "", "An engine") + keyAlg.Set("RSA") // set default + enrollEdgeRouterCmd.Flags().VarP(&keyAlg, "keyAlg", "a", "Crypto algorithm to use when generating private key") root.AddCommand(enrollEdgeRouterCmd) } @@ -57,7 +61,7 @@ func enrollGw(cmd *cobra.Command, args []string) { log.Panicf("could not load JWT file from path [%s]", *jwtPath) } - if err := enroller.Enroll(jwtBuf, true, *engine); err != nil { + if err := enroller.Enroll(jwtBuf, true, *engine, keyAlg); err != nil { log.Fatalf("enrollment failure: (%v)", err) } } else { From f43ac5b1e69392e5f8af9eb018e2dd9a7675322e Mon Sep 17 00:00:00 2001 From: Shawn Carey Date: Thu, 4 Feb 2021 08:41:40 -0500 Subject: [PATCH 3/6] don't use gops agent shutdown handler. (#292) --- ziti-tunnel/cmd/ziti-tunnel/subcmd/root.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ziti-tunnel/cmd/ziti-tunnel/subcmd/root.go b/ziti-tunnel/cmd/ziti-tunnel/subcmd/root.go index ff8a24e46..3802b3ed9 100644 --- a/ziti-tunnel/cmd/ziti-tunnel/subcmd/root.go +++ b/ziti-tunnel/cmd/ziti-tunnel/subcmd/root.go @@ -101,7 +101,10 @@ func rootPostRun(cmd *cobra.Command, _ []string) { log := pfxlog.Logger() if cliAgentEnabled { - if err := agent.Listen(agent.Options{Addr: cliAgentAddr}); err != nil { + // don't use the agent's shutdown handler. it calls os.Exit on SIGINT + // which interferes with the servicePoller shutdown + cleanup := false + if err := agent.Listen(agent.Options{Addr: cliAgentAddr, ShutdownCleanup: &cleanup}); err != nil { pfxlog.Logger().WithError(err).Error("unable to start CLI agent") } } @@ -151,4 +154,7 @@ func rootPostRun(cmd *cobra.Command, _ []string) { log.WithError(err).Fatal("failed to authenticate") } serviceListener.WaitForShutdown() + if cliAgentEnabled { + agent.Close() + } } From d1fa38b85a9b8b71aba90247ecebe760351754b7 Mon Sep 17 00:00:00 2001 From: Andrew Martinez Date: Thu, 4 Feb 2021 09:44:03 -0500 Subject: [PATCH 4/6] change log, edge dep - api session performance - er current identity list --- CHANGELOG.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ go.mod | 2 +- go.sum | 5 ++--- 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e3ff2078..966f73640 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ## What's New * Websocket binding in Edge Router to support connections from BrowZer-based apps that use the `ziti-sdk-js`. Edge Routers support various configurations including a single `tls` binding, a single `ws` binding, or having both `tls` and `ws` bindings simultaneously. If both binding types are used, they must be specified with different ports. +* Edge Router list for current identity + +## Websocket Binding ``` # Example Edge Router config snippet (note new `ws` address type): @@ -19,6 +22,58 @@ listeners: ``` +## Edge Router List For Current Identity + +A new endpoint has been added which will display the list of Edge Routers an authenticated session has access to via any policy. +The records will indicate whether the router is online, its hostname, and its supported protocols. This endpoint will not return Edge +Routers that have not completed enrollment. Edge Routers that are offline will not have hostname and supported protocol information. + +Endpoint: `GET /current-identity/edge-routers` + +Example Output: +``` +{ + "data": [ + { + "createdAt": "2021-01-27T20:13:18.599Z", + "id": "LolSlAQMq", + "tags": {}, + "updatedAt": "2021-01-27T20:13:19.762Z", + "hostname": "", + "isOnline": false, + "name": "er1", + "supportedProtocols": {} + }, + { + "createdAt": "2021-01-27T20:13:19.308Z", + "id": "oVzRl6kCq", + "tags": {}, + "updatedAt": "2021-01-27T20:13:19.901Z", + "hostname": "127.0.0.1:5002", + "isOnline": true, + "name": "er2", + "supportedProtocols": { + "tls": "tls://127.0.0.1:5002", + "wss": "wss://127.0.0.1:5002" + } + } + ], + "meta": { + "filterableFields": [ + "id", + "createdAt", + "updatedAt", + "name", + ], + "pagination": { + "limit": 10, + "offset": 0, + "totalCount": 2 + } + } +} +``` + # Release 0.18.7 ## What's New diff --git a/go.mod b/go.mod index 87f7af5a4..c45c2240e 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19 github.com/michaelquigley/pfxlog v0.3.6 - github.com/openziti/edge v0.17.57 + github.com/openziti/edge v0.17.59 github.com/openziti/fabric v0.15.18 github.com/openziti/foundation v0.15.10 github.com/openziti/sdk-golang v0.15.13 diff --git a/go.sum b/go.sum index 8cef59055..9b9dfab9f 100644 --- a/go.sum +++ b/go.sum @@ -520,9 +520,8 @@ github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= -github.com/openziti/edge v0.17.56 h1:K775G+6l1GT9xwlt5UOCGteu91PTwX9jBsHm+P9okTs= -github.com/openziti/edge v0.17.56/go.mod h1:pHFEpTmILwipHcmvMzSYDKLaWGgb5Iob/4CHp8UdppQ= -github.com/openziti/fabric v0.15.15/go.mod h1:H2bwevoCxvJxr3xIsG9AQq9Wy+rxOMNrJTQaPzj/Pas= +github.com/openziti/edge v0.17.59 h1:QCRWpF5De3fB/GQDcC4RNRwHZ3Xsm9tGrKrQD0LiRvk= +github.com/openziti/edge v0.17.59/go.mod h1:tuzW9dGztEPiDY8P7a45dq+N8VA3KRDGnYIGOR+DFJE= github.com/openziti/fabric v0.15.18 h1:Ze/v2ZCGjo2QqA5Y+o2PP/Mcf/GLRSDGc3Ia2+2c6jw= github.com/openziti/fabric v0.15.18/go.mod h1:KKvO246Nk8twpNv+Mee60NVJh83eh9ZreAb3H8JEnJY= github.com/openziti/foundation v0.15.9/go.mod h1:34ifQ24R2EUNjakzZBKY1M4EvnOWeIYJOrJxRGdRNh4= From 8900b7ae106e3ab2d063d1a4a71ce1bc5ecdeddf Mon Sep 17 00:00:00 2001 From: Curt Tudor Date: Thu, 4 Feb 2021 13:33:53 -0500 Subject: [PATCH 5/6] purge session from forwardTable during unroutTimeout if no xgressForSession is found (#294) --- CHANGELOG.md | 1 + go.mod | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e3ff2078..5d43a3945 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ listeners: advertise: curt-edge-ws-router:3022 ``` +* Fix router memory leak: purge session from forwardTable during unroutTimeout # Release 0.18.7 diff --git a/go.mod b/go.mod index 87f7af5a4..1206e1cc0 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19 github.com/michaelquigley/pfxlog v0.3.6 github.com/openziti/edge v0.17.57 - github.com/openziti/fabric v0.15.18 + github.com/openziti/fabric v0.15.19 github.com/openziti/foundation v0.15.10 github.com/openziti/sdk-golang v0.15.13 github.com/pborman/uuid v1.2.0 From a982b4fac69cecedb1fc118f39aa415cbf25e4c0 Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Fri, 5 Feb 2021 13:04:06 -0500 Subject: [PATCH 6/6] Update deps and changelog --- CHANGELOG.md | 17 ++++++++++++----- go.mod | 6 +++--- go.sum | 10 ++++++---- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ab7d7fa6..52f59d066 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,14 @@ ## What's New -* Websocket binding in Edge Router to support connections from BrowZer-based apps that use the `ziti-sdk-js`. Edge Routers support various configurations including a single `tls` binding, a single `ws` binding, or having both `tls` and `ws` bindings simultaneously. If both binding types are used, they must be specified with different ports. +* Websocket binding in Edge Router to support connections from BrowZer-based apps that use + the `ziti-sdk-js`. Edge Routers support various configurations including a single `tls` binding, a + single `ws` binding, or having both `tls` and `ws` bindings simultaneously. If both binding types + are used, they must be specified with different ports. * Edge Router list for current identity +* Fix terminator PATCH, don't update/clear peer data unless requested +* Fix concurrency related crash in router +* Fix resource leak in fabric: forwarder tables weren't always updated after unroute ## Websocket Binding @@ -25,13 +31,15 @@ listeners: ## Edge Router List For Current Identity -A new endpoint has been added which will display the list of Edge Routers an authenticated session has access to via any policy. -The records will indicate whether the router is online, its hostname, and its supported protocols. This endpoint will not return Edge -Routers that have not completed enrollment. Edge Routers that are offline will not have hostname and supported protocol information. +A new endpoint has been added which will display the list of Edge Routers an authenticated session +has access to via any policy. The records will indicate whether the router is online, its hostname, +and its supported protocols. This endpoint will not return Edge Routers that have not completed +enrollment. Edge Routers that are offline will not have hostname and supported protocol information. Endpoint: `GET /current-identity/edge-routers` Example Output: + ``` { "data": [ @@ -114,7 +122,6 @@ There is a new controller config file setting: * `ctrlChanLatencyIntervalSeconds` which controls how often the latency probe is sent. Default value: 10 - # Release 0.18.6 ## What's New diff --git a/go.mod b/go.mod index 35d8c7071..4730ffd4f 100644 --- a/go.mod +++ b/go.mod @@ -24,9 +24,9 @@ require ( github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19 github.com/michaelquigley/pfxlog v0.3.6 - github.com/openziti/edge v0.17.59 - github.com/openziti/fabric v0.15.19 - github.com/openziti/foundation v0.15.10 + github.com/openziti/edge v0.17.60 + github.com/openziti/fabric v0.15.20 + github.com/openziti/foundation v0.15.12 github.com/openziti/sdk-golang v0.15.13 github.com/pborman/uuid v1.2.0 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index c463f79c3..aedf2e0df 100644 --- a/go.sum +++ b/go.sum @@ -520,15 +520,17 @@ github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= -github.com/openziti/edge v0.17.59 h1:QCRWpF5De3fB/GQDcC4RNRwHZ3Xsm9tGrKrQD0LiRvk= -github.com/openziti/edge v0.17.59/go.mod h1:tuzW9dGztEPiDY8P7a45dq+N8VA3KRDGnYIGOR+DFJE= +github.com/openziti/edge v0.17.60 h1:Qfwqh+7S9SiTE6DiN4/fhWRfrvo4sEVUnUbRRXoBTs8= +github.com/openziti/edge v0.17.60/go.mod h1:tuzW9dGztEPiDY8P7a45dq+N8VA3KRDGnYIGOR+DFJE= github.com/openziti/fabric v0.15.18 h1:Ze/v2ZCGjo2QqA5Y+o2PP/Mcf/GLRSDGc3Ia2+2c6jw= github.com/openziti/fabric v0.15.18/go.mod h1:KKvO246Nk8twpNv+Mee60NVJh83eh9ZreAb3H8JEnJY= -github.com/openziti/fabric v0.15.19 h1:8uUx+eGamZJORlhs9ik8yuqvZ2mOCd3MWuyCkot/ma0= -github.com/openziti/fabric v0.15.19/go.mod h1:yXgrctF8VOJdHWGoC6b9dqvcQDJ8IvV9Phbs7PHQEiU= +github.com/openziti/fabric v0.15.20 h1:V3ILMQEbVVGzs/ciHWZe/elPa6stL+O2jmJbozHlhcM= +github.com/openziti/fabric v0.15.20/go.mod h1:2Q63EWL1MDcdhZYoaMQDVjbGzRgonIdgRmzxaNDHJI0= github.com/openziti/foundation v0.15.9/go.mod h1:34ifQ24R2EUNjakzZBKY1M4EvnOWeIYJOrJxRGdRNh4= github.com/openziti/foundation v0.15.10 h1:gDU2Ot2u50q+x5kkVvJqi4XjLeZRVRoVCFJjN6QCCFA= github.com/openziti/foundation v0.15.10/go.mod h1:34ifQ24R2EUNjakzZBKY1M4EvnOWeIYJOrJxRGdRNh4= +github.com/openziti/foundation v0.15.12 h1:fdhhEsJPfvVIdarY4fd4gPGHkOGIAuxIig2hHweZ9K0= +github.com/openziti/foundation v0.15.12/go.mod h1:34ifQ24R2EUNjakzZBKY1M4EvnOWeIYJOrJxRGdRNh4= github.com/openziti/sdk-golang v0.15.13 h1:Pd5WqFcPxrM8o/VeqCoKeGCgL+pC9Y5dVb1tqMhRprI= github.com/openziti/sdk-golang v0.15.13/go.mod h1:L1UbvXUV7DV6a3pd50CAJqtt9z6nN53p2cKNJlHZXR8= github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6 h1:lNCW6THrCKBiJBpz8kbVGjC7MgdCGKwuvBgc7LoD6sw=