[PR #1252] [MERGED] Adding proxy client IP header override functionality #1549

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

📋 Pull Request Information

Original PR: https://github.com/binwiederhier/ntfy/pull/1252
Author: @pixitha
Created: 1/6/2025
Status: Merged
Merged: 6/1/2025
Merged by: @binwiederhier

Base: mainHead: main


📝 Commits (5)

  • 926967b adding logic to specifcy client-ip header from proxy
  • 20c014b Adding test and some docs
  • 0e6a483 fixing auto-format change
  • 0aee625 fixing auto-format change
  • a49cafb more correcting auto-formats

📊 Changes

7 files changed (+69 additions, -216 deletions)

View changed files

📝 cmd/serve.go (+3 -0)
📝 docs/config.md (+2 -1)
📝 go.sum (+4 -198)
📝 server/config.go (+2 -0)
📝 server/server.go (+2 -2)
📝 server/server_test.go (+13 -0)
📝 server/util.go (+43 -15)

📄 Description

Based on this #905, I added the ability to specify the header for the proxy server to send the real client IP, if you don't want to use XFF header.

Was able to test and build and deploy this to fly.io and it now correctly identifies the client ip.

Still need to refactor it a bit more I think, maybe add the option to specify the subnet for the proxy server for still using XFF with a bit more logic?


🔄 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/1252 **Author:** [@pixitha](https://github.com/pixitha) **Created:** 1/6/2025 **Status:** ✅ Merged **Merged:** 6/1/2025 **Merged by:** [@binwiederhier](https://github.com/binwiederhier) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (5) - [`926967b`](https://github.com/binwiederhier/ntfy/commit/926967b6e7e3658b84de1dede794346ebcae5f60) adding logic to specifcy client-ip header from proxy - [`20c014b`](https://github.com/binwiederhier/ntfy/commit/20c014ba8d4874365167a5ba9fa66a32cb6a3c11) Adding test and some docs - [`0e6a483`](https://github.com/binwiederhier/ntfy/commit/0e6a483b2f5d29c9525b2d80f8512d77bc5b71e4) fixing auto-format change - [`0aee625`](https://github.com/binwiederhier/ntfy/commit/0aee6252bbb16b442c2151424eb97577c6f68e0f) fixing auto-format change - [`a49cafb`](https://github.com/binwiederhier/ntfy/commit/a49cafbadb78477b0fb74ca6725d7f664470eb50) more correcting auto-formats ### 📊 Changes **7 files changed** (+69 additions, -216 deletions) <details> <summary>View changed files</summary> 📝 `cmd/serve.go` (+3 -0) 📝 `docs/config.md` (+2 -1) 📝 `go.sum` (+4 -198) 📝 `server/config.go` (+2 -0) 📝 `server/server.go` (+2 -2) 📝 `server/server_test.go` (+13 -0) 📝 `server/util.go` (+43 -15) </details> ### 📄 Description Based on this #905, I added the ability to specify the header for the proxy server to send the real client IP, if you don't want to use XFF header. Was able to test and build and deploy this to fly.io and it now correctly identifies the client ip. Still need to refactor it a bit more I think, maybe add the option to specify the subnet for the proxy server for still using XFF with a bit more logic? --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 01:02:37 +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#1549
No description provided.