[PR #633] [MERGED] WIP: Subscriber rate limiting #1358

Closed
opened 2026-05-07 01:01:45 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/binwiederhier/ntfy/pull/633
Author: @binwiederhier
Created: 2/23/2023
Status: Merged
Merged: 2/26/2023
Merged by: @binwiederhier

Base: mainHead: vrate


📝 Commits (10+)

  • d686e1e Use visitor instead of UserID in topicSubscription
  • 28b654a Keep track of lastVisitor to a topic
  • fb2fa4c Fix m.Expires and prune stale topics based on lastVisitorExpires
  • 6bfe4a9 Bill to visitor and set TTL in response
  • 7c5b9c0 only log expiry if applicable
  • c6b64df remove ttl
  • b9badee remove TTL, will make a seperate PR
  • 36685e9 Suggested changes
  • 1655f58 rate limiting impl 2.0?
  • bc3d897 Use mutexes in topic

📊 Changes

13 files changed (+578 additions, -106 deletions)

View changed files

📝 docs/releases.md (+13 -1)
📝 server/errors.go (+1 -1)
📝 server/log.go (+4 -0)
📝 server/server.go (+110 -46)
📝 server/server_manager.go (+18 -3)
📝 server/server_matrix.go (+11 -24)
📝 server/server_matrix_test.go (+4 -8)
📝 server/server_middleware.go (+33 -1)
📝 server/server_test.go (+293 -17)
📝 server/topic.go (+35 -4)
📝 server/util.go (+29 -0)
📝 server/visitor.go (+1 -0)
📝 user/manager.go (+26 -1)

📄 Description

No description provided


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/binwiederhier/ntfy/pull/633 **Author:** [@binwiederhier](https://github.com/binwiederhier) **Created:** 2/23/2023 **Status:** ✅ Merged **Merged:** 2/26/2023 **Merged by:** [@binwiederhier](https://github.com/binwiederhier) **Base:** `main` ← **Head:** `vrate` --- ### 📝 Commits (10+) - [`d686e1e`](https://github.com/binwiederhier/ntfy/commit/d686e1ee77b0a1de2ea108a12259eae6497def5c) Use visitor instead of UserID in topicSubscription - [`28b654a`](https://github.com/binwiederhier/ntfy/commit/28b654ae2746b6a48deddab9df69dfc5fa88895e) Keep track of lastVisitor to a topic - [`fb2fa4c`](https://github.com/binwiederhier/ntfy/commit/fb2fa4c478778ab0d09154b5d274ae37caa6a4b6) Fix m.Expires and prune stale topics based on lastVisitorExpires - [`6bfe4a9`](https://github.com/binwiederhier/ntfy/commit/6bfe4a97797bcb3f513f63b5dcc944decb60d926) Bill to visitor and set TTL in response - [`7c5b9c0`](https://github.com/binwiederhier/ntfy/commit/7c5b9c0e62fc1ec113f12b81e70735e4fb84dc1e) only log expiry if applicable - [`c6b64df`](https://github.com/binwiederhier/ntfy/commit/c6b64df662c8ea9a29d44571dcf7acba09cb8b1e) remove ttl - [`b9badee`](https://github.com/binwiederhier/ntfy/commit/b9badee6dbb4d43d6f1abee2f433e7113bb86ab8) remove TTL, will make a seperate PR - [`36685e9`](https://github.com/binwiederhier/ntfy/commit/36685e9df9b9792d85ca7b448ff29a570f6389df) Suggested changes - [`1655f58`](https://github.com/binwiederhier/ntfy/commit/1655f584f9382239ab89f78f3250bc37aa5d62f3) rate limiting impl 2.0? - [`bc3d897`](https://github.com/binwiederhier/ntfy/commit/bc3d897d7a315153f9dcdbf742435551abbeda4e) Use mutexes in topic ### 📊 Changes **13 files changed** (+578 additions, -106 deletions) <details> <summary>View changed files</summary> 📝 `docs/releases.md` (+13 -1) 📝 `server/errors.go` (+1 -1) 📝 `server/log.go` (+4 -0) 📝 `server/server.go` (+110 -46) 📝 `server/server_manager.go` (+18 -3) 📝 `server/server_matrix.go` (+11 -24) 📝 `server/server_matrix_test.go` (+4 -8) 📝 `server/server_middleware.go` (+33 -1) 📝 `server/server_test.go` (+293 -17) 📝 `server/topic.go` (+35 -4) 📝 `server/util.go` (+29 -0) 📝 `server/visitor.go` (+1 -0) 📝 `user/manager.go` (+26 -1) </details> ### 📄 Description _No description provided_ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 01:01:45 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#1358
No description provided.