mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 16:35:53 +02:00
[GH-ISSUE #893] Android app: Downloading attached file fails when using basic auth #632
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#632
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 @EisFrei on GitHub (Sep 22, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/893
🐞 Describe the bug
When using basic auth to protect the self hosted server text messaging works as expected after entering the credentials.
Those credentials appear to not being used when trying to download an attached file.
How to reproduce
💻 Components impacted
Android app
💡 Screenshots and/or logs
Device info:
ntfy: 1.16.0 (play)
OS: 4.19.157-perf-gdfc2307a5578
Android: 13 (SDK 33)
Model: alioth
Product: alioth_eea
--
Settings:
{
"autoDeleteSeconds": 2592000,
"autoDownloadMaxSize": 1048576,
"broadcastEnabled": true,
"connectionProtocol": "ws",
"darkMode": -1,
"defaultBaseUrl": "https://ntfy.xxxxx",
"lastSharedTopics": [],
"minPriority": 1,
"mutedUntil": 0,
"recordLogs": true
}
Logs
--
1695371296140 2023-09-22 10:28:16.140 D NtfyDownloadManager Enqueuing work to download attachment for notification u6ramlLx3myR, work: io.heckel.ntfy.DOWNLOAD_FILE_u6ramlLx3myR
1695371296178 2023-09-22 10:28:16.178 D NtfyAttachDownload Downloading attachment from https://ntfy.xxxxxx/file/u6ramlLx3myR.jpg
1695371296357 2023-09-22 10:28:16.357 D NtfyAttachDownload Download: headers received: Response{protocol=h2, code=401, message=, url=https://ntfy.xxxxxxxx/file/u6ramlLx3myR.jpg}
1695371296357 2023-09-22 10:28:16.357 W NtfyAttachDownload Attachment download failed
Exception:
java.lang.Exception: Unexpected response: 401
at io.heckel.ntfy.msg.DownloadAttachmentWorker.downloadAttachment(DownloadAttachmentWorker.kt:71)
at io.heckel.ntfy.msg.DownloadAttachmentWorker.doWork(DownloadAttachmentWorker.kt:48)
at androidx.work.Worker$1.run(Worker.java:86)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at java.lang.Thread.run(Thread.java:1012)
🔮 Additional context
An Apache2 reverse proxy using basic auth is running in front of the ntfy server
@binwiederhier commented on GitHub (Sep 22, 2023):
The /file/ endpoint does not require a password. The message ID is randomly generated serves as a secret URL to download the file. This makes linking to the uploaded file easier and is equally secure.
You seem to be running ntfy behind a proxy that adds auth headers. This is not officially supported yet.
@dcousens commented on GitHub (Feb 6, 2024):
@binwiederhier are you open to re-opening this as a feature request?
Maybe as
attachment.headers?@Torxgewinde commented on GitHub (Feb 12, 2024):
To make use of the hint @binwiederhier gave, i'd like to add a config for HAProxy that works for my personal setup quite acceptable:
/etc/haproxy/haproxy.conf: