Skip to content

Commit

Permalink
Merge pull request #410 from openziti/v0.4.8
Browse files Browse the repository at this point in the history
Multiple Changes for v0.4.8
  • Loading branch information
michaelquigley authored Oct 17, 2023
2 parents 5f51214 + 44c6656 commit 2d6cd3a
Show file tree
Hide file tree
Showing 13 changed files with 109 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: setup-go
uses: actions/setup-go@v3
with:
go-version: 1.21.0
go-version: '>=1.21.3'

- name: setup-node
uses: actions/setup-node@v3
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '>=1.21.0'
go-version: '>=1.21.3'
cache: true

- uses: actions/setup-node@v3
Expand All @@ -43,7 +43,7 @@ jobs:
with:
distribution: goreleaser
version: latest
args: release --skip-publish --config .goreleaser-linux.yml
args: release --skip=publish --config .goreleaser-linux.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -66,12 +66,12 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '>=1.21.0'
go-version: '>=1.21.3'
cache: true

- uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x

- run: npm install
working-directory: ui
Expand All @@ -85,7 +85,7 @@ jobs:
with:
distribution: goreleaser
version: latest
args: release --skip-publish --config .goreleaser-linux-arm64.yml
args: release --skip=publish --config .goreleaser-linux-arm64.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -108,12 +108,12 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '>=1.21.0'
go-version: '>=1.21.3'
cache: true

- uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x

- run: npm install
working-directory: ui
Expand All @@ -127,7 +127,7 @@ jobs:
with:
distribution: goreleaser
version: latest
args: release --skip-publish --config .goreleaser-linux-armhf.yml
args: release --skip=publish --config .goreleaser-linux-armhf.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -157,12 +157,12 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '>=1.21.0'
go-version: '>=1.21.3'
cache: true

- uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x

- run: npm install
working-directory: ui
Expand All @@ -176,7 +176,7 @@ jobs:
with:
distribution: goreleaser
version: latest
args: release --skip-publish --config .goreleaser-darwin.yml
args: release --skip=publish --config .goreleaser-darwin.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AC_USERNAME: ${{ secrets.AC_USERNAME }}
Expand All @@ -201,12 +201,12 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '>=1.21.0'
go-version: '>=1.21.3'
cache: true

- uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x

- run: npm install
working-directory: ui
Expand All @@ -220,7 +220,7 @@ jobs:
with:
distribution: goreleaser
version: latest
args: release --skip-publish --config .goreleaser-windows.yml
args: release --skip=publish --config .goreleaser-windows.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
4 changes: 2 additions & 2 deletions .goreleaser-darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ builds:
goarch:
- amd64
hooks:
post: gon build/gon-amd64.hcl
post: gon -log-level=info build/gon-amd64.hcl

- id: zrok-arm64
main: ./cmd/zrok
Expand All @@ -23,4 +23,4 @@ builds:
goarch:
- arm64
hooks:
post: gon build/gon-arm64.hcl
post: gon -log-level=info build/gon-arm64.hcl
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# v0.4.8

