diff --git a/controller/config.go b/controller/config.go index 6b984e69..5ac9533e 100644 --- a/controller/config.go +++ b/controller/config.go @@ -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 } diff --git a/etc/ctrl.yml b/etc/ctrl.yml index ec1a4ec4..842776a6 100644 --- a/etc/ctrl.yml +++ b/etc/ctrl.yml @@ -4,6 +4,8 @@ # /___|_| \___/|_|\_\ # controller configuration +v: 1 + endpoint: host: 0.0.0.0 port: 18080