teableio / teable

✨ The Next Gen Airtable Alternative: No-Code Postgres
https://teable.io
Other
11.66k stars 536 forks source link

Image preview - 400 Bad Request #929

Open valentin2105 opened 1 month ago

valentin2105 commented 1 month ago

Describe the bug The preview of pictures don't work and return 400 Bad Request

To Reproduce Install teable in production behind a reverse-proxy.

Additional context

The request is :

https://teable-qualif.domain.tld/_next/image?url=https%3A%2F%2Fteable-qualif.domain.tld%2Fapi%2Fattachments%2Fread%2Fpublic%2Favatar%2Fusr7fq1tWA25ZXMqguf&w=64&q=75

The answer is :

"url" parameter is valid but upstream response is invalid

I have tried few things :

connectSrc -> https:// images -> protocol: https, hostename:

ENABLE_CSP=false on Dockerfile

NEXT_ENV_IMAGES_ALL_REMOTE -> "true" on the running container

It doesn't change anything.

I also tried sed -i 's/app.use(helmet());/app.use(helmet({ crossOriginResourcePolicy: false, });/g' apps/nestjs-backend/src/bootstrap.ts but doesn't build.

Please can I have any help to fix this ?

tea-artist commented 1 month ago

add an env NEXT_ENV_IMAGES_ALL_REMOTE=true in teable container should fix this problem, we will fix it in the next update

valentin2105 commented 3 weeks ago

@tea-artist, I already set this variable, doesn't fix my issue.

tea-artist commented 3 weeks ago

Can you give a minimum reproducible yaml to help us better locate the problem?

valentin2105 commented 3 weeks ago

I run it on Kubernetes with Nginx Ingress proxy on front of it.

I use latest release v1.4.1

My env vars :

      - env:                                                                                                                                                                                    
        - name: TZ                                                                                                                                                                              
          value: "Pacific/Noumea"                                                                                                                                                               
        - name: POSTGRES_HOST                                                                                                                                                                   
          value: "vm-db01.placeholder.com"                                                                                                                                               
        - name: POSTGRES_PORT                                                                                                                                                                   
          value: "5566"                                                                                                                                                                         
        - name: POSTGRES_DB                                                                                                                                                                     
          value: "teable"                                                                                                                                                                       
        - name: POSTGRES_USER
          value: "teable"
        - name: POSTGRES_PASSWORD
          valueFrom:
            secretKeyRef:
              key: POSTGRES_PASSWORD
              name: teable-secrets
        - name: PRISMA_DATABASE_URL
          valueFrom:
            secretKeyRef:
              key: PRISMA_DATABASE_URL
              name: teable-secrets
        - name: PUBLIC_ORIGIN
          value: "https://teable.placeholder.com"
        - name: PUBLIC_DATABASE_PROXY
          value: "127.0.0.1:42345"
        - name: BACKEND_MAIL_HOST
          value: "appmail.province-sud.nc"
        - name: BACKEND_MAIL_PORT
          value: "587"
        - name: BACKEND_MAIL_SECURE
          value: "false"
        - name: BACKEND_MAIL_SENDER
          value: "appli.teable@placeholder.com"
        - name: BACKEND_MAIL_SENDER_NAME
          value: "Teable"
        - name: BACKEND_MAIL_AUTH_USER
          value: "appli.teable"
        - name: BACKEND_MAIL_AUTH_PASS
          valueFrom:
            secretKeyRef:
              key: BACKEND_MAIL_AUTH_PASS
              name: teable-secrets
        - name: NEXT_ENV_IMAGES_ALL_REMOTE
          value: "true"
        - name: ENABLE_CSP
          value: "false"