Closed m4dm4rtig4n closed 1 year ago
I was able to reproduce your problem. Let me describe the environment so we better debug this:
If you setup a traefik + uptime-kuma environment like this (docker-compose.yml
):
version: "3.3"
services:
traefik:
image: "traefik:v2.9"
container_name: "traefik"
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
uptime-kuma:
image: louislam/uptime-kuma:1
container_name: uptime-kuma
volumes:
- ./uptime-kuma-data:/app/data
ports:
- "3001:3001"
labels:
- "traefik.enable=true"
- "traefik.http.routers.uptimekuma.rule=Host(`uptimekuma.localhost`)"
- "traefik.http.routers.uptimekuma.entrypoints=web"
- "traefik.http.services.uptimekuma.loadbalancer.server.port=3001"
Just note that uptime-kuma
has 2 ingress ways:
http://uptimekuma.localhost
;http://localhost:3001
So now I made some tests:
from uptime_kuma_api import UptimeKumaApi, MonitorType
# connect
api = UptimeKumaApi('http://uptimekuma.localhost') # traefik proxy
#api = UptimeKumaApi('http://localhost:3001') # direct connection
api.login('admin', 'hddmg123')
monitor_list = api.get_monitors()
for monitor in monitor_list:
print(monitor)
api.disconnect()
With this setup, I can connect using a direct connection but not with the proxy connection.
@mariogarridopt This works for me. But after the start I had to wait about two minutes until Traefik allowed the connection to uptime kuma. If you open the url in the web browser you see exactly the same behavior.
>>> api = UptimeKumaApi('http://uptimekuma.localhost')
>>> api.info()
{'version': '1.19.6', 'latestVersion': '1.19.5', 'primaryBaseURL': None, 'serverTimezone': 'Europe/Berlin', 'serverTimezoneOffset': '+01:00'}
But this is without SSL. Perhaps the above problem only occurs with encrypted connections.
@m4dm4rtig4n
Can you please try to use replace https://
with wss://
in the url (wss://myurl.behind.reverseproxy
)?
Does Uptime Kuma works in the web browser?
Can you please try to use replace
https://
withwss://
in the url (wss://myurl.behind.reverseproxy
)?
Same error :/
Does Uptime Kuma works in the web browser?
Service available on url :
I think found error, calls are blocked by my SSO...
I have create port forwarding to skip my SSO and it's work. Sorry for inconveniant :/
Hello,
I Try to use your librarie behind traefik, but connection are always refuse :/
My code :