"ntfy tier" CLI command
This commit is contained in:
parent
e3b39f670f
commit
a32e8abc12
8 changed files with 140 additions and 40 deletions
|
@ -24,7 +24,9 @@ func logv(v *visitor) *log.Event {
|
|||
|
||||
// logr creates a new log event with HTTP request and visitor fields
|
||||
func logvr(v *visitor, r *http.Request) *log.Event {
|
||||
return logv(v).Fields(httpContext(r))
|
||||
return logv(v).
|
||||
Fields(httpContext(r)).
|
||||
Fields(requestLimiterFields(v.RequestLimiter()))
|
||||
}
|
||||
|
||||
// logvrm creates a new log event with HTTP request, visitor fields and message fields
|
||||
|
|
|
@ -37,7 +37,7 @@ import (
|
|||
- HIGH Rate limiting: Sensitive endpoints (account/login/change-password/...)
|
||||
- HIGH Account limit creation triggers when account is taken!
|
||||
- HIGH Docs
|
||||
- HIGH CLI "ntfy tier [add|list|delete]"
|
||||
- HIGH make request limit independent of message limit again
|
||||
- HIGH Self-review
|
||||
- MEDIUM: Test for expiring messages after reservation removal
|
||||
- MEDIUM: Test new token endpoints & never-expiring token
|
||||
|
@ -235,8 +235,8 @@ func (s *Server) Run() error {
|
|||
}
|
||||
log.Info("Listening on%s, ntfy %s, log level is %s", listenStr, s.config.Version, log.CurrentLevel().String())
|
||||
if log.IsFile() {
|
||||
fmt.Fprintf(os.Stderr, "Listening on%s, ntfy %s, log file is %s\n", listenStr, s.config.Version, log.File())
|
||||
fmt.Fprintln(os.Stderr, "No more output is expected.")
|
||||
fmt.Fprintf(os.Stderr, "Listening on%s, ntfy %s\n", listenStr, s.config.Version)
|
||||
fmt.Fprintf(os.Stderr, "Logs are written to %s\n", log.File())
|
||||
}
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/", s.handle)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue