waha icon indicating copy to clipboard operation
waha copied to clipboard

Cloudflare and HTTPS issue

Open masitings opened this issue 1 year ago • 3 comments

First of all, you guys are awesome! This is the one i've been looking for a whole year.

I saw there are configuration to setup using a domain and there's env variables to use SSL and Cert path there. But i just wondering how can i put the domain with SSL from cloudflare without enabling it in configuration, should i stick to disable WAHA_HTTPS_ENABLED . This is the configuration file i used.

docker run -it -e "WHATSAPP_DEFAULT_ENGINE=NOWEB" -e "WHATSAPP_SWAGGER_USERNAME=<username>" -e "WHATSAPP_SWAGGER_PASSWORD=<password>" -e "WHATSAPP_DASHBOARD_USERNAME=<username>" -e "WHATSAPP_DASHBOARD_PASSWORD=<password>" -e "WHATSAPP_API_KEY=<keys>" -e "WHATSAPP_HOOK_URL=<hooks>" -e "DOMAIN=<domain>" -e "WAHA_HTTPS_ENABLED=true" -e "WAHA_HTTPS_PATH_KEY=/etc/letsencrypt/live/<domain>/privkey.pem" -e "WAHA_HTTPS_PATH_CERT=/etc/letsencrypt/live/<domain>/cert.pem" -e "WAHA_HTTPS_PATH_CA=/etc/letsencrypt/live/<domain>/chain.pem" -e "WHATSAPP_API_HOSTNAME=<domain>" -p 3000:3000/tcp devlikeapro/waha-plus

When running this command, it gives me error something like this.

image

Do you guys have any idea how to solve this, should i stick using the SSL from server or switch using cldouflare instead.

Thank you in advance!

patron:PLUS

masitings avatar Jul 11 '24 16:07 masitings

Tonight Cloudflare + WAHA (without https) just stopped working :( I use Ploi to provision SSL via Let's Encrypt

patron:PLUS

UPD: The problem was with Swagger. When it's switched off the error stops the container and restarts it over and over.

elasti-co avatar Jul 12 '24 07:07 elasti-co

When it's switched off the error stops the container

@elasti-co probably cloudflare check upstream by requesting / resourse for the server or the container management tool does it Consider configuring /api/version instead for simple healtchecks

If not - could you show the errors from the docker logs?

patron:PRO

devlikepro avatar Jul 12 '24 12:07 devlikepro

Do you guys have any idea how to solve this, should i stick using the SSL from server or switch using cldouflare instead.

@masitings we suggest using cloudflare instead, so just remove all HTTPS related configurtaion from the command and put API behind cloudflare :+1: The software should do a single thing good, so TLS termination should be done by a service specialized for this (like nginx or cloudflare or any other cloud solutions)

patron:PRO

devlikepro avatar Jul 12 '24 12:07 devlikepro