diff --git a/config.go b/config.go index 81a7bf3..95fce88 100644 --- a/config.go +++ b/config.go @@ -17,15 +17,15 @@ import ( ) type Config struct { - ScheduleDuration map[string]string `json:"schedule"` - Box map[string]BoxConfig `json:"box"` - Email EmailConfig `json:"email"` - Apps []AppConfig `json:"apps"` - Timezone string `json:"timezone"` - Admin *AdminConfig `json:"admin"` - box map[string]*Box `json:"-"` - apps map[string]*App `json:"-"` - timezone *time.Location `json:"-"` + ScheduleDuration map[string]string `json:"schedule"` + Box map[string]*BoxConfig `json:"box"` + Email *EmailConfig `json:"email,omitempty"` + Apps []*AppConfig `json:"apps"` + Timezone string `json:"timezone"` + Admin *AdminConfig `json:"admin"` + box map[string]*Box `json:"-"` + apps map[string]*App `json:"-"` + timezone *time.Location `json:"-"` } var ( @@ -95,7 +95,7 @@ func LoadConfigByte(conf []byte) (*Config, error) { return nil, err } - if c.Email.Active { + if c.Email != nil { if len(c.Email.SmtpHost) == 0 { err := fmt.Errorf("no smtp") log.WithFields(log.Fields{"error": err}).Errorf("") diff --git a/email.go b/email.go index 12e6671..44f1c2d 100644 --- a/email.go +++ b/email.go @@ -17,7 +17,6 @@ type Email struct { } type EmailConfig struct { - Active bool `json:"active"` SmtpHost string `json:"smtp"` FromEmail string `json:"email_from"` ToEmail []string `json:"email_to"` diff --git a/version.go b/version.go index e179375..fc09a9e 100644 --- a/version.go +++ b/version.go @@ -1,7 +1,7 @@ // Code generated by version.sh (@generated) DO NOT EDIT. package main -var githash = "86da866" +var githash = "9a9db97" var branch = "master" -var buildstamp = "2024-11-17_15:49:40" -var commits = "93" -var version = "86da866-b93 - 2024-11-17_15:49:40" +var buildstamp = "2024-11-17_16:00:43" +var commits = "94" +var version = "9a9db97-b94 - 2024-11-17_16:00:43"