FEATURE: The `sdk` package now includes a `sdk.Overview` function, which returns a complete description of the account attached to the enabled environment. Useful for inventorying the deployed shares and environments (https://github.com/openziti/zrok/issues/407)

CHANGE: The `zrok access public` frontend configuration format has changed and now requires that the configuration document include a `v: 2` declaration. This frontend configuration format is now versioned and when the code updates the configuration structure, you will receive an error message at startup, provoking you to look into updating your configuration (https://github.com/openziti/zrok/issues/406)

CHANGE: The title color of the header was changed from white to flourescent green, to better match the overall branding

CHANGE: Tweaks to build and release process for logging and deprecations. Pin golang version at 1.21.3+ and node version at 18.x across all platforms

CHANGE: Improvements to email invitation sent in response to `zrok invite` to correct broken links, some minor HTML issues and improve overall deliverability (https://github.com/openziti/zrok/issues/405)

CHANGE: Added warning message after `zrok invite` submit directing the user to check their "spam" folder if they do not receive the invite message.

# v0.4.7

FEATURE: OAuth authentication with the ability to restrict authenticated users to specified domains for `zrok share public`. Supports both Google and GitHub authentication in this version. More authentication providers, and extensibility to come in future `zrok` releases. See the OAuth configuration guide at `docs/guides/self-hosting/oauth/configuring-oauth.md` for details (https://github.com/openziti/zrok/issues/45, https://github.com/openziti/zrok/issues/404)
Expand Down
3 changes: 2 additions & 1 deletion cmd/zrok/invite.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ func (cmd *inviteCommand) run(_ *cobra.Command, _ []string) {
tui.Error("error creating invitation", err)
}

fmt.Printf("invitation sent to '%v'!\n", email)
fmt.Printf("invitation sent to '%v'!\n\n", email)
fmt.Printf(fmt.Sprintf("%v\n\n", tui.Attention.Render("*** be sure to check your SPAM folder if you do not receive the invitation email!")))
}
}

Expand Down
28 changes: 4 additions & 24 deletions cmd/zrok/overview.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ package main
import (
"fmt"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/sdk"
"github.com/openziti/zrok/tui"
"github.com/spf13/cobra"
"io"
"net/http"
)

func init() {
Expand Down Expand Up @@ -41,32 +40,13 @@ func (cmd *overviewCommand) run(_ *cobra.Command, _ []string) {
tui.Error("unable to load environment; did you 'zrok enable'?", nil)
}

client := &http.Client{}
apiEndpoint, _ := root.ApiEndpoint()
req, err := http.NewRequest("GET", fmt.Sprintf("%v/api/v1/overview", apiEndpoint), nil)
json, err := sdk.Overview(root)
if err != nil {
if !panicInstead {
tui.Error("error accessing overview", err)
}
panic(err)
}
req.Header.Add("X-TOKEN", root.Environment().Token)
resp, err := client.Do(req)
if err != nil {
if !panicInstead {
tui.Error("error requesting overview", err)
}
panic(err)
}

json, err := io.ReadAll(resp.Body)
if err != nil {
if !panicInstead {
tui.Error("error reading body", err)
tui.Error("error loading zrokdir", err)
}
panic(err)
}
_ = resp.Body.Close()

fmt.Println(string(json))
fmt.Println(json)
}
24 changes: 7 additions & 17 deletions controller/emailUi/verify.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,38 @@
<title>Welcome to zrok!</title>
<meta name="description" content="Please click to create your zrok account.">
<meta name="viewport" content="width=device-width">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono&display=swap" rel="stylesheet">
<style>
body {
margin: 0;
padding: 25;
padding: 25px;
font-family: 'JetBrains Mono', 'Courier New', monospace;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #ffffff;
background-color: #3b2693;

}

a:link {
color: #00d7e4;
color: white;
}

a:visited {
color: #00d7e4;
color: white;
}

a:hover,
a:active {
color: #ff0100;
}

.claim {
font-size: 2em;
margin: 0.5em 0 1em 0;
}

.container {
width: 62em;
margin: 2em auto;
max-width: 100%;
text-align: center;
}



.btn {
display: inline-block;
margin: .25em;
Expand Down Expand Up @@ -132,23 +122,23 @@

<div class="container">
<div class="banner" style="margin: auto;">
<img src="https://zrok.io/wp-content/uploads/2023/01/welcome.jpg" width="363px" height="500px" style="padding-bottom: 10px;"/>
<img src="https://zrok.io/wp-content/uploads/2023/01/welcome.jpg" width="363px" height="500px" style="padding-bottom: 10px;" alt="welcome to zrok"/>
</div>
<div class="cta" style="text-align: center;">
<p style="text-align: center;">Please click the button below to create your zrok account for {{ .EmailAddress }}.</p>
<p style="text-align: center; color: white;">Please click the button below to create your zrok account for {{ .EmailAddress }}.</p>
<a class="btn btn-primary" href="{{ .VerifyUrl }}" style="color: #ffffff;">Create Account</a>
<a class="btn btn-secondary" href="https://docs.zrok.io/" style="color: #ffffff">Documentation</a>
</div>

<table border="0" cellpadding="0" cellspacing="0" align="center" class="about">
<tr>
<td><a href="https://github.com/openziti/zrok" target="_blank">github.com/openziti/zrok</a></td>
<td><a href="https://github.com/openziti/zrok" target="_blank" style="color: white;">github.com/openziti/zrok</a></td>
</tr>
<tr>
<td>{{ .Version }}</td>
</tr>
</table>
<p style="text-align: center;"></a>Copyright © 2023 <a href="http://www.netfoundry.io" target="_blank" style="color: #00d7e4;">NetFoundry, Inc.</a></p>
<p style="text-align: center;">Copyright © 2023 <a href="http://www.netfoundry.io" target="_blank" style="color: white;">NetFoundry, Inc.</a></p>
</div>
</body>

Expand Down
1 change: 1 addition & 0 deletions controller/verifyEmail.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func sendVerificationEmail(emailAddress, token string) error {
msg.SetImportance(mail.ImportanceHigh)
msg.SetBodyString(mail.TypeTextPlain, plainBody)
msg.SetBodyString(mail.TypeTextHTML, htmlBody)
msg.SetHeader("List-Unsubscribe", "<mailto: invite@zrok.io?subject=unsubscribe>")

client, err := mail.NewClient(cfg.Email.Host,
mail.WithPort(cfg.Email.Port),
Expand Down
6 changes: 6 additions & 0 deletions endpoints/publicProxy/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import (
"strings"
)

const V = 2

type Config struct {
V int
Identity string
Address string
HostMatch string
Expand Down Expand Up @@ -51,6 +54,9 @@ func (c *Config) Load(path string) error {
if err := cf.BindYaml(c, path, cf.DefaultOptions()); err != nil {
return errors.Wrapf(err, "error loading frontend config '%v'", path)
}
if c.V != V {
return errors.Errorf("invalid configuration version '%d'; expected '%d'", c.V, V)
}
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion etc/ctrl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# The `v` field determines the configuration version. When software is released that changes the structure of the
# configuration, the software will expect this field to be incremented. This protects you against invalid configuration
# versions.
# versions and will refer to you to the documentation when the configuration structure changes.
#
v: 3

Expand Down
21 changes: 21 additions & 0 deletions etc/frontend.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# The `v` field determines the configuration version. When software is released that changes the structure of the
# configuration, the software will expect this field to be incremented. This protects you against invalid configuration
# versions and will refer to you to the documentation when the configuration structure changes.
#
v: 2

# Setting the `host_match` setting will cause a `zrok access public` to ignore `Host` headers that do not contain the
# configured string. This will allow you to let a load balancer access the frontend by IP address for health check
# purposes, and will allow `Host` headers that match the configured DNS name to be routed through `zrok`.
Expand All @@ -7,10 +13,25 @@
# The OAuth configuration is used when enabling OAuth authentication with your public frontend.
#
#oauth:
# # `redirect_host` and `redirect_port` should correspond with the DNS hostname and URL representing
# # the OAuth frontend you'll use with your installation.
# #
# redirect_host: oauth.zrok.io
# redirect_port: 28080
#
# # `redirect_http_only` will generate an HTTP URI for your OAuth frontend, rather than HTTPS. This
# # should only be set to `true` in development environments.
# #
# redirect_http_only: false
#
# # `hash_key` is a unique key for your installation that is used to secure authentication payloads
# # with OAuth providers.
# #
# hash_key: "<yourRandomHashKey>"
#
# # `providers` contains an array of provider details enabled in your installation. Currently only
# # `google` and `github` are supported. Your configuration can include `google`, `github`, or both.
# #
# providers:
# - name: google
# client_id: <client-id>
Expand Down
Loading

0 comments on commit 2d6cd3a

Please sign in to comment.