linagora / tmail-backend

GNU Affero General Public License v3.0
37 stars 19 forks source link

docker setup some problems #1170

Open hozansahin opened 1 week ago

hozansahin commented 1 week ago

Hi There, https://github.com/linagora/tmail-flutter/blob/master/docker-compose.yaml I created my own docker-compose file using this directive and below is what worked. On port 80 and 443 I need to use other different port where nginx works my docker-compose.yaml

version: "3.9"
networks:
    1panel-network:
        external: true
services:
  tmail-frontend:
    image: linagora/tmail-web:master
    container_name: tmail-frontend
    ports:
      - "8180:80"
    volumes:
      - ./env.file:/usr/share/nginx/html/assets/env.file
    networks:
      - 1panel-network
    depends_on:
      - tmail-backend

  tmail-backend:
    image: linagora/tmail-backend:memory-branch-master
    container_name: tmail-backend
    volumes:
      - ./jwt_publickey:/root/conf/jwt_publickey
      - ./jwt_privatekey:/root/conf/jwt_privatekey
    ports:
      - "88:80"
    networks:
      - 1panel-network

My env.file

SERVER_URL=https://posta.thirdcode.org
DOMAIN_REDIRECT_URL=https://posta.thirdcode.org:3000
WEB_OIDC_CLIENT_ID=teammail-web
OIDC_SCOPES=openid,profile,email,offline_access
APP_GRID_AVAILABLE=supported
FCM_AVAILABLE=supported
IOS_FCM=supported
FORWARD_WARNING_MESSAGE=

I use cloudflare tunnel and my configuration is in the image below: resim

I cannot log in to any of the demo accounts. it gives a connection error. can you help with this.

resim

chibenwa commented 1 week ago

Can you use developer tools and report the exact query that fail, please?

hozansahin commented 1 week ago

Can you use developer tools and report the exact query that fail, please?

image 405 Method Not Allowed image

Har File: https://nc.thirdcode.org/s/wfxgKyGc3YdQFzE

Console Output:

translater.js:37 [Twake Mail] Current Language:  tr
translater.js:53 [Twake Mail] Error loading tr resources: SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
loadLanguageResources @ translater.js:53
translater.js:55 [Twake Mail] Using default English resources: Object
worker_service.js:85 [TwakeMail] getPlatform():  Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
worker_service.js:109 [TwakeMail] initialWorkerService(): OriginInUrl: Location
translater.js:37 [Twake Mail] Current Language:  tr
main.dart.js:56456 Got object store box in database encryptionkeycache.
main.dart.js:56456 Got object store box in database emailcache.
main.dart.js:56456 Got object store box in database recentloginurlcache.
main.dart.js:56456 Got object store box in database recentsearchcache.
main.dart.js:56456 Got object store box in database recentloginusernamecache.
main.dart.js:56456 Got object store box in database accountcache.
login:1 Access to XMLHttpRequest at 'https://posta.thirdcode.org/.well-known/webfinger?resource=https://posta.thirdcode.org&rel=http://openid.net/specs/connect/1.0/issuer' from origin 'http://5.180.254.233:8180' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
posta.thirdcode.org/.well-known/webfinger?resource=https://posta.thirdcode.org&rel=http://openid.net/specs/connect/1.0/issuer:1 

       Failed to load resource: net::ERR_FAILED
chibenwa commented 1 week ago

Make sure to forward OPTIONS (cors) call to the Twake Mail backend server - or allow everything.

hozansahin commented 1 week ago

Make sure to forward OPTIONS (cors) call to the Twake Mail backend server - or allow everything.

I guess I can't communicate with the backend side, I can't do that, can you help me with this?

Arsnael commented 1 week ago

Hi,

The error seems here:

login:1 Access to XMLHttpRequest at 'https://posta.thirdcode.org/.well-known/webfinger?resource=https://posta.thirdcode.org&rel=http://openid.net/specs/connect/1.0/issuer' from origin 'http://5.180.254.233:8180' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Missing an Access-Control-Allow-Origin header for cors. I don't know much about cloudflare tunnel but maybe it's removing it somehow from the original request? You might want to check that