this post was submitted on 10 Jul 2023
2 points (100.0% liked)

ntfy

45 readers
1 users here now

ntfy (pronounced notify) is a simple HTTP-based pub-sub notification service. You can use it to send push notifications to your phone via HTTP PUT/POST.

ntfy websiteDocumentationGitHubGoogle PlayF-DroidDiscordApp StoreMatrix

If you'd like to become a sponsor, I would be humbled to accept your donation via GitHub Sponsors or Liberapay 💸💰.

founded 1 year ago
MODERATORS
2
Docker-compose + Traefik (lemmy.zell-mbc.com)
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

Has anyone got a working setup of this combination? I somehow can't get things to work

I can run the below on the docker host sucessfully:

curl -d "Backup successful 😀" localhost:81/test  
{"id":"4EpidFddbe8p","time":1688997266,"expires":1689040466,"event":"message","topic":"test","message":"Backup successful 😀"}

…but when I try the public url from a different machine I get a 404 page not found. Which to me means ntfy is running, but there's something wrong with my Traefik setup.

docker-compose.yml

…
    ports:
      - 81:80
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.ntfy.rule=Host(`ntfy.mydomain.com`)"
      - "traefik.http.routers.ntfy.tls=true"
      - "traefik.http.routers.ntfy.entrypoints=http"
      - "traefik.http.routers.ntfy.entrypoints=https"
      - "traefik.http.routers.ntfy.tls.certresolver=http"
      - "traefik.http.services.ntfy.loadBalancer.server.port=81"
      - "traefik.docker.network=traefik-proxy"
      - "traefik.http.routers.ntfy.service=ntfy"

Minimalistic server.yml:

cat config/server.yml 
# ntfy server config file
base-url: "https://ntfy.mydomain.com"
  #upstream-base-url: "https://ntfy.sh"
  #listen-http: "127.0.0.1:80"
cache-file: "/var/cache/ntfy/cache.db"
  #attachment-cache-dir: "/var/cache/ntfy/attachments"
behind-proxy: true

Can anyone spot a mistake here or suggest additional troubleshooting steps?

---- Edit: Never mind, Traefik has given me so much grief, my brain doesn't seem to be compatible :-), that I decided to switch to nginx. Got everything running after 5 minutes…

top 2 comments
sorted by: hot top controversial new old
[–] [email protected] 1 points 1 year ago (1 children)
[–] [email protected] 2 points 1 year ago

I did indeed, and I have to say I am impressed from what I see so far! A really nice and complete tool you created. Thanks a lot for putting in the hours 👍