diff options
Diffstat (limited to 'internal/config')
-rw-r--r-- | internal/config/config.go | 5 | ||||
-rw-r--r-- | internal/config/default.go | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index b0263b170..3705c364f 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -59,9 +59,9 @@ type Config struct { /* Not parsed from .yaml configuration file. - For short running commands (admin CLI tools etc). */ AccountCLIFlags map[string]string + SoftwareVersion string } // FromFile returns a new config from a file, or an error if something goes amiss. @@ -252,6 +252,8 @@ func (c *Config) ParseCLIFlags(f KeyedFlags) error { c.LetsEncryptConfig.EmailAddress = f.String(fn.LetsEncryptEmailAddress) } + c.SoftwareVersion = GetDefaults().SoftwareVersion + // command-specific flags // admin account CLI flags @@ -323,6 +325,7 @@ type Defaults struct { ConfigPath string Host string Protocol string + SoftwareVersion string DbType string DbAddress string diff --git a/internal/config/default.go b/internal/config/default.go index 89360bb26..2cc46c996 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -1,5 +1,7 @@ package config +const softwareVersion = "0.1.0-SNAPSHOT" + // TestDefault returns a default config for testing func TestDefault() *Config { defaults := GetTestDefaults() @@ -8,6 +10,7 @@ func TestDefault() *Config { ApplicationName: defaults.ApplicationName, Host: defaults.Host, Protocol: defaults.Protocol, + SoftwareVersion: defaults.SoftwareVersion, DBConfig: &DBConfig{ Type: defaults.DbType, Address: defaults.DbAddress, @@ -62,6 +65,7 @@ func Default() *Config { ApplicationName: defaults.ApplicationName, Host: defaults.Host, Protocol: defaults.Protocol, + SoftwareVersion: defaults.SoftwareVersion, DBConfig: &DBConfig{ Type: defaults.DbType, Address: defaults.DbAddress, @@ -117,6 +121,7 @@ func GetDefaults() Defaults { ConfigPath: "", Host: "", Protocol: "https", + SoftwareVersion: softwareVersion, DbType: "postgres", DbAddress: "localhost", @@ -163,6 +168,7 @@ func GetTestDefaults() Defaults { ConfigPath: "", Host: "localhost:8080", Protocol: "http", + SoftwareVersion: softwareVersion, DbType: "postgres", DbAddress: "localhost", |