mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 16:35:53 +02:00
[GH-ISSUE #1529] Android: Attachment download not using User #1078
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#1078
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 @ManInDark on GitHub (Dec 31, 2025).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1529
🐞 Describe the bug
For protected topics (or hosting ntfy behind a reverse proxy with basic auth in my case) you can set a username password pair by creating a user with those credentials.
The issue is that those credentials are not used when attempting to download attachments.
💻 Components impacted
Android App
💡 Screenshots and/or logs
🔮 Additional context
I've already started looking into this, the solution is likely to change the
DownloadAttachmentWorker.ktaround the line 65 to have theRequest.Builder()also use the credentials like they are inApiService.ktin therequestBuilderfunction.I am currently struggeling as I'm not quite familiar with how the live api works in Android and if I try to retrieve the users via said api I only get null.
@binwiederhier commented on GitHub (Dec 31, 2025):
This is not a supported use case.
Typically, attachments do not need credentials. The message ID is the password. It cannot be guessed. You can exclude
server.com/file/*from the basic auth requirement in your proxy.Which version of the Android app are you on? It may be easy enough add that code, so I may still do it
@wunter8 commented on GitHub (Dec 31, 2025):
Making the attachment URLs require auth would be a pretty big breaking change, no?
@binwiederhier commented on GitHub (Dec 31, 2025):
I would just make the Android client send the credentials when downloading, so that his authenticated proxy would be happy.
Turns out that if you use the same basic auth in your proxy that you use for the ntfy user, it'll work apparently. At lease according to @ManInDark
@wunter8 commented on GitHub (Dec 31, 2025):
Wouldn't the "custom request headers" PR fix this scenario?
@ManInDark commented on GitHub (Dec 31, 2025):
Oh, good to know, I just put the whole app behind the proxy since I already had other apps with the same setup and naively assumed it would just work.
FDroid 1.19.4, I could also change the subpath access but that would be greatly appreciated.
@ManInDark commented on GitHub (Dec 31, 2025):
I actually don't use the users feature since I already have access control using the proxy.
Though it could also be done twice, you just have to proxy the auth headers too.
@ManInDark commented on GitHub (Jan 1, 2026):
Something like this should theoretically work, but for some reason I can't quite figure out the
repository.getUsersLiveData()returns just null instead of the user list.So all in all it's probably a relatively small change without any differences for those not using proxy auth.
@binwiederhier commented on GitHub (Jan 5, 2026):
This is solved in https://github.com/binwiederhier/ntfy-android/pull/149
@ManInDark commented on GitHub (Jan 6, 2026):
I've tested it with
45c36b8f (HEAD -> mtls, origin/mtls) Reviewas the last commit (git log -1 --oneline), it didn't work.I assume that the user object isn't passed correctly, but not sure on that, I'll do some more detailed debugging later.
@ManInDark commented on GitHub (Jan 6, 2026):
Apparently my assumption was correct, in
DownloadAttachmentWorker.kt:65no user is passed to therequestBuilderfunction:This function only needs the second parameter to be set to the user: (
HttpUtil.kt:59)I still have no idea how to get an instance of the user list at this point in the code, so sorry that I can't help further than that.
@binwiederhier commented on GitHub (Jan 6, 2026):
You are a hero. Thanks for testing. Fixed in a latest commit (untested)
@ManInDark commented on GitHub (Jan 6, 2026):
I've tested this commit:
And it works! Thank you very much for implementing this feature!
@binwiederhier commented on GitHub (Jan 16, 2026):
Will be part of 1.22.x
@ManInDark commented on GitHub (Feb 1, 2026):
I've just confirmed that it works perfectly with the version 1.22.2
Thank you very much!
Should I add an example with basic auth to tje documentation or do you want to keep this as an unsupported setup?