mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 16:35:53 +02:00
[GH-ISSUE #992] Is another webserve needed for pushing attachments outside ntfy UI? #694
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#694
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 @bertod on GitHub (Dec 27, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/992
❓ Question
Hello,
What
I'm sending push notifications on my self-hosted ntfy server and I need to send attachments as well. So, what I do is to write my attachments in the
attachment-cache-diras set in the server.yml. However, when doing this, the notification I received tries to find the attachment in<base_url>/fileand fails.When I create a new msg in the topic using ntfy UI, it uploads the attachment in the same dir but works.
Question
Is it really possible to make ntfy finding an attachment which is stored in the cache dir without using the UI? Do I need to change some setting?
My Workaround
I leverage on a different webserve (e.g., apache, nginx, whatever) and upload the attachment to it. In this way, it works (ofc, the POSTrequest header is changed accordingly)
@wunter8 commented on GitHub (Dec 27, 2023):
ntfy does not support attachments that have been uploaded to the attachments directory by hand. When you add something by hand, ntfy doesn't know about it so it cannot attach it to any messages.
ntfy expects you to send a message to a topic with an attachment to the server (from anywhere). ntfy will extract the attachment, give it a unique ID, and save it in the attachments directory. It will then publish the message with (a link to download) the attachment to all subscribers of the topic. You can send the message with the attachment from the UI or from any other HTTP client (e.g., curl, httpie, python requests, etc.)
@bertod commented on GitHub (Dec 27, 2023):
yeah, makes sense. The only thing is that we would end up duplicating the image and we would need to manually delete one copy. It's not a big deal, but still.
Thank you! I'm gonna close this issue :)
@wunter8 commented on GitHub (Dec 27, 2023):
If you skip the step of putting them in the attachments directory by hand and just use the UI/curl/httpie, you won't have any duplicates and everything would still work like normal, right?