alexjustesen / speedtest-tracker

Speedtest Tracker is a self-hosted internet performance tracking application that runs speedtest checks against Ookla's Speedtest service.
https://speedtest-tracker.dev/
MIT License
2.71k stars 100 forks source link

webhook not working via https #1544

Closed aifrog closed 3 months ago

aifrog commented 3 months ago

I can get the webhook working well when using http. However, when using https this would not work. No problem at the receiving end as tested with a simple browser. Whats wrong? Best, H-C

svenvg93 commented 3 months ago

I don’t have any problems when using https://webhook.site/ which uses https as well for link. Can you share your setting used?

TheGroundZero commented 3 months ago

No issues here using HTTPS endpoint of Healthchecks.io

Does your HTTPS endpoint have a self-signed certificate?

aifrog commented 3 months ago

Its a certificate from Letsencrypt and I call "https://speedtest.domain.abc/hook/speedtest". This works well from a browser on the host, but from inside the docker container. A direct call via http is tested and works well (not going through the reverse proxy). Configuration as follows:

version: "3.9"
services:
  db:
    image: postgres:16
    container_name: SpeedTest-TRACKER-DB
    hostname: speedtestracker-db
    mem_limit: 1g
    cpu_shares: 1024
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: ["CMD", "pg_isready", "-q", "-d", "speedtest", "-U", "speedtestuser"]
      timeout: 45s
      interval: 10s
      retries: 10
    volumes:
      - /volume1/docker/speedtest/db:/var/lib/postgresql/data:rw
    environment:
      POSTGRES_DB: speedtest
      POSTGRES_USER: speedtestuser
      POSTGRES_PASSWORD: xxxxxx
    restart: on-failure:5

  speedtest-tracker:
    image: ghcr.io/linuxserver/speedtest-tracker:latest
    container_name: SpeedTest-TRACKER
    healthcheck:
     test: curl -f http://localhost:80/ || exit 1
    environment:
       SPEEDTEST_SCHEDULE: "*/15 * * * *"
       SPEEDTEST_SERVERS: "53257,41540,44081"
       MAIL_HOST: xx.xxx.xxx
       MAIL_PORT: 465
       MAIL_USERNAME: xxx
       MAIL_PASSWORD: xxx
       MAIL_ENCRYPTION: tls
       MAIL_FROM_ADDRESS: xxx@xx.xxx
       PUBLIC_DASHBOARD: true
       PUID: 1047
       PGID: 1000
       TZ: Europe/Berlin
       APP_TIMEZONE: Europe/Berlin
       DISPLAY_TIMEZONE: Europe/Berlin
       DB_CONNECTION: pgsql
       DB_HOST: speedtestracker-db
       DB_PORT: 5432
       DB_DATABASE: speedtest
       DB_USERNAME: speedtestuser
       DB_PASSWORD: xxxxxxx
       APP_KEY: xxxxxxxxxxxxxxxxx
       #APP_KEY: Not mandatory. docker exec speedtest-tracker php /app/www/artisan key:generate --show
    volumes:
      - /volume1/docker/speedtest/config:/config:rw
    ports:
      - 8999:80
    restart: on-failure:5
svenvg93 commented 3 months ago

What happens when you do http through the proxy (if that is possible for your setup) What is the proxy you're using?

Can you enable debug by adding APP_DEBUG=true to the environment of the docker compose. Chech /app/www/storage/logs/laravel.log in the container for any logs while testing the webhook. Might give us some insights.

aifrog commented 3 months ago

Going via http through the proxy works. I am using a reverse proxy fro synology. The debug will follow later ...

aifrog commented 3 months ago

I found it. It was me with a stupid error. My proxy did not accept the ip address of the docker network. Thanks for your help.