androidseb25 / iGotify-Notification-Assistent

Docker container for sending Gotify notifications to iOS devices (bridge to gotify websocket)
MIT License
99 stars 3 forks source link

No Connection to gotify/server-arm64 Container #55

Closed DonPablo1010 closed 2 months ago

DonPablo1010 commented 2 months ago

Describe the bug I'm having trouble getting igotify to work with gotify/server-arm64. The igotify container isn't able to establish a connection with the gotify container using this image. On another instance running the regular gotify image, everything works fine.

Expected behavior It would be great if arm64 support were available. Does igotify also require a separate image for that?

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

androidseb25 commented 2 months ago

Can you give me please some logs? What version do you use?

The assistant works with arm64 because it's a multiplatform image that includes arm/arm64/amd64.

If there are some trouble with the gotify image please consider the dev of gotify, I'm only the guy who developed an bridge for iOS

DonPablo1010 commented 2 months ago

Database is created: True info: Microsoft.Hosting.Lifetime[14] Now listening on: http://[::]:8080 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0] Hosting environment: Production info: Microsoft.Hosting.Lifetime[0] Content root path: /app warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3] Failed to determine the https port for redirect.

This is the log of the igotify container. Is the problem maybe relatet to nginx proxy manager? Because on the setup working i use the one from synology and here where this happens it ist nginx.

androidseb25 commented 2 months ago

that's all? when not please provide the me the full log, the domain and token etc can be removed. nothing like

Gotify - Url: http://xyz.xyz Is Gotify - Url available: yes/no SecNtfy Server - Url: http://xyz.xyz Is SecNtfy Server - Url available: yes/no Client - Token: XXXXX

DonPablo1010 commented 2 months ago

Container Log:

Database is created: True info: Microsoft.Hosting.Lifetime[14] Now listening on: http://[::]:8080 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0] Hosting environment: Production info: Microsoft.Hosting.Lifetime[0] Content root path: /app warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3] Failed to determine the https port for redirect. ClientToken: <Token> DeviceToken: <DeviceToken> GotifyUrl: https://push.mydomain.ch Client connecting... Done! Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s. Disconnection happened, type: Error Webseocket Reconnection failed with Error. Try to reconnect in 10s.

After sendig a Notification no Push arrives and the iosbridge looses connection to the gotify server. It is no longer possible to establish a connection untill fresh install.

Here is my nginx server Block:

`server { listen 80; server_name push.mydomain.ch;

location / {
    return 301 https://$host$request_uri;
}

}

server { listen 443 ssl; server_name push.mydomain.ch;

ssl_certificate /etc/letsencrypt/live/mydomain.ch/fullchain.>
ssl_certificate_key /etc/letsencrypt/live/mydomain.ch/privke>

location / {
    proxy_pass http://10.105.105.77:8680/;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_connect_timeout 1m;
    proxy_send_timeout 1m;
    proxy_read_timeout 1m;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}

}`

`server { listen 80; listen [::]:80; server_name iospush.mydomain.ch;

location / {
    return 301 https://$host$request_uri;
}

}

server { listen 443 ssl; listen [::]:443 ssl; server_name iospush.mydomain.ch;

ssl_certificate /etc/letsencrypt/live/mydomain.ch/fullchain.>
ssl_certificate_key /etc/letsencrypt/live/mydomain.ch/privke>

location / {
    proxy_pass http://10.105.105.77:8681/;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_connect_timeout 1m;
    proxy_send_timeout 1m;
    proxy_read_timeout 1m;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}

} `

androidseb25 commented 2 months ago

did you can see the swagger api when you open you're iospush.mydomain.ch domain?

when yes please try to send a test message with the last endpoint in the list. you need the notification token starting with NTFY-DEVICE-. You will find it in the app, when you everything setuped

DonPablo1010 commented 2 months ago

Sending the testmessage to the device over Swagger worked.

The Container Log says still: Gotify Server is not available try to reconnect in 10s

It has lost the Websocket connection as i sendt the first Testnotification and connectioncan no longer be established to the gotify server from igotify container... But i can reached the server over push.mydomain.ch without a problem with a browser...

androidseb25 commented 2 months ago

can you test if the domain is reachable from inside the iGotify Notification Container?

DonPablo1010 commented 2 months ago

Yes, got it!! Sorry, you can close this issue. How could i be so dumb. It was ufw. But i was so shure that i did the disable while testing.

If any one wonders how to test if a host is reachable from inside the container, here is how to:

docker exec -ti <ContainerName> timeout 3 /bin/bash -c "echo > /dev/tcp/push.yourdomain.ch/443 >& /dev/null" && echo "ok" || echo "nok"

As soon as i disable ufw and ran the cmd above i got "ok"... Now i allowed docker networkbridge ip range to any app 'Nginx Full' and the containers can connect over the reverse proxy.

androidseb25 commented 2 months ago

Ok

Nice, ufw I also sometimes forget 😅