Commit Graph
22 Commits
Author SHA1 Message Date
Karmanyaah Malhotra 0d7aba9487 Fix Matrix errors and tests 2023-02-25 00:12:14 -06:00
Karmanyaah Malhotra fbbfa2bbc1 fix matrix tests for new error handling
Test driven development
2023-02-24 23:09:21 -06:00
Karmanyaah Malhotra 2f5cfab01c Fix 507 tests for UnifiedPush subscribe rate limiting 2023-02-24 22:16:03 -06:00
Karmanyaah Malhotra ce7d447f16 limitRequestsWithTopic 2023-02-21 22:40:15 -06:00
Karmanyaah Malhotra 0e4044b747 rename lastVisitor to vRate 2023-02-21 20:18:04 -06:00
Karmanyaah Malhotra bc3d897d7a Use mutexes in topic 2023-02-21 20:16:03 -06:00
Karmanyaah Malhotra 1655f584f9 rate limiting impl 2.0? 2023-02-21 20:04:56 -06:00
Karmanyaah Malhotra 36685e9df9 Suggested changes
- https://github.com/binwiederhier/ntfy/pull/609/files/b9badee6dbb4d43d6f1abee2f433e7113bb86ab8#r1111115151
- https://github.com/binwiederhier/ntfy/pull/609/files/b9badee6dbb4d43d6f1abee2f433e7113bb86ab8#r1111114771
2023-02-20 17:58:51 -06:00
Karmanyaah Malhotra b9badee6db remove TTL, will make a seperate PR 2023-02-15 03:38:24 -06:00
Karmanyaah Malhotra c6b64df662 remove ttl 2023-02-15 03:31:59 -06:00
Karmanyaah Malhotra 7c5b9c0e62 only log expiry if applicable 2023-02-14 14:21:33 -06:00
Karmanyaah Malhotra 6bfe4a9779 Bill to visitor and set TTL in response 2023-02-14 14:07:02 -06:00
Karmanyaah Malhotra fb2fa4c478 Fix m.Expires and prune stale topics based on lastVisitorExpires 2023-02-14 14:00:43 -06:00
Karmanyaah Malhotra 28b654ae27 Keep track of lastVisitor to a topic 2023-02-14 13:58:13 -06:00
Karmanyaah Malhotra d686e1ee77 Use visitor instead of UserID in topicSubscription 2023-02-14 13:07:32 -06:00
Karmanyaah Malhotra 1672322fc1 test ContainsIP utility 2022-10-07 21:22:22 -05:00
Karmanyaah Malhotra bc5060b218 test new config parsing 2022-10-07 21:15:45 -05:00
Karmanyaah Malhotra 4edc625331 fix lint 2022-10-07 20:36:01 -05:00
Karmanyaah Malhotra 3b29294679 minor modification to tests involving ips 2022-10-07 20:27:22 -05:00
Karmanyaah Malhotra 511d3f6aaf recommended fixes [2 of 2] 2022-10-07 16:24:11 -05:00
Karmanyaah Malhotra de2ca33700 recommended fixes [1 of 2] 2022-10-07 16:17:04 -05:00
Karmanyaah Malhotra c2382d29a1 refactor visitor IPs and allow exempting IP Ranges
Use netip.Addr instead of storing addresses as strings. This requires
conversions at the database level and in tests, but is more memory
efficient otherwise, and facilitates the following.

Parse rate limit exemptions as netip.Prefix. This allows storing IP
ranges in the exemption list. Regular IP addresses (entered explicitly
or resolved from hostnames) are IPV4/32, denoting a range of one
address.
2022-10-05 16:04:42 -05:00