This commit is contained in:
shoopea 2024-11-17 17:00:52 +01:00
parent 9a9db972a7
commit cd94f48b8a
3 changed files with 14 additions and 15 deletions

View File

@ -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("")

View File

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

View File

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