gotify / android

An app for creating push notifications for new messages posted to gotify/server.
MIT License
934 stars 156 forks source link

not being able to connect to my gotify server #339

Closed Spleenftw closed 6 months ago

Spleenftw commented 6 months ago

hello,

my gotify is exposed behind a cloudflare tunnel.

When im trying to connect to it with my phone, it says the following error : " Request to 'https://gotify.xxx.xxx/version' failed with status code 403"

But when i'm trying with a curl or web navigator :

user@machine:~$ curl https://gotify.xxx.xxx/version {"version":"2.4.0","commit":"97f180b65091fc6ca313d29dfc5b559aa8cd9465","buildDate":"2023-09-17-08:24:00"}

Any idea ?

jmattheis commented 6 months ago

Probably releated to cors. Try the solution listed in https://github.com/gotify/server/issues/640#issuecomment-2001943833. Maybe related https://github.com/gotify/android/issues/201

Show the gotify/server log when the 403 occurs.

Spleenftw commented 6 months ago

Added the solution you linked :

version: "3"

services:
  gotify:
    image: gotify/server
    ports:
      - 8081:80
    environment:
      - GOTIFY_DEFAULTUSER_PASS=custom
      - GOTIFY_SERVER_CORS_ALLOWORIGINS=[xxx.xxx]
      - GOTIFY_SERVER_STREAM_ALLOWEDORIGINS=[xxx.xxx]
    volumes:
      - "/var/gotify/data:/app/data"

still not working on android.

the tunnel is configured like that : image

jmattheis commented 6 months ago

Show the gotify/server log when the 403 occurs.

Spleenftw commented 6 months ago

I don't have any logs, it looks like it doesnt even connect to it

jmattheis commented 6 months ago

Does opening the gotify url in a webbrowser on the phone works. If the request doesn't reach gotify I cannot help you. It's something with your setup.

Spleenftw commented 6 months ago

It does work on chrome on my phone

jmattheis commented 6 months ago

Try the options listed in https://community.cloudflare.com/t/api-403-after-enabling-cloudflare/108078

Spleenftw commented 6 months ago

lowering the security made it work. thanks