mirror of
https://github.com/openziti/zrok.git
synced 2024-11-25 01:23:49 +01:00
configuration versioning (#118)
This commit is contained in:
parent
758011d0c0
commit
b4f85e711f
@ -6,7 +6,10 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
const ConfigVersion = 1
|
||||
|
||||
type Config struct {
|
||||
V int
|
||||
Endpoint *EndpointConfig
|
||||
Proxy *ProxyConfig
|
||||
Email *EmailConfig
|
||||
@ -61,5 +64,8 @@ func LoadConfig(path string) (*Config, error) {
|
||||
if err := cf.BindYaml(cfg, path, cf.DefaultOptions()); err != nil {
|
||||
return nil, errors.Wrapf(err, "error loading controller config '%v'", path)
|
||||
}
|
||||
if cfg.V != ConfigVersion {
|
||||
return nil, errors.Errorf("expecting configuration version '%v', your configuration is version '%v'; please see zrok.io for changelog and configuration documentation", ConfigVersion, cfg.V)
|
||||
}
|
||||
return cfg, nil
|
||||
}
|
||||
|
@ -4,6 +4,8 @@
|
||||
# /___|_| \___/|_|\_\
|
||||
# controller configuration
|
||||
|
||||
v: 1
|
||||
|
||||
endpoint:
|
||||
host: 0.0.0.0
|
||||
port: 18080
|
||||
|
Loading…
Reference in New Issue
Block a user