mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-10 00:08:52 +02:00
[GH-ISSUE #958] Can't use https #672
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#672
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 @iomari on GitHub (Nov 22, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/958
Greetings,
I can't seem to get https working. Http works fine though. Below is my server.yml file. I have key.pem and cert.pm configured.
I running kubuntu 23.10 and I'm using systemd to control the service. The config below works just fine with http. But if i comment the listen-http line and uncomment the next 3 lines, I get errors when I restart the service.
@binwiederhier commented on GitHub (Nov 22, 2023):
In yaml, lines starting with "#" are comments. So you don't really have TLS configured at all.
@iomari commented on GitHub (Nov 22, 2023):
Maybe you didn't read my post carefully.
The current config works because the 3 https lines are commented out. If I uncomment them I get errors.
@binwiederhier commented on GitHub (Nov 22, 2023):
Troubleshooting is best done on discord or matrix. Feel free to join.
If you get errors, it is a really really really good idea to include screenshots or copied text of the errors. Otherwise we cannot help.
You've done the equivalent of your mom telling you "my computer is broken" without giving any more details 😊
@iomari commented on GitHub (Nov 22, 2023):
sudo systemctl restart ntfy ; sleep 2 ; sudo systemctl status ntfy
The output of: sudo journalctl -xeu ntfy.service
@binwiederhier commented on GitHub (Nov 22, 2023):
I'm a very patient person, but I ask you to learn to do some work yourself. Read the error message, or ask ChatGPT to interpret what's wrong. It's quite obvious.
I'll close this ticket, as it is clearly not a ntfy bug. Happy Thanksgiving 🦃
@mdbench commented on GitHub (Aug 5, 2025):
I am requesting you reopen this ticket specific to NTFY on a Docker Container. Even when you set server.yml appropriately, HTTPS does not work. It looks like you misconfigured support for HTTPS.
I can help you troubleshoot to fix to your misconfiguration of HTTPS but first thing is first. To reproduce bug on your side, see below:
Here is a dictionary for details removed for privacy reasons:
[generic port] = Port not listed for privacy reasons
[generic path to docker-compose.yml] = Path to yml not listed for privacy reasons
[generic IP] = IP not listed for privacy reasons
[generic path to key] = Path to SSL key not listed for privacy reasons
[generic path to cert] = Path to SSL cert not listed for privacy reasons
I deployed through a simple custom shell script:
#!/bin/bash mkdir -p /opt/ntfy/config mkdir -p /opt/ntfy/cache mkdir -p /opt/ntfy/db if test -f "/opt/ntfy/config/server.yml"; then echo "File exists, moving away from task to make server.yml..." else echo "File does not exist, making server.yml..." touch /opt/ntfy/config/server.yml echo 'listen-https: ":[generic port]"' >> /opt/ntfy/config/server.yml echo 'key-file: /etc/ntfy/certs/key.key' >> /opt/ntfy/config/server.yml echo 'cert-file: /etc/ntfy/certs/cert.crt' >> /opt/ntfy/config/server.yml echo 'auth-file: /var/lib/ntfy/auth.db' >> /opt/ntfy/config/server.yml echo 'auth-default-access: deny-all' >> /opt/ntfy/config/server.yml echo 'enable-login: true' >> /opt/ntfy/config/server.yml echo "Made server.yml" fi cd [generic path to docker-compose.yml] docker compose up -dHere is docker-compose.yml:
services: ntfy: image: binwiederhier/ntfy:latest container_name: ntfy command: serve environment: - TZ=America/New_York - NTFY_BASE_URL=https://[generic IP] - NTFY_AUTH_FILE=/var/lib/ntfy/auth.db - NTFY_AUTH_DEFAULT_ACCESS=deny-all - NTFY_ENABLE_LOGIN=true volumes: - [generic path to key]:/etc/ntfy/certs/key.key - [generic path to cert]:/etc/ntfy/certs/cert.crt - /opt/ntfy/cache:/var/cache/ntfy - /opt/ntfy/config:/etc/ntfy - /opt/ntfy/db:/var/lib/ntfy - /opt/ntfy/config/server.yml:/etc/ntfy/server.yml ports: - [generic port]:80 - [generic port]:443 restart: unless-stoppedDocker is up and running. HTTP works. HTTPS does not. This was made as simple as possible for this post in accordance with your documentation where you explicitly mentioned "Be sure to use HTTPS to avoid eavesdropping and exposing your password" in reference to Basic Auth. I then saw you did not explicitly mention how to setup HTTPS and when you did you referenced setting it up behind what looks to be a proxy, as you used Let's Encrypt certs for the setup that are really only mentioned in your docs for use behind a proxy.
As an FYI, it is not recommended to use a proxy server to forward HTTP requests to HTTPS as you are not actually using HTTPS, even while the endpoint looks like it is HTTPS. It is recommended that all docker solutions come with HTTPS support out of the box and use of a proxy does not meet that requirement. Don't worry. You aren't the only one doing this. Most GO-based Dockers I have come across do not provide HTTPS support out of the box and it would be impossible to believe that someone could create a GO app and at the end of development stop the project to tell users to just use a proxy manager. But, I have seen some weird coders/dev teams lately...
Since this service probably took a lot of time to make, let's get this fixed just so people don't start believing you didn't write this code and got ChatGPT's mom to write it for you.