Merge pull request #857 from openziti/release-next

Release 0.26.9
This commit is contained in:
Paul Lorenz
2022-10-12 14:44:05 -04:00
committed by GitHub
62 changed files with 3615 additions and 715 deletions
+82 -8
View File
@@ -11,9 +11,19 @@ on:
env:
GOFLAGS: "-trimpath"
GOX_OUTPUT: "release/{{.Arch}}/{{.OS}}/{{.Dir}}"
GOX_TEST_OUTPUT: "test/{{.Arch}}/{{.OS}}/bin/{{.Dir}}"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: "us-east-2"
gh_ci_key: ${{ secrets.GH_CI_KEY }}
CONSUL_ENCRYPTION_KEY: ${{ secrets.CONSUL_ENCRYPTION_KEY }}
ELASTIC_ENDPOINT: ${{ secrets.ELASTIC_ENDPOINT }}
ELASTIC_USERNAME: ${{ secrets.ELASTIC_USERNAME }}
ELASTIC_PASSWORD: ${{ secrets.ELASTIC_PASSWORD }}
CONSUL_ENDPOINT: ${{ secrets.CONSUL_ENDPOINT }}
CONSUL_AGENT_CERT: ${{ secrets.CONSUL_AGENT_CERT }}
BUILD_NUMBER: ${{ format('{0}-{1}-{2}', github.run_id, github.run_number, github.run_attempt) }}
jobs:
mac-os-build:
@@ -77,10 +87,76 @@ jobs:
path: release/
retention-days: 5
linux-build:
name: Build and Publish Linux Binaries and Docker Image
fablab-smoketest:
name: Fablab Smoketest
runs-on: ubuntu-20.04
needs: [ mac-os-build, windows-build ]
outputs:
ziti-version: ${{ steps.get_version.outputs.ziti-version }}
steps:
- name: Git Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '1.19.x'
- name: Install Ziti CI
uses: netfoundry/ziti-ci@v1
- name: Build and Test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ziti_ci_gpg_key: ${{ secrets.ZITI_CI_GPG_KEY }}
ziti_ci_gpg_key_id: ${{ secrets.ZITI_CI_GPG_KEY_ID }}
run: |
mkdir -p dist/bin
$(go env GOPATH)/bin/ziti-ci configure-git
$(go env GOPATH)/bin/ziti-ci generate-build-info common/version/info_generated.go version
pushd network-tests && go install ./... && popd
pushd network-tests && go build -o ../dist/bin/ ./utils/... && popd
go build -tags=all,tests -o dist/bin/ ./...
- name: Create Zitilab Bindings
run: |
mkdir ~/.fablab
touch ~/.fablab/bindings.yml
echo "credentials:" >> ~/.fablab/bindings.yml
echo " aws:" >> ~/.fablab/bindings.yml
echo " managed_key: true" >> ~/.fablab/bindings.yml
echo " edge:" >> ~/.fablab/bindings.yml
echo " username: admin" >> ~/.fablab/bindings.yml
echo " password: admin" >> ~/.fablab/bindings.yml
echo " influxdb:" >> ~/.fablab/bindings.yml
echo " username: fablab" >> ~/.fablab/bindings.yml
echo " password: fablab" >> ~/.fablab/bindings.yml
echo "ziti_version: $($(go env GOPATH)/bin/ziti-ci -q get-current-version)" >> ~/.fablab/bindings.yml
cat ~/.fablab/bindings.yml
- name: Test Ziti Command
env:
ZITI_ROOT: dist/
run: |
$(go env GOPATH)/bin/simple-transfer create
$(go env GOPATH)/bin/simple-transfer up
$(go env GOPATH)/bin/simple-transfer run
- name: Test Ziti Command Teardown
if: always()
env:
ZITI_ROOT: dist/
run: |
$(go env GOPATH)/bin/simple-transfer dispose
$(go env GOPATH)/bin/simple-transfer clean
# END linux-build-steps
publish:
name: Publish Binaries and Docker Image
runs-on: ubuntu-20.04
needs: [ mac-os-build, windows-build, fablab-smoketest ]
outputs:
ziti-version: ${{ steps.get_version.outputs.ziti-version }}
steps:
@@ -226,16 +302,14 @@ jobs:
push: true
tags: ${{ steps.tagprep.outputs.tags }}
# END linux-build-steps
smoketest:
jenkins-smoketest:
# BEGIN smoketest-job
#
# Any event that triggers this main workflow also triggers the smoketest
#
needs: linux-build
needs: publish
name: Call the On-Demand Smoketest Workflow
uses: ./.github/workflows/jenkins-smoketest.yml
secrets: inherit
with:
ziti-version: ${{ needs.linux-build.outputs.ziti-version }}
ziti-version: ${{ needs.publish.outputs.ziti-version }}
@@ -12,6 +12,8 @@ on:
release:
types: [released]
workflow_dispatch:
watch:
types: [started]
jobs:
mattermost-ziti-webhook:
+85
View File
@@ -1,3 +1,88 @@
# Release 0.26.9
## What's New
- Edge
- Bug Fixes
- Fabric
- Bug Fixes
- Ziti CLI
- Allow dynamic modification of enrollment durations
- Bug Fixes
- SDK Golang
- Bug Fixes
- Identity
## Ziti CLI
### Allow dynamic modification of enrollment durations
#### Identity Enrollment Duration
Setting the environment variable `ZITI_EDGE_IDENTITY_ENROLLMENT_DURATION` to some value **in minutes** will override the default identity enrollment duration configuration
when creating new controller configurations. If left unset, the default value is used. Using this method applies to controller config generation through the CLI as
well as quickstart deployments.
Example:
```shell
# Set identity enrollment to 60 minutes, controller configs created afterward will use this value
export ZITI_EDGE_IDENTITY_ENROLLMENT_DURATION=60
```
An additional argument `--identityEnrollmentDuration` has been added to the CLI controller config generation. If the argument is provided, the value of the argument will take
precedence, followed by the value of the environment variable (noted above), and if neither are used, the default value is used. Note that the argument takes a time unit
(m for minutes, h for hour, etc.)
Example:
```shell
# Create a controller config with an identity enrollment duration of 60 minutes
ziti create config controller --identityEnrollmentDuration 60m
# OR
ziti create config controller --identityEnrollmentDuration 1h
```
#### Router Enrollment Duration
Setting the environment variable `ZITI_EDGE_ROUTER_ENROLLMENT_DURATION` to some value **in minutes** will override the default router enrollment duration configuration
when creating new controller configurations. If left unset, the default value is used. Using this method applies to controller config generation through the CLI as
well as quickstart deployments.
Example:
```shell
# Set router enrollment to 60 minutes, controller configs created afterward will use this value
export ZITI_EDGE_ROUTER_ENROLLMENT_DURATION=60
```
An additional argument `--routerEnrollmentDuration` has been added to the CLI controller config generation. If the argument is provided, the value of the argument will take
precedence, followed by the value of the environment variable (noted above), and if neither are used, the default value is used. Note that the argument takes a time unit
(m for minutes, h for hour, etc.)
Example:
```shell
# Create a controller config with a router enrollment duration of 60 minutes
ziti create config controller --routerEnrollmentDuration 60m
# OR
ziti create config controller --routerEnrollmentDuration 1h
```
### Ziti Component Updates and Bug Fixes
* github.com/openziti/channel/v2: [v1.0.3 -> v2.0.4](https://github.com/openziti/channel/compare/v1.0.3...v2.0.4)
* github.com/openziti/edge: [v0.23.0 -> v0.24.3](https://github.com/openziti/edge/compare/v0.23.0...v0.24.3)
* [Issue #1189](https://github.com/openziti/edge/issues/1189) - router embedded tunneler can create redundant api session if initial requests come in a flood
* [Issue #1186](https://github.com/openziti/edge/issues/1186) - Panic when creating sdk hosted terminator
* github.com/openziti/fabric: [v0.20.0 -> v0.21.2](https://github.com/openziti/fabric/compare/v0.20.0...v0.21.2)
* [Issue #469](https://github.com/openziti/fabric/issues/469) - Initial support for multiple control channels in routers
* github.com/openziti/foundation/v2: [v2.0.4 -> v2.0.5](https://github.com/openziti/foundation/compare/v2.0.4...v2.0.5)
* github.com/openziti/identity: [v1.0.12 -> v1.0.16](https://github.com/openziti/identity/compare/v1.0.12...v1.0.16)
* github.com/openziti/sdk-golang: [v0.16.121 -> v0.16.128](https://github.com/openziti/sdk-golang/compare/v0.16.121...v0.16.128)
* github.com/openziti/storage: [v0.1.21 -> v0.1.23](https://github.com/openziti/storage/compare/v0.1.21...v0.1.23)
* [Issue #23](https://github.com/openziti/storage/issues/23) - fix panic: IterateLink on ref counted link collection should never return a nil cursor
* github.com/openziti/transport/v2: [v2.0.29 -> v2.0.33](https://github.com/openziti/transport/compare/v2.0.29...v2.0.33)
* github.com/openziti/jwks: [v1.0.1 -> v1.0.2](https://github.com/openziti/jwks/compare/v1.0.1...v1.0.2)
* github.com/openziti/metrics: [v1.1.0 -> v1.1.2](https://github.com/openziti/metrics/compare/v1.1.0...v1.1.2)
* github.com/openziti/x509-claims: [v1.0.2 -> v1.0.3](https://github.com/openziti/x509-claims/compare/v1.0.2...v1.0.3)
* github.com/openziti/ziti: [0.26.8 -> 0.26.9](https://github.com/openziti/ziti/compare/0.26.8...0.26.9)
* [Issue #845](https://github.com/openziti/ziti/issues/845) - Setting ZITI_EDGE_ROUTER_IP_OVERRIDE now adds the IP to the CSR SANs of the router config
# Release 0.26.8
## What's New
+3 -3
View File
@@ -66,12 +66,12 @@ There are various levels of accessibility a network application/service can have
Making something dark can be done in a few ways, but the way it's generally handled in Ziti is that services reach out and establish one or more connections to the Ziti network fabric. Clients coming into the fabric can then reach the service through these connections after being authenticated and authorized.
Ziti routers, which make up the fabric, can also be dark. Routers located in private networks will usually be made dark. These routers will reach out of the private network to talk to the controller and to make connections to join the network fabric mesh. This allows the services and routers in your private networks to make only outbound connections, so no holes have to opened for inbound traffic.
Ziti routers, which make up the fabric, can also be dark. Routers located in private networks will usually be made dark. These routers will reach out of the private network to talk to the controller and to make connections to join the network fabric mesh. This allows the services and routers in your private networks to make only outbound connections, so no holes have to be opened for inbound traffic.
Services can be completely dark if they are implemented with a Ziti SDK. If this is not possible a Ziti tunneler or proxy can be colocated with the service. The service then only needs to allow connections from the local machine or network, depending on how close you colocate the proxy to the service.
### End to End Encryption
If you take advantage of Ziti's developer SDKs and embed Ziti in your client and server applications, your traffic can be configured to be seamlessly encrypted from the client application to server application. If you prefer to use tunnelers or proxy applications, the traffic can be ecnrypted for you from machine to machine or private network to private network. Various combinations of the above are also supported.
If you take advantage of Ziti's developer SDKs and embed Ziti in your client and server applications, your traffic can be configured to be seamlessly encrypted from the client application to server application. If you prefer to use tunnelers or proxy applications, the traffic can be encrypted for you from machine to machine or private network to private network. Various combinations of the above are also supported.
End-to-end encryption means that even if systems between the client and server are compromised, your traffic cannot be decrypted or tampered with.
@@ -83,7 +83,7 @@ If you are looking to jump right in feet first you can follow along with one of
guides](https://openziti.github.io/ziti/quickstarts/quickstart-overview.html). These guides are designed to get an
overlay network quickly and allow you to run it all locally, use docker or host it anywhere.
This environment is perfect for evaluators to get to know Ziti and the capabilities it offers. The environement was not
This environment is perfect for evaluators to get to know Ziti and the capabilities it offers. The environment was not
designed for large scale deployment or for long-term usage. If you are looking for a managed service to help you run a
truly global, scalable network browse over to our website at http://netfoundry.io to learn more.
+32 -33
View File
@@ -1,6 +1,6 @@
module github.com/openziti/ziti
go 1.18
go 1.19
require (
github.com/Jeffail/gabs v1.4.0
@@ -18,40 +18,39 @@ require (
github.com/golang/protobuf v1.5.2
github.com/google/go-cmp v0.5.9
github.com/gorilla/websocket v1.5.0
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d
github.com/jedib0t/go-pretty/v6 v6.3.5
github.com/jedib0t/go-pretty/v6 v6.4.0
github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19
github.com/michaelquigley/pfxlog v0.6.9
github.com/openziti/agent v1.0.3
github.com/openziti/channel v1.0.3
github.com/openziti/edge v0.23.0
github.com/openziti/fabric v0.20.0
github.com/openziti/foundation/v2 v2.0.4
github.com/openziti/identity v1.0.12
github.com/openziti/metrics v1.1.0
github.com/openziti/sdk-golang v0.16.121
github.com/openziti/storage v0.1.21
github.com/openziti/transport/v2 v2.0.29
github.com/openziti/channel/v2 v2.0.5
github.com/openziti/edge v0.24.7
github.com/openziti/fabric v0.21.3
github.com/openziti/foundation/v2 v2.0.5
github.com/openziti/identity v1.0.16
github.com/openziti/sdk-golang v0.16.129
github.com/openziti/storage v0.1.23
github.com/openziti/transport/v2 v2.0.33
github.com/openziti/xweb/v2 v2.0.2
github.com/openziti/ziti-db-explorer v1.1.1
github.com/pborman/uuid v1.2.0
github.com/pkg/errors v0.9.1
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
github.com/russross/blackfriday v1.5.2
github.com/shirou/gopsutil/v3 v3.22.8
github.com/shirou/gopsutil/v3 v3.22.9
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.5.0
github.com/spf13/cobra v1.6.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.10.0
github.com/stretchr/testify v1.8.0
github.com/valyala/fasttemplate v1.2.1
go.etcd.io/bbolt v1.3.6
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4
golang.org/x/net v0.0.0-20220923203811-8be639271d50
google.golang.org/grpc v1.42.0
google.golang.org/protobuf v1.28.1
gopkg.in/AlecAivazis/survey.v1 v1.8.7
gopkg.in/resty.v1 v1.12.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
rsc.io/goversion v1.2.0
)
@@ -94,14 +93,14 @@ require (
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/hashicorp/go-hclog v1.3.0 // indirect
github.com/hashicorp/go-hclog v1.3.1 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-msgpack v0.5.5 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/raft v1.3.10 // indirect
github.com/hashicorp/raft v1.3.11 // indirect
github.com/hashicorp/raft-boltdb v0.0.0-20220329195025-15018e9b97e0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jessevdk/go-flags v1.5.0 // indirect
github.com/jinzhu/copier v0.3.5 // indirect
github.com/josharian/intern v1.0.0 // indirect
@@ -112,15 +111,15 @@ require (
github.com/kyokomi/emoji/v2 v2.2.8 // indirect
github.com/lucasb-eyer/go-colorful v1.0.3 // indirect
github.com/lucsky/cuid v1.2.1 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mattn/go-tty v0.0.3 // indirect
github.com/mdlayher/netlink v1.6.0 // indirect
github.com/mdlayher/socket v0.1.1 // indirect
github.com/mdlayher/netlink v1.6.2 // indirect
github.com/mdlayher/socket v0.2.3 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/miekg/dns v1.1.50 // indirect
github.com/miekg/pkcs11 v1.1.1 // indirect
@@ -131,15 +130,16 @@ require (
github.com/oklog/ulid v1.3.1 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/openziti/dilithium v0.3.3 // indirect
github.com/openziti/jwks v1.0.1 // indirect
github.com/openziti/x509-claims v1.0.2 // indirect
github.com/openziti/jwks v1.0.2 // indirect
github.com/openziti/metrics v1.1.2 // indirect
github.com/openziti/x509-claims v1.0.3 // indirect
github.com/orcaman/concurrent-map/v2 v2.0.0 // indirect
github.com/parallaxsecond/parsec-client-go v0.0.0-20220111122524-cb78842db373 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pkg/term v1.2.0-beta.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect
github.com/rivo/uniseg v0.4.2 // indirect
github.com/rodaine/table v1.0.1 // indirect
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect
github.com/speps/go-hashids v2.0.0+incompatible // indirect
@@ -149,25 +149,24 @@ require (
github.com/subosito/gotenv v1.2.0 // indirect
github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125 // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.4.0 // indirect
github.com/tklauser/numcpus v0.5.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.mongodb.org/mongo-driver v1.10.0 // indirect
go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1 // indirect
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect
go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 // indirect
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a // indirect
golang.org/x/image v0.0.0-20191206065243-da761ea9ff43 // indirect
golang.org/x/mod v0.5.1 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41 // indirect
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 // indirect
golang.org/x/sys v0.0.0-20221010170243-090e33056c14 // indirect
golang.org/x/term v0.0.0-20220919170432-7a66f970e087 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.7 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
+63 -57
View File
@@ -380,7 +380,6 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
@@ -439,8 +438,8 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-hclog v0.9.1/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
github.com/hashicorp/go-hclog v1.3.0 h1:G0ACM8Z2WilWgPv3Vdzwm3V0BQu/kSmrkVtpe1fy9do=
github.com/hashicorp/go-hclog v1.3.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
github.com/hashicorp/go-hclog v1.3.1 h1:vDwF1DFNZhntP4DAjuTpOw3uEgMUpXh1pB5fW9DqHpo=
github.com/hashicorp/go-hclog v1.3.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc=
github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
@@ -467,8 +466,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/raft v1.1.0/go.mod h1:4Ak7FSPnuvmb0GV6vgIAJ4vYT4bek9bb6Q+7HVbyzqM=
github.com/hashicorp/raft v1.3.10 h1:LR5QZX1VQd0DFWZfeCwWawyeKfpS/Tm1yjnJIY5X4Tw=
github.com/hashicorp/raft v1.3.10/go.mod h1:J8naEwc6XaaCfts7+28whSeRvCqTd6e20BlCU3LtEO4=
github.com/hashicorp/raft v1.3.11 h1:p3v6gf6l3S797NnK5av3HcczOC1T5CLoaRvg0g9ys4A=
github.com/hashicorp/raft v1.3.11/go.mod h1:J8naEwc6XaaCfts7+28whSeRvCqTd6e20BlCU3LtEO4=
github.com/hashicorp/raft-boltdb v0.0.0-20220329195025-15018e9b97e0 h1:CO8dBMLH6dvE1jTn/30ZZw3iuPsNfajshWoJTnVc5cc=
github.com/hashicorp/raft-boltdb v0.0.0-20220329195025-15018e9b97e0/go.mod h1:nTakvJ4XYq45UXtn0DbwR4aU9ZdjlnIenpbs6Cd+FM0=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
@@ -478,14 +477,13 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df/go.mod h1:QMZY7/J/KSQEhKWFeDesPjMj+wCHReeknARU3wqlyN4=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/influxdata/influxdb-client-go/v2 v2.2.2/go.mod h1:fa/d1lAdUHxuc1jedx30ZfNG573oQTQmUni3N6pcW+0=
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d h1:/WZQPMZNsjZ7IlCpsLGdQBINg5bxKQ1K1sh6awxLtkA=
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo=
github.com/jedib0t/go-pretty/v6 v6.3.5 h1:B6RuZT3Gz0NvFwADctw+gZn3cSA+jIHykXyd72zPgOY=
github.com/jedib0t/go-pretty/v6 v6.3.5/go.mod h1:MgmISkTWDSFu0xOqiZ0mKNntMQ2mDgOcwOkwBEkMDJI=
github.com/jedib0t/go-pretty/v6 v6.4.0 h1:YlI/2zYDrweA4MThiYMKtGRfT+2qZOO65ulej8GTcVI=
github.com/jedib0t/go-pretty/v6 v6.4.0/go.mod h1:MgmISkTWDSFu0xOqiZ0mKNntMQ2mDgOcwOkwBEkMDJI=
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc=
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
@@ -549,8 +547,9 @@ github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tW
github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/lucsky/cuid v1.2.1 h1:MtJrL2OFhvYufUIn48d35QGXyeTC8tn0upumW9WwTHg=
github.com/lucsky/cuid v1.2.1/go.mod h1:QaaJqckboimOmhRSJXSx/+IT+VTfxfPGSo/6mfgUfmE=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY=
github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE=
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls=
@@ -594,16 +593,17 @@ github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE=
github.com/mattn/go-tty v0.0.3 h1:5OfyWorkyO7xP52Mq7tB36ajHDG5OHrmBGIS/DtakQI=
github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvrWyR0=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mdlayher/netlink v1.6.0 h1:rOHX5yl7qnlpiVkFWoqccueppMtXzeziFjWAjLg6sz0=
github.com/mdlayher/netlink v1.6.0/go.mod h1:0o3PlBmGst1xve7wQ7j/hwpNaFaH4qCRyWCdcZk8/vA=
github.com/mdlayher/socket v0.1.1 h1:q3uOGirUPfAV2MUoaC7BavjQ154J7+JOkTWyiV+intI=
github.com/mdlayher/socket v0.1.1/go.mod h1:mYV5YIZAfHh4dzDVzI8x8tWLWCliuX8Mon5Awbj+qDs=
github.com/mdlayher/netlink v1.6.2 h1:D2zGSkvYsJ6NreeED3JiVTu1lj2sIYATqSaZlhPzUgQ=
github.com/mdlayher/netlink v1.6.2/go.mod h1:O1HXX2sIWSMJ3Qn1BYZk1yZM+7iMki/uYGGiwGyq/iU=
github.com/mdlayher/socket v0.2.3 h1:XZA2X2TjdOwNoNPVPclRCURoX/hokBY8nkTmRZFEheM=
github.com/mdlayher/socket v0.2.3/go.mod h1:bz12/FozYNH/VbvC3q7TRIK/Y6dH1kCKsXaUeXi/FmY=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
@@ -675,30 +675,30 @@ github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTm
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
github.com/openziti/agent v1.0.3 h1:FtVIl5vu+xk0uwlXTqWnGHp7RqSFAzuBa1YuCPZkTsk=
github.com/openziti/agent v1.0.3/go.mod h1:k9gQv82hTTxdVSfMmD0LyWzCEy+9fWh2ISsg1llgRqU=
github.com/openziti/channel v1.0.3 h1:WlM3DYTWxfGslct1jnUUgOHbm0wYS1LRCVwdfx8mBzU=
github.com/openziti/channel v1.0.3/go.mod h1:/te3/V0rq3r9hM0JIAlL8dlg+SynzkVE7uL6ntaYlik=
github.com/openziti/channel/v2 v2.0.5 h1:/it82bDT/9oS9XnATcKbgVE9Rf9hoYmbUcYOy03HZ44=
github.com/openziti/channel/v2 v2.0.5/go.mod h1:Qe2cSAhuMhtX3ABQp4kiYYWPCAScp828SPljlrkKW8Y=
github.com/openziti/dilithium v0.3.3 h1:PLgQ6PMNLSTzCFbX/h98cmudgz/cU6TmjdSv5NAPD8k=
github.com/openziti/dilithium v0.3.3/go.mod h1:vsCjI2AU/hon9e+dLhUFbCNGesJDj2ASgkySOcpmvjo=
github.com/openziti/edge v0.23.0 h1:B5z5MPvtBV6TE6818rSyOodzdkz9bT0l64Fw2QMg/gQ=
github.com/openziti/edge v0.23.0/go.mod h1:+gCC6YBEs9eiKL0buzN+AydDbIvfRChIVNuntRMvBBo=
github.com/openziti/fabric v0.20.0 h1:kWE3Lb8xLS3Rcwwmzh4Jb0bSjgubcll7+ntx0mO76no=
github.com/openziti/fabric v0.20.0/go.mod h1:zJnnBUS8eXELmrBIyOi4x/Wyo2mslQ47+cqpAmmuJyY=
github.com/openziti/foundation/v2 v2.0.4 h1:QnpbNgRzPTnbu/QIqdNhYJl4nrhxrX7VXiIF5yIqQhc=
github.com/openziti/foundation/v2 v2.0.4/go.mod h1:L75kwCC5WTUPqxuAd3G+WMBompaElMb/nYlJjR1sJ9Q=
github.com/openziti/identity v1.0.12 h1:Y6adirthFBpMSI0fyWWGR/fUFtaMOIWQIvyr2yTeIcM=
github.com/openziti/identity v1.0.12/go.mod h1:ScEYhB5F5FfBmTEHmfATBlbzMIpMJwDF8CcJbNuO5ic=
github.com/openziti/jwks v1.0.1 h1:+BtBzDWFVUlJfCbBhQR0BZI3YNtoBvfhfdCUSSB0G+0=
github.com/openziti/jwks v1.0.1/go.mod h1:KwO0x9FBG0aoJS5f6nH5xeHoplyR1H143SMI9kF0mC8=
github.com/openziti/metrics v1.1.0 h1:V3stVSxGz0Rq3GXxQz+ahMH8D3jR8yVT+IrJZNWdFxA=
github.com/openziti/metrics v1.1.0/go.mod h1:N3ffH3Vp7czCpyDSk1hFE3DZ3bTEUSiubHWHZFUuP2g=
github.com/openziti/sdk-golang v0.16.121 h1:fhjkrUnQZxC3hz9pR6zN2jkTmnzEyv8AGNyQlI1QQZU=
github.com/openziti/sdk-golang v0.16.121/go.mod h1:cdv9FOrj3XuOQR/B54OrUwaAvrd1Wwpbl1KxwJvTC2k=
github.com/openziti/storage v0.1.21 h1:m8ny8AuCqjZQRpiHUhQlmZjUGAW1LCRjrPA93WQsjP0=
github.com/openziti/storage v0.1.21/go.mod h1:onJ7mLnnB2nfKdNCJHZlVRnPZSSPUJvuu3gzZ8vR2Mo=
github.com/openziti/transport/v2 v2.0.29 h1:lT9FyDUF3bxkMYjFACW909LSc7sonLK86ghRDXN05Ug=
github.com/openziti/transport/v2 v2.0.29/go.mod h1:vYXp00wBXxq3s5ffSJEfkscOBH2+/d29FK1l7yMid4g=
github.com/openziti/x509-claims v1.0.2 h1:PSv/xRfejIAcPc16A902k08rSBs3R8bjtL4qq6WEwCI=
github.com/openziti/x509-claims v1.0.2/go.mod h1:Z0WIpBm6c4ecrpRKrou6Gk2wrLWxJO/+tuUwKh8VewE=
github.com/openziti/edge v0.24.7 h1:0v9zHEPVaVuhGV6JsjEAMS1jD6tvXp7xqaF7zjehajI=
github.com/openziti/edge v0.24.7/go.mod h1:Q7qNSlIpXnnKFNL8vaxvUSRvwrPI3Dq7B6sLMPo15Ss=
github.com/openziti/fabric v0.21.3 h1:ia1LrvGa/piCYIcjz2ZLn72x4hbgZ1+6tvqgYtYb6F4=
github.com/openziti/fabric v0.21.3/go.mod h1:DNOJWVGvHUZpX8XwQToJFqroZZDO1ji5WXSnAXqU6ok=
github.com/openziti/foundation/v2 v2.0.5 h1:Elv0MQS8K+GQxRJxFFcuEpEGqC/Aca7WEMaPUYBx8eU=
github.com/openziti/foundation/v2 v2.0.5/go.mod h1:M/RUF8wR2X3OE9buI+Gd3ac7FzrZkQ+g07XY/dX3X/U=
github.com/openziti/identity v1.0.16 h1:S5cgSl8QJMRhYHMvvCWZQTmMEPk1QsMPMHtRS4cUzFg=
github.com/openziti/identity v1.0.16/go.mod h1:Z+OIIw65HRlwiL3Eu3twyCeVmCT9d/GQOi5ifdmbCng=
github.com/openziti/jwks v1.0.2 h1:32BGXIAnefS+v7uXKPb1x8/cQ7srek6Ai06dsrMTY4E=
github.com/openziti/jwks v1.0.2/go.mod h1:KwO0x9FBG0aoJS5f6nH5xeHoplyR1H143SMI9kF0mC8=
github.com/openziti/metrics v1.1.2 h1:PENxryysU6j7H0NplGD6Q0tQJ4ulHs2Zemr0hQur1E0=
github.com/openziti/metrics v1.1.2/go.mod h1:vMO63hmXpI0p1iiA4WBuFuQPCfmhwAcv84iWeyrXcfs=
github.com/openziti/sdk-golang v0.16.129 h1:qjP4tnsBRPKyH4mJuwYUB3rb4K7/thKEpaOYZwztU2A=
github.com/openziti/sdk-golang v0.16.129/go.mod h1:jOaQbUy/j32LHqjKT+hmCxnfxOMkcVE7ZlzadE6zc3A=
github.com/openziti/storage v0.1.23 h1:6a9xbDcofjjwgkW5ABpQNVb0G0fJtDi4nPKB5DnbPc8=
github.com/openziti/storage v0.1.23/go.mod h1:MuCS3ZQK2MVy57ge06w0s+BQst+PFAXttnC2+8zYz/g=
github.com/openziti/transport/v2 v2.0.33 h1:zEatb8tye6553kbXm5x/mHnzhL6RHfM+T8dQYHz7hY4=
github.com/openziti/transport/v2 v2.0.33/go.mod h1:qBzEbobGeq6DkOkveIg/rQZLXqkEW3SYhQwcJV+fsGk=
github.com/openziti/x509-claims v1.0.3 h1:HNdQ8Nf1agB3lBs1gahcO6zfkeS4S5xoQ2/PkY4HRX0=
github.com/openziti/x509-claims v1.0.3/go.mod h1:Z0WIpBm6c4ecrpRKrou6Gk2wrLWxJO/+tuUwKh8VewE=
github.com/openziti/xweb/v2 v2.0.2 h1:XYlVFriTq/U1wcUrc+XPnWJGhXh9NJPhtQ7+r3aC0cU=
github.com/openziti/xweb/v2 v2.0.2/go.mod h1:KQOOlnJk08EZT3TWkvDj/pbIUEVbgG0IrrNzl8gsi40=
github.com/openziti/ziti-db-explorer v1.1.1 h1:G0eoTby+aIjjt5TxEfR+FMI2CWd4RvZFjzaIMX2lEBw=
@@ -733,8 +733,9 @@ github.com/pkg/term v1.2.0-beta.2/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiK
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI=
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/pquerna/otp v1.2.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg=
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
@@ -771,8 +772,9 @@ github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqn
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.2 h1:YwD0ulJSJytLpiaWua0sBDusfsCZohxjxzVTYjwxfV8=
github.com/rivo/uniseg v0.4.2/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rodaine/table v1.0.1 h1:U/VwCnUxlVYxw8+NJiLIuCxA/xa6jL38MY3FYysVWWQ=
github.com/rodaine/table v1.0.1/go.mod h1:UVEtfBsflpeEcD56nF4F5AocNFta0ZuolpSVdPtlmP4=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
@@ -789,8 +791,8 @@ github.com/sacloud/libsacloud v1.36.2/go.mod h1:P7YAOVmnIn3DKHqCZcUKYUXmSwGBm3yS
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
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/shirou/gopsutil/v3 v3.22.8 h1:a4s3hXogo5mE2PfdfJIonDbstO/P+9JszdfhAHSzD9Y=
github.com/shirou/gopsutil/v3 v3.22.8/go.mod h1:s648gW4IywYzUfE/KjXxUsqrqx/T2xO5VqOXxONeRfI=
github.com/shirou/gopsutil/v3 v3.22.9 h1:yibtJhIVEMcdw+tCTbOPiF1VcsuDeTE4utJ8Dm4c5eA=
github.com/shirou/gopsutil/v3 v3.22.9/go.mod h1:bBYl1kjgEJpWpxeHmLI+dVHWtyAwfcmSBLDsp2TNT8A=
github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY=
github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM=
github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0=
@@ -844,8 +846,8 @@ github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk=
github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU=
github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM=
github.com/spf13/cobra v1.6.0 h1:42a0n6jwCot1pUmomAp4T7DeMD+20LFv4Q54pxLf2LI=
github.com/spf13/cobra v1.6.0/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
@@ -882,8 +884,9 @@ github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw=
github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk=
github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o=
github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ=
github.com/tklauser/numcpus v0.5.0 h1:ooe7gN0fg6myJ0EKoTAf5hebTZrH52px3New/D9iJ+A=
github.com/tklauser/numcpus v0.5.0/go.mod h1:OGzpTxpcIMNGYQdit2BYL1pvk/dSOaJWjKoflh+RQjo=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/transip/gotransip/v6 v6.2.0/go.mod h1:pQZ36hWWRahCUXkFWlx9Hs711gLd8J4qdgLdRzmtY+g=
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
@@ -929,8 +932,8 @@ go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4x
go.mongodb.org/mongo-driver v1.8.3/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY=
go.mongodb.org/mongo-driver v1.10.0 h1:UtV6N5k14upNp4LTduX0QCufG124fSu25Wz9tu94GLg=
go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8=
go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1 h1:A/5uWzF44DlIgdm/PQFwfMkW0JX+cIcQi/SwLAmZP5M=
go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk=
go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 h1:CCriYyAfq1Br1aIYettdHZTy8mBTIPo7We18TuO/bak=
go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk=
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
@@ -978,8 +981,8 @@ golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM=
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a h1:NmSIgad6KjE6VvHciPZuNRTKxGhlPfD6OA87W/PLkqg=
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -1073,12 +1076,11 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM=
golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA=
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220923203811-8be639271d50 h1:vKyz8L3zkd+xrMeIaBsQ/MNVPVFSffdaU3ZyYlBGFnI=
golang.org/x/net v0.0.0-20220923203811-8be639271d50/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -1105,8 +1107,10 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 h1:cu5kTvlzcw1Q5S9f5ip1/cpiB4nXvw1XYzFPGgzLUOY=
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180606202747-9527bec2660b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180622082034-63fc586f45fe/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -1189,18 +1193,20 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41 h1:ohgcoMbSofXygzo6AD2I1kz3BFmW1QArPYTtwEM3UXc=
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20221010170243-090e33056c14 h1:k5II8e6QD8mITdi+okbbmR/cIyEbeXLBhy5Ha4nevyc=
golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 h1:Q5284mrmYTpACcm+eAKjKJH48BBwSyfJqmmGDTtT8Vc=
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20220919170432-7a66f970e087 h1:tPwmk4vmvVCMdr98VgL4JH+qZxPL8fqlUOHnyOM8N3w=
golang.org/x/term v0.0.0-20220919170432-7a66f970e087/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+175
View File
@@ -0,0 +1,175 @@
module github.com/openziti/ziti/network-tests
go 1.19
replace github.com/openziti/ziti => ../
require (
github.com/openziti/fablab v0.4.7
github.com/openziti/sdk-golang v0.16.129
github.com/openziti/zitilab v0.1.1
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.6.0
)
require (
github.com/AppsFlyer/go-sundheit v0.5.0 // indirect
github.com/Jeffail/gabs v1.4.0 // indirect
github.com/Jeffail/gabs/v2 v2.6.1 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/MichaelMure/go-term-markdown v0.1.4 // indirect
github.com/MichaelMure/go-term-text v0.3.1 // indirect
github.com/alecthomas/chroma v0.9.2 // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20211106181442-e4c1a74c66bd // indirect
github.com/armon/go-metrics v0.3.10 // indirect
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
github.com/aws/aws-sdk-go v1.44.114 // indirect
github.com/biogo/store v0.0.0-20200525035639-8c94ae1e7c9c // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/boltdb/bolt v1.3.1 // indirect
github.com/c-bata/go-prompt v0.2.6 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/dgoogauth v0.0.0-20190221195224-5a805980a5f3 // indirect
github.com/dineshappavoo/basex v0.0.0-20170425072625-481a6f6dc663 // indirect
github.com/disintegration/imaging v1.6.2 // indirect
github.com/dlclark/regexp2 v1.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/ef-ds/deque v1.0.4 // indirect
github.com/eliukblau/pixterm/pkg/ansimage v0.0.0-20191210081756-9fb6cf8c2f75 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/felixge/httpsnoop v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa // indirect
github.com/go-acme/lego/v4 v4.2.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-openapi/analysis v0.21.4 // indirect
github.com/go-openapi/errors v0.20.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/loads v0.21.2 // indirect
github.com/go-openapi/runtime v0.24.1 // indirect
github.com/go-openapi/spec v0.20.7 // indirect
github.com/go-openapi/strfmt v0.21.3 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-openapi/validate v0.22.0 // indirect
github.com/go-resty/resty/v2 v2.7.0 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/gomarkdown/markdown v0.0.0-20191123064959-2c17d62f5098 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/go-hclog v1.3.1 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-msgpack v0.5.5 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/raft v1.3.11 // indirect
github.com/hashicorp/raft-boltdb v0.0.0-20220329195025-15018e9b97e0 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d // indirect
github.com/jedib0t/go-pretty/v6 v6.4.0 // indirect
github.com/jessevdk/go-flags v1.5.0 // indirect
github.com/jinzhu/copier v0.3.5 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/kataras/go-events v0.0.3-0.20201007151548-c411dc70c0a6 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19 // indirect
github.com/kr/fs v0.1.0 // indirect
github.com/kyokomi/emoji/v2 v2.2.8 // indirect
github.com/lucasb-eyer/go-colorful v1.0.3 // indirect
github.com/lucsky/cuid v1.2.1 // indirect
github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mattn/go-tty v0.0.3 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/michaelquigley/figlet v0.0.0-20191015203154-054d06db54b4 // indirect
github.com/michaelquigley/pfxlog v0.6.9 // indirect
github.com/miekg/dns v1.1.50 // indirect
github.com/miekg/pkcs11 v1.1.1 // indirect
github.com/mitchellh/go-ps v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/natefinch/lumberjack v2.0.0+incompatible // indirect
github.com/natefinch/npipe v0.0.0-20160621034901-c1b8fa8bdcce // indirect
github.com/netfoundry/secretstream v0.1.2 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/openziti/agent v1.0.3 // indirect
github.com/openziti/channel/v2 v2.0.5 // indirect
github.com/openziti/edge v0.24.7 // indirect
github.com/openziti/fabric v0.21.3 // indirect
github.com/openziti/foundation/v2 v2.0.5 // indirect
github.com/openziti/identity v1.0.16 // indirect
github.com/openziti/jwks v1.0.2 // indirect
github.com/openziti/metrics v1.1.2 // indirect
github.com/openziti/storage v0.1.23 // indirect
github.com/openziti/transport/v2 v2.0.33 // indirect
github.com/openziti/x509-claims v1.0.3 // indirect
github.com/openziti/xweb/v2 v2.0.2 // indirect
github.com/openziti/ziti v0.26.8 // indirect
github.com/openziti/ziti-db-explorer v1.1.1 // indirect
github.com/orcaman/concurrent-map/v2 v2.0.0 // indirect
github.com/parallaxsecond/parsec-client-go v0.0.0-20220111122524-cb78842db373 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/sftp v1.13.5 // indirect
github.com/pkg/term v1.2.0-beta.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rivo/uniseg v0.4.2 // indirect
github.com/rodaine/table v1.0.1 // indirect
github.com/russross/blackfriday v1.5.2 // indirect
github.com/shirou/gopsutil/v3 v3.22.9 // indirect
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect
github.com/speps/go-hashids v2.0.0+incompatible // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.10.0 // indirect
github.com/stretchr/testify v1.8.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125 // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.5.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.1 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.mongodb.org/mongo-driver v1.10.0 // indirect
go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 // indirect
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a // indirect
golang.org/x/image v0.0.0-20191206065243-da761ea9ff43 // indirect
golang.org/x/mod v0.5.1 // indirect
golang.org/x/net v0.0.0-20220923203811-8be639271d50 // indirect
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 // indirect
golang.org/x/sys v0.0.0-20221010170243-090e33056c14 // indirect
golang.org/x/term v0.0.0-20220919170432-7a66f970e087 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.7 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/AlecAivazis/survey.v1 v1.8.7 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/resty.v1 v1.12.0 // indirect
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
rsc.io/goversion v1.2.0 // indirect
)
+1303
View File
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,51 @@
package actions
import (
"time"
"github.com/openziti/fablab/kernel/lib/actions"
"github.com/openziti/fablab/kernel/lib/actions/component"
"github.com/openziti/fablab/kernel/lib/actions/host"
"github.com/openziti/fablab/kernel/lib/actions/semaphore"
"github.com/openziti/fablab/kernel/model"
zitilib_actions "github.com/openziti/zitilab/actions"
"github.com/openziti/zitilab/actions/edge"
"github.com/openziti/zitilab/models"
)
type bootstrapAction struct{}
func NewBootstrapAction() model.ActionBinder {
action := &bootstrapAction{}
return action.bind
}
func (a *bootstrapAction) bind(m *model.Model) model.Action {
workflow := actions.Workflow()
workflow.AddAction(host.GroupExec("*", 25, "rm -f logs/*"))
workflow.AddAction(component.Stop("#ctrl"))
workflow.AddAction(edge.InitController("#ctrl"))
workflow.AddAction(component.Start("#ctrl"))
workflow.AddAction(semaphore.Sleep(2 * time.Second))
workflow.AddAction(edge.Login("#ctrl"))
workflow.AddAction(component.StopInParallel(models.EdgeRouterTag, 25))
workflow.AddAction(edge.InitEdgeRouters(models.EdgeRouterTag, 2))
workflow.AddAction(edge.InitIdentities(models.SdkAppTag, 2))
workflow.AddAction(zitilib_actions.Edge("create", "service", "echo"))
workflow.AddAction(zitilib_actions.Edge("create", "service-policy", "echo-servers", "Bind", "--service-roles", "@echo", "--identity-roles", "#service"))
workflow.AddAction(zitilib_actions.Edge("create", "service-policy", "echo-client", "Dial", "--service-roles", "@echo", "--identity-roles", "#client"))
workflow.AddAction(zitilib_actions.Edge("create", "edge-router-policy", "echo-servers", "--edge-router-roles", "@router-east", "--identity-roles", "#service"))
workflow.AddAction(zitilib_actions.Edge("create", "edge-router-policy", "echo-clients", "--edge-router-roles", "@router-west", "--identity-roles", "#client"))
workflow.AddAction(zitilib_actions.Edge("create", "service-edge-router-policy", "echo", "--semantic", "AnyOf", "--service-roles", "@echo", "--edge-router-roles", "#all"))
workflow.AddAction(component.Stop(models.ControllerTag))
return workflow
}
@@ -0,0 +1,55 @@
package actions
import (
"time"
"github.com/openziti/fablab/kernel/lib/actions"
"github.com/openziti/fablab/kernel/lib/actions/component"
"github.com/openziti/fablab/kernel/lib/actions/semaphore"
"github.com/openziti/fablab/kernel/model"
util_actions "github.com/openziti/ziti/network-tests/utils/actions"
zitilib_actions "github.com/openziti/zitilab/actions"
"github.com/openziti/zitilab/models"
)
func NewStartAction(metricbeat MetricbeatConfig, consul ConsulConfig) model.ActionBinder {
action := &startAction{
Metricbeat: metricbeat,
Consul: consul,
}
return action.bind
}
func (a *startAction) bind(m *model.Model) model.Action {
workflow := actions.Workflow()
workflow.AddAction(component.Start("#ctrl"))
workflow.AddAction(semaphore.Sleep(2 * time.Second))
workflow.AddAction(component.StartInParallel(models.EdgeRouterTag, 25))
workflow.AddAction(semaphore.Sleep(2 * time.Second))
workflow.AddAction(zitilib_actions.StartMetricbeat("*", a.Metricbeat.ConfigPath, a.Metricbeat.DataPath, a.Metricbeat.LogPath))
workflow.AddAction(zitilib_actions.StartConsul("*", a.Consul.ServerAddr, a.Consul.ConfigDir, a.Consul.DataPath, a.Consul.LogPath))
workflow.AddAction(semaphore.Sleep(2 * time.Second))
workflow.AddAction(util_actions.StartEchoServers("#echo-server"))
workflow.AddAction(semaphore.Sleep(2 * time.Second))
return workflow
}
type startAction struct {
Metricbeat MetricbeatConfig
Consul ConsulConfig
}
type MetricbeatConfig struct {
ConfigPath string
DataPath string
LogPath string
}
type ConsulConfig struct {
ConfigDir string
ServerAddr string
DataPath string
LogPath string
}
@@ -0,0 +1,24 @@
datacenter = "ziti-build-metrics"
data_dir = "/opt/consul"
encrypt = "${encryption_key}"
advertise_addr="${public_ip}"
tls {
defaults {
verify_incoming = false
verify_outgoing = true
ca_file="consul/consul-agent-ca.pem"
}
}
auto_encrypt {
tls = true
}
acl {
enabled = true
default_policy = "allow"
enable_token_persistence = true
}
@@ -0,0 +1,232 @@
v: 3
db: /home/{{ .Model.MustVariable "credentials.ssh.username" }}/fablab/ctrl.db
identity:
cert: /home/{{ .Model.MustVariable "credentials.ssh.username" }}/fablab/pki/intermediate/certs/{{ .Component.PublicIdentity }}-client.cert
server_cert: /home/{{ .Model.MustVariable "credentials.ssh.username" }}/fablab/pki/intermediate/certs/{{ .Component.PublicIdentity }}-server.cert
key: /home/{{ .Model.MustVariable "credentials.ssh.username" }}/fablab/pki/intermediate/keys/{{ .Component.PublicIdentity }}.key
ca: /home/{{ .Model.MustVariable "credentials.ssh.username" }}/fablab/pki/intermediate/certs/{{ .Component.PublicIdentity }}-server.chain.pem
#trace:
# path: ctrl.trace
profile:
# cpu:
# path: /home/plorenz/tmp/ctrl.cpu.pprof
# memory:
# path: ctrl.memprof
# the endpoint that routers will connect to the controller over.
ctrl:
listener: tls:0.0.0.0:6262
options:
# (optional) settings
# set the maximum number of connect requests that are buffered and waiting to be acknowledged (1 to 5000, default 1000)
#maxQueuedConnects: 50
# the maximum number of connects that have begun hello synchronization (1 to 1000, default 16)
#maxOutstandingConnects: 100
# the number of milliseconds to wait before a hello synchronization fails and closes the connection (30ms to 60000ms, default: 1000ms)
#connectTimeoutMs: 3000
# Sets the control channel write timeout. A write timeout will close the control channel, so the router will reconnect
#writeTimeout: 15s
# A listener address which will be sent to connecting routers in order to change their configured controller
# address. If defined, routers will update address configuration to immediately use the new address for future
# connections. The value of newListener must be resolvable both via DNS and validate via certificates
#newListener: tls:localhost:6262
# the endpoint that management tools connect to the controller over.
mgmt:
listener: tls:0.0.0.0:10000
#options:
# (optional) settings
# set the maximum number of connect requests that are buffered and waiting to be acknowledged (1 to 5000, default 1000)
#maxQueuedConnects: 50
# the maximum number of connects that have begun hello synchronization (1 to 1000, default 16)
#maxOutstandingConnects: 100
# the number of milliseconds to wait before a hello synchronization fails and closes the connection (30ms to 60000ms, default: 1000ms)
#connectTimeoutMs: 3000
#metrics:
#file:
#path: /tmp/ziti-controller-metrics.log
#maxsizemb: 100:wq
# Supported formats: json, plain
# Defaults to json
#format: plain
#influxdb:
#url: http://localhost:8086
#database: ziti
#events:
# jsonLogger:
# subscriptions:
# - type: fabric.routers
# - type: fabric.terminators
# - type: metrics
# sourceFilter: .*
# metricFilter: .*egress.*m1_rate*
# - type: fabric.circuits
# include:
# - created
# - type: edge.sessions
# include:
# - created
# - type: edge.apiSessions
# - type: fabric.usage
# - type: services
# - type: fabric.usage
# - type: edge.entityCounts
# interval: 5s
# handler:
# type: file
# format: json
# path: /tmp/ziti-events.log
# xctrl_example
#
#example:
# enabled: false
# delay: 5
healthChecks:
boltCheck:
# How often to try entering a bolt read tx. Defaults to 30 seconds
interval: 30s
# When to timeout the check. Defaults to 15 seconds
timeout: 15s
# How long to wait before starting the check. Defaults to 15 seconds
initialDelay: 15s
# By having an 'edge' section defined, the ziti-controller will attempt to parse the edge configuration. Removing this
# section, commenting out, or altering the name of the section will cause the edge to not run.
edge:
# This section represents the configuration of the Edge API that is served over HTTPS
api:
#(optional, default 90s) Alters how frequently heartbeat and last activity values are persisted
# activityUpdateInterval: 90s
#(optional, default 250) The number of API Sessions updated for last activity per transaction
# activityUpdateBatchSize: 250
# sessionTimeout - optional, default 10m
# The number of minutes before an Edge API session will timeout. Timeouts are reset by
# API requests and connections that are maintained to Edge Routers
sessionTimeout: 30m
# address - required
# The default address (host:port) to use for enrollment for the Client API. This value must match one of the addresses
# defined in a bind point's address field for the `edge-client` API in the web section.
address: {{.Host.PublicIp}}:1280
# enrollment - required
# A section containing settings pertaining to enrollment.
enrollment:
# signingCert - required
# A Ziti Identity configuration section that specifically makes use of the cert and key fields to define
# a signing certificate from the PKI that the Ziti environment is using to sign certificates. The signingCert.cert
# will be added to the /.well-known CA store that is used to bootstrap trust with the Ziti Controller.
signingCert:
cert: /home/{{ .Model.MustVariable "credentials.ssh.username" }}/fablab/pki/intermediate/certs/intermediate.cert
key: /home/{{ .Model.MustVariable "credentials.ssh.username" }}/fablab/pki/intermediate/keys/intermediate.key
# edgeIdentity - optional
# A section for identity enrollment specific settings
edgeIdentity:
# duration - optional, default 5m
# The length of time that a Ziti Edge Identity enrollment should remain valid. After
# this duration, the enrollment will expire and not longer be usable.
duration: 5m
# edgeRouter - Optional
# A section for edge router enrollment specific settings.
edgeRouter:
# duration - optional, default 5m
# The length of time that a Ziti Edge Router enrollment should remain valid. After
# this duration, the enrollment will expire and not longer be usable.
duration: 5m
# web - optional
# Defines webListeners that will be hosted by the controller. Each webListener can host many APIs and be bound to many
# bind points.
web:
# name - required
# Provides a name for this listener, used for logging output. Not required to be unique, but is highly suggested.
- name: all-apis-localhost
# bindPoints - required
# One or more bind points are required. A bind point specifies an interface (interface:port string) that defines
# where on the host machine the webListener will listen and the address (host:port) that should be used to
# publicly address the webListener(i.e. mydomain.com, localhost, 127.0.0.1). This public address may be used for
# incoming address resolution as well as used in responses in the API.
bindPoints:
#interface - required
# A host:port string on which network interface to listen on. 0.0.0.0 will listen on all interfaces
- interface: 0.0.0.0:1280
# address - required
# The public address that external incoming requests will be able to resolve. Used in request processing and
# response content that requires full host:port/path addresses.
address: {{.Host.PublicIp}}:1280
# newAddress - optional
# A host:port string which will be sent out as an HTTP header "ziti-new-address" if specified. If the header
# is present, clients should update location configuration to immediately use the new address for future
# connections. The value of newAddress must be resolvable both via DNS and validate via certificates
#newAddress: localhost:1280
# identity - optional
# Allows the webListener to have a specific identity instead of defaulting to the root `identity` section.
# identity:
# cert: ${ZITI_SOURCE}/ziti/etc/ca/intermediate/certs/ctrl-client.cert.pem
# server_cert: ${ZITI_SOURCE}/ziti/etc/ca/intermediate/certs/ctrl-server.cert.pem
# key: ${ZITI_SOURCE}/ziti/etc/ca/intermediate/private/ctrl.key.pem
# ca: ${ZITI_SOURCE}/ziti/etc/ca/intermediate/certs/ca-chain.cert.pem
# options - optional
# Allows the specification of webListener level options - mainly dealing with HTTP/TLS settings. These options are
# used for all http servers started by the current webListener.
options:
# idleTimeout - optional, default 5000ms
# The maximum amount of idle time in milliseconds allowed for pipelined HTTP requests. Setting this too high
# can cause resources on the host to be consumed as clients remain connected and idle. Lowering this value
# will cause clients to reconnect on subsequent HTTPs requests.
idleTimeout: 5000ms #http timeouts, new
# readTimeout - optional, default 5000ms
# The maximum amount of time in milliseconds http servers will wait to read the first incoming requests. A higher
# value risks consuming resources on the host with clients that are acting bad faith or suffering from high latency
# or packet loss. A lower value can risk losing connections to high latency/packet loss clients.
readTimeout: 5000ms
# writeTimeout - optional, default 10000ms
# The total maximum time in milliseconds that the http server will wait for a single requests to be received and
# responded too. A higher value can allow long running requests to consume resources on the host. A lower value
# can risk ending requests before the server has a chance to respond.
writeTimeout: 100000ms
# minTLSVersion - optional, default TSL1.2
# The minimum version of TSL to support
minTLSVersion: TLS1.2
# maxTLSVersion - optional, default TSL1.3
# The maximum version of TSL to support
maxTLSVersion: TLS1.3
# apis - required
# Allows one or more APIs to be bound to this webListener
apis:
# binding - required
# Specifies an API to bind to this webListener. Built-in APIs are
# - health-checks
# - edge-management
# - edge-client
# - fabric-management
- binding: health-checks
options: { }
- binding: fabric
- binding: edge-management
# options - variable optional/required
# This section is used to define values that are specified by the API they are associated with.
# These settings are per API. The example below is for the `edge-api` and contains both optional values and
# required values.
options: { }
- binding: edge-client
options: { }
@@ -0,0 +1,8 @@
[logstash-6.x]
name=Elastic repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
@@ -0,0 +1,53 @@
fields_under_root: true
fields:
build_number: ${build_number}
ziti_version: ${ziti_version}
processors:
- add_cloud_metadata: ~
metricbeat.modules:
- module: system
metricsets:
- cpu # CPU usage
- load # CPU load averages
- memory # Memory usage
- network # Network IO
enabled: true
period: 30s
cpu.metrics: ["percentages"] # The other available options are normalized_percentages and ticks.
core.metrics: ["percentages"] # The other available option is ticks.
#- module: docker
# metricsets:
# - "container"
# - "cpu"
# - "diskio"
# - "healthcheck"
# - "info"
# - "image"
# - "memory"
# - "network"
# hosts: ["unix:///var/run/docker.sock"]
# period: 30s
# enabled: true
# # If set to true, replace dots in labels with `_`.
# labels.dedot: true
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["${host}"]
# Optional protocol and basic auth credentials.
protocol: "https"
username: "${user}"
password: "${password}"
index: 'zt-%{[agent.version]}-%{+yyyy.MM.dd}'
setup.template.enabled: true
setup.template.name: 'zt-%{[agent.version]}'
setup.template.pattern: 'zt-%{[agent.version]}-*'
setup.template.fields: "/etc/metricbeat/fields.yml"
setup.template.settings:
index.number_of_shards: 1
index.codec: best_compression
@@ -0,0 +1,70 @@
{{$ssh_username := .Model.MustVariable "credentials.ssh.username"}}
{{$identity := .Component.PublicIdentity}}
{{$ctrl_ip := publicIp "component#ctrl"}}
{{$router_ip := .Host.PublicIp}}
v: 3
enableDebugOps: true
identity:
cert: /home/{{$ssh_username}}/fablab/pki/intermediate/certs/{{$identity}}-client.cert
server_cert: /home/{{$ssh_username}}/fablab/pki/intermediate/certs/{{$identity}}-server.cert
key: /home/{{$ssh_username}}/fablab/pki/intermediate/keys/{{$identity}}.key
ca: /home/{{$ssh_username}}/fablab/pki/intermediate/certs/{{$identity}}-server.chain.pem
ctrl:
endpoint: tls:{{$ctrl_ip}}:6262
healthChecks:
ctrlPingCheck:
# How often to ping the controller over the control channel. Defaults to 30 seconds
interval: 30s
# When to timeout the ping. Defaults to 15 seconds
timeout: 15s
# How long to wait before pinging the controller. Defaults to 15 seconds
initialDelay: 15s
metrics:
reportInterval: 15s
messageQueueSize: 10
link:
listeners:
- binding: transport
bind: tls:0.0.0.0:6000
advertise: tls:{{$router_ip}}:6000
dialers:
- binding: transport
listeners:
{{if .Component.HasTag "tunneler"}}
- binding: tunnel
options:
mode: tproxy
{{end}}
- binding: edge
address: tls:0.0.0.0:6262
options:
# (required) The public hostname and port combination that Ziti SDKs should connect on. Previously this was in the chanIngress section.
advertise: {{ .Host.PublicIp }}:6262
# By having an 'edge' section defined, the ziti-router will attempt to parse the edge configuration. Removing this
# section, commenting out, or altering the name of the section will cause the router to no longer operate as an Edge
# Router.
edge:
# (required) Information used to generate the initial registration CSR. For documentation on these fields please
# refer to the openssl documentation. These values MUST be supplied and have no defaults.
csr:
country: US
province: NC
locality: Charlotte
organization: NetFoundry
organizationalUnit: Ziti
# (required) SANs that this Gateways certs should contain. At least one IP or DNS SAN should be defined that matches
# the edge listeners "advertise" value from the "listeners" section.
sans:
ip:
- {{ .Host.PublicIp }}
@@ -0,0 +1,9 @@
service {
name = "ziti"
id = "ziti"
port = 6262
meta {
build_number= "${build_number}"
ziti_version= "${ziti_version}"
}
}
+275
View File
@@ -0,0 +1,275 @@
package main
import (
"embed"
"fmt"
"os"
"time"
"github.com/openziti/fablab"
"github.com/openziti/fablab/kernel/lib/actions/component"
"github.com/openziti/fablab/kernel/lib/binding"
"github.com/openziti/fablab/kernel/lib/runlevel/0_infrastructure/aws_ssh_key"
semaphore_0 "github.com/openziti/fablab/kernel/lib/runlevel/0_infrastructure/semaphore"
terraform_0 "github.com/openziti/fablab/kernel/lib/runlevel/0_infrastructure/terraform"
"github.com/openziti/fablab/kernel/lib/runlevel/1_configuration/config"
"github.com/openziti/fablab/kernel/lib/runlevel/2_kitting/devkit"
distribution "github.com/openziti/fablab/kernel/lib/runlevel/3_distribution"
"github.com/openziti/fablab/kernel/lib/runlevel/3_distribution/rsync"
aws_ssh_key2 "github.com/openziti/fablab/kernel/lib/runlevel/6_disposal/aws_ssh_key"
"github.com/openziti/fablab/kernel/lib/runlevel/6_disposal/terraform"
"github.com/openziti/fablab/kernel/model"
"github.com/openziti/fablab/resources"
"github.com/openziti/ziti/network-tests/simple-transfer/actions"
runlevel_0_infrastructure "github.com/openziti/ziti/network-tests/simple-transfer/stages/0_infrastructure"
"github.com/openziti/zitilab"
zitilib_runlevel_0_infrastructure "github.com/openziti/zitilab/runlevel/0_infrastructure"
zitilib_runlevel_1_configuration "github.com/openziti/zitilab/runlevel/1_configuration"
"github.com/sirupsen/logrus"
)
//go:embed configs
var configResource embed.FS
type scaleStrategy struct{}
func (s scaleStrategy) IsScaled(entity model.Entity) bool {
return entity.GetType() == model.EntityTypeHost && entity.GetScope().HasTag("scaled")
}
func (s scaleStrategy) GetEntityCount(entity model.Entity) uint32 {
if entity.GetType() == model.EntityTypeHost && entity.GetScope().HasTag("scaled") {
return 4
}
return 1
}
func getConfigData(filePath string) []byte {
data, err := configResource.ReadFile(fmt.Sprintf("configs/%s", filePath))
if err != nil {
logrus.Errorf("Unable to read config data from %s: [%s]", filePath, err)
}
return data
}
var m = &model.Model{
Id: "simple-transfer",
Scope: model.Scope{
Defaults: model.Variables{
"environment": "simple-transfer-smoketest",
"credentials": model.Variables{
"ssh": model.Variables{
"username": "ubuntu",
},
"edge": model.Variables{
"username": "admin",
"password": "admin",
},
},
},
},
StructureFactories: []model.Factory{
model.NewScaleFactoryWithDefaultEntityFactory(scaleStrategy{}),
},
Factories: []model.Factory{
newStageFactory(),
},
Resources: model.Resources{
resources.Configs: resources.SubFolder(configResource, "configs"),
resources.Terraform: resources.DefaultTerraformResources(),
},
Regions: model.Regions{
"us-east-1": {
Region: "us-east-1",
Site: "us-east-1a",
Hosts: model.Hosts{
"ctrl": {
InstanceType: "t2.micro",
Components: model.Components{
"ctrl": {
Scope: model.Scope{Tags: model.Tags{"ctrl"}},
BinaryName: "ziti-controller",
ConfigSrc: "ctrl.yml",
ConfigName: "ctrl.yml",
PublicIdentity: "ctrl",
},
"consul": {
BinaryName: "consul",
},
},
},
"router-east": {
InstanceType: "t2.micro",
Components: model.Components{
"router-east": {
Scope: model.Scope{Tags: model.Tags{"edge-router", "terminator"}},
BinaryName: "ziti-router",
ConfigSrc: "router.yml",
ConfigName: "router-east.yml",
PublicIdentity: "router-east",
RunWithSudo: true,
},
"echo-server": {
Scope: model.Scope{Tags: model.Tags{"sdk-app", "service"}},
PublicIdentity: "echo-server",
},
"consul": {
BinaryName: "consul",
},
},
},
},
},
"us-west-2": {
Region: "us-west-2",
Site: "us-west-2b",
Hosts: model.Hosts{
"router-west": {
Scope: model.Scope{Tags: model.Tags{}},
InstanceType: "t2.micro",
Components: model.Components{
"router-west": {
Scope: model.Scope{Tags: model.Tags{"edge-router", "terminator"}},
BinaryName: "ziti-router",
ConfigSrc: "router.yml",
ConfigName: "router-west.yml",
PublicIdentity: "router-west",
RunWithSudo: true,
},
"echo-client": {
Scope: model.Scope{Tags: model.Tags{"sdk-app", "client"}},
PublicIdentity: "echo-client",
},
"consul": {
BinaryName: "consul",
},
},
},
},
},
},
Actions: model.ActionBinders{
"bootstrap": actions.NewBootstrapAction(),
"start": actions.NewStartAction(actions.MetricbeatConfig{
ConfigPath: "metricbeat",
DataPath: "metricbeat/data",
LogPath: "metricbeat/logs",
},
actions.ConsulConfig{
ServerAddr: os.Getenv("CONSUL_ENDPOINT"),
ConfigDir: "consul",
DataPath: "consul/data",
LogPath: "consul/log.out",
}),
"stop": model.Bind(component.StopInParallel("*", 15)),
},
Infrastructure: model.InfrastructureStages{
aws_ssh_key.Express(),
terraform_0.Express(),
runlevel_0_infrastructure.RetryInfra(zitilib_runlevel_0_infrastructure.InstallMetricbeat("*", zitilib_runlevel_0_infrastructure.RECCOMENDED_METRICBEAT_VERSION), 5),
runlevel_0_infrastructure.RetryInfra(zitilib_runlevel_0_infrastructure.InstallConsul("*"), 5),
semaphore_0.Restart(90 * time.Second),
},
Configuration: model.ConfigurationStages{
zitilib_runlevel_1_configuration.IfPkiNeedsRefresh(
zitilib_runlevel_1_configuration.Fabric(),
zitilib_runlevel_1_configuration.DotZiti(),
),
config.Component(),
zitilab.DefaultZitiBinaries(),
devkit.DevKitF(zitilab.ZitiDistBinaries, []string{"ziti-echo"}),
},
Distribution: model.DistributionStages{
distribution.DistributeSshKey("*"),
distribution.Locations("*", "logs"),
distribution.DistributeDataWithReplaceCallbacks(
"*",
string(getConfigData("metricbeat.yml")),
"metricbeat/metricbeat.yml",
os.FileMode(0644),
map[string]func(*model.Host) string{
"${host}": func(h *model.Host) string {
return os.Getenv("ELASTIC_ENDPOINT")
},
"${user}": func(h *model.Host) string {
return os.Getenv("ELASTIC_USERNAME")
},
"${password}": func(h *model.Host) string {
return os.Getenv("ELASTIC_PASSWORD")
},
"${build_number}": func(h *model.Host) string {
return os.Getenv("BUILD_NUMBER")
},
"${ziti_version}": func(h *model.Host) string {
return h.MustStringVariable("ziti_version")
},
},
),
distribution.DistributeDataWithReplaceCallbacks(
"*",
string(getConfigData("consul.hcl")),
"consul/consul.hcl",
os.FileMode(0644),
map[string]func(*model.Host) string{
"${public_ip}": func(h *model.Host) string {
return h.PublicIp
},
"${encryption_key}": func(h *model.Host) string {
return os.Getenv("CONSUL_ENCRYPTION_KEY")
},
"${build_number}": func(h *model.Host) string {
return os.Getenv("BUILD_NUMBER")
},
"${ziti_version}": func(h *model.Host) string {
return h.MustStringVariable("ziti_version")
},
},
),
distribution.DistributeDataWithReplaceCallbacks(
"#ctrl",
string(getConfigData("ziti.hcl")),
"consul/ziti.hcl",
os.FileMode(0644),
map[string]func(*model.Host) string{
"${build_number}": func(h *model.Host) string {
return os.Getenv("BUILD_NUMBER")
},
"${ziti_version}": func(h *model.Host) string {
return h.MustStringVariable("ziti_version")
},
}),
distribution.DistributeData(
"*",
[]byte(os.Getenv("CONSUL_AGENT_CERT")),
"consul/consul-agent-ca.pem"),
rsync.RsyncStaged(),
},
Disposal: model.DisposalStages{
terraform.Dispose(),
aws_ssh_key2.Dispose(),
},
}
func main() {
m.AddActivationActions("stop", "bootstrap", "start")
model.AddBootstrapExtension(
zitilab.BootstrapWithFallbacks(
&zitilab.BootstrapFromEnv{},
))
model.AddBootstrapExtension(binding.AwsCredentialsLoader)
model.AddBootstrapExtension(aws_ssh_key.KeyManager)
fablab.InitModel(m)
fablab.Run()
}
+28
View File
@@ -0,0 +1,28 @@
package main
import (
"crypto/rand"
"net/url"
fablib_5_operation "github.com/openziti/fablab/kernel/lib/runlevel/5_operation"
"github.com/openziti/fablab/kernel/model"
runlevel_5_operation "github.com/openziti/ziti/network-tests/simple-transfer/stages/5_operation"
)
type stageFactory struct{}
func newStageFactory() model.Factory {
return &stageFactory{}
}
func (sf *stageFactory) Build(m *model.Model) error {
runPhase := fablib_5_operation.NewPhase()
//generate 10k random bytes
data := make([]byte, 10000)
rand.Read(data)
m.AddOperatingStage(runlevel_5_operation.AssertEcho("#echo-client", url.QueryEscape(string(data))))
m.AddOperatingStage(runPhase)
return nil
}
@@ -0,0 +1,33 @@
package runlevel_0_infrastructure
import (
"fmt"
"github.com/openziti/fablab/kernel/model"
"github.com/sirupsen/logrus"
)
type retry struct {
stage model.InfrastructureStage
retries int
}
func RetryInfra(stage model.InfrastructureStage, retries int) model.InfrastructureStage {
return &retry{
stage: stage,
retries: retries,
}
}
func (r *retry) Express(run model.Run) error {
var err error
for i := 0; i < r.retries; i++ {
if e := r.stage.Express(run); e == nil {
continue
} else {
err = fmt.Errorf("%w", e)
}
}
logrus.Warn("Infra stage successful after retries. Earlier errors: [%w]", err)
return nil
}
@@ -0,0 +1,44 @@
package runlevel_5_operation
import (
"fmt"
"strings"
"github.com/openziti/fablab/kernel/lib"
"github.com/openziti/fablab/kernel/model"
"github.com/sirupsen/logrus"
)
type echoClient struct {
componentSpec string
message string
}
func AssertEcho(componentSpec, message string) model.OperatingStage {
return &echoClient{
componentSpec: componentSpec,
message: message,
}
}
func (ec *echoClient) Operate(run model.Run) error {
return run.GetModel().ForEachComponent(ec.componentSpec, 1, func(c *model.Component) error {
ssh := lib.NewSshConfigFactory(c.GetHost())
remoteConfigFile := "/home/ubuntu/fablab/cfg/" + c.PublicIdentity + ".json"
echoClientCmd := fmt.Sprintf("/home/%s/fablab/bin/ziti-echo client --identity %s %s 2>&1",
ssh.User(), remoteConfigFile, ec.message)
if output, err := lib.RemoteExec(ssh, echoClientCmd); err != nil {
logrus.Errorf("error starting echo client [%s] (%v)", output, err)
return err
} else {
//trim the newline ssh added
output = strings.TrimRight(output, "\n")
if output != ec.message {
return fmt.Errorf("Got message [%s] expected [%s]", output, ec.message)
}
}
return nil
})
}
@@ -0,0 +1,41 @@
package runlevel_5_operation
import (
"fmt"
"github.com/openziti/fablab/kernel/lib"
"github.com/openziti/fablab/kernel/model"
"github.com/sirupsen/logrus"
)
type echoServer struct {
joiner chan struct{}
host *model.Host
}
func EchoServer(host *model.Host, joiner chan struct{}) model.OperatingStage {
return &echoServer{
joiner: joiner,
host: host,
}
}
func (es *echoServer) Operate(run model.Run) error {
go func() {
defer func() {
if es.joiner != nil {
close(es.joiner)
logrus.Debug("closed joiner")
}
}()
ssh := lib.NewSshConfigFactory(es.host)
echoServerCmd := fmt.Sprintf("ziti edge tutorial ziti-echo-server")
if output, err := lib.RemoteExec(ssh, echoServerCmd); err != nil {
logrus.Errorf("error starting echo server [%s] (%v)", output, err)
}
}()
return nil
}
+36
View File
@@ -0,0 +1,36 @@
package actions
import (
"fmt"
"github.com/openziti/fablab/kernel/lib"
"github.com/openziti/fablab/kernel/model"
"github.com/sirupsen/logrus"
)
type echoServerStart struct {
componentSpec string
}
func StartEchoServers(componentSpec string) model.Action {
return &echoServerStart{
componentSpec: componentSpec,
}
}
func (esi *echoServerStart) Execute(m *model.Model) error {
return m.ForEachComponent(esi.componentSpec, 1, func(c *model.Component) error {
ssh := lib.NewSshConfigFactory(c.GetHost())
remoteConfigFile := "/home/ubuntu/fablab/cfg/" + c.PublicIdentity + ".json"
echoServerCmd := fmt.Sprintf("screen -d -m nohup /home/%s/fablab/bin/ziti-echo server --identity %s 2>&1 &",
ssh.User(), remoteConfigFile)
if output, err := lib.RemoteExec(ssh, echoServerCmd); err != nil {
logrus.Errorf("error starting echo server [%s] (%v)", output, err)
return err
}
logrus.Error("After remote starting echo server")
return nil
})
}
@@ -0,0 +1,76 @@
package cmd
import (
"context"
"fmt"
"io"
"log"
"net"
"net/http"
"net/url"
"strings"
"github.com/openziti/sdk-golang/ziti"
"github.com/openziti/sdk-golang/ziti/config"
"github.com/spf13/cobra"
)
var clientCmd = &cobra.Command{
Use: "client {string-to-echo}",
Short: "Simple ziti enabled echo client",
Args: cobra.MinimumNArgs(1),
Run: echoClient,
}
func init() {
clientCmd.Flags().SetInterspersed(true)
rootCmd.AddCommand(clientCmd)
}
func echoClient(cmd *cobra.Command, args []string) {
cfg, err := config.NewFromFile(identityFile)
if err != nil {
log.Fatal(err)
}
zitiContext := ziti.NewContextWithConfig(cfg)
dial := func(_ context.Context, _, addr string) (net.Conn, error) {
service := strings.Split(addr, ":")[0]
return zitiContext.Dial(service)
}
zitiTransport := http.DefaultTransport.(*http.Transport).Clone()
zitiTransport.DialContext = dial
zec := &zitiEchoClient{
client: &http.Client{Transport: zitiTransport},
}
resp, err := zec.Echo(strings.Join(args, " "))
if resp != "" {
fmt.Print(resp)
}
if err != nil {
log.Fatal(err)
}
}
type zitiEchoClient struct {
client *http.Client
}
func (zec *zitiEchoClient) Echo(input string) (string, error) {
u := fmt.Sprintf("http://echo?input=%v", url.QueryEscape(input))
resp, err := zec.client.Get(u)
if err != nil {
return "", err
}
defer resp.Body.Close()
b, err := io.ReadAll(resp.Body)
if err != nil {
return "", err
}
return string(b), err
}
+26
View File
@@ -0,0 +1,26 @@
package cmd
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
var identityFile string
var rootCmd = &cobra.Command{
Use: "ziti-echo",
Short: "A simple Echo Service",
}
func init() {
rootCmd.PersistentFlags().StringVar(&identityFile, "identity", "i", "ziti identity file")
}
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
@@ -0,0 +1,85 @@
package cmd
import (
"log"
"net"
"net/http"
"os"
"os/signal"
"syscall"
"time"
"github.com/openziti/sdk-golang/ziti"
"github.com/openziti/sdk-golang/ziti/config"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
var serverCmd = &cobra.Command{
Use: "server",
Short: "Simple Ziti enabled echo serer",
Run: runServer,
}
func init() {
rootCmd.AddCommand(serverCmd)
}
func runServer(cmd *cobra.Command, args []string) {
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
echoServer := &zitiEchoServer{
identityJson: identityFile,
}
if err := echoServer.run(); err != nil {
log.Fatal(err)
}
for {
select {
case <-time.After(10 * time.Second):
logrus.Debug("Beating to show server still running")
case <-sigs:
logrus.Info("Server shutting down...")
return
}
}
}
type zitiEchoServer struct {
identityJson string
listener net.Listener
}
func (s *zitiEchoServer) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
input := r.URL.Query().Get("input")
result := input
logrus.Infof("\nziti-http-echo-server: ")
logrus.Infof("received input '%v'\n", input)
if _, err := rw.Write([]byte(result)); err != nil {
panic(err)
}
}
func (s *zitiEchoServer) run() (err error) {
config, err := config.NewFromFile(s.identityJson)
if err != nil {
return err
}
zitiContext := ziti.NewContextWithConfig(config)
if s.listener, err = zitiContext.Listen("echo"); err != nil {
return err
}
logrus.Info("\nziti-http-echo-server: ")
logrus.Info("listening for connections from echo server")
go func() { _ = http.Serve(s.listener, http.HandlerFunc(s.ServeHTTP)) }()
return nil
}
func (s *zitiEchoServer) stop() error {
return s.listener.Close()
}
+9
View File
@@ -0,0 +1,9 @@
package main
import (
"github.com/openziti/ziti/network-tests/utils/ziti-echo/cmd"
)
func main() {
cmd.Execute()
}
+4
View File
@@ -4,6 +4,10 @@ ZITI_VERSION=latest
ZITI_CONTROLLER_RAWNAME=ziti-controller
ZITI_EDGE_CONTROLLER_RAWNAME=ziti-edge-controller
# The duration of the enrollment period (in minutes), default if not set
ZITI_EDGE_IDENTITY_ENROLLMENT_DURATION=
ZITI_EDGE_ROUTER_ENROLLMENT_DURATION=
## Additional variables to override.
#ZITI_EDGE_CONTROLLER_RAWNAME=some.other.name.com
#ZITI_EDGE_CTRL_ADVERTISED_HOST_PORT=some.other.name.com:1280
+3
View File
@@ -6,6 +6,9 @@ services:
- ./.env
ports:
- "1280:1280"
environment:
- ZITI_EDGE_IDENTITY_ENROLLMENT_DURATION=${ZITI_EDGE_IDENTITY_ENROLLMENT_DURATION}
- ZITI_EDGE_ROUTER_ENROLLMENT_DURATION=${ZITI_EDGE_ROUTER_ENROLLMENT_DURATION}
networks:
zitiblue:
aliases:
@@ -1380,6 +1380,14 @@ function createZacSystemdFile {
return 1
fi
if which node >/dev/null; then
# store the absolute path to the node executable because it's required by systemd on Amazon Linux, at least
NODE_BIN=$(readlink -f $(which node))
else
echo "ERROR: missing executable 'node'" >&2
return 1
fi
cat > "${output_file}" <<HeredocForSystemd
[Unit]
Description=Ziti-Console
@@ -1388,7 +1396,7 @@ After=network.target
[Service]
User=root
WorkingDirectory=${ZITI_HOME}/ziti-console
ExecStart=node "${ZITI_HOME}/ziti-console/server.js"
ExecStart=${NODE_BIN} "${ZITI_HOME}/ziti-console/server.js"
Restart=always
RestartSec=2
LimitNOFILE=65536
-71
View File
@@ -1,71 +0,0 @@
Ziti Probe
----------
`ziti-probe` is utility application allowing to collect network metrics from the _edge_.
## Setup
create `ziti-probe-config.v1` config type for metric collection service with the following schema
(this is optional)
```json
{
"$id": "http://ziti-edge.netfoundry.io/schemas/ziti-probe-config.v1.json",
"type":"object",
"additionalProperties": false,
"required": [],
"properties":{
"dbType": {
"type":"string"
},
"dbName": {
"type": "string"
},
"dbUser": {
"type": "string"
},
"dbPassword": {
"type": "string"
},
"interval": {
"type": "integer",
"minimum": 1,
"maximum": 3600
}
}
}
```
create service configuration `probe-service-cfg` (exact name does not matter,
it wil be used to configure the service in the next step), This is optional
```js
{
"dbType": "influxdb", // only influxdb is currently supported
"dbName": "ziti", // name of database in Influxdb, ziti is the default
"dbUser": "superuser", // optional
"dbPassword": "supersecret", // optional
"interval": 60 // how often metrics are uploaded (in seconds), 300 (every 5 minutes) is the default
}
```
create service with a router termination
```shell script
$ ziti edge controller create service probe-service probe-service-cfg
$ ziti edge controller create terminator probe-service router1 tcp:127.0.0.1:8086
```
in this example `router1` is the name of the fabric router that has access to influxDB server,
and `tcp:127.0.0.1:8086` is the address of influxDB server. Adjust as needed.
create ziti identity(ies) for your probe(s). `ziti-probe` is a Ziti-SDK-enabled application,
so standard enrollment procedure should be followed.
## Running `ziti-probe`
```shell script
$ ziti-probe run <identity-file>
```
#### What's happening?
1. `ziti-probe` authenticates to Ziti controller with provided identity
1. it checks that `probe-service` is available and get configuration.
If configuration is not assigned default values are used.
1. it opens connections to all edge routers configured for `probe-service` (refer to ziti policies)
1. each connection performs a round-trip latency probe to each of edge routers every 30 seconds
1. `ziti-probe` then submits collected metrics to `probe-service`.
metric names are in the following format: `latency.<edgeRouterAddress>`, e.g `latency.tls://54.145.23.14:3022`
-69
View File
@@ -1,69 +0,0 @@
//go:build all
/*
Copyright NetFoundry Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package subcmd
import (
"fmt"
"os"
"github.com/michaelquigley/pfxlog"
"github.com/openziti/ziti/common/enrollment"
"github.com/openziti/ziti/ziti/cmd/ziti/cmd/common"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
func init() {
root.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Enable verbose logging")
root.PersistentFlags().StringVar(&logFormatter, "log-formatter", "", "Specify log formatter [json|pfxlog|text]")
p := common.NewOptionsProvider(os.Stdout, os.Stderr)
root.AddCommand(enrollment.NewEnrollCommand(p))
}
var root = &cobra.Command{
Use: "ziti-probe",
Short: "Ziti Probe",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if verbose {
logrus.SetLevel(logrus.DebugLevel)
}
switch logFormatter {
case "pfxlog":
logrus.SetFormatter(pfxlog.NewFormatter(pfxlog.DefaultOptions().StartingToday()))
case "json":
logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: "2006-01-02T15:04:05.000Z"})
case "text":
logrus.SetFormatter(&logrus.TextFormatter{})
default:
// let logrus do its own thing
}
},
}
var verbose bool
var logFormatter string
func Execute() {
if err := root.Execute(); err != nil {
fmt.Printf("error: %s\n", err)
}
}
-285
View File
@@ -1,285 +0,0 @@
//go:build all
package subcmd
import (
"context"
"fmt"
influxdb "github.com/influxdata/influxdb1-client"
"github.com/michaelquigley/pfxlog"
"github.com/openziti/metrics"
"github.com/openziti/sdk-golang/ziti"
"github.com/openziti/sdk-golang/ziti/config"
"github.com/openziti/sdk-golang/ziti/edge"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"net"
"net/http"
"net/url"
"os"
"reflect"
"sync/atomic"
"time"
"unsafe"
)
var runCmd = &cobra.Command{
Use: "run <config>",
Short: "Runs ziti probe",
Long: "runs ziti probe: captures latency to edge routers and submits them to probe-service",
Args: cobra.MaximumNArgs(1),
Run: theProbe.run,
}
const (
DefaultDbName = "ziti"
DefaultDbType = "influxdb"
DefaultInterval = 5 * 60 // 5 minutes
ProbeService = "probe-service"
)
func init() {
root.AddCommand(runCmd)
}
var log = pfxlog.Logger()
type probeCfg struct {
dbName string
dbType string
dbUser string
dbPassword string
interval int
}
var defaultConfig = probeCfg{
dbName: DefaultDbName,
dbType: DefaultDbType,
interval: DefaultInterval,
}
type probe struct {
cfg *probeCfg
influxDb *influxdb.Client
ctx ziti.Context
latest atomic.Value
closer chan interface{}
}
var theProbe = &probe{
closer: make(chan interface{}),
}
func (p *probe) sendMetrics() {
for {
select {
case <-time.After(time.Duration(p.cfg.interval) * time.Second):
message := p.ctx.Metrics().Poll()
if message == nil {
continue
}
//TODO: currently broken as influx support was removed from metrics
// The AsBatch function can be extraced from foundation history
// if we want to get this working again
bp, err := metrics.AsBatch(message)
if err != nil {
logrus.Errorln(err)
return
}
bp.Database = p.cfg.dbName
_, err = p.influxDb.Write(*bp)
if err == nil {
logrus.Debug("write complete")
} else {
logrus.Errorf("error writing to influxdb: %v", err)
for {
logrus.Info("attempting to reconnect")
if service, ok := p.ctx.GetService(ProbeService); ok {
if err := p.connectToInfluxDb(service); err == nil {
logrus.Info("reconnected")
if _, err = p.influxDb.Write(*bp); err != nil {
logrus.Errorf("failed to write after reconnect")
} else {
break
}
} else {
logrus.Errorf("failed to reconnect: %v", err)
}
} else {
logrus.Errorf("could not find %s", ProbeService)
}
time.Sleep(30 * time.Second)
}
}
}
}
}
func (p *probe) run(_ *cobra.Command, args []string) {
var err error
if len(args) == 0 {
log.Infof("loading ziti identity from env.ZITI_SDK_CONFIG[%s]", os.Getenv("ZITI_SDK_CONFIG"))
p.ctx = ziti.NewContext()
} else {
if cfg, err := config.NewFromFile(args[0]); err != nil {
log.WithError(err).Fatalf("failed to load config from file[%s]", args[0])
} else {
cfg.ConfigTypes = append(cfg.ConfigTypes, "ziti-probe-config.v1")
p.ctx = ziti.NewContextWithConfig(cfg)
}
}
for {
if err = p.ctx.Authenticate(); err != nil {
sleepDuration := 5 * time.Second
log.Errorf("failed to authenticate, trying again in %.2f seconds: %v", sleepDuration.Seconds(), err)
time.Sleep(sleepDuration)
} else {
break
}
}
for {
if _, err = p.ctx.GetServices(); err != nil {
sleepDuration := 5 * time.Second
log.Errorf("failed to load available services, try again in %.2f seconds: %v", sleepDuration.Seconds(), err)
time.Sleep(sleepDuration)
} else {
break
}
}
var service *edge.Service
for {
var found bool
service, found = p.ctx.GetService(ProbeService)
if !found {
sleepDuration := 5 * time.Second
log.Errorf("required service was not found, try again in %.2f seconds", sleepDuration.Seconds())
time.Sleep(sleepDuration)
} else {
break
}
}
for {
err := p.connectToInfluxDb(service)
if err != nil {
sleepDuration := 5 * time.Second
log.Errorf("could not connect to influxDb, trying again in %.2f seconds: %v", sleepDuration.Seconds(), err)
time.Sleep(sleepDuration)
} else {
break
}
}
go p.sendMetrics()
select {
case <-p.closer:
}
p.ctx.Close()
}
func (p *probe) connectToInfluxDb(service *edge.Service) error {
p.cfg = getProbeConfig(service)
var err error
p.influxDb, err = p.createInfluxDbClient(p.cfg)
if err != nil {
return fmt.Errorf("could not create influxDb client: %v", err)
}
_, res, err := p.influxDb.Ping()
if err != nil {
return fmt.Errorf("failed to get influxDb server info: %v", err)
}
log.Info("connected to influx version = ", res)
return nil
}
func getProbeConfig(service *edge.Service) *probeCfg {
cfg, found := service.Configs["ziti-probe-config.v1"]
if !found {
return &defaultConfig
}
dbName := DefaultDbName
if val, found := cfg["dbName"]; found {
if str, ok := val.(string); ok {
dbName = str
}
}
dbType := DefaultDbType
if val, found := cfg["dbType"]; found {
if str, ok := val.(string); ok {
dbType = str
}
}
var dbUser string
if val, found := cfg["dbUser"]; found {
if str, ok := val.(string); ok {
dbUser = str
}
}
var dbPassword string
if val, found := cfg["dbPassword"]; found {
if str, ok := val.(string); ok {
dbPassword = str
}
}
interval := DefaultInterval
if val, found := cfg["interval"]; found {
if flt, ok := val.(float64); ok {
interval = int(flt)
}
}
return &probeCfg{
dbName: dbName,
dbType: dbType,
dbUser: dbUser,
dbPassword: dbPassword,
interval: interval,
}
}
func (p *probe) createInfluxDbClient(cfg *probeCfg) (*influxdb.Client, error) {
httpC := &http.Client{
Transport: &http.Transport{
DialContext: func(c context.Context, network, addr string) (net.Conn, error) {
log.Infof("connecting to %s:%s", network, addr)
return p.ctx.Dial("probe-service")
},
},
}
influxConfig := influxdb.NewConfig()
u, _ := url.Parse("http://" + ProbeService)
influxConfig.URL = *u
influxConfig.Username = cfg.dbUser
influxConfig.Password = cfg.dbPassword
clt, _ := influxdb.NewClient(influxConfig)
ic := reflect.ValueOf(clt)
ict := ic.Type()
hcf, _ := ict.Elem().FieldByName("httpClient")
hcp := unsafe.Pointer(uintptr(unsafe.Pointer(clt)) + hcf.Offset)
httpCppClient := (**http.Client)(hcp)
*httpCppClient = httpC
return clt, nil
}
-37
View File
@@ -1,37 +0,0 @@
//go:build all
/*
Copyright NetFoundry Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package subcmd
import (
"fmt"
"github.com/openziti/ziti/common/version"
"github.com/spf13/cobra"
)
func init() {
root.AddCommand(versionCmd)
}
var versionCmd = &cobra.Command{
Use: "version",
Short: "Show component version",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println(version.GetBuildMetadata(verbose))
},
}
-19
View File
@@ -1,19 +0,0 @@
//go:build all
package main
import (
"github.com/michaelquigley/pfxlog"
"github.com/openziti/foundation/v2/debugz"
"github.com/openziti/ziti/ziti-probe/subcmd"
"github.com/sirupsen/logrus"
)
func init() {
pfxlog.GlobalInit(logrus.InfoLevel, pfxlog.DefaultOptions().SetTrimPrefix("github.com/openziti/").NoColor())
}
func main() {
debugz.AddStackDumpHandler()
subcmd.Execute()
}
+4 -4
View File
@@ -19,6 +19,7 @@ package subcmd
import (
"fmt"
"github.com/michaelquigley/pfxlog"
"github.com/openziti/agent"
"github.com/openziti/edge/edge_common"
"github.com/openziti/edge/router/debugops"
"github.com/openziti/edge/router/fabric"
@@ -27,7 +28,6 @@ import (
"github.com/openziti/edge/router/xgress_edge_tunnel"
"github.com/openziti/fabric/router"
"github.com/openziti/fabric/router/xgress"
"github.com/openziti/agent"
"github.com/openziti/foundation/v2/debugz"
"github.com/openziti/ziti/common/version"
"github.com/sirupsen/logrus"
@@ -81,16 +81,16 @@ func run(cmd *cobra.Command, args []string) {
xgressEdgeFactory := xgress_edge.NewFactory(config, version.GetCmdBuildInfo(), stateManager, r.GetMetricsRegistry())
xgress.GlobalRegistry().Register(edge_common.EdgeBinding, xgressEdgeFactory)
if err := r.RegisterXctrl(xgressEdgeFactory); err != nil {
if err := r.RegisterXrctrl(xgressEdgeFactory); err != nil {
logrus.WithError(err).Panic("error registering edge in framework")
}
xgressEdgeTransportFactory := xgress_edge_transport.NewFactory(r)
xgressEdgeTransportFactory := xgress_edge_transport.NewFactory()
xgress.GlobalRegistry().Register(xgress_edge_transport.BindingName, xgressEdgeTransportFactory)
xgressEdgeTunnelFactory := xgress_edge_tunnel.NewFactory(config, stateManager)
xgress.GlobalRegistry().Register(edge_common.TunnelBinding, xgressEdgeTunnelFactory)
if err := r.RegisterXctrl(xgressEdgeTunnelFactory); err != nil {
if err := r.RegisterXrctrl(xgressEdgeTunnelFactory); err != nil {
logrus.WithError(err).Panic("error registering edge tunnel in framework")
}
+1 -1
View File
@@ -18,7 +18,7 @@ package cmd
import (
"fmt"
"github.com/openziti/channel"
"github.com/openziti/channel/v2"
"github.com/openziti/agent"
"github.com/openziti/identity"
"github.com/openziti/ziti/ziti/cmd/ziti/cmd/agentcli"
+2 -2
View File
@@ -19,8 +19,8 @@ package cmd
import (
"fmt"
"github.com/openziti/agent"
"github.com/openziti/channel"
"github.com/openziti/channel/protobufs"
"github.com/openziti/channel/v2"
"github.com/openziti/channel/v2/protobufs"
"github.com/openziti/edge/pb/edge_mgmt_pb"
"github.com/openziti/identity"
"github.com/openziti/ziti/ziti/cmd/ziti/cmd/agentcli"
@@ -18,7 +18,7 @@ package cmd
import (
"fmt"
"github.com/openziti/channel"
"github.com/openziti/channel/v2"
"github.com/openziti/fabric/controller"
"github.com/openziti/fabric/pb/mgmt_pb"
"github.com/openziti/agent"
@@ -19,7 +19,7 @@ package cmd
import (
"fmt"
"github.com/golang/protobuf/proto"
"github.com/openziti/channel"
"github.com/openziti/channel/v2"
"github.com/openziti/fabric/pb/mgmt_pb"
"github.com/openziti/agent"
"github.com/openziti/identity"
@@ -18,7 +18,7 @@ package cmd
import (
"fmt"
"github.com/openziti/channel"
"github.com/openziti/channel/v2"
"github.com/openziti/fabric/pb/mgmt_pb"
"github.com/openziti/fabric/router"
"github.com/openziti/agent"
+1 -1
View File
@@ -1,7 +1,7 @@
package agentcli
import (
"github.com/openziti/channel"
"github.com/openziti/channel/v2"
"github.com/openziti/agent"
"github.com/openziti/identity"
"github.com/openziti/ziti/ziti/cmd/ziti/cmd/common"
+2 -2
View File
@@ -20,8 +20,8 @@ import (
"fmt"
"github.com/gorilla/websocket"
"github.com/michaelquigley/pfxlog"
"github.com/openziti/channel"
"github.com/openziti/channel/websockets"
"github.com/openziti/channel/v2"
"github.com/openziti/channel/v2/websockets"
"github.com/openziti/identity"
"github.com/openziti/ziti/ziti/cmd/ziti/util"
"io"
@@ -138,14 +138,14 @@ edge:
# edgeIdentity - optional
# A section for identity enrollment specific settings
edgeIdentity:
# duration - optional, default {{ .Controller.EdgeIdentityDuration.Minutes }}m
# duration - optional, default {{ .Controller.DefaultEdgeIdentityDuration.Minutes }}m
# The length of time that a Ziti Edge Identity enrollment should remain valid. After
# this duration, the enrollment will expire and no longer be usable.
duration: {{ .Controller.EdgeIdentityDuration.Minutes }}m
# edgeRouter - Optional
# A section for edge router enrollment specific settings.
edgeRouter:
# duration - optional, default {{ .Controller.EdgeRouterDuration.Minutes }}m
# duration - optional, default {{ .Controller.DefaultEdgeRouterDuration.Minutes }}m
# The length of time that a Ziti Edge Router enrollment should remain valid. After
# this duration, the enrollment will expire and no longer be usable.
duration: {{ .Controller.EdgeRouterDuration.Minutes }}m
@@ -50,6 +50,7 @@ csr:
- localhost
ip:
- "127.0.0.1"
{{ if .Router.Edge.IPOverride }} - "{{ .Router.Edge.IPOverride }}"{{ end }}
{{ else }}
edge:
csr:
@@ -64,6 +65,7 @@ edge:
- localhost
ip:
- "127.0.0.1"
{{ if .Router.Edge.IPOverride }} - "{{ .Router.Edge.IPOverride }}"{{ end }}
{{ end }}
{{ if not .Router.IsWss }}#{{ end }}transport:
{{ if not .Router.IsWss }}#{{ end }} ws:
+40 -27
View File
@@ -17,7 +17,7 @@
package cmd
import (
"github.com/openziti/channel"
"github.com/openziti/channel/v2"
edge "github.com/openziti/edge/controller/config"
fabCtrl "github.com/openziti/fabric/controller"
fabForwarder "github.com/openziti/fabric/router/forwarder"
@@ -58,28 +58,30 @@ type ConfigTemplateValues struct {
}
type ControllerTemplateValues struct {
Name string
Port string
AdvertisedAddress string
ListenerAddress string
IdentityCert string
IdentityServerCert string
IdentityKey string
IdentityCA string
MinQueuedConnects int
MaxQueuedConnects int
DefaultQueuedConnects int
MinOutstandingConnects int
MaxOutstandingConnects int
DefaultOutstandingConnects int
MinConnectTimeout time.Duration
MaxConnectTimeout time.Duration
DefaultConnectTimeout time.Duration
EdgeIdentityDuration time.Duration
EdgeRouterDuration time.Duration
Edge EdgeControllerValues
WebListener ControllerWebListenerValues
HealthCheck ControllerHealthCheckValues
Name string
Port string
AdvertisedAddress string
ListenerAddress string
IdentityCert string
IdentityServerCert string
IdentityKey string
IdentityCA string
MinQueuedConnects int
MaxQueuedConnects int
DefaultQueuedConnects int
MinOutstandingConnects int
MaxOutstandingConnects int
DefaultOutstandingConnects int
MinConnectTimeout time.Duration
MaxConnectTimeout time.Duration
DefaultConnectTimeout time.Duration
EdgeIdentityDuration time.Duration
EdgeRouterDuration time.Duration
DefaultEdgeIdentityDuration time.Duration
DefaultEdgeRouterDuration time.Duration
Edge EdgeControllerValues
WebListener ControllerWebListenerValues
HealthCheck ControllerHealthCheckValues
}
type EdgeControllerValues struct {
@@ -128,8 +130,9 @@ type RouterTemplateValues struct {
}
type EdgeRouterTemplateValues struct {
Hostname string
Port string
Hostname string
Port string
IPOverride string
}
type WSSRouterTemplateValues struct {
@@ -241,6 +244,14 @@ func (data *ConfigTemplateValues) populateEnvVars() {
zitiEdgeCtrlAdvertisedPort, err := cmdhelper.GetZitiEdgeCtrlAdvertisedPort()
handleVariableError(err, constants.ZitiEdgeCtrlAdvertisedPortVarName)
// Get Ziti edge Identity enrollment duration
zitiEdgeIdentityEnrollmentDuration, err := cmdhelper.GetZitiEdgeIdentityEnrollmentDuration()
handleVariableError(err, constants.ZitiEdgeIdentityEnrollmentDurationVarName)
// Get Ziti edge Router enrollment duration
zitiEdgeRouterEnrollmentDuration, err := cmdhelper.GetZitiEdgeRouterEnrollmentDuration()
handleVariableError(err, constants.ZitiEdgeRouterEnrollmentDurationVarName)
data.ZitiHome = zitiHome
data.Hostname = hostname
data.Controller.Name = zitiCtrlHostname
@@ -251,6 +262,10 @@ func (data *ConfigTemplateValues) populateEnvVars() {
data.Controller.Edge.AdvertisedHostPort = zitiEdgeCtrlAdvertisedHostPort
data.Router.Edge.Port = zitiEdgeRouterPort
data.Controller.Edge.AdvertisedPort = zitiEdgeCtrlAdvertisedPort
data.Controller.EdgeIdentityDuration = zitiEdgeIdentityEnrollmentDuration
data.Controller.EdgeRouterDuration = zitiEdgeRouterEnrollmentDuration
data.Controller.DefaultEdgeIdentityDuration = edge.DefaultEdgeEnrollmentDuration
data.Controller.DefaultEdgeRouterDuration = edge.DefaultEdgeEnrollmentDuration
}
func (data *ConfigTemplateValues) populateDefaults() {
@@ -272,8 +287,6 @@ func (data *ConfigTemplateValues) populateDefaults() {
data.Controller.Edge.APIActivityUpdateBatchSize = edge.DefaultEdgeApiActivityUpdateBatchSize
data.Controller.Edge.APIActivityUpdateInterval = edge.DefaultEdgeAPIActivityUpdateInterval
data.Controller.Edge.APISessionTimeout = edge.DefaultEdgeSessionTimeout
data.Controller.EdgeIdentityDuration = edge.DefaultEdgeEnrollmentDuration
data.Controller.EdgeRouterDuration = edge.DefaultEdgeEnrollmentDuration
data.Controller.WebListener.IdleTimeout = edge.DefaultHttpIdleTimeout
data.Controller.WebListener.ReadTimeout = edge.DefaultHttpReadTimeout
data.Controller.WebListener.WriteTimeout = edge.DefaultHttpWriteTimeout
+25 -5
View File
@@ -18,6 +18,7 @@ package cmd
import (
_ "embed"
edge "github.com/openziti/edge/controller/config"
cmdhelper "github.com/openziti/ziti/ziti/cmd/ziti/cmd/helpers"
"github.com/openziti/ziti/ziti/cmd/ziti/cmd/templates"
"github.com/openziti/ziti/ziti/cmd/ziti/constants"
@@ -28,11 +29,14 @@ import (
"path/filepath"
"strings"
"text/template"
"time"
)
const (
optionCtrlPort = "ctrlPort"
optionDatabaseFile = "databaseFile"
optionCtrlPort = "ctrlPort"
optionDatabaseFile = "databaseFile"
optionEdgeIdentityEnrollmentDuration = "identityEnrollmentDuration"
optionEdgeRouterEnrollmentDuration = "routerEnrollmentDuration"
)
var (
@@ -52,6 +56,11 @@ var (
# Print the controller config to a file
ziti create config controller --output <path to file>/<filename>.yaml
# Create the controller config with an edge router enrollment duration of 2 hours
ziti create config controller --identityEnrollmentDuration 2h
# OR
ziti create config controller --identityEnrollmentDuration 120m
`)
)
@@ -62,8 +71,10 @@ var controllerConfigTemplate string
type CreateConfigControllerOptions struct {
CreateConfigOptions
CtrlPort string
MgmtListener string
CtrlPort string
MgmtListener string
EdgeIdentityEnrollmentDuration time.Duration
EdgeRouterEnrollmentDuration time.Duration
}
// NewCmdCreateConfigController creates a command object for the "create" command
@@ -97,6 +108,13 @@ func NewCmdCreateConfigController() *cobra.Command {
if data.Controller.Port == "" || controllerOptions.CtrlPort != constants.DefaultZitiControllerPort {
data.Controller.Port = controllerOptions.CtrlPort
}
// Update with the passed in arg if it's not the default (CLI flag should override other methods of modifying these values)
if controllerOptions.EdgeIdentityEnrollmentDuration != edge.DefaultEdgeEnrollmentDuration {
data.Controller.EdgeIdentityDuration = controllerOptions.EdgeIdentityEnrollmentDuration
}
if controllerOptions.EdgeRouterEnrollmentDuration != edge.DefaultEdgeEnrollmentDuration {
data.Controller.EdgeRouterDuration = controllerOptions.EdgeRouterEnrollmentDuration
}
// process identity information
SetControllerIdentity(&data.Controller)
@@ -122,8 +140,10 @@ func NewCmdCreateConfigController() *cobra.Command {
}
func (options *CreateConfigControllerOptions) addFlags(cmd *cobra.Command) {
cmd.Flags().StringVar(&options.CtrlPort, optionCtrlPort, constants.DefaultZitiControllerPort, "port to use for the config controller")
cmd.Flags().StringVar(&options.CtrlPort, optionCtrlPort, constants.DefaultZitiControllerPort, "port used for the router to controller communication")
cmd.Flags().StringVar(&options.DatabaseFile, optionDatabaseFile, "ctrl.db", "location of the database file")
cmd.Flags().DurationVar(&options.EdgeIdentityEnrollmentDuration, optionEdgeIdentityEnrollmentDuration, edge.DefaultEdgeEnrollmentDuration, "the edge identity enrollment duration, use 0h0m0s format")
cmd.Flags().DurationVar(&options.EdgeRouterEnrollmentDuration, optionEdgeRouterEnrollmentDuration, edge.DefaultEdgeEnrollmentDuration, "the edge router enrollment duration, use 0h0m0s format")
}
// run implements the command
@@ -1,16 +1,117 @@
package cmd
import (
"fmt"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"os"
"testing"
"time"
)
/* BEGIN Controller config template structure */
type ControllerConfig struct {
V string `yaml:"v"`
Db string `yaml:"db"`
Identity Identity `yaml:"identity"`
Ctrl Ctrl `yaml:"ctrl"`
Mgmt Mgmt `yaml:"mgmt"`
HealthChecks HealthChecks `yaml:"healthChecks"`
Edge Edge `yaml:"edge"`
Web []Web `yaml:"web"`
}
type Identity struct {
Cert string `yaml:"cert"`
Server_cert string `yaml:"server_cert"`
Key string `yaml:"key"`
Ca string `yaml:"ca"`
}
type Ctrl struct {
Listener string `yaml:"listener"`
}
type Mgmt struct {
Listener string `yaml:"listener"`
}
type HealthChecks struct {
BoltCheck BoltCheck `yaml:"boltCheck"`
}
type BoltCheck struct {
Interval string `yaml:"interval"`
Timeout string `yaml:"timeout"`
InitialDelay string `yaml:"initialDelay"`
}
type Edge struct {
Api Api `yaml:"api"`
Enrollment Enrollment `yaml:"enrollment"`
}
type Api struct {
SessionTimeout string `yaml:"sessionTimeout"`
Address string `yaml:"address"`
}
type Enrollment struct {
SigningCert SigningCert `yaml:"signingCert"`
EdgeIdentity EdgeIdentity `yaml:"edgeIdentity"`
EdgeRouter EdgeRouter `yaml:"edgeRouter"`
}
type SigningCert struct {
Cert string `yaml:"cert"`
Key string `yaml:"key"`
}
type EdgeIdentity struct {
Duration string `yaml:"duration"`
}
type EdgeRouter struct {
Duration string `yaml:"duration"`
}
type Web struct {
Name string `yaml:"name"`
BindPoints []BindPoints `yaml:"bindPoints"`
Identity Identity `yaml:"identity"`
Options Options `yaml:"options"`
Apis []Apis `yaml:"apis"`
}
type BindPoints struct {
BpInterface string `yaml:"interface"`
Address string `yaml:"address"`
}
type Options struct {
IdleTimeout string `yaml:"idleTimeout"`
ReadTimeout string `yaml:"readTimeout"`
WriteTimeout string `yaml:"writeTimeout"`
MinTLSVersion string `yaml:"minTLSVersion"`
MaxTLSVersion string `yaml:"maxTLSVersion"`
}
type Apis struct {
Binding string `yaml:"binding"`
Options ApiOptions `yaml:"options"`
}
type ApiOptions struct {
// Unsure of this format right now
}
/* END Controller config template structure */
func TestControllerOutputPathDoesNotExist(t *testing.T) {
expectedErrorMsg := "stat /IDoNotExist: no such file or directory"
// Create the options with both flags set to true
// Create the options with non-existent path
options := &CreateConfigControllerOptions{}
options.Output = "/IDoNotExist/MyController.yaml"
@@ -130,3 +231,251 @@ func TestEdgeCtrlAdvertisedPortValueWhenSet(t *testing.T) {
assert.Equal(t, expectedPort, data.Controller.Edge.AdvertisedPort)
}
func TestDefaultEdgeIdentityEnrollmentDuration(t *testing.T) {
// Expect the default (3 hours)
expectedDuration := time.Duration(180) * time.Minute
expectedConfigValue := "180m"
// Unset the env var so the default is used
_ = os.Unsetenv("ZITI_EDGE_IDENTITY_ENROLLMENT_DURATION")
// Create and run the CLI command (capture output, otherwise config prints to stdout instead of test results)
cmd := NewCmdCreateConfigController()
configOutput := captureOutput(func() {
_ = cmd.Execute()
})
assert.Equal(t, expectedDuration, data.Controller.EdgeIdentityDuration)
// Expect that the config value is represented correctly
configStruct := configToStruct(configOutput)
assert.Equal(t, expectedConfigValue, configStruct.Edge.Enrollment.EdgeIdentity.Duration)
}
func TestEdgeIdentityEnrollmentDurationWhenEnvVarSet(t *testing.T) {
expectedDuration := 5 * time.Minute // Setting a custom duration which is not the default value
expectedConfigValue := "5m"
// Set a custom value for the enrollment duration
_ = os.Setenv("ZITI_EDGE_IDENTITY_ENROLLMENT_DURATION", fmt.Sprintf("%.0f", expectedDuration.Minutes()))
// Create and run the CLI command (capture output, otherwise config prints to stdout instead of test results)
cmd := NewCmdCreateConfigController()
configOutput := captureOutput(func() {
_ = cmd.Execute()
})
assert.Equal(t, expectedDuration, data.Controller.EdgeIdentityDuration)
// Expect that the config value is represented correctly
configStruct := configToStruct(configOutput)
assert.Equal(t, expectedConfigValue, configStruct.Edge.Enrollment.EdgeIdentity.Duration)
}
func TestEdgeIdentityEnrollmentDurationWhenEnvVarSetToBlank(t *testing.T) {
// Expect the default (3 hours)
expectedDuration := time.Duration(180) * time.Minute
expectedConfigValue := "180m"
// Set a custom value for the enrollment duration
_ = os.Setenv("ZITI_EDGE_IDENTITY_ENROLLMENT_DURATION", "")
// Create and run the CLI command (capture output, otherwise config prints to stdout instead of test results)
cmd := NewCmdCreateConfigController()
configOutput := captureOutput(func() {
_ = cmd.Execute()
})
assert.Equal(t, expectedDuration, data.Controller.EdgeIdentityDuration)
// Expect that the config value is represented correctly
configStruct := configToStruct(configOutput)
assert.Equal(t, expectedConfigValue, configStruct.Edge.Enrollment.EdgeIdentity.Duration)
}
func TestEdgeIdentityEnrollmentDurationCLITakesPriority(t *testing.T) {
envVarValue := 5 * time.Minute // Setting a custom duration which is not the default value
cliValue := "10m" // Setting a CLI custom duration which is also not the default value
expectedConfigValue := "10m"
// Set a custom value for the enrollment duration
_ = os.Setenv("ZITI_EDGE_IDENTITY_ENROLLMENT_DURATION", fmt.Sprintf("%.0f", envVarValue.Minutes()))
// Create and run the CLI command (capture output, otherwise config prints to stdout instead of test results)
cmd := NewCmdCreateConfigController()
cmd.SetArgs([]string{"--identityEnrollmentDuration", cliValue})
configOutput := captureOutput(func() {
_ = cmd.Execute()
})
// Expect that the CLI value was used over the environment variable
expectedValue, _ := time.ParseDuration(cliValue)
assert.Equal(t, expectedValue, data.Controller.EdgeIdentityDuration)
// Expect that the config value is represented correctly
configStruct := configToStruct(configOutput)
assert.Equal(t, expectedConfigValue, configStruct.Edge.Enrollment.EdgeIdentity.Duration)
}
func TestDefaultEdgeRouterEnrollmentDuration(t *testing.T) {
expectedDuration := time.Duration(180) * time.Minute
expectedConfigValue := "180m"
// Unset the env var so the default is used
_ = os.Unsetenv("ZITI_EDGE_ROUTER_ENROLLMENT_DURATION")
// Create and run the CLI command (capture output, otherwise config prints to stdout instead of test results)
cmd := NewCmdCreateConfigController()
configOutput := captureOutput(func() {
_ = cmd.Execute()
})
assert.Equal(t, expectedDuration, data.Controller.EdgeRouterDuration)
// Expect that the config value is represented correctly
configStruct := configToStruct(configOutput)
assert.Equal(t, expectedConfigValue, configStruct.Edge.Enrollment.EdgeRouter.Duration)
}
func TestEdgeRouterEnrollmentDurationWhenEnvVarSet(t *testing.T) {
expectedDuration := 5 * time.Minute // Setting a custom duration which is not the default value
expectedConfigValue := "5m"
// Set a custom value for the enrollment duration
_ = os.Setenv("ZITI_EDGE_ROUTER_ENROLLMENT_DURATION", fmt.Sprintf("%.0f", expectedDuration.Minutes()))
// Create and run the CLI command (capture output, otherwise config prints to stdout instead of test results)
cmd := NewCmdCreateConfigController()
configOutput := captureOutput(func() {
_ = cmd.Execute()
})
assert.Equal(t, expectedDuration, data.Controller.EdgeRouterDuration)
// Expect that the config value is represented correctly
configStruct := configToStruct(configOutput)
assert.Equal(t, expectedConfigValue, configStruct.Edge.Enrollment.EdgeRouter.Duration)
}
func TestEdgeRouterEnrollmentDurationWhenEnvVarSetToBlank(t *testing.T) {
// Expect the default (3 hours)
expectedDuration := time.Duration(180) * time.Minute
expectedConfigValue := "180m"
// Set a custom value for the enrollment duration
_ = os.Setenv("ZITI_EDGE_ROUTER_ENROLLMENT_DURATION", "")
// Create and run the CLI command
cmd := NewCmdCreateConfigController()
configOutput := captureOutput(func() {
_ = cmd.Execute()
})
assert.Equal(t, expectedDuration, data.Controller.EdgeRouterDuration)
// Expect that the config value is represented correctly
configStruct := configToStruct(configOutput)
assert.Equal(t, expectedConfigValue, configStruct.Edge.Enrollment.EdgeRouter.Duration)
}
func TestEdgeRouterEnrollmentDurationCLITakesPriority(t *testing.T) {
envVarValue := 5 * time.Minute // Setting a custom duration which is not the default value
cliValue := "10m" // Setting a CLI custom duration which is also not the default value
expectedConfigValue := "10m" // Config value representation should be in minutes
// Set a custom value for the enrollment duration
_ = os.Setenv("ZITI_EDGE_ROUTER_ENROLLMENT_DURATION", fmt.Sprintf("%.0f", envVarValue.Minutes()))
// Create and run the CLI command (capture output, otherwise config prints to stdout instead of test results)
cmd := NewCmdCreateConfigController()
cmd.SetArgs([]string{"--routerEnrollmentDuration", cliValue})
configOutput := captureOutput(func() {
_ = cmd.Execute()
})
// Expect that the CLI value was used over the environment variable
expectedValue, _ := time.ParseDuration(cliValue)
assert.Equal(t, expectedValue, data.Controller.EdgeRouterDuration)
// Expect that the config value is represented correctly
configStruct := configToStruct(configOutput)
assert.Equal(t, expectedConfigValue, configStruct.Edge.Enrollment.EdgeRouter.Duration)
}
func TestEdgeRouterEnrollmentDurationCLIConvertsToMin(t *testing.T) {
cliValue := "1h" // Setting a CLI custom duration which is also not the default value
expectedConfigValue := "60m" // Config value representation should be in minutes
// Make sure the env var is not set
_ = os.Unsetenv("ZITI_EDGE_ROUTER_ENROLLMENT_DURATION")
// Create and run the CLI command
cmd := NewCmdCreateConfigController()
cmd.SetArgs([]string{"--routerEnrollmentDuration", cliValue})
configOutput := captureOutput(func() {
_ = cmd.Execute()
})
// Expect that the CLI value was used over the environment variable
expectedValue, _ := time.ParseDuration(cliValue)
assert.Equal(t, expectedValue, data.Controller.EdgeRouterDuration)
// Expect that the config value is represented correctly
configStruct := configToStruct(configOutput)
assert.Equal(t, expectedConfigValue, configStruct.Edge.Enrollment.EdgeRouter.Duration)
}
func TestEdgeRouterAndIdentityEnrollmentDurationTogetherCLI(t *testing.T) {
cliIdentityDurationValue := "1h"
cliRouterDurationValue := "30m"
expectedIdentityConfigValue := "60m"
expectedRouterConfigValue := "30m"
// Make sure the env vars are not set
_ = os.Unsetenv("ZITI_EDGE_IDENTITY_ENROLLMENT_DURATION")
_ = os.Unsetenv("ZITI_EDGE_ROUTER_ENROLLMENT_DURATION")
// Create and run the CLI command
cmd := NewCmdCreateConfigController()
cmd.SetArgs([]string{"--routerEnrollmentDuration", cliRouterDurationValue, "--identityEnrollmentDuration", cliIdentityDurationValue})
configOutput := captureOutput(func() {
_ = cmd.Execute()
})
// Expect that the config values are represented correctly
configStruct := configToStruct(configOutput)
assert.Equal(t, expectedIdentityConfigValue, configStruct.Edge.Enrollment.EdgeIdentity.Duration)
assert.Equal(t, expectedRouterConfigValue, configStruct.Edge.Enrollment.EdgeRouter.Duration)
}
func TestEdgeRouterAndIdentityEnrollmentDurationTogetherEnvVar(t *testing.T) {
envVarIdentityDurationValue := "120"
envVarRouterDurationValue := "60"
expectedIdentityConfigValue := "120m"
expectedRouterConfigValue := "60m"
// Set the env vars
_ = os.Setenv("ZITI_EDGE_IDENTITY_ENROLLMENT_DURATION", envVarIdentityDurationValue)
_ = os.Setenv("ZITI_EDGE_ROUTER_ENROLLMENT_DURATION", envVarRouterDurationValue)
// Create and run the CLI command
cmd := NewCmdCreateConfigController()
configOutput := captureOutput(func() {
_ = cmd.Execute()
})
// Expect that the config values are represented correctly
configStruct := configToStruct(configOutput)
assert.Equal(t, expectedIdentityConfigValue, configStruct.Edge.Enrollment.EdgeIdentity.Duration)
assert.Equal(t, expectedRouterConfigValue, configStruct.Edge.Enrollment.EdgeRouter.Duration)
}
func configToStruct(config string) ControllerConfig {
configStruct := ControllerConfig{}
err2 := yaml.Unmarshal([]byte(config), &configStruct)
if err2 != nil {
fmt.Println(err2)
}
return configStruct
}
+33 -24
View File
@@ -111,11 +111,14 @@ func NewCmdCreateConfigEnvironment() *cobra.Command {
{constants.ZitiRouterIdentityServerCertVarName, constants.ZitiRouterIdentityServerCertVarDescription, data.Router.IdentityServerCert},
{constants.ZitiRouterIdentityKeyVarName, constants.ZitiRouterIdentityKeyVarDescription, data.Router.IdentityKey},
{constants.ZitiRouterIdentityCAVarName, constants.ZitiRouterIdentityCAVarDescription, data.Router.IdentityCA},
{constants.ZitiEdgeRouterIPOverrideVarName, constants.ZitiEdgeRouterIPOverrideVarDescription, data.Router.Edge.IPOverride},
{constants.ZitiCtrlListenerAddressVarName, constants.ZitiCtrlListenerAddressVarDescription, data.Controller.ListenerAddress},
{constants.ZitiCtrlAdvertisedAddressVarName, constants.ZitiCtrlAdvertisedAddressVarDescription, data.Controller.AdvertisedAddress},
{constants.ZitiEdgeCtrlListenerHostPortVarName, constants.ZitiEdgeCtrlListenerHostPortVarDescription, data.Controller.Edge.ListenerHostPort},
{constants.ZitiEdgeCtrlAdvertisedHostPortVarName, constants.ZitiEdgeCtrlAdvertisedHostPortVarDescription, data.Controller.Edge.AdvertisedHostPort},
{constants.ZitiEdgeCtrlAdvertisedPortVarName, constants.ZitiEdgeCtrlAdvertisedPortVarDescription, data.Controller.Edge.AdvertisedPort},
{constants.ZitiEdgeIdentityEnrollmentDurationVarName, constants.ZitiEdgeIdentityEnrollmentDurationVarDescription, data.Controller.EdgeIdentityDuration.String()},
{constants.ZitiEdgeRouterEnrollmentDurationVarName, constants.ZitiEdgeRouterEnrollmentDurationVarDescription, data.Controller.EdgeRouterDuration.String()},
}
// Setup logging
@@ -154,29 +157,32 @@ func NewCmdCreateConfigEnvironment() *cobra.Command {
createConfigLong := fmt.Sprintf("Creates a config file for specified Ziti component using environment variables which have default values but can be manually set to override the config output.\n\n"+
"The following environment variables can be set to override config values (current value is displayed):\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s\n"+
"%-36s %-50s %s",
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s\n"+
"%-40s %-50s %s",
constants.ZitiHomeVarName, constants.ZitiHomeVarDescription, data.ZitiHome,
constants.ZitiCtrlPortVarName, constants.ZitiCtrlPortVarDescription, data.Controller.Port,
constants.ZitiCtrlNameVarName, constants.ZitiCtrlNameVarDescription, data.Controller.Name,
@@ -191,6 +197,7 @@ func NewCmdCreateConfigEnvironment() *cobra.Command {
constants.ZitiRouterIdentityServerCertVarName, constants.ZitiRouterIdentityServerCertVarDescription, data.Router.IdentityServerCert,
constants.ZitiRouterIdentityKeyVarName, constants.ZitiRouterIdentityKeyVarDescription, data.Router.IdentityKey,
constants.ZitiRouterIdentityCAVarName, constants.ZitiRouterIdentityCAVarDescription, data.Router.IdentityCA,
constants.ZitiEdgeRouterIPOverrideVarName, constants.ZitiEdgeRouterIPOverrideVarDescription, data.Router.Edge.IPOverride,
constants.ZitiCtrlIdentityCertVarName, constants.ZitiCtrlIdentityCertVarDescription, data.Controller.IdentityCert,
constants.ZitiCtrlIdentityServerCertVarName, constants.ZitiCtrlIdentityServerCertVarDescription, data.Controller.IdentityServerCert,
constants.ZitiCtrlIdentityKeyVarName, constants.ZitiCtrlIdentityKeyVarDescription, data.Controller.IdentityKey,
@@ -200,7 +207,9 @@ func NewCmdCreateConfigEnvironment() *cobra.Command {
constants.ZitiEdgeCtrlIdentityKeyVarName, constants.ZitiEdgeCtrlIdentityKeyVarDescription, data.Controller.Edge.IdentityKey,
constants.ZitiEdgeCtrlIdentityCAVarName, constants.ZitiEdgeCtrlIdentityCAVarDescription, data.Controller.Edge.IdentityCA,
constants.ZitiSigningCertVarName, constants.ZitiSigningCertVarDescription, data.Controller.Edge.ZitiSigningCert,
constants.ZitiSigningKeyVarName, constants.ZitiSigningKeyVarDescription, data.Controller.Edge.ZitiSigningKey)
constants.ZitiSigningKeyVarName, constants.ZitiSigningKeyVarDescription, data.Controller.Edge.ZitiSigningKey,
constants.ZitiEdgeIdentityEnrollmentDurationVarName, constants.ZitiEdgeIdentityEnrollmentDurationVarDescription, fmt.Sprintf("%.0f", data.Controller.EdgeIdentityDuration.Minutes()),
constants.ZitiEdgeRouterEnrollmentDurationVarName, constants.ZitiEdgeRouterEnrollmentDurationVarDescription, fmt.Sprintf("%.0f", data.Controller.EdgeRouterDuration.Minutes()))
cmd.Long = createConfigLong
@@ -38,6 +38,12 @@ func SetZitiRouterIdentity(r *RouterTemplateValues, routerName string) {
} else {
r.Edge.Hostname, _ = os.Hostname()
}
// Edge router IP override
edgeRouterIPOverride := os.Getenv(constants.ZitiEdgeRouterIPOverrideVarName)
if edgeRouterIPOverride != "" {
r.Edge.IPOverride = edgeRouterIPOverride
}
}
func SetZitiRouterIdentityCert(r *RouterTemplateValues, routerName string) {
val := os.Getenv(constants.ZitiRouterIdentityCertVarName)
@@ -4,6 +4,7 @@ import (
"github.com/openziti/ziti/ziti/cmd/ziti/constants"
"github.com/stretchr/testify/assert"
"os"
"strings"
"testing"
"time"
)
@@ -316,3 +317,32 @@ func TestExecuteCreateConfigRouterFabricHasNonBlankTemplateValues(t *testing.T)
assert.NotZero(t, *value, expectedNonEmptyTimeFields[field]+" should be a non-zero value")
}
}
func TestEdgeRouterIPOverrideIsConsumed(t *testing.T) {
routerName := "MyFabricRouter"
blank := ""
externalIP := "123.456.78.9"
// Setup options
clearOptionsAndTemplateData()
routerOptions.Output = defaultOutput
// Set the env variable to non-empty value
_ = os.Setenv(constants.ZitiEdgeRouterIPOverrideVarName, externalIP)
// Check that template value is currently blank
assert.Equal(t, blank, data.Router.Edge.IPOverride, "Mismatch router IP override, expected %s but got %s", blank, data.Router.Edge.IPOverride)
// Create and run the CLI command (capture output, otherwise config prints to stdout instead of test results)
cmd := NewCmdCreateConfigRouter()
cmd.SetArgs([]string{"edge", "--routerName", routerName})
configOutput := captureOutput(func() {
_ = cmd.Execute()
})
// Check that the template values now contains the custom external IP override value
assert.Equal(t, externalIP, data.Router.Edge.IPOverride, "Mismatch router IP override, expected %s but got %s", externalIP, data.Router.Edge.IPOverride)
// Check that the config output has the IP
assert.True(t, strings.Contains(configOutput, externalIP), "Expected value not found; expected to find value of "+constants.ZitiEdgeRouterIPOverrideVarName+" in config output.")
}
+3
View File
@@ -32,10 +32,13 @@ func getZitiEnvironmentVariables() []string {
"ZITI_ROUTER_IDENTITY_SERVER_CERT",
"ZITI_ROUTER_IDENTITY_KEY",
"ZITI_ROUTER_IDENTITY_CA",
"ZITI_EDGE_ROUTER_IP_OVERRIDE",
"ZITI_CTRL_LISTENER_ADDRESS",
"ZITI_CTRL_ADVERTISED_ADDRESS",
"ZITI_CTRL_EDGE_LISTENER_HOST_PORT",
"ZITI_EDGE_CTRL_ADVERTISED_HOST_PORT",
"ZITI_EDGE_IDENTITY_ENROLLMENT_DURATION",
"ZITI_EDGE_ROUTER_ENROLLMENT_DURATION",
}
}
+1 -1
View File
@@ -20,7 +20,7 @@ import (
"bufio"
"fmt"
"github.com/michaelquigley/pfxlog"
"github.com/openziti/channel"
"github.com/openziti/channel/v2"
"github.com/openziti/agent"
"github.com/openziti/identity"
"github.com/openziti/sdk-golang/ziti"
@@ -18,7 +18,7 @@ package demo
import (
"fmt"
"github.com/openziti/channel"
"github.com/openziti/channel/v2"
"github.com/openziti/agent"
"github.com/openziti/ziti/ziti/cmd/ziti/cmd/agentcli"
"github.com/openziti/ziti/ziti/cmd/ziti/cmd/common"
+1 -1
View File
@@ -19,7 +19,7 @@ package fabric
import (
"fmt"
"google.golang.org/protobuf/proto"
"github.com/openziti/channel"
"github.com/openziti/channel/v2"
"github.com/openziti/fabric/pb/mgmt_pb"
"github.com/openziti/ziti/ziti/cmd/ziti/cmd/api"
"github.com/openziti/ziti/ziti/cmd/ziti/cmd/common"
+1 -1
View File
@@ -18,7 +18,7 @@ package fabric
import (
"fmt"
"github.com/openziti/channel"
"github.com/openziti/channel/v2"
"github.com/openziti/fabric/pb/mgmt_pb"
"github.com/openziti/ziti/ziti/cmd/ziti/cmd/api"
"github.com/openziti/ziti/ziti/cmd/ziti/cmd/common"
@@ -19,8 +19,8 @@ package fabric
import (
"fmt"
"google.golang.org/protobuf/proto"
"github.com/openziti/channel"
"github.com/openziti/channel/trace/pb"
"github.com/openziti/channel/v2"
"github.com/openziti/channel/v2/trace/pb"
"github.com/openziti/fabric/pb/mgmt_pb"
"github.com/openziti/ziti/ziti/cmd/ziti/cmd/api"
"github.com/openziti/ziti/ziti/cmd/ziti/cmd/common"
+2 -2
View File
@@ -20,8 +20,8 @@ import (
"encoding/json"
"fmt"
"google.golang.org/protobuf/proto"
"github.com/openziti/channel"
"github.com/openziti/channel/trace/pb"
"github.com/openziti/channel/v2"
"github.com/openziti/channel/v2/trace/pb"
"github.com/openziti/fabric/pb/ctrl_pb"
"github.com/openziti/fabric/pb/mgmt_pb"
"github.com/openziti/fabric/router/xgress"
+42
View File
@@ -17,10 +17,13 @@
package helpers
import (
edge "github.com/openziti/edge/controller/config"
"github.com/openziti/ziti/ziti/cmd/ziti/constants"
"github.com/pkg/errors"
"os"
"strconv"
"strings"
"time"
)
func HomeDir() string {
@@ -147,6 +150,45 @@ func GetZitiEdgeCtrlAdvertisedPort() (string, error) {
return getValueOrSetAndGetDefault(constants.ZitiEdgeCtrlAdvertisedPortVarName, constants.DefaultZitiEdgeAPIPort)
}
func GetZitiEdgeIdentityEnrollmentDuration() (time.Duration, error) {
retVal, err := getValueOrSetAndGetDefault(constants.ZitiEdgeIdentityEnrollmentDurationVarName, strconv.FormatInt(int64(edge.DefaultEdgeEnrollmentDuration.Minutes()), 10))
if err != nil {
err := errors.Wrap(err, "Unable to get "+constants.ZitiEdgeIdentityEnrollmentDurationVarDescription)
if err != nil {
return edge.DefaultEdgeEnrollmentDuration, err
}
}
retValInt, err := strconv.Atoi(retVal)
if err != nil {
err := errors.Wrap(err, "Unable to get "+constants.ZitiEdgeIdentityEnrollmentDurationVarDescription)
if err != nil {
return edge.DefaultEdgeEnrollmentDuration, err
}
}
return time.Duration(retValInt) * time.Minute, nil
}
func GetZitiEdgeRouterEnrollmentDuration() (time.Duration, error) {
retVal, err := getValueOrSetAndGetDefault(constants.ZitiEdgeRouterEnrollmentDurationVarName, strconv.FormatInt(int64(edge.DefaultEdgeEnrollmentDuration.Minutes()), 10))
if err != nil {
err := errors.Wrap(err, "Unable to get "+constants.ZitiEdgeRouterEnrollmentDurationVarDescription)
if err != nil {
return edge.DefaultEdgeEnrollmentDuration, err
}
}
retValInt, err := strconv.Atoi(retVal)
if err != nil {
err := errors.Wrap(err, "Unable to get "+constants.ZitiEdgeRouterEnrollmentDurationVarDescription)
if err != nil {
return edge.DefaultEdgeEnrollmentDuration, err
}
}
//fmt.Println("Router Duration: " + retVal + " - " + (time.Duration(retValInt) * time.Minute).String())
return time.Duration(retValInt) * time.Minute, nil
}
func getValueOrSetAndGetDefault(envVarName string, defaultValue string) (string, error) {
// Get path from env variable
retVal := os.Getenv(envVarName)
+86
View File
@@ -1,10 +1,12 @@
package helpers
import (
"fmt"
"github.com/stretchr/testify/assert"
"os"
"strings"
"testing"
"time"
)
func TestHomeDirHasNoWindowsSlashes(t *testing.T) {
@@ -346,6 +348,90 @@ func TestGetZitiEdgeCtrlPortWhenNotSet(t *testing.T) {
assert.Equal(t, expectedValue, actualValue)
}
func TestGetZitiEdgeIdentityEnrollmentDurationWhenSet(t *testing.T) {
// Setup
varName := "ZITI_EDGE_IDENTITY_ENROLLMENT_DURATION"
expectedValue := 5 * time.Minute
// Set the env variable
_ = os.Setenv(varName, fmt.Sprintf("%.0f", expectedValue.Minutes()))
// Check that the value matches
actualValue, _ := GetZitiEdgeIdentityEnrollmentDuration()
assert.Equal(t, expectedValue, actualValue)
}
/* Ensure that the default value is returned even if the environment variable is set but is blank. */
func TestGetZitiEdgeIdentityEnrollmentDurationWhenSetToBlank(t *testing.T) {
// Setup
varName := "ZITI_EDGE_IDENTITY_ENROLLMENT_DURATION"
// Expect the default, hard coding the value to act as an alert if default is changed in edge project
expectedValue := 180 * time.Minute
// Set the env variable
_ = os.Setenv(varName, "")
// Check that the value matches
actualValue, _ := GetZitiEdgeIdentityEnrollmentDuration()
assert.Equal(t, expectedValue, actualValue)
}
func TestGetZitiEdgeIdentityEnrollmentDurationWhenNotSet(t *testing.T) {
// Setup
varName := "ZITI_EDGE_IDENTITY_ENROLLMENT_DURATION"
// Expect the default, hard coding the value to act as an alert if default is changed in edge project
expectedValue := 180 * time.Minute
// Set the env variable
_ = os.Setenv(varName, fmt.Sprintf("%.0f", expectedValue.Minutes()))
// Check that the value matches
actualValue, _ := GetZitiEdgeIdentityEnrollmentDuration()
assert.Equal(t, expectedValue, actualValue)
}
func TestGetZitiEdgeRouterEnrollmentDurationWhenSet(t *testing.T) {
// Setup
varName := "ZITI_EDGE_ROUTER_ENROLLMENT_DURATION"
expectedValue := 5 * time.Minute
// Set the env variable
_ = os.Setenv(varName, fmt.Sprintf("%.0f", expectedValue.Minutes()))
// Check that the value matches
actualValue, _ := GetZitiEdgeRouterEnrollmentDuration()
assert.Equal(t, expectedValue, actualValue)
}
/* Ensure that the default value is returned even if the environment variable is set but is blank. */
func TestGetZitiEdgeRouterEnrollmentDurationWhenSetToBlank(t *testing.T) {
// Setup
varName := "ZITI_EDGE_ROUTER_ENROLLMENT_DURATION"
// Expect the default, hard coding the value to act as an alert if default is changed in edge project
expectedValue := 180 * time.Minute
// Set the env variable
_ = os.Setenv(varName, "")
// Check that the value matches
actualValue, _ := GetZitiEdgeRouterEnrollmentDuration()
assert.Equal(t, expectedValue, actualValue)
}
func TestGetZitiEdgeRouterEnrollmentDurationWhenNotSet(t *testing.T) {
// Setup
varName := "ZITI_EDGE_ROUTER_ENROLLMENT_DURATION"
// Expect the default, hard coding the value to act as an alert if default is changed in edge project
expectedValue := 180 * time.Minute
// Set the env variable
_ = os.Setenv(varName, fmt.Sprintf("%.0f", expectedValue.Minutes()))
// Check that the value matches
actualValue, _ := GetZitiEdgeRouterEnrollmentDuration()
assert.Equal(t, expectedValue, actualValue)
}
func TestGetZitiEdgeCtrlPortWhenSet(t *testing.T) {
// Setup
varName := "ZITI_EDGE_CONTROLLER_PORT"
@@ -18,11 +18,12 @@ package tutorial
import (
"fmt"
"net"
"net/http"
"github.com/fatih/color"
"github.com/openziti/sdk-golang/ziti"
"github.com/openziti/sdk-golang/ziti/config"
"net"
"net/http"
)
type zitiEchoServer struct {
+55 -49
View File
@@ -50,53 +50,59 @@ const (
// Env Var Constants
const (
ZitiHomeVarName = "ZITI_HOME"
ZitiHomeVarDescription = "Root home directory for Ziti related files"
ZitiCtrlNameVarName = "ZITI_CONTROLLER_NAME"
ZitiCtrlNameVarDescription = "The name of the Ziti Controller"
ZitiCtrlPortVarName = "ZITI_CTRL_PORT"
ZitiCtrlPortVarDescription = "The port of the Ziti Controller"
ZitiEdgeRouterRawNameVarName = "ZITI_EDGE_ROUTER_RAWNAME"
ZitiEdgeRouterRawNameVarDescription = "The Edge Router Raw Name"
ZitiEdgeRouterPortVarName = "ZITI_EDGE_ROUTER_PORT"
ZitiEdgeRouterPortVarDescription = "Port of the Ziti Edge Router"
ZitiEdgeCtrlIdentityCertVarName = "ZITI_EDGE_CTRL_IDENTITY_CERT"
ZitiEdgeCtrlIdentityCertVarDescription = "Path to Identity Cert for Ziti Edge Controller"
ZitiEdgeCtrlIdentityServerCertVarName = "ZITI_EDGE_CTRL_IDENTITY_SERVER_CERT"
ZitiEdgeCtrlIdentityServerCertVarDescription = "Path to Identity Server Cert for Ziti Edge Controller"
ZitiEdgeCtrlIdentityKeyVarName = "ZITI_EDGE_CTRL_IDENTITY_KEY"
ZitiEdgeCtrlIdentityKeyVarDescription = "Path to Identity Key for Ziti Edge Controller"
ZitiEdgeCtrlIdentityCAVarName = "ZITI_EDGE_CTRL_IDENTITY_CA"
ZitiEdgeCtrlIdentityCAVarDescription = "Path to Identity CA for Ziti Edge Controller"
ZitiCtrlIdentityCertVarName = "ZITI_CTRL_IDENTITY_CERT"
ZitiCtrlIdentityCertVarDescription = "Path to Identity Cert for Ziti Controller"
ZitiCtrlIdentityServerCertVarName = "ZITI_CTRL_IDENTITY_SERVER_CERT"
ZitiCtrlIdentityServerCertVarDescription = "Path to Identity Server Cert for Ziti Controller"
ZitiCtrlIdentityKeyVarName = "ZITI_CTRL_IDENTITY_KEY"
ZitiCtrlIdentityKeyVarDescription = "Path to Identity Key for Ziti Controller"
ZitiCtrlIdentityCAVarName = "ZITI_CTRL_IDENTITY_CA"
ZitiCtrlIdentityCAVarDescription = "Path to Identity CA for Ziti Controller"
ZitiSigningCertVarName = "ZITI_SIGNING_CERT"
ZitiSigningCertVarDescription = "Path to the Ziti Signing Cert"
ZitiSigningKeyVarName = "ZITI_SIGNING_KEY"
ZitiSigningKeyVarDescription = "Path to the Ziti Signing Key"
ZitiRouterIdentityCertVarName = "ZITI_ROUTER_IDENTITY_CERT"
ZitiRouterIdentityCertVarDescription = "Path to Identity Cert for Ziti Router"
ZitiRouterIdentityServerCertVarName = "ZITI_ROUTER_IDENTITY_SERVER_CERT"
ZitiRouterIdentityServerCertVarDescription = "Path to Identity Server Cert for Ziti Router"
ZitiRouterIdentityKeyVarName = "ZITI_ROUTER_IDENTITY_KEY"
ZitiRouterIdentityKeyVarDescription = "Path to Identity Key for Ziti Router"
ZitiRouterIdentityCAVarName = "ZITI_ROUTER_IDENTITY_CA"
ZitiRouterIdentityCAVarDescription = "Path to Identity CA for Ziti Router"
ZitiCtrlListenerAddressVarName = "ZITI_CTRL_LISTENER_ADDRESS"
ZitiCtrlListenerAddressVarDescription = "The Ziti Controller Listener Address"
ZitiCtrlAdvertisedAddressVarName = "ZITI_CTRL_ADVERTISED_ADDRESS"
ZitiCtrlAdvertisedAddressVarDescription = "The Ziti Controller Advertised Address"
ZitiEdgeCtrlListenerHostPortVarName = "ZITI_CTRL_EDGE_LISTENER_HOST_PORT"
ZitiEdgeCtrlListenerHostPortVarDescription = "Host and port of the Ziti Edge Controller Listener"
ZitiEdgeCtrlAdvertisedHostPortVarName = "ZITI_EDGE_CTRL_ADVERTISED_HOST_PORT"
ZitiEdgeCtrlAdvertisedHostPortVarDescription = "Host and port of the Ziti Edge Controller API"
ZitiEdgeCtrlAdvertisedPortVarName = "ZITI_EDGE_CONTROLLER_PORT"
ZitiEdgeCtrlAdvertisedPortVarDescription = "The advertised port of the edge controller"
ExternalDNSVarName = "EXTERNAL_DNS"
ZitiHomeVarName = "ZITI_HOME"
ZitiHomeVarDescription = "Root home directory for Ziti related files"
ZitiCtrlNameVarName = "ZITI_CONTROLLER_NAME"
ZitiCtrlNameVarDescription = "The name of the Ziti Controller"
ZitiCtrlPortVarName = "ZITI_CTRL_PORT"
ZitiCtrlPortVarDescription = "The port of the Ziti Controller"
ZitiEdgeRouterRawNameVarName = "ZITI_EDGE_ROUTER_RAWNAME"
ZitiEdgeRouterRawNameVarDescription = "The Edge Router Raw Name"
ZitiEdgeRouterPortVarName = "ZITI_EDGE_ROUTER_PORT"
ZitiEdgeRouterPortVarDescription = "Port of the Ziti Edge Router"
ZitiEdgeCtrlIdentityCertVarName = "ZITI_EDGE_CTRL_IDENTITY_CERT"
ZitiEdgeCtrlIdentityCertVarDescription = "Path to Identity Cert for Ziti Edge Controller"
ZitiEdgeCtrlIdentityServerCertVarName = "ZITI_EDGE_CTRL_IDENTITY_SERVER_CERT"
ZitiEdgeCtrlIdentityServerCertVarDescription = "Path to Identity Server Cert for Ziti Edge Controller"
ZitiEdgeCtrlIdentityKeyVarName = "ZITI_EDGE_CTRL_IDENTITY_KEY"
ZitiEdgeCtrlIdentityKeyVarDescription = "Path to Identity Key for Ziti Edge Controller"
ZitiEdgeCtrlIdentityCAVarName = "ZITI_EDGE_CTRL_IDENTITY_CA"
ZitiEdgeCtrlIdentityCAVarDescription = "Path to Identity CA for Ziti Edge Controller"
ZitiCtrlIdentityCertVarName = "ZITI_CTRL_IDENTITY_CERT"
ZitiCtrlIdentityCertVarDescription = "Path to Identity Cert for Ziti Controller"
ZitiCtrlIdentityServerCertVarName = "ZITI_CTRL_IDENTITY_SERVER_CERT"
ZitiCtrlIdentityServerCertVarDescription = "Path to Identity Server Cert for Ziti Controller"
ZitiCtrlIdentityKeyVarName = "ZITI_CTRL_IDENTITY_KEY"
ZitiCtrlIdentityKeyVarDescription = "Path to Identity Key for Ziti Controller"
ZitiCtrlIdentityCAVarName = "ZITI_CTRL_IDENTITY_CA"
ZitiCtrlIdentityCAVarDescription = "Path to Identity CA for Ziti Controller"
ZitiSigningCertVarName = "ZITI_SIGNING_CERT"
ZitiSigningCertVarDescription = "Path to the Ziti Signing Cert"
ZitiSigningKeyVarName = "ZITI_SIGNING_KEY"
ZitiSigningKeyVarDescription = "Path to the Ziti Signing Key"
ZitiRouterIdentityCertVarName = "ZITI_ROUTER_IDENTITY_CERT"
ZitiRouterIdentityCertVarDescription = "Path to Identity Cert for Ziti Router"
ZitiRouterIdentityServerCertVarName = "ZITI_ROUTER_IDENTITY_SERVER_CERT"
ZitiRouterIdentityServerCertVarDescription = "Path to Identity Server Cert for Ziti Router"
ZitiRouterIdentityKeyVarName = "ZITI_ROUTER_IDENTITY_KEY"
ZitiRouterIdentityKeyVarDescription = "Path to Identity Key for Ziti Router"
ZitiRouterIdentityCAVarName = "ZITI_ROUTER_IDENTITY_CA"
ZitiRouterIdentityCAVarDescription = "Path to Identity CA for Ziti Router"
ZitiCtrlListenerAddressVarName = "ZITI_CTRL_LISTENER_ADDRESS"
ZitiCtrlListenerAddressVarDescription = "The Ziti Controller Listener Address"
ZitiCtrlAdvertisedAddressVarName = "ZITI_CTRL_ADVERTISED_ADDRESS"
ZitiCtrlAdvertisedAddressVarDescription = "The Ziti Controller Advertised Address"
ZitiEdgeCtrlListenerHostPortVarName = "ZITI_CTRL_EDGE_LISTENER_HOST_PORT"
ZitiEdgeCtrlListenerHostPortVarDescription = "Host and port of the Ziti Edge Controller Listener"
ZitiEdgeCtrlAdvertisedHostPortVarName = "ZITI_EDGE_CTRL_ADVERTISED_HOST_PORT"
ZitiEdgeCtrlAdvertisedHostPortVarDescription = "Host and port of the Ziti Edge Controller API"
ZitiEdgeCtrlAdvertisedPortVarName = "ZITI_EDGE_CONTROLLER_PORT"
ZitiEdgeCtrlAdvertisedPortVarDescription = "The advertised port of the edge controller"
ZitiEdgeIdentityEnrollmentDurationVarName = "ZITI_EDGE_IDENTITY_ENROLLMENT_DURATION"
ZitiEdgeIdentityEnrollmentDurationVarDescription = "The identity enrollment duration in minutes"
ZitiEdgeRouterEnrollmentDurationVarName = "ZITI_EDGE_ROUTER_ENROLLMENT_DURATION"
ZitiEdgeRouterEnrollmentDurationVarDescription = "The router enrollment duration in minutes"
ExternalDNSVarName = "EXTERNAL_DNS"
ZitiEdgeRouterIPOverrideVarName = "ZITI_EDGE_ROUTER_IP_OVERRIDE"
ZitiEdgeRouterIPOverrideVarDescription = "Override the default edge router IP with a custom IP, this IP will also be added to the PKI"
)
+1 -1
View File
@@ -40,7 +40,7 @@ func LogReleaseVersionCheck(ziti_component string) {
currentBuildVersion := version.GetVersion()
currentBuildSemver, err := semver.ParseTolerant(currentBuildVersion) // ParseTolerant trims leading "v"
if err != nil {
logger.Warnln("failed to parse current build version as semver: '%s' with error: %s", version.GetVersion(), err)
logger.Warnf("failed to parse current build version as semver: '%s' with error: %s", version.GetVersion(), err)
return
}
// ignore non-release builds and current release build