Skip to content

Commit

Permalink
Merge pull request #1404 from openziti/tunneler-proxy-support
Browse files Browse the repository at this point in the history
Add proxy support to host.v1/host.v2. Fixes #1397
  • Loading branch information
plorenz authored Oct 12, 2023
2 parents 5695bdb + f600b75 commit 8d58228
Show file tree
Hide file tree
Showing 15 changed files with 390 additions and 242 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,35 @@

## What's New

* Initial proxy support in host.v1/host.v2

## Proxy Support in host.v1/host.v2

`host.v1` and `host.v2` configurations may now specify a proxy to use.
Currently only HTTP Connect proxies which don't require authentication are supported.

**Example using `host.v1`**

{
"address": "192.168.2.50",
"port": 1234,
"protocol": "tcp",
"proxy": {
"address": "192.168.1.110:3128",
"type": "http"
}
}


## Component Updates and Bug Fixes
* github.com/openziti/storage: [v0.2.18 -> v0.2.19](https://github.com/openziti/storage/compare/v0.2.18...v0.2.19)
* [Issue #52](https://github.com/openziti/storage/issues/52) - Grammar should expect single valid query followed by EOF

* github.com/openziti/ziti: [v0.30.4 -> v0.30.5](https://github.com/openziti/ziti/compare/v0.30.4...v0.30.5)
* [Issue #1336](https://github.com/openziti/ziti/issues/1336) - `ziti edge quickstart` did
not create the usual edge router/service edge router policy.
* [Issue #1397](https://github.com/openziti/ziti/issues/1397) - HTTP Proxy suport for host.v1/host.v2 config types
* [Issue #1406](https://github.com/openziti/ziti/issues/1406) - Entity change event dispatcher isn't shutting down properly when controller shuts down
* [Issue #1382](https://github.com/openziti/ziti/issues/1382) - service failure costs are not shrinking over time

# Release 0.30.4
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
[![Build Status](https://github.com/openziti/ziti/actions/workflows/main.yml/badge.svg)](https://github.com/openziti/ziti/actions/workflows/main.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/openziti/ziti)](https://goreportcard.com/report/github.com/openziti/ziti)
![OpenZiti Logo](https://raw.githubusercontent.com/openziti/ziti-doc/main/docusaurus/static/img/ziti-logo-dark.svg)

<br>

[![Build Status](https://github.com/openziti/ziti/actions/workflows/main.yml/badge.svg?query=branch%3Arelease-next)](https://github.com/openziti/ziti/actions/workflows/main.yml?query=branch%3Arelease-next)
[![Go Report Card](https://goreportcard.com/badge/github.com/openziti/ziti)](https://goreportcard.com/report/github.com/openziti/ziti)
[![GoDoc](https://godoc.org/github.com/openziti/ziti?status.svg)](https://pkg.go.dev/github.com/openziti/ziti)
[![Discourse Widget](https://img.shields.io/badge/join-us%20on%20discourse-gray.svg?longCache=true&logo=discourse&colorB=brightgreen")](https://openziti.discourse.group/)
[![License: Apache-v2](https://img.shields.io/badge/License-Apache--2.0-yellow.svg)](LICENSE)

<br>

# OpenZiti

OpenZiti represents the next generation of secure, open-source networking for your applications. OpenZiti has several components.
Expand Down
28 changes: 27 additions & 1 deletion controller/persistence/migration_initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package persistence

import (
"fmt"
"github.com/openziti/ziti/controller/db"
"github.com/openziti/storage/boltz"
"github.com/openziti/ziti/controller/db"
"math"
"time"
)
Expand Down Expand Up @@ -270,6 +270,28 @@ var tunnelDefinitions = map[string]interface{}{
"minimum": float64(0),
"maximum": float64(math.MaxInt32),
},
"proxyType": map[string]interface{}{
"type": "string",
"enum": []interface{}{"http"},
"description": "supported proxy types",
},
"proxyConfiguration": map[string]interface{}{
"type": "object",
"required": []interface{}{
"type",
"address",
},
"properties": map[string]interface{}{
"type": map[string]interface{}{
"$ref": "#/definitions/proxyType",
"description": "The type of the proxy being used",
},
"address": map[string]interface{}{
"type": "string",
"description": "The address of the proxy in host:port format",
},
},
},
}

// hostV1 schema with ["$id"] and ["definitions"] excluded
Expand Down Expand Up @@ -371,6 +393,10 @@ var hostV1SchemaSansDefs = map[string]interface{}{
},
},
},
"proxy": map[string]interface{}{
"$ref": "#/definitions/proxyConfiguration",
"description": "If defined, outgoing connections will be send through this proxy server",
},
},
),
"additionalProperties": false,
Expand Down
9 changes: 7 additions & 2 deletions controller/persistence/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ package persistence

import (
"github.com/michaelquigley/pfxlog"
"github.com/openziti/ziti/controller/db"
"github.com/openziti/storage/boltz"
"github.com/openziti/ziti/controller/db"
"github.com/pkg/errors"
)

const (
CurrentDbVersion = 34
CurrentDbVersion = 35
FieldVersion = "version"
)

Expand Down Expand Up @@ -156,6 +156,11 @@ func (m *Migrations) migrate(step *boltz.MigrationStep) int {
step.SetError(m.stores.ConfigType.Update(step.Ctx, hostV2ConfigType, nil))
}

if step.CurrentVersion < 35 {
step.SetError(m.stores.ConfigType.Update(step.Ctx, hostV1ConfigType, nil))
step.SetError(m.stores.ConfigType.Update(step.Ctx, hostV2ConfigType, nil))
}

// current version
if step.CurrentVersion <= CurrentDbVersion {
return CurrentDbVersion
Expand Down
62 changes: 33 additions & 29 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/go-openapi/strfmt v0.21.7
github.com/go-openapi/swag v0.22.4
github.com/go-openapi/validate v0.22.1
github.com/go-resty/resty/v2 v2.8.0
github.com/go-resty/resty/v2 v2.9.1
github.com/golang-jwt/jwt/v5 v5.0.0
github.com/google/go-cmp v0.5.9
github.com/google/gopacket v1.1.19
Expand All @@ -33,10 +33,10 @@ require (
github.com/gorilla/mux v1.8.0
github.com/gorilla/websocket v1.5.0
github.com/hashicorp/go-hclog v1.5.0
github.com/hashicorp/golang-lru/v2 v2.0.6
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/hashicorp/raft v1.5.0
github.com/hashicorp/raft-boltdb v0.0.0-20220329195025-15018e9b97e0
github.com/jedib0t/go-pretty/v6 v6.4.7
github.com/jedib0t/go-pretty/v6 v6.4.8
github.com/jessevdk/go-flags v1.5.0
github.com/jinzhu/copier v0.4.0
github.com/kataras/go-events v0.0.3
Expand All @@ -47,17 +47,17 @@ require (
github.com/mitchellh/mapstructure v1.5.0
github.com/natefinch/lumberjack v2.0.0+incompatible
github.com/openziti/agent v1.0.15
github.com/openziti/channel/v2 v2.0.99
github.com/openziti/edge-api v0.25.37
github.com/openziti/foundation/v2 v2.0.32
github.com/openziti/identity v1.0.63
github.com/openziti/channel/v2 v2.0.101
github.com/openziti/edge-api v0.25.38
github.com/openziti/foundation/v2 v2.0.33
github.com/openziti/identity v1.0.64
github.com/openziti/jwks v1.0.3
github.com/openziti/metrics v1.2.35
github.com/openziti/runzmd v1.0.32
github.com/openziti/sdk-golang v0.20.116
github.com/openziti/metrics v1.2.36
github.com/openziti/runzmd v1.0.33
github.com/openziti/sdk-golang v0.20.122
github.com/openziti/secretstream v0.1.12
github.com/openziti/storage v0.2.19
github.com/openziti/transport/v2 v2.0.107
github.com/openziti/storage v0.2.20
github.com/openziti/transport/v2 v2.0.109
github.com/openziti/x509-claims v1.0.3
github.com/openziti/xweb/v2 v2.1.0
github.com/openziti/ziti-db-explorer v1.1.3
Expand All @@ -71,16 +71,16 @@ require (
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.16.0
github.com/spf13/viper v1.17.0
github.com/stretchr/testify v1.8.4
github.com/teris-io/shortid v0.0.0-20201117134242-e59966efd125
github.com/xeipuuv/gojsonschema v1.2.0
github.com/zitadel/oidc/v2 v2.7.0
go.etcd.io/bbolt v1.3.7
golang.org/x/crypto v0.13.0
golang.org/x/net v0.15.0
golang.org/x/sync v0.3.0
golang.org/x/sys v0.12.0
golang.org/x/crypto v0.14.0
golang.org/x/net v0.17.0
golang.org/x/sync v0.4.0
golang.org/x/sys v0.13.0
golang.org/x/text v0.13.0
google.golang.org/protobuf v1.31.0
gopkg.in/AlecAivazis/survey.v1 v1.8.7
Expand All @@ -103,7 +103,7 @@ require (
github.com/boltdb/bolt v1.3.1 // indirect
github.com/c-bata/go-prompt v0.2.6 // indirect
github.com/creack/pty v1.1.11 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/disintegration/imaging v1.6.2 // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
Expand Down Expand Up @@ -149,19 +149,21 @@ require (
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/openziti/dilithium v0.3.3 // indirect
github.com/parallaxsecond/parsec-client-go v0.0.0-20221025095442-f0a77d263cf9 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pkg/term v1.2.0-beta.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rodaine/table v1.0.1 // indirect
github.com/rs/cors v1.9.0 // indirect
github.com/sagikazarmark/locafero v0.3.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/speps/go-hashids v2.0.0+incompatible // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
Expand All @@ -174,12 +176,14 @@ require (
go.opentelemetry.io/otel v1.19.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect
go.opentelemetry.io/otel/trace v1.19.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/image v0.12.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/term v0.12.0 // indirect
golang.org/x/tools v0.13.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/image v0.13.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/tools v0.14.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
Expand Down
Loading

0 comments on commit 8d58228

Please sign in to comment.