mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[PR #429] [MERGED] Allow Exempting IP Ranges #1296
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#1296
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/binwiederhier/ntfy/pull/429
Author: @karmanyaahm
Created: 10/5/2022
Status: ✅ Merged
Merged: 10/8/2022
Merged by: @binwiederhier
Base:
main← Head:ip-range-exempt📝 Commits (7)
c2382d2refactor visitor IPs and allow exempting IP Rangesde2ca33recommended fixes [1 of 2]511d3f6recommended fixes [2 of 2]3b29294minor modification to tests involving ips4edc625fix lintbc5060btest new config parsing1672322test ContainsIP utility📊 Changes
14 files changed (+164 additions, -60 deletions)
View changed files
📝
cmd/serve.go(+33 -6)📝
cmd/serve_test.go(+23 -5)📝
server/config.go(+3 -2)📝
server/message_cache.go(+11 -4)📝
server/message_cache_test.go(+13 -7)📝
server/server.go(+22 -8)📝
server/server_firebase_test.go(+6 -4)📝
server/server_matrix_test.go(+4 -2)📝
server/server_test.go(+13 -11)📝
server/smtp_sender.go(+1 -1)📝
server/types.go(+4 -2)📝
server/visitor.go(+7 -5)📝
util/util.go(+14 -2)📝
util/util_test.go(+10 -1)📄 Description
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 and efficient to compare; mainly it 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 just that one
address.
draft still need to add tests and fix bugs.However, is the change from string IPs to netip.Addr and netip.Prefix acceptable?
Closes #423
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.