Fix notifications and old instance cleanup (#748)

Co-authored-by: Simon Aronsson <simme@arcticbit.se>
This commit is contained in:
nils måsén 2021-01-10 11:12:54 +01:00 committed by GitHub
parent 06e705d538
commit 40ab6fd5ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 123 additions and 53 deletions

View file

@ -1,9 +1,11 @@
package notifications
import (
"fmt"
"os"
"time"
"github.com/containrrr/shoutrrr/pkg/format"
"github.com/spf13/cobra"
shoutrrrSmtp "github.com/containrrr/shoutrrr/pkg/services/smtp"
@ -75,10 +77,16 @@ func (e *emailTypeNotifier) GetURL() string {
UseHTML: false,
}
pkr := format.NewPropKeyResolver(conf)
var err error
if len(e.User) > 0 {
conf.Set("auth", "Plain")
err = pkr.Set("auth", "Plain")
} else {
conf.Set("auth", "None")
err = pkr.Set("auth", "None")
}
if err != nil {
fmt.Printf("Could not set auth type for email notifier: %v", err)
}
return conf.GetURL().String()