-
-
Notifications
You must be signed in to change notification settings - Fork 722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow configurable web push expiry duration #1212
base: main
Are you sure you want to change the base?
feat: allow configurable web push expiry duration #1212
Conversation
cmd/serve.go
Outdated
@@ -100,6 +100,8 @@ var flagsServe = append( | |||
altsrc.NewStringFlag(&cli.StringFlag{Name: "web-push-file", Aliases: []string{"web_push_file"}, EnvVars: []string{"NTFY_WEB_PUSH_FILE"}, Usage: "file used to store web push subscriptions"}), | |||
altsrc.NewStringFlag(&cli.StringFlag{Name: "web-push-email-address", Aliases: []string{"web_push_email_address"}, EnvVars: []string{"NTFY_WEB_PUSH_EMAIL_ADDRESS"}, Usage: "e-mail address of sender, required to use browser push services"}), | |||
altsrc.NewStringFlag(&cli.StringFlag{Name: "web-push-startup-queries", Aliases: []string{"web_push_startup_queries"}, EnvVars: []string{"NTFY_WEB_PUSH_STARTUP_QUERIES"}, Usage: "queries run when the web push database is initialized"}), | |||
altsrc.NewStringFlag(&cli.StringFlag{Name: "web-push-expiry-duration", Aliases: []string{"web_push_expiry_duration"}, EnvVars: []string{"NTFY_WEB_PUSH_EXPIRY_DURATION"}, Value: util.FormatDuration(server.DefaultWebPushExpiryDuration), Usage: "send web push warning notification after this time before expiring unused subscriptions"}), | |||
altsrc.NewStringFlag(&cli.StringFlag{Name: "web-push-expiry-warning-duration", Aliases: []string{"web_push_expiry_warning_duration"}, EnvVars: []string{"NTFY_WEB_PUSH_EXPIRY_WARNING_DURATION"}, Value: util.FormatDuration(server.DefaultWebPushExpiryWarningDuration), Usage: "automatically expire unused subscriptions after this time"}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this "usage" description and the next one got switched
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
docs/config.md
Outdated
@@ -876,7 +876,9 @@ a database to keep track of the browser's subscriptions, and an admin email addr | |||
- `web-push-private-key` is the generated VAPID private key, e.g. AA2BB1234567890abcdefzxcvbnm1234567890 | |||
- `web-push-file` is a database file to keep track of browser subscription endpoints, e.g. `/var/cache/ntfy/webpush.db` | |||
- `web-push-email-address` is the admin email address send to the push provider, e.g. `[email protected]` | |||
- `web-push-startup-queries` is an optional list of queries to run on startup` | |||
- `web-push-startup-queries` is an optional list of queries to run on startup` | |||
- `web-push-expiry-warning-duration` defines the duration for which unused subscriptions are sent a warning (default is `7d`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "defines the duration after which ..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
docs/config.md
Outdated
- `web-push-startup-queries` is an optional list of queries to run on startup` | ||
- `web-push-startup-queries` is an optional list of queries to run on startup` | ||
- `web-push-expiry-warning-duration` defines the duration for which unused subscriptions are sent a warning (default is `7d`) | ||
- `web-push-expiry-duration` defines the duration for which unused subscriptions will expire (default is `9d`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Allow the config settings
DefaultWebPushExpiryWarningDuration
andDefaultWebPushExpiryDuration
to be configurable.Closes #1211