1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-05-31 10:39:23 +02:00

ntfy pub: use default-user and default-password from client.yml

fixes 
This commit is contained in:
Hunter Kehoe 2022-10-09 08:34:23 -06:00
parent dfec18be3d
commit 85eb9160d8
2 changed files with 7 additions and 1 deletions

View file

@ -160,6 +160,8 @@ func execPublish(c *cli.Context) error {
fmt.Fprintf(c.App.ErrWriter, "\r%s\r", strings.Repeat(" ", 20))
}
options = append(options, client.WithBasicAuth(user, pass))
} else if conf.DefaultUser != "" && conf.DefaultPassword != nil {
options = append(options, client.WithBasicAuth(conf.DefaultUser, *conf.DefaultPassword))
}
if pid > 0 {
newMessage, err := waitForProcess(pid)