cogentapps / chat-with-gpt

An open-source ChatGPT app with a voice
https://www.chatwithgpt.ai
MIT License
2.29k stars 485 forks source link

clipboard not working on docker selfhosted app #170

Open clacalderonc opened 11 months ago

clacalderonc commented 11 months ago

Hi Team,

When i use the self hosted version of the app, the clipboard button for chat content (or markdown code blocks) doesn't really work at all.

Self hosted: image

chatwithgpt.ai

image

i'm using the latest docker image available, tried on chrome, edge, firefox, same result, no errors on browser console.

Rergards. Claudio

cogentapps commented 11 months ago

Thanks for reporting this. Just to confirm, are you using the release branch of the docker image (docker pull ghcr.io/cogentapps/chat-with-gpt:release)?

clacalderonc commented 11 months ago

Thanks for reporting this. Just to confirm, are you using the release branch of the docker image (docker pull ghcr.io/cogentapps/chat-with-gpt:release)?

yes, using the release tag and just to be sure I recreated the environment several times, i made this small docker-compose to handle my env.


version: '3'
services:
  app:
    image: ghcr.io/cogentapps/chat-with-gpt:release
    ports:
      - 3000:3000
    volumes:
      - ./data:/app/data
cogentapps commented 11 months ago

Most likely because many browsers block copying on 'insecure' connections (no SSL) and the Docker command doesn't use SSL by default. We have experimental support for enabling this in ./data/config.yaml:

tls:
  selfSigned: true

but it’s currently untested and may not work. See discussion in #132 for another possible approach.

clacalderonc commented 11 months ago

Most likely because many browsers block copying on 'insecure' connections (no SSL) and the Docker command doesn't use SSL by default. We have experimental support for enabling this in ./data/config.yaml:

tls:
  selfSigned: true

but it’s currently untested and may not work. See discussion in #132 for another possible approach.

Great, I enabled that option and issued a letsencrypt certificate and is working now, I saw that the selfSigned option try to use a script that is not present on the image (generate-self-signed-certificate.sh).

Anyway, you can put cert.pem / key.pem files in data/ directory, plus the self signed option enabled and ssl it's working.