devlikeapro / waha

WAHA - WhatsApp HTTP API (REST API) that you can configure in a click! Two engines: chromium-based WEBJS and pure-websocket NOWEB
https://waha.devlike.pro/
Apache License 2.0
1.01k stars 306 forks source link

Cloudflare and HTTPS issue #432

Open masitings opened 4 months ago

masitings commented 4 months ago

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

elasti-co commented 4 months ago

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.

devlikepro commented 4 months ago

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 commented 4 months ago

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