Send emails

This commit is contained in:
Philipp Heckel 2021-12-23 21:04:17 +01:00
parent c8c53eed07
commit 873c57b3d8
6 changed files with 46 additions and 14 deletions

View file

@ -7,7 +7,6 @@ import (
"github.com/urfave/cli/v2/altsrc"
"heckel.io/ntfy/util"
"os"
"strings"
)
var (
@ -60,7 +59,3 @@ func initConfigFileInputSource(configFlag string, flags []cli.Flag) cli.BeforeFu
return altsrc.ApplyInputSourceValues(context, inputSource, flags)
}
}
func collapseTopicURL(s string) string {
return strings.TrimPrefix(strings.TrimPrefix(s, "https://"), "http://")
}

View file

@ -95,6 +95,7 @@ func execServe(c *cli.Context) error {
conf.CacheDuration = cacheDuration
conf.KeepaliveInterval = keepaliveInterval
conf.ManagerInterval = managerInterval
//XXXXXXXXX
conf.GlobalTopicLimit = globalTopicLimit
conf.VisitorSubscriptionLimit = visitorSubscriptionLimit
conf.VisitorRequestLimitBurst = visitorRequestLimitBurst

View file

@ -180,7 +180,7 @@ func runCommandInternal(c *cli.Context, command string, m *client.Message) error
defer os.Remove(scriptFile)
verbose := c.Bool("verbose")
if verbose {
log.Printf("[%s] Executing: %s (for message: %s)", collapseTopicURL(m.TopicURL), command, m.Raw)
log.Printf("[%s] Executing: %s (for message: %s)", util.ShortTopicURL(m.TopicURL), command, m.Raw)
}
cmd := exec.Command("sh", "-c", scriptFile)
cmd.Stdin = c.App.Reader