simplify
This commit is contained in:
parent
9a9db972a7
commit
cd94f48b8a
@ -18,9 +18,9 @@ import (
|
||||
|
||||
type Config struct {
|
||||
ScheduleDuration map[string]string `json:"schedule"`
|
||||
Box map[string]BoxConfig `json:"box"`
|
||||
Email EmailConfig `json:"email"`
|
||||
Apps []AppConfig `json:"apps"`
|
||||
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:"-"`
|
||||
@ -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("")
|
||||
|
1
email.go
1
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"`
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user