mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[GH-ISSUE #620] [Feature] allow an anonymous "localhost user" for the Private instance #464
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#464
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?
Originally created by @LuckyTurtleDev on GitHub (Feb 19, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/620
Application servers needs anonymous write access to ntfy. I am not a big fan of allowing everyone to upload data to my server.
Since ntfy is running on the same server as the application servers , I wonder if it would possible to give only localhost/docker anonymous write access to ntfy.
@binwiederhier commented on GitHub (Feb 19, 2023):
I'm sure you've seen the section about access control in the docs (https://docs.ntfy.sh/config/#access-control), so you can define granular access controls based on users.
For your specific problem, you could define default permissions as
deny-all, and then create ACL entries to allow anonymous write access to a topic:server.yml
Define ACL:
And then you could restrict access to
/sometopicin nginx (or whatever your proxy is) to only local IP addresses.I do not intend to add IP restrictive access to ntfy itself (for now).
@binwiederhier commented on GitHub (Feb 19, 2023):
Alternatively, if you have
listen-unixdefined, you can directly write to the unix socket, e.g.curl -d hi --unix-socket /tmp/ntfy.sock http://127.0.0.1/sometopic@binwiederhier commented on GitHub (Feb 20, 2023):
Hope this was answered. If not, feel free to comment or re-open.
@LuckyTurtleDev commented on GitHub (Feb 20, 2023):
Yes it was answered. Thanks. I will try out your solution soon.
Maybe this can be keep open for the feature request?
@LuckyTurtleDev commented on GitHub (Feb 21, 2023):
@binwiederhier sadly I am not allowed to reopen the issue
@binwiederhier commented on GitHub (Feb 21, 2023):
I don't think I want to implement IP-based access control in ntfy. That seems like something that has to live or be solved outside it. In a proxy, as I said. You can easily solve this in nginx.
@LuckyTurtleDev commented on GitHub (Feb 22, 2023):
If I restrict access to
/sometopicwould not this effect also reading the topic?Maybe it is a better idea to add the authorization header if the request does come from localhost?
@LuckyTurtleDev commented on GitHub (Mar 13, 2023):
I have now simple add a autheader at the reverse proxy for local ips. Works without any issue
Caddyfile:@binwiederhier commented on GitHub (Mar 13, 2023):
Very elegant. Nice.