config test
This commit is contained in:
parent
a5b2d51cfb
commit
f2509f0ca6
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
config.json
|
||||||
|
backup
|
@ -15,9 +15,9 @@ import (
|
|||||||
type Config struct {
|
type Config struct {
|
||||||
Zfsnap map[string]string `json:"zfsnap"`
|
Zfsnap map[string]string `json:"zfsnap"`
|
||||||
Box map[string]*Box `json:"box"`
|
Box map[string]*Box `json:"box"`
|
||||||
|
Email EmailConfig `json:"email"`
|
||||||
Apps []AppConfig `json:"apps"`
|
Apps []AppConfig `json:"apps"`
|
||||||
Timezone string `json:"timezone"`
|
Timezone string `json:"timezone"`
|
||||||
Email EmailConfig `json:"email"`
|
|
||||||
Now time.Time `json:"-"`
|
Now time.Time `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,6 +50,13 @@ func (c *Config) Load() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(cfg.Email.smtpHost) == 0 || len(cfg.Email.fromEmail) == 0 || len(cfg.Email.toEmail) == 0 {
|
||||||
|
if *debugFlag {
|
||||||
|
log.Printf("Config.Load : no email")
|
||||||
|
}
|
||||||
|
return fmt.Errorf("no email")
|
||||||
|
}
|
||||||
|
|
||||||
c.Now = time.Now().In(l)
|
c.Now = time.Now().In(l)
|
||||||
|
|
||||||
for k, v := range c.Box {
|
for k, v := range c.Box {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Code generated by version.sh (@generated) DO NOT EDIT.
|
// Code generated by version.sh (@generated) DO NOT EDIT.
|
||||||
package main
|
package main
|
||||||
var githash = "f3abe27"
|
var githash = "a5b2d51"
|
||||||
var buildstamp = "2022-06-19_04:20:21"
|
var buildstamp = "2022-06-19_04:26:58"
|
||||||
var commits = "46"
|
var commits = "47"
|
||||||
var version = "f3abe27-b46 - 2022-06-19_04:20:21"
|
var version = "a5b2d51-b47 - 2022-06-19_04:26:58"
|
||||||
|
Loading…
Reference in New Issue
Block a user