From f429a1dd31223a8e861c6126100c7977c7a2ba9d Mon Sep 17 00:00:00 2001 From: dovholuknf <46322585+dovholuknf@users.noreply.github.com> Date: Mon, 25 May 2020 11:37:02 -0400 Subject: [PATCH 01/18] see what a publish looks like with a classifier --- service/publish.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/publish.bat b/service/publish.bat index 0cdb6f01..6801bbf9 100644 --- a/service/publish.bat +++ b/service/publish.bat @@ -6,7 +6,7 @@ IF "%BUILD_VERSION%"=="" GOTO BUILD_VERSION_ERROR IF "%TRAVIS_BRANCH%"=="master" GOTO RELEASE @echo Publishing to snapshot repo -ziti-ci publish artifactory --groupId=ziti-tunnel-win.amd64.windows --artifactId=ziti-tunnel-win --version=%BUILD_VERSION%-SNAPSHOT --target=service/ziti-tunnel-win.zip +ziti-ci publish artifactory --groupId=ziti-tunnel-win.amd64.windows --artifactId=ziti-tunnel-win --version=%BUILD_VERSION%-SNAPSHOT --target=service/ziti-tunnel-win.zip --classifier=$TRAVIS_BRANCH GOTO END :RELEASE From 1538c8e98b0e7ea7b36866f59e73308b1325490d Mon Sep 17 00:00:00 2001 From: dovholuknf <46322585+dovholuknf@users.noreply.github.com> Date: Mon, 25 May 2020 11:40:59 -0400 Subject: [PATCH 02/18] on windows - environment variables are wrapped in parens... lol --- service/publish.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/publish.bat b/service/publish.bat index 6801bbf9..94147e95 100644 --- a/service/publish.bat +++ b/service/publish.bat @@ -6,7 +6,7 @@ IF "%BUILD_VERSION%"=="" GOTO BUILD_VERSION_ERROR IF "%TRAVIS_BRANCH%"=="master" GOTO RELEASE @echo Publishing to snapshot repo -ziti-ci publish artifactory --groupId=ziti-tunnel-win.amd64.windows --artifactId=ziti-tunnel-win --version=%BUILD_VERSION%-SNAPSHOT --target=service/ziti-tunnel-win.zip --classifier=$TRAVIS_BRANCH +ziti-ci publish artifactory --groupId=ziti-tunnel-win.amd64.windows --artifactId=ziti-tunnel-win --version=%BUILD_VERSION%-SNAPSHOT --target=service/ziti-tunnel-win.zip --classifier=%TRAVIS_BRANCH% GOTO END :RELEASE From 2752f114747da10678c6081c584ef60a7b536ff8 Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Tue, 26 May 2020 14:55:38 -0400 Subject: [PATCH 03/18] generate the version.go file sooner up so that it's compiled in --- service/build.bat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/build.bat b/service/build.bat index 708aac09..f5738d57 100644 --- a/service/build.bat +++ b/service/build.bat @@ -8,6 +8,9 @@ IF "%BUILD_VERSION%"=="" GOTO BUILD_VERSION_ERROR call %SVC_ROOT_DIR%/../get-ziti-ci.bat ziti-ci version +@echo generating version info - this will not be pushed +ziti-ci generate-build-info --useVersion=false %SVC_ROOT_DIR%/ziti-tunnel/version.go main + @echo configuring git ziti-ci configure-git pwd @@ -43,9 +46,6 @@ cp %TUNNELER_SDK_DIR%\install\lib\libuv.dll %SVC_ROOT_DIR% @echo COPIED dlls to %SVC_ROOT_DIR% cd %SVC_ROOT_DIR% -@echo emitting version information -ziti-ci generate-build-info ziti-tunnel/version.go main - REM go build -a ./ziti-wintun go build -a ./ziti-tunnel From ee45baf3c8febde2c6dd8d8aea2470ee1c2cf320 Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Tue, 26 May 2020 15:16:38 -0400 Subject: [PATCH 04/18] Release 0.0.5 --- service/ziti-tunnel/version.go | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 service/ziti-tunnel/version.go diff --git a/service/ziti-tunnel/version.go b/service/ziti-tunnel/version.go new file mode 100644 index 00000000..e69de29b From 19a527a39d9bda0639ddd4db39552c7b04ad980c Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Tue, 26 May 2020 15:20:06 -0400 Subject: [PATCH 05/18] Release 0.0.5 --- service/ziti-tunnel/version.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/service/ziti-tunnel/version.go b/service/ziti-tunnel/version.go index e69de29b..85a67088 100644 --- a/service/ziti-tunnel/version.go +++ b/service/ziti-tunnel/version.go @@ -0,0 +1,11 @@ +// Code generated by ziti-ci. DO NOT EDIT. + +package main + +const ( + Version = "0.0.5" + Revision = "ee45baf3c8fe" + Branch = "may25" + BuildUser = "Clint D" + BuildDate = "2020-05-26 15:20:06" +) From 6ed93ab596178f87991e0e506ac1a29713c07ccd Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Tue, 26 May 2020 15:43:27 -0400 Subject: [PATCH 06/18] update build.bat and add version command to support outputting of the version --- service/build.bat | 3 +-- service/go.mod | 2 +- service/go.sum | 2 ++ service/ziti-tunnel/main.go | 7 +++++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/service/build.bat b/service/build.bat index f5738d57..443ad5be 100644 --- a/service/build.bat +++ b/service/build.bat @@ -25,11 +25,10 @@ mkdir %TUNNELER_SDK_DIR% git clone %REPO_URL% %TUNNELER_SDK_DIR% IF %ERRORLEVEL% NEQ 0 @echo Could not clone git repo:%REPO_URL% -cd ziti-tunneler-sdk-c +cd %TUNNELER_SDK_DIR% git checkout %REPO_BRANCH% IF %ERRORLEVEL% NEQ 0 @echo Could not checkout branch :%REPO_BRANCH% - @echo Updating submodules... git submodule update --init --recursive IF %ERRORLEVEL% NEQ 0 @echo Could not update submodules diff --git a/service/go.mod b/service/go.mod index ea0ae395..a967c35c 100644 --- a/service/go.mod +++ b/service/go.mod @@ -11,7 +11,7 @@ require ( github.com/lestrrat-go/strftime v1.0.1 // indirect github.com/michaelquigley/pfxlog v0.0.0-20190813191113-2be43bd0dccc github.com/miekg/dns v1.1.29 - github.com/netfoundry/ziti-ci v0.0.0-20200522192519-a95b5ebe20c6 // indirect + github.com/netfoundry/ziti-ci v0.0.0-20200525130813-03a689aae69d // indirect github.com/netfoundry/ziti-foundation v0.9.8 github.com/netfoundry/ziti-sdk-golang v0.11.16 github.com/sirupsen/logrus v1.5.0 diff --git a/service/go.sum b/service/go.sum index e7c6f618..39553671 100644 --- a/service/go.sum +++ b/service/go.sum @@ -112,6 +112,8 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/netfoundry/secretstream v0.1.1/go.mod h1:uasYkYSp0MmNSlKOWJ2sVzxPms8e58TS4ENq4yro86k= github.com/netfoundry/ziti-ci v0.0.0-20200522192519-a95b5ebe20c6 h1:FGfOXV39auED7XAqslvQsbRK9IoakYFWMQYlRKWb91A= github.com/netfoundry/ziti-ci v0.0.0-20200522192519-a95b5ebe20c6/go.mod h1:GJwBOsCiMCjc8uK1/0NRLv+ZVlw2YpyT1IgpguWrahE= +github.com/netfoundry/ziti-ci v0.0.0-20200525130813-03a689aae69d h1:Qo9EPXgs8RbTx5DqOoZ/+z9G9wFy45pOdCzuht9TJkM= +github.com/netfoundry/ziti-ci v0.0.0-20200525130813-03a689aae69d/go.mod h1:GJwBOsCiMCjc8uK1/0NRLv+ZVlw2YpyT1IgpguWrahE= github.com/netfoundry/ziti-foundation v0.9.8 h1:Nyx4U+pZ6iPtXBYSIad8xg5nBVjQNLatCHg5krQmeWM= github.com/netfoundry/ziti-foundation v0.9.8/go.mod h1:desAxe5jN/V/+cYe99TGEqxtMVdlJ1HfSRzCmuPJD7M= github.com/netfoundry/ziti-sdk-golang v0.11.16 h1:YZxHtDq4o+r141ISHvElT0CH4DKdb+EeQaoxSDVJAq0= diff --git a/service/ziti-tunnel/main.go b/service/ziti-tunnel/main.go index bb8094ca..c302b44a 100644 --- a/service/ziti-tunnel/main.go +++ b/service/ziti-tunnel/main.go @@ -94,6 +94,8 @@ func main() { err = service.ControlService(svc.Pause, svc.Paused) case "continue": err = service.ControlService(svc.Continue, svc.Running) + case "version": + printVersion() default: usage(fmt.Sprintf("invalid command %s", cmd)) } @@ -113,3 +115,8 @@ func usage(errmsg string) { errmsg, os.Args[0]) os.Exit(2) } + +func printVersion() { + fmt.Printf("%v version: %v, revision: %v, branch: %v, build-by: %v, built-on: %v\n", + os.Args[0], Version, Revision, Branch, BuildUser, BuildDate) +} \ No newline at end of file From e0bb772aa0028c3d4d5637215db4954713fc6001 Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Tue, 26 May 2020 15:54:59 -0400 Subject: [PATCH 07/18] udpate include to ziti from nf --- service/cziti/ctun.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/cziti/ctun.go b/service/cziti/ctun.go index 20427dde..b1ea7d06 100644 --- a/service/cziti/ctun.go +++ b/service/cziti/ctun.go @@ -21,9 +21,9 @@ package cziti /* #cgo LDFLAGS: -l ziti_tunneler -l lwipcore -l lwipwin32arch -l ziti_tunneler -l ziti_tunneler_cbs -#include -#include -#include +#include +#include +#include #include From a1608424d023539c3dde6a5590d842dee8d2dabe Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Tue, 26 May 2020 16:02:44 -0400 Subject: [PATCH 08/18] update url to c project --- service/build.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/build.bat b/service/build.bat index 443ad5be..df5f7433 100644 --- a/service/build.bat +++ b/service/build.bat @@ -16,7 +16,7 @@ ziti-ci configure-git pwd cd service -SET REPO_URL=https://github.com/netfoundry/ziti-tunneler-sdk-c.git +SET REPO_URL=https://github.com/openziti/ziti-tunneler-sdk-c.git SET REPO_BRANCH=update-submodule-to-https-vs-git SET TUNNELER_SDK_DIR=%SVC_ROOT_DIR%deps\ziti-tunneler-sdk-c mkdir %TUNNELER_SDK_DIR% From 815a90b6c88d13ba347d5c15e51aba7d2135e455 Mon Sep 17 00:00:00 2001 From: dovholuknf <46322585+dovholuknf@users.noreply.github.com> Date: Tue, 26 May 2020 22:40:54 -0400 Subject: [PATCH 09/18] test to see if go build succeeded --- README.md | 1 + service/build.bat | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index b5610cf2..3d4d257e 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,4 @@ components: * A Windows service which runs as the local system account which creates the TUN as well as manages the Ziti connections * A Windows UWP UI application that allows the interactively logged on user to interact with the Windows service + diff --git a/service/build.bat b/service/build.bat index df5f7433..bd171d3c 100644 --- a/service/build.bat +++ b/service/build.bat @@ -47,6 +47,7 @@ cd %SVC_ROOT_DIR% REM go build -a ./ziti-wintun go build -a ./ziti-tunnel +if %ERRORLEVEL% GEQ 1 EXIT /B %ERRORLEVEL% @echo creating the distribution zip file zip ziti-tunnel-win.zip *.dll ziti*exe From 2bd965107beb19589612fd3dc65318c6a558bbcd Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Tue, 26 May 2020 22:47:39 -0400 Subject: [PATCH 10/18] Release 0.0.5 --- service/ziti-tunnel/version.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/service/ziti-tunnel/version.go b/service/ziti-tunnel/version.go index 85a67088..e69de29b 100644 --- a/service/ziti-tunnel/version.go +++ b/service/ziti-tunnel/version.go @@ -1,11 +0,0 @@ -// Code generated by ziti-ci. DO NOT EDIT. - -package main - -const ( - Version = "0.0.5" - Revision = "ee45baf3c8fe" - Branch = "may25" - BuildUser = "Clint D" - BuildDate = "2020-05-26 15:20:06" -) From 481f28f80cf00a09a46697772f4a465a046c5276 Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Tue, 26 May 2020 23:03:40 -0400 Subject: [PATCH 11/18] add another check to make sure the ziti-tunnel-sdk-c builds and put the missing CGO flags back i somehow removed --- service/build.bat | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service/build.bat b/service/build.bat index bd171d3c..76b0d324 100644 --- a/service/build.bat +++ b/service/build.bat @@ -19,6 +19,8 @@ cd service SET REPO_URL=https://github.com/openziti/ziti-tunneler-sdk-c.git SET REPO_BRANCH=update-submodule-to-https-vs-git SET TUNNELER_SDK_DIR=%SVC_ROOT_DIR%deps\ziti-tunneler-sdk-c +set CGO_CFLAGS=-DNOGDI -I %TUNNELER_SDK_DIR%\install\include +set CGO_LDFLAGS=-L %TUNNELER_SDK_DIR%\install\lib mkdir %TUNNELER_SDK_DIR% @echo cloning %REPO_URL% @@ -38,6 +40,7 @@ if not exist %TUNNELER_SDK_DIR%\install mkdir %TUNNELER_SDK_DIR%\install cmake -G Ninja -S %TUNNELER_SDK_DIR% -B %TUNNELER_SDK_DIR%\build -DCMAKE_INSTALL_PREFIX=%TUNNELER_SDK_DIR%\install cmake --build %TUNNELER_SDK_DIR%\build --target install +if %ERRORLEVEL% GEQ 1 EXIT /B %ERRORLEVEL% cp %TUNNELER_SDK_DIR%\install\lib\ziti.dll %SVC_ROOT_DIR% cp %TUNNELER_SDK_DIR%\install\lib\libuv.dll %SVC_ROOT_DIR% From fdb339a9273103c2fbfa85f7c567cd2a14e28e2a Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Tue, 26 May 2020 23:08:44 -0400 Subject: [PATCH 12/18] Release 0.0.5 --- service/ziti-tunnel/version.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/service/ziti-tunnel/version.go b/service/ziti-tunnel/version.go index e69de29b..e703a6dc 100644 --- a/service/ziti-tunnel/version.go +++ b/service/ziti-tunnel/version.go @@ -0,0 +1,11 @@ +// Code generated by ziti-ci. DO NOT EDIT. + +package main + +const ( + Version = "0.0.5" + Revision = "481f28f80cf0" + Branch = "may25" + BuildUser = "Clint D" + BuildDate = "2020-05-26 23:08:43" +) From 4c10d946a4aeb19cc6feea4a02d2842a0985cb8f Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Tue, 26 May 2020 23:28:15 -0400 Subject: [PATCH 13/18] move from NF_ to ziti_ and similar fixes --- service/cziti/ctun.go | 12 ++++++------ service/cziti/sdk.go | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/service/cziti/ctun.go b/service/cziti/ctun.go index b1ea7d06..2beb6f3d 100644 --- a/service/cziti/ctun.go +++ b/service/cziti/ctun.go @@ -98,11 +98,11 @@ func HookupTun(dev tun.Device, dns []net.IP) (Tunnel, error) { opts := (*C.tunneler_sdk_options)(C.calloc(1, C.sizeof_tunneler_sdk_options)) opts.netif_driver = drv - opts.ziti_dial = C.ziti_dial_cb(C.ziti_sdk_c_dial) - opts.ziti_close = C.ziti_close_cb(C.ziti_sdk_c_close) - opts.ziti_write = C.ziti_write_cb(C.ziti_sdk_c_write) + opts.ziti_dial = C.ziti_sdk_dial_cb(C.ziti_sdk_c_dial) + opts.ziti_close = C.ziti_sdk_close_cb(C.ziti_sdk_c_close) + opts.ziti_write = C.ziti_sdk_write_cb(C.ziti_sdk_c_write) - t.tunCtx = C.NF_tunneler_init(opts, _impl.libuvCtx.l) + t.tunCtx = C.ziti_tunneler_init(opts, _impl.libuvCtx.l) go runDNSserver(dns) @@ -248,8 +248,8 @@ func (t *tunnel) runWriteLoop() { func (t *tunnel) AddIntercept(service string, host string, port int, ctx unsafe.Pointer) { zitiCtx := (*C.ziti_context)(C.malloc(C.sizeof_ziti_context)) - zitiCtx.nf_ctx = ctx - res := C.NF_tunneler_intercept_v1(t.tunCtx, unsafe.Pointer(zitiCtx), + zitiCtx.ziti_ctx = ctx + res := C.ziti_tunneler_intercept_v1(t.tunCtx, unsafe.Pointer(zitiCtx), C.CString(service), C.CString(host), C.int(port)) log.Debug("intercept added", res) } diff --git a/service/cziti/sdk.go b/service/cziti/sdk.go index 8c5bbb2a..3f5e9370 100644 --- a/service/cziti/sdk.go +++ b/service/cziti/sdk.go @@ -72,7 +72,7 @@ func SetLogLevel(level int) { func Start() { - v := C.NF_get_version() + v := C.ziti_get_version() log.Infof("starting ziti-sdk-c %s(%s)[%s]", C.GoString(v.version), C.GoString(v.revision), C.GoString(v.build_date)) _impl.run() @@ -94,8 +94,8 @@ type Service struct { } type CZitiCtx struct { - options C.nf_options - nf C.nf_context + options C.ziti_options + nf C.ziti_context status int statusErr error @@ -108,7 +108,7 @@ func (c *CZitiCtx) Status() (int, error) { func (c *CZitiCtx) Name() string { if c.nf != nil { - id := C.NF_get_identity(c.nf) + id := C.ziti_get_identity(c.nf) if id != nil { return C.GoString(id.name) } @@ -118,7 +118,7 @@ func (c *CZitiCtx) Name() string { func (c *CZitiCtx) Controller() string { if c.nf != nil { - return C.GoString(C.NF_get_controller(c.nf)) + return C.GoString(C.ziti_get_controller(c.nf)) } return C.GoString(c.options.controller) } @@ -126,7 +126,7 @@ func (c *CZitiCtx) Controller() string { var tunCfgName = C.CString("ziti-tunneler-client.v1") //export serviceCB -func serviceCB(nf C.nf_context, service *C.ziti_service, status C.int, data unsafe.Pointer) { +func serviceCB(nf C.ziti_context, service *C.ziti_service, status C.int, data unsafe.Pointer) { ctx := (*CZitiCtx)(data) if ctx.Services == nil { @@ -185,7 +185,7 @@ func serviceCB(nf C.nf_context, service *C.ziti_service, status C.int, data unsa } //export initCB -func initCB(nf C.nf_context, status C.int, data unsafe.Pointer) { +func initCB(nf C.ziti_context, status C.int, data unsafe.Pointer) { ctx := (*CZitiCtx)(data) ctx.nf = nf @@ -213,8 +213,8 @@ func zitiError(code C.int) error { func LoadZiti(cfg string) *CZitiCtx { ctx := &CZitiCtx{} ctx.options.config = C.CString(cfg) - ctx.options.init_cb = C.nf_init_cb(C.initCB) - ctx.options.service_cb = C.nf_service_cb(C.serviceCB) + ctx.options.init_cb = C.ziti_init_cb(C.initCB) + ctx.options.service_cb = C.ziti_service_cb(C.serviceCB) //TODO don't commit this - ctx.options.refresh_interval = C.long(600) ctx.options.refresh_interval = C.long(15) ctx.options.config_types = C.all_configs @@ -222,7 +222,7 @@ func LoadZiti(cfg string) *CZitiCtx { ch := make(chan *CZitiCtx) initMap[cfg] = ch - rc := C.NF_init_opts(&ctx.options, _impl.libuvCtx.l, unsafe.Pointer(ctx)) + rc := C.ziti_init_opts(&ctx.options, _impl.libuvCtx.l, unsafe.Pointer(ctx)) if rc != C.ZITI_OK { ctx.status, ctx.statusErr = int(rc), zitiError(rc) go func() { @@ -241,7 +241,7 @@ func GetTransferRates(ctx *CZitiCtx) (int64, int64, bool) { //extern void NF_get return 0, 0, false } var up, down C.double - C.NF_get_transfer_rates(ctx.nf, &up, &down) + C.ziti_get_transfer_rates(ctx.nf, &up, &down) return int64(up), int64(down), true } \ No newline at end of file From b8b76787309721dd2ec781d01926a49d7441f7a4 Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Wed, 27 May 2020 00:32:25 -0400 Subject: [PATCH 14/18] update cziti stuff to the latest and greatest and remove NF_ --> ziti_ etc --- service/cziti/ctun.go | 3 +-- service/cziti/sdk.c | 4 ++-- service/cziti/sdk.go | 8 ++++---- service/cziti/sdk.h | 8 ++++---- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/service/cziti/ctun.go b/service/cziti/ctun.go index 2beb6f3d..d0ce3f81 100644 --- a/service/cziti/ctun.go +++ b/service/cziti/ctun.go @@ -43,7 +43,6 @@ extern void readIdle(uv_prepare_t *idler); extern void call_on_packet(void *packet, ssize_t len, packet_cb cb, void *ctx); - */ import "C" import ( @@ -247,7 +246,7 @@ func (t *tunnel) runWriteLoop() { } func (t *tunnel) AddIntercept(service string, host string, port int, ctx unsafe.Pointer) { - zitiCtx := (*C.ziti_context)(C.malloc(C.sizeof_ziti_context)) + zitiCtx := (*C.intercept_ctx_t)(C.malloc(C.sizeof_intercept_ctx_t)) zitiCtx.ziti_ctx = ctx res := C.ziti_tunneler_intercept_v1(t.tunCtx, unsafe.Pointer(zitiCtx), C.CString(service), C.CString(host), C.int(port)) diff --git a/service/cziti/sdk.c b/service/cziti/sdk.c index cf1fd952..4271ff40 100644 --- a/service/cziti/sdk.c +++ b/service/cziti/sdk.c @@ -16,8 +16,8 @@ */ #include "sdk.h" -#include -#include +#include +#include void libuv_stopper(uv_async_t *a) { uv_stop(a->loop); diff --git a/service/cziti/sdk.go b/service/cziti/sdk.go index 3f5e9370..8d79843a 100644 --- a/service/cziti/sdk.go +++ b/service/cziti/sdk.go @@ -20,11 +20,11 @@ package cziti /* #cgo windows LDFLAGS: -l libziti.imp -luv -lws2_32 -lpsapi -#include +#include #include "sdk.h" -extern void initCB(nf_context nf, int status, void *ctx); -extern void serviceCB(nf_context nf, ziti_service*, int status, void *ctx); +extern void initCB(ziti_context nf, int status, void *ctx); +extern void serviceCB(ziti_context nf, ziti_service*, int status, void *ctx); */ import "C" @@ -236,7 +236,7 @@ func LoadZiti(cfg string) *CZitiCtx { return res } -func GetTransferRates(ctx *CZitiCtx) (int64, int64, bool) { //extern void NF_get_transfer_rates(nf_context nf, double* up, double* down); +func GetTransferRates(ctx *CZitiCtx) (int64, int64, bool) { //extern void NF_get_transfer_rates(ziti_context nf, double* up, double* down); if ctx == nil { return 0, 0, false } diff --git a/service/cziti/sdk.h b/service/cziti/sdk.h index 97a52e6d..d80cf904 100644 --- a/service/cziti/sdk.h +++ b/service/cziti/sdk.h @@ -18,14 +18,14 @@ #include #include #define USING_ZITI_SHARED -#include -#include +#include +#include #include typedef struct cziti_ctx_s { - nf_options opts; - nf_context nf; + ziti_options opts; + ziti_context nf; uv_async_t async; } cziti_ctx; From 284f9c064c927fee7d625577642feafbac2024ac Mon Sep 17 00:00:00 2001 From: ziti-ci Date: Wed, 27 May 2020 01:09:24 -0400 Subject: [PATCH 15/18] move to 0.0.6 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index bbdeab62..1750564f 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.0.5 +0.0.6 From 135c90db5991d08af6503b18237573485e99cf93 Mon Sep 17 00:00:00 2001 From: dovholuknf <46322585+dovholuknf@users.noreply.github.com> Date: Wed, 27 May 2020 08:23:46 -0400 Subject: [PATCH 16/18] refine build.bat a bit --- service/build.bat | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/service/build.bat b/service/build.bat index 76b0d324..0abd315c 100644 --- a/service/build.bat +++ b/service/build.bat @@ -1,6 +1,8 @@ @echo off set SVC_ROOT_DIR=%~dp0 -set /p BUILD_VERSION=<%SVC_ROOT_DIR%..\version +set ZITI_TUNNEL_WIN_ROOT=%SVC_ROOT_DIR%..\ +set /p BUILD_VERSION=<%ZITI_TUNNEL_WIN_ROOT%version +cd %ZITI_TUNNEL_WIN_ROOT% IF "%BUILD_VERSION%"=="" GOTO BUILD_VERSION_ERROR @@ -23,32 +25,37 @@ set CGO_CFLAGS=-DNOGDI -I %TUNNELER_SDK_DIR%\install\include set CGO_LDFLAGS=-L %TUNNELER_SDK_DIR%\install\lib mkdir %TUNNELER_SDK_DIR% -@echo cloning %REPO_URL% -git clone %REPO_URL% %TUNNELER_SDK_DIR% -IF %ERRORLEVEL% NEQ 0 @echo Could not clone git repo:%REPO_URL% +if not exist %SVC_ROOT_DIR%ziti.dll ( + @echo cloning %REPO_URL% + git clone %REPO_URL% %TUNNELER_SDK_DIR% + IF %ERRORLEVEL% NEQ 0 @echo Could not clone git repo:%REPO_URL% -cd %TUNNELER_SDK_DIR% -git checkout %REPO_BRANCH% -IF %ERRORLEVEL% NEQ 0 @echo Could not checkout branch :%REPO_BRANCH% + cd %TUNNELER_SDK_DIR% + git checkout %REPO_BRANCH% + IF %ERRORLEVEL% NEQ 0 @echo Could not checkout branch :%REPO_BRANCH% -@echo Updating submodules... -git submodule update --init --recursive -IF %ERRORLEVEL% NEQ 0 @echo Could not update submodules + @echo Updating submodules... + git submodule update --init --recursive + IF %ERRORLEVEL% NEQ 0 @echo Could not update submodules -if not exist %TUNNELER_SDK_DIR%\build mkdir %TUNNELER_SDK_DIR%\build -if not exist %TUNNELER_SDK_DIR%\install mkdir %TUNNELER_SDK_DIR%\install + if not exist %TUNNELER_SDK_DIR%\build mkdir %TUNNELER_SDK_DIR%\build + if not exist %TUNNELER_SDK_DIR%\install mkdir %TUNNELER_SDK_DIR%\install -cmake -G Ninja -S %TUNNELER_SDK_DIR% -B %TUNNELER_SDK_DIR%\build -DCMAKE_INSTALL_PREFIX=%TUNNELER_SDK_DIR%\install -cmake --build %TUNNELER_SDK_DIR%\build --target install -if %ERRORLEVEL% GEQ 1 EXIT /B %ERRORLEVEL% + cmake -G Ninja -S %TUNNELER_SDK_DIR% -B %TUNNELER_SDK_DIR%\build -DCMAKE_INSTALL_PREFIX=%TUNNELER_SDK_DIR%\install + cmake --build %TUNNELER_SDK_DIR%\build --target install + if %ERRORLEVEL% GEQ 1 EXIT /B %ERRORLEVEL% -cp %TUNNELER_SDK_DIR%\install\lib\ziti.dll %SVC_ROOT_DIR% -cp %TUNNELER_SDK_DIR%\install\lib\libuv.dll %SVC_ROOT_DIR% + cp %TUNNELER_SDK_DIR%\install\lib\ziti.dll %SVC_ROOT_DIR% + cp %TUNNELER_SDK_DIR%\install\lib\libuv.dll %SVC_ROOT_DIR% -@echo COPIED dlls to %SVC_ROOT_DIR% -cd %SVC_ROOT_DIR% + @echo COPIED dlls to %SVC_ROOT_DIR% + cd %SVC_ROOT_DIR% +) else ( + @echo ------------------------------------------------------------------------------ + @echo SKIPPED BUILDING ziti.dll because ziti.dll was found at %SVC_ROOT_DIR%ziti.dll + @echo ------------------------------------------------------------------------------ +) -REM go build -a ./ziti-wintun go build -a ./ziti-tunnel if %ERRORLEVEL% GEQ 1 EXIT /B %ERRORLEVEL% From 14f29d99bf46e0d8fb448731a1373b2c21d9ff35 Mon Sep 17 00:00:00 2001 From: dovholuknf <46322585+dovholuknf@users.noreply.github.com> Date: Wed, 27 May 2020 22:03:32 -0400 Subject: [PATCH 17/18] add more debug statements and make the service update channel buffered. also wait for the ziti tun to clean up before exiting the service --- service/cziti/sdk.go | 2 +- service/ziti-tunnel/service/ipc.go | 18 ++++++++++++------ service/ziti-tunnel/service/service.go | 4 ++++ service/ziti-tunnel/service/state.go | 2 +- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/service/cziti/sdk.go b/service/cziti/sdk.go index 8d79843a..c685292a 100644 --- a/service/cziti/sdk.go +++ b/service/cziti/sdk.go @@ -41,7 +41,7 @@ const ( REMOVED = "removed" ) -var ServiceChanges = make(chan ServiceChange) +var ServiceChanges = make(chan ServiceChange, 256) var log = pfxlog.Logger() type sdk struct { diff --git a/service/ziti-tunnel/service/ipc.go b/service/ziti-tunnel/service/ipc.go index 5f93da01..4b8c1ea4 100644 --- a/service/ziti-tunnel/service/ipc.go +++ b/service/ziti-tunnel/service/ipc.go @@ -57,7 +57,7 @@ func (p *Pipes) Close() { var shutdown = make(chan bool) //a channel informing go routines to exit -func SubMain(ops <-chan string, changes chan<- svc.Status) error { +func SubMain(ops chan string, changes chan<- svc.Status) error { log.Info("============================== service begins ==============================") rts.LoadConfig() @@ -114,13 +114,16 @@ func SubMain(ops <-chan string, changes chan<- svc.Status) error { shutdown <- true // stop the metrics ticker shutdown <- true // stop the service change listener + log.Infof("shutting down connections...") pipes.shutdownConnections() + + log.Infof("shutting down events...") events.shutdown() + log.Infof("resetting dns...") windns.ResetDNS() - - log.Error("DELETING INTERFACE!") + log.Infof("Removing existing interface: %s", TunName) wt, err := tun.WintunPool.GetInterface(TunName) if err == nil { // If so, we delete it, in case it has weird residual configuration. @@ -136,6 +139,7 @@ func SubMain(ops <-chan string, changes chan<- svc.Status) error { log.Info("============================== service ends ==============================") + ops <- "done" return nil } func waitForStopRequest(ops <-chan string) { @@ -143,13 +147,14 @@ func waitForStopRequest(ops <-chan string) { loop: for { c := <-ops - log.Infof("request for control received, %v", c) + log.Infof("request for control received: %v", c) if c == "stop" { break loop } else { log.Debug("unexpected operation: " + c) } } + log.Infof("wait loop is exiting") } func openPipes() (*Pipes, error) { @@ -713,6 +718,7 @@ func acceptServices() { case <-shutdown: return case c := <-cziti.ServiceChanges: + log.Debug("processing service change event") matched := false //find the id using the context for _, id := range activeIds { @@ -733,17 +739,17 @@ func acceptServices() { Fingerprint: id.FingerPrint, Service: svc, } + log.Debug(" dispatched added service change event") case cziti.REMOVED: for idx, svc := range id.Services { if svc.Name == c.Servicename { id.Services = append(id.Services[:idx], id.Services[idx+1:]...) - events.broadcast <- dto.ServiceEvent{ ActionEvent: SERVICE_REMOVED, Fingerprint: id.FingerPrint, Service: *svc, } - + log.Debug(" dispatched remove service change event") } } } diff --git a/service/ziti-tunnel/service/service.go b/service/ziti-tunnel/service/service.go index cd60c5b0..8dcc13c6 100644 --- a/service/ziti-tunnel/service/service.go +++ b/service/ziti-tunnel/service/service.go @@ -77,6 +77,10 @@ loop: log.Info("main loop exiting") changes <- svc.Status{State: svc.StopPending} + + log.Infof("waiting for shutdown to complete") + <- control + log.Infof("shutdown to complete") return } diff --git a/service/ziti-tunnel/service/state.go b/service/ziti-tunnel/service/state.go index 5d82d5c7..57e9aa58 100644 --- a/service/ziti-tunnel/service/state.go +++ b/service/ziti-tunnel/service/state.go @@ -212,7 +212,7 @@ func noZiti() bool { func (t *RuntimeState) Close() { if t.tun != nil { - log.Warn("TODO: actually close the tun - or disable all the identities etc.") + log.Debug("TODO: actually close the tun - or disable all the identities etc.") /* cziti.Stop() */ From 666df79e86c43a82a7ea15eb802d222815a880f1 Mon Sep 17 00:00:00 2001 From: dovholuknf <46322585+dovholuknf@users.noreply.github.com> Date: Fri, 29 May 2020 09:30:08 -0400 Subject: [PATCH 18/18] set cziti log based on tunneler log and other minor tweaks --- service/cziti/ctun.go | 6 +- service/cziti/sdk.go | 1 + service/go.mod | 3 +- service/go.sum | 78 ++++-------------------- service/quick-build.bat | 41 +++++++++++-- service/ziti-tunnel/globals/loghelper.go | 18 +++--- service/ziti-tunnel/main.go | 3 +- service/ziti-tunnel/service/ipc.go | 18 +++--- version | 2 +- 9 files changed, 74 insertions(+), 96 deletions(-) diff --git a/service/cziti/ctun.go b/service/cziti/ctun.go index d0ce3f81..a8cfe23f 100644 --- a/service/cziti/ctun.go +++ b/service/cziti/ctun.go @@ -212,6 +212,7 @@ func readIdle(idler *C.uv_prepare_t) { for i := np; i > 0; i-- { b := <-t.readQ buf := C.CBytes(b) + C.call_on_packet(buf, C.ssize_t(len(b)), t.onPacket, t.onPacketCtx) C.free(buf) } @@ -246,9 +247,6 @@ func (t *tunnel) runWriteLoop() { } func (t *tunnel) AddIntercept(service string, host string, port int, ctx unsafe.Pointer) { - zitiCtx := (*C.intercept_ctx_t)(C.malloc(C.sizeof_intercept_ctx_t)) - zitiCtx.ziti_ctx = ctx - res := C.ziti_tunneler_intercept_v1(t.tunCtx, unsafe.Pointer(zitiCtx), - C.CString(service), C.CString(host), C.int(port)) + res := C.ziti_tunneler_intercept_v1(t.tunCtx, ctx, C.CString(service), C.CString(host), C.int(port)) log.Debug("intercept added", res) } diff --git a/service/cziti/sdk.go b/service/cziti/sdk.go index c685292a..2152564f 100644 --- a/service/cziti/sdk.go +++ b/service/cziti/sdk.go @@ -67,6 +67,7 @@ func SetLog(f *os.File) { } func SetLogLevel(level int) { + log.Infof("Setting cziti log level to: %d", level) C.setLogLevel(C.int(level)) } diff --git a/service/go.mod b/service/go.mod index a967c35c..7278df0b 100644 --- a/service/go.mod +++ b/service/go.mod @@ -7,11 +7,11 @@ require ( github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 // indirect github.com/jonboulle/clockwork v0.1.0 // indirect + github.com/kr/pretty v0.1.0 // indirect github.com/lestrrat-go/file-rotatelogs v2.3.0+incompatible github.com/lestrrat-go/strftime v1.0.1 // indirect github.com/michaelquigley/pfxlog v0.0.0-20190813191113-2be43bd0dccc github.com/miekg/dns v1.1.29 - github.com/netfoundry/ziti-ci v0.0.0-20200525130813-03a689aae69d // indirect github.com/netfoundry/ziti-foundation v0.9.8 github.com/netfoundry/ziti-sdk-golang v0.11.16 github.com/sirupsen/logrus v1.5.0 @@ -20,4 +20,5 @@ require ( golang.org/x/sys v0.0.0-20200406113430-c6e801f48ba2 golang.zx2c4.com/wireguard v0.0.20200320 golang.zx2c4.com/wireguard/windows v0.1.0 + gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect ) diff --git a/service/go.sum b/service/go.sum index 39553671..43d2c7e0 100644 --- a/service/go.sum +++ b/service/go.sum @@ -5,16 +5,10 @@ github.com/Jeffail/gabs v1.4.0/go.mod h1:6xMvQMK4k33lb7GUUpaAPh6nKMmemQeg5d4gn7/ github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/alangpierce/go-forceexport v0.0.0-20160317203124-8f1d6941cd75/go.mod h1:uAXEEpARkRhCZfEvy/y0Jcc888f9tHCc1W7/UeEtreE= -github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antlr/antlr4 v0.0.0-20191115170859-54daca92f7b0/go.mod h1:T7PbCXFs94rrTttyxjbyT5+/1V8T2TYDejxUfHJjw1Y= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/biogo/store v0.0.0-20190426020002-884f370e325d/go.mod h1:Iev9Q3MErcn+w3UOJD/DkEzllvugfdx7bGcMOFhvr/4= -github.com/buger/jsonparser v0.0.0-20180910192245-6acdf747ae99/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -24,57 +18,38 @@ 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/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q= -github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo= -github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 h1:Ghm4eQYC0nEPnSJdVkTrXpu9KtoVCSo1hg7mtI7G9KU= github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239/go.mod h1:Gdwt2ce0yfBxPvZrHkprdPPTTS3N5rwmLE8T22KBXlw= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa h1:RDBNVkRviHZtvDvId8XSGPu3rmpmSe+wKRcEWNgsfWU= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= -github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-resty/resty/v2 v2.1.0 h1:Z6IefCpUMfnvItVJaJXWv/pMiiD11So35QgwEELsldE= -github.com/go-resty/resty/v2 v2.1.0/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 h1:IPJ3dvxmJ4uczJe5YQdrYB16oTJlGSC/OyZDqUk9xX4= github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= -github.com/jfrog/gofrog v1.0.6 h1:yUDxSCw8gTK6vC4PvtG0HTnEOQJSZ+O4lWGCgkev1nU= -github.com/jfrog/gofrog v1.0.6/go.mod h1:HkDzg+tMNw23UryoOv0+LB94BzYcl6MCIoz8Tmlb+s8= -github.com/jfrog/jfrog-client-go v0.10.0 h1:SDnAOcQ/F0b5BPZE5zOkyya618scvRl+D/3z2/KVR9E= -github.com/jfrog/jfrog-client-go v0.10.0/go.mod h1:rKxpmcVmqPhhiFLxftmuhrf/scgVNNHQ8Y9pSrc2vBo= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/kataras/go-events v0.0.3-0.20170604004442-17d67be645c3/go.mod h1:6IxMW59VJdEIqj3bjFGJvGLRdb0WHtrlxPZy9qXctcg= -github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e h1:RgQk53JHp/Cjunrr1WlsXSZpqXn+uREuHvUVcK82CV8= -github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 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/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8= github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= @@ -85,6 +60,7 @@ github.com/lestrrat-go/strftime v1.0.1/go.mod h1:E1nN3pCbtMSu1yjSVeyuRFVm/U0xoR7 github.com/lucas-clemente/quic-go v0.13.1/go.mod h1:Vn3/Fb0/77b02SGhQk36KzOUmXgVpFfizUfW5WMaqyU= github.com/lxn/walk v0.0.0-20191128110447-55ccb3a9f5c1/go.mod h1:E23UucZGqpuUANJooIbHWCufXvOcT6E7Stq81gU+CSQ= github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4/go.mod h1:ouWl4wViUNh8tPSIwxTVMuS014WakR1hqvBc2I0bMoA= +github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/marten-seemann/chacha20 v0.2.0/go.mod h1:HSdjFau7GzYRj+ahFNwsO3ouVJr1HFkWoEwNDb4TMtE= github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= @@ -95,41 +71,27 @@ github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= -github.com/mholt/archiver v2.1.0+incompatible h1:1ivm7KAHPtPere1YDOdrY6xGdbMNGRWThZbYh5lWZT0= -github.com/mholt/archiver v2.1.0+incompatible/go.mod h1:Dh2dOXnSdiLxRiPoVfIr/fI1TwETms9B8CTWfeh7ROU= github.com/michaelquigley/pfxlog v0.0.0-20190813191113-2be43bd0dccc h1:PQrqw9XKYcPRI9rKwoGZucMjWvfZpyfb5j8Lc13j8YY= github.com/michaelquigley/pfxlog v0.0.0-20190813191113-2be43bd0dccc/go.mod h1:Z0K0l/NScHvLeGoy4SZTps+ZxGv85ql4AvZqTqOxBY8= github.com/miekg/dns v1.1.29 h1:xHBEhR+t5RzcFJjBLJlax2daXOrTYtr9z4WdKEfWFzg= github.com/miekg/dns v1.1.29/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/pkcs11 v1.0.3 h1:iMwmD7I5225wv84WxIG/bmxz9AXjWvTWIbM/TYHvWtw= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.0.0/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/netfoundry/secretstream v0.1.1/go.mod h1:uasYkYSp0MmNSlKOWJ2sVzxPms8e58TS4ENq4yro86k= -github.com/netfoundry/ziti-ci v0.0.0-20200522192519-a95b5ebe20c6 h1:FGfOXV39auED7XAqslvQsbRK9IoakYFWMQYlRKWb91A= -github.com/netfoundry/ziti-ci v0.0.0-20200522192519-a95b5ebe20c6/go.mod h1:GJwBOsCiMCjc8uK1/0NRLv+ZVlw2YpyT1IgpguWrahE= -github.com/netfoundry/ziti-ci v0.0.0-20200525130813-03a689aae69d h1:Qo9EPXgs8RbTx5DqOoZ/+z9G9wFy45pOdCzuht9TJkM= -github.com/netfoundry/ziti-ci v0.0.0-20200525130813-03a689aae69d/go.mod h1:GJwBOsCiMCjc8uK1/0NRLv+ZVlw2YpyT1IgpguWrahE= github.com/netfoundry/ziti-foundation v0.9.8 h1:Nyx4U+pZ6iPtXBYSIad8xg5nBVjQNLatCHg5krQmeWM= github.com/netfoundry/ziti-foundation v0.9.8/go.mod h1:desAxe5jN/V/+cYe99TGEqxtMVdlJ1HfSRzCmuPJD7M= github.com/netfoundry/ziti-sdk-golang v0.11.16 h1:YZxHtDq4o+r141ISHvElT0CH4DKdb+EeQaoxSDVJAq0= github.com/netfoundry/ziti-sdk-golang v0.11.16/go.mod h1:Onxp1kNm0xarDjl6S43Y9PQPVHfXgUFcM157KQKqHm4= -github.com/nwaples/rardecode v1.0.0 h1:r7vGuS5akxOnR4JQSkko62RJ1ReCMXxQRPtxsiFMBOs= -github.com/nwaples/rardecode v1.0.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= -github.com/pelletier/go-buffruneio v0.2.0 h1:U4t4R6YkofJ5xHm3dJzuRpPZ0mr5MMCoAWooScCR7aA= -github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= +github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pierrec/lz4 v2.3.0+incompatible h1:CZzRn4Ut9GbUkHlQ7jqBXeZQV41ZSKWFc302ZU6lUTk= -github.com/pierrec/lz4 v2.3.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -137,26 +99,23 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.5.0 h1:1N5EYkVAPEywqZRJd7cwnRtCb6xJx7NH3T3WUTF980Q= github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo= github.com/speps/go-hashids v2.0.0+incompatible/go.mod h1:P7hqPzMdnZOfyIk+xrlG1QaSMw+gCBdHKsBDnhpaZvc= +github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= +github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.2.1/go.mod h1:P4AexN0a+C9tGAnUFNwDMYYZv3pjFuvmeiMyKRaNVlI= +github.com/spf13/viper v1.3.2 h1:VUFqw5KcqRf7i70GOzW7N+Q7+gxVBkSSqiXB12+JQ4M= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/src-d/gcfg v1.3.0 h1:2BEDr8r0I0b8h/fOqwtxCEiq2HJu8n2JGZJQFGXWLjg= -github.com/src-d/gcfg v1.3.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -166,13 +125,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/tebeka/strftime v0.1.4 h1:e0FKSyxthD1Xk4cIixFPoyfD33u2SbjNngOaaC3ePoU= github.com/tebeka/strftime v0.1.4/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIUJUJH6XQ= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ulikunitz/xz v0.5.6 h1:jGHAfXawEGZQ3blwU5wnWKQJvAraT7Ftq9EXjnXYgt8= -github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= -github.com/xanzy/ssh-agent v0.2.0 h1:Adglfbi5p9Z0BmK2oKU9nTG+zKfniSfnaMYB+ULd+Ro= -github.com/xanzy/ssh-agent v0.2.0/go.mod h1:0NyE30eGUDliuLEHJgYte/zncp2zdTStcOnWhgSqHD8= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/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-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -184,11 +138,9 @@ golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d h1:1ZiEyfaQIg3Qh0EoqpwAak golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190228165749-92fc7df08ae7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191003171128-d98b1b443823/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= @@ -196,9 +148,7 @@ golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180906133057-8cf3aee42992/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -231,16 +181,10 @@ golang.zx2c4.com/wireguard/windows v0.1.0/go.mod h1:EK7CxrFnicmYJ0ZCF6crBh2/EMMe google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/src-d/go-billy.v4 v4.3.0 h1:KtlZ4c1OWbIs4jCv5ZXrTqG8EQocr0g/d4DjNg70aek= -gopkg.in/src-d/go-billy.v4 v4.3.0/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk= -gopkg.in/src-d/go-git-fixtures.v3 v3.1.1/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= -gopkg.in/src-d/go-git.v4 v4.7.0 h1:WXB+2gCoRhQiAr//IMHpIpoDsTrDgvjDORxt57e8XTA= -gopkg.in/src-d/go-git.v4 v4.7.0/go.mod h1:CzbUWqMn4pvmvndg3gnh5iZFmSsbhyhUWdI0IQ60AQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= diff --git a/service/quick-build.bat b/service/quick-build.bat index 6b779fdb..5b8ee5d2 100644 --- a/service/quick-build.bat +++ b/service/quick-build.bat @@ -1,9 +1,42 @@ -SET TUNNELER_SDK_DIR=c:\git\github\ziti-tunneler-sdk-c +@echo off +SET CURDIR=%CD% +set SVC_ROOT_DIR=%~dp0 +set ZITI_TUNNEL_WIN_ROOT=%SVC_ROOT_DIR%..\ +cd %ZITI_TUNNEL_WIN_ROOT% + +SET REPO_URL=https://github.com/openziti/ziti-tunneler-sdk-c.git +SET REPO_BRANCH=update-submodule-to-https-vs-git +SET TUNNELER_SDK_DIR=%SVC_ROOT_DIR%deps\ziti-tunneler-sdk-c set CGO_CFLAGS=-DNOGDI -I %TUNNELER_SDK_DIR%\install\include set CGO_LDFLAGS=-L %TUNNELER_SDK_DIR%\install\lib +mkdir %TUNNELER_SDK_DIR% + +if not exist %SVC_ROOT_DIR%ziti.dll ( + if not exist %TUNNELER_SDK_DIR%\build mkdir %TUNNELER_SDK_DIR%\build + if not exist %TUNNELER_SDK_DIR%\install mkdir %TUNNELER_SDK_DIR%\install + + cmake -G Ninja -S %TUNNELER_SDK_DIR% -B %TUNNELER_SDK_DIR%\build -DCMAKE_INSTALL_PREFIX=%TUNNELER_SDK_DIR%\install + cmake --build %TUNNELER_SDK_DIR%\build --target install + + echo ERROR LEVEL: %ERRORLEVEL% + echo ERROR LEVEL: %ERRORLEVEL% + echo ERROR LEVEL: %ERRORLEVEL% + echo ERROR LEVEL: %ERRORLEVEL% + echo ERROR LEVEL: %ERRORLEVEL% + + cp %TUNNELER_SDK_DIR%\install\lib\ziti.dll %SVC_ROOT_DIR% + cp %TUNNELER_SDK_DIR%\install\lib\libuv.dll %SVC_ROOT_DIR% + + @echo COPIED dlls to %SVC_ROOT_DIR% + cd %SVC_ROOT_DIR% +) else ( + @echo ------------------------------------------------------------------------------ + @echo SKIPPED BUILDING ziti.dll because ziti.dll was found at %SVC_ROOT_DIR%ziti.dll + @echo ------------------------------------------------------------------------------ +) -cls go build -a ./ziti-tunnel +if %ERRORLEVEL% GEQ 1 EXIT /B %ERRORLEVEL% -copy *.dll c:\temp\ziti-windows-tunneler\ -copy ziti-tunnel.exe c:\temp\ziti-windows-tunneler\ \ No newline at end of file +:END +cd /d %CURDIR% \ No newline at end of file diff --git a/service/ziti-tunnel/globals/loghelper.go b/service/ziti-tunnel/globals/loghelper.go index b92ba2fc..95b42128 100644 --- a/service/ziti-tunnel/globals/loghelper.go +++ b/service/ziti-tunnel/globals/loghelper.go @@ -56,25 +56,25 @@ func InitLogger(logLevel logrus.Level) { logger.Infof("Logger initialized. Log file located at: %s", config.LogFile()) } -func ParseLevel(lvl string) logrus.Level { +func ParseLevel(lvl string) (logrus.Level, int) { switch strings.ToLower(lvl) { case "panic": - return logrus.PanicLevel + return logrus.PanicLevel, 0 case "fatal": - return logrus.FatalLevel + return logrus.FatalLevel, 1 case "error": - return logrus.ErrorLevel + return logrus.ErrorLevel, 2 case "warn", "warning": - return logrus.WarnLevel + return logrus.WarnLevel, 3 case "info": - return logrus.InfoLevel + return logrus.InfoLevel, 4 case "debug": - return logrus.DebugLevel + return logrus.DebugLevel, 5 case "trace": - return logrus.TraceLevel + return logrus.TraceLevel, 6 default: logrus.Warnf("level not recognized: %s. Using Info", lvl) - return logrus.InfoLevel + return logrus.InfoLevel, 4 } } diff --git a/service/ziti-tunnel/main.go b/service/ziti-tunnel/main.go index c302b44a..017a93a4 100644 --- a/service/ziti-tunnel/main.go +++ b/service/ziti-tunnel/main.go @@ -33,7 +33,8 @@ import ( var log = globals.Logger() func main() { - globals.InitLogger(globals.ParseLevel("info")) + l, _ := globals.ParseLevel("info") + globals.InitLogger(l) //if len(os.Args) < 2 { // // if no args supplied - expect to run as service diff --git a/service/ziti-tunnel/service/ipc.go b/service/ziti-tunnel/service/ipc.go index 4b8c1ea4..dfe4ac34 100644 --- a/service/ziti-tunnel/service/ipc.go +++ b/service/ziti-tunnel/service/ipc.go @@ -50,9 +50,9 @@ type Pipes struct { } func (p *Pipes) Close() { - p.ipc.Close() - p.logs.Close() - p.events.Close() + _ = p.ipc.Close() + _ = p.logs.Close() + _ = p.events.Close() } var shutdown = make(chan bool) //a channel informing go routines to exit @@ -62,10 +62,9 @@ func SubMain(ops chan string, changes chan<- svc.Status) error { rts.LoadConfig() l := rts.state.LogLevel - logLevel := globals.ParseLevel(l) + logLevel, czitiLevel := globals.ParseLevel(l) globals.InitLogger(logLevel) - _ = globals.Elog.Info(InformationEvent, SvcName+" starting. log file located at "+config.LogFile()) // create a channel for notifying any connections that they are to be interrupted @@ -77,7 +76,7 @@ func SubMain(ops chan string, changes chan<- svc.Status) error { log.Warnf("could not open cziti.log for writing. no debug information will be captured.") } else { cziti.SetLog(logFile) - cziti.SetLogLevel(4) + cziti.SetLogLevel(czitiLevel) defer logFile.Close() } @@ -203,6 +202,7 @@ func openPipes() (*Pipes, error) { func (p *Pipes) shutdownConnections() { log.Info("waiting for all connections to close...") + p.Close() for i := 0; i < connections; i++ { log.Debug("cancelling read loop") @@ -260,7 +260,7 @@ func accept(p net.Listener, serveFunction func(net.Conn), debug string) { } wg.Add(1) connections++ - log.Debugf("accepting a new client for %s", debug) + log.Debugf("accepting a new client for %s. total connection count: %d", debug, connections) go serveFunction(c) } @@ -285,7 +285,7 @@ func serveIpc(conn net.Conn) { case <-interrupt: log.Info("request to interrupt read loop received") conn.Close() - log.Warnf("read loop interrupted") + log.Info("read loop interrupted") case <-done: log.Debug("loop finished normally") } @@ -310,7 +310,7 @@ func serveIpc(conn net.Conn) { respondWithError(enc, "could not read line properly! exiting loop!", UNKNOWN_ERROR, err) } } - log.Debug("exiting read loop for ipc") + log.Debugf("connection closed due to shutdown request for ipc: %v", err) return } diff --git a/version b/version index 1750564f..5a5831ab 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.0.6 +0.0.7