Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

back merge to python setup #499

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
32333ae
optionally exit when only reserving so we can host with the SDK and d…
qrkourier Dec 11, 2023
b376683
dependency updates
michaelquigley Dec 12, 2023
049151a
use the new 'RefreshService(name)' instead of 'RefreshServices()' (#487)
michaelquigley Dec 12, 2023
68e088d
changelog (#487)
michaelquigley Dec 12, 2023
e77e55e
updated caddy 'browse.html' template to latest v2.7.6
michaelquigley Dec 12, 2023
76009ef
Merge pull request #489 from openziti/sdk_update
michaelquigley Dec 13, 2023
47df117
updated golang-sdk to v0.21.2; adjust ziti.ListenOptions to include W…
michaelquigley Dec 13, 2023
40bbb4a
Merge pull request #491 from openziti/wait_for_terminator
michaelquigley Dec 13, 2023
b7f9b86
Merge pull request #486 from openziti/frontdoor-option-exit-after-res…
qrkourier Dec 14, 2023
417d627
use GitHub vars when releasing container images
qrkourier Dec 14, 2023
96e5e14
build Py wheel with alternate name in testing forks
qrkourier Dec 14, 2023
ece79f2
set and check zrok-access JWT audience matches share host
qrkourier Dec 15, 2023
7be46bf
normalize some existing log messages
qrkourier Dec 15, 2023
4a3c25b
bump the ziti version in the zrok container image
qrkourier Dec 15, 2023
d9d7bc6
Merge pull request #492 from openziti/v0.4.19-cookie
qrkourier Dec 15, 2023
523da9d
Merge pull request #494 from openziti/docker-repo-use-vars
qrkourier Dec 15, 2023
6c9e5bd
correctly spell OAuth
qrkourier Dec 17, 2023
1b3eacc
Merge pull request #497 from openziti/frontdoor-fix-vars
qrkourier Dec 17, 2023
264570e
added first iteration decorator for zrok and example flask server
camotts Dec 13, 2023
43d6d05
update requirements. Add context managing for share and access. Updat…
camotts Dec 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 120
1 change: 1 addition & 0 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
- name: Build distro
env:
ZROK_VERSION: ${{ github.event.release.tag_name }}
ZROK_PY_NAME: ${{ vars.ZROK_PY_NAME || null }}
run: |
python setup.py sdist

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/publish-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ jobs:

- name: Set Up Container Image Tags for zrok CLI Container
env:
RELEASE_REPO: openziti/zrok
ZROK_VERSION: ${{ steps.semver.outputs.zrok_semver }}
ZROK_CONTAINER_IMAGE_REPO: ${{ vars.ZROK_CONTAINER_IMAGE_REPO || 'openziti/zrok' }}
ZROK_CONTAINER_IMAGE_TAG: ${{ steps.semver.outputs.zrok_semver }}
id: tagprep_cli
run: |
echo DOCKER_TAGS="${RELEASE_REPO}:${ZROK_VERSION},${RELEASE_REPO}:latest" | tee -a $GITHUB_OUTPUT
echo DOCKER_TAGS="${ZROK_CONTAINER_IMAGE_REPO}:${ZROK_CONTAINER_IMAGE_TAG},${ZROK_CONTAINER_IMAGE_REPO}:latest" \
| tee -a $GITHUB_OUTPUT

# this is the CLI image with the Linux binary for each
# arch that was downloaded in ./dist/
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
# CHANGELOG

## v0.4.20

CHANGE: OpenZiti SDK updated to `v0.21.2`. All `ziti.ListenOptions` listener options configured to use `WaitForNEstablishedListeners: 1`. When a `zrok share` client or an `sdk.Share` client are connected to an OpenZiti router that supports "listener established" events, then listen calls will not return until the listener is fully established on the OpenZiti network. Previously a `zrok share` client could report that it is fully operational and listening before the listener is fully established on the OpenZiti network; in practice this produced a very small window of time when the share would not be ready to accept requests. This change eliminates this window of time (https://github.com/openziti/zrok/issues/490)

FIX: Require the JWT in a zrok OAuth cookie to have an audience claim that matches the public share hostname. This prevents a cookie from one share from being use to log in to another share.

## v0.4.19

FEATURE: Reserved shares now support unique names ("vanity tokens"). This allows for the creation of reserved shares with identifiable names rather than generated share tokens. Includes basic support for profanity checking (https://github.com/openziti/zrok/issues/401)

CHANGE: The `publicProxy` endpoint implementation used in the `zrok access public` frontend has been updated to use the new `RefreshService(serviceName)` call instead of `RefreshServices()`. This should greatly improve the performance of requests against missing or non-responsive zrok shares (https://github.com/openziti/zrok/issues/487)

CHANGE: The Python SDK has been updated to properly support the "reserved" flag on the `ShareRequest` passed to `CreateShare`

CHANGE: Dependency updates; `github.com/openziti/[email protected]`; `github.com/caddyserver/caddy/[email protected]`; indirect dependencies

## v0.4.18

FEATURE: Python SDK added. Can be found on [pypi](https://test.pypi.org/project/zrok-sdk). `pastebin` example illustrates basic SDK usage (see `sdk/python/examples/README.md` for details) (https://github.com/openziti/zrok/issues/401)
Expand Down
9 changes: 5 additions & 4 deletions cmd/zrok/testLoopPublic.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,17 @@ func (l *looper) serviceListener() {
logrus.Errorf("error opening ziti config '%v': %v", l.zif, err)
return
}
opts := ziti.ListenOptions{
ConnectTimeout: 5 * time.Minute,
MaxConnections: 10,
options := ziti.ListenOptions{
ConnectTimeout: 5 * time.Minute,
MaxConnections: 64,
WaitForNEstablishedListeners: 1,
}
zctx, err := ziti.NewContext(zcfg)
if err != nil {
logrus.Errorf("error loading ziti context: %v", err)
return
}
if l.listener, err = zctx.ListenWithOptions(l.shrToken, &opts); err == nil {
if l.listener, err = zctx.ListenWithOptions(l.shrToken, &options); err == nil {
if err := http.Serve(l.listener, l); err != nil {
logrus.Errorf("looper #%d, error serving: %v", l.id, err)
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/zrok/testWebsocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (cmd *testWebsocketCommand) run(_ *cobra.Command, args []string) {
addr = cmd.serviceName
} else {
if len(args) == 0 {
logrus.Error("Address required if not using ziti")
logrus.Error("address required if not using ziti")
flag.Usage()
os.Exit(1)
}
Expand All @@ -102,13 +102,13 @@ func (cmd *testWebsocketCommand) run(_ *cobra.Command, args []string) {
}
defer c.Close(websocket.StatusInternalError, "the sky is falling")

logrus.Info("Writing to server...")
logrus.Info("writing to server...")
err = wsjson.Write(ctx, c, "hi")
if err != nil {
logrus.Error(err)
return
}
logrus.Info("Reading response...")
logrus.Info("reading response...")
typ, dat, err := c.Read(ctx)
if err != nil {
logrus.Error(err)
Expand Down
2 changes: 1 addition & 1 deletion docker/compose/zrok-public-reserved/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ services:
ZROK_TARGET: # backend target, is a path in container filesystem unless proxy mode
ZROK_INSECURE: # "--insecure" if proxy target has unverifiable TLS server certificate
ZROK_OAUTH_PROVIDER: # google, github
ZROK_OATH_EMAILS: # allow space-separated list of OAuth email addresses or @domain.tld
ZROK_OAUTH_EMAILS: # allow space-separated list of OAuth email addresses or @domain.tld
ZROK_BASIC_AUTH: # username:password, mutually-exclusive with ZROK_OAUTH_PROVIDER

# least relevant options
Expand Down
2 changes: 1 addition & 1 deletion docker/compose/zrok-public-share/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ services:
ZROK_TARGET: http://zrok-test:9090 # backend target, is a path in container filesystem unless proxy mode
ZROK_INSECURE: # "--insecure" if proxy target has unverifiable TLS server certificate
ZROK_OAUTH_PROVIDER: # google, github
ZROK_OATH_EMAILS: # space-separated list of OAuth email addresses or @domain.tld to allow
ZROK_OAUTH_EMAILS: # space-separated list of OAuth email addresses or @domain.tld to allow
ZROK_BASIC_AUTH: # username:password, mutually-exclusive with ZROK_OAUTH_PROVIDER

# least relevant options
Expand Down
2 changes: 1 addition & 1 deletion docker/images/zrok/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# this builds docker.io/openziti/zrok
ARG ZITI_CLI_TAG="0.31.0"
ARG ZITI_CLI_TAG="0.31.2"
ARG ZITI_CLI_IMAGE="docker.io/openziti/ziti-cli"
# this builds docker.io/openziti/ziti-controller
FROM ${ZITI_CLI_IMAGE}:${ZITI_CLI_TAG}
Expand Down
5 changes: 3 additions & 2 deletions endpoints/drive/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ type Backend struct {

func NewBackend(cfg *BackendConfig) (*Backend, error) {
options := ziti.ListenOptions{
ConnectTimeout: 5 * time.Minute,
MaxConnections: 64,
ConnectTimeout: 5 * time.Minute,
MaxConnections: 64,
WaitForNEstablishedListeners: 1,
}
zcfg, err := ziti.NewConfigFromFile(cfg.IdentityPath)
if err != nil {
Expand Down
5 changes: 3 additions & 2 deletions endpoints/proxy/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ type Backend struct {

func NewBackend(cfg *BackendConfig) (*Backend, error) {
options := ziti.ListenOptions{
ConnectTimeout: 5 * time.Minute,
MaxConnections: 64,
ConnectTimeout: 5 * time.Minute,
MaxConnections: 64,
WaitForNEstablishedListeners: 1,
}
zcfg, err := ziti.NewConfigFromFile(cfg.IdentityPath)
if err != nil {
Expand Down
Loading