public frontend configuration structure now versioned; starts with 'v: 2' (#406)

This commit is contained in:
Michael Quigley 2023-10-16 21:18:28 -04:00
parent 8dbebed34a
commit 2f8b711fb9
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
4 changed files with 15 additions and 1 deletions

View File

@ -2,6 +2,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

View File

@ -10,7 +10,10 @@ import (
"strings"
)
const V = 2
type Config struct {
V int
Identity string
Address string
HostMatch string
@ -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
}

View File

@ -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

View File

@ -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`.