https://www.youtube.com/watch?v=qzPRDt1zukM
Manual de Instalação Chatwoot
sudo apt update && apt upgrade -y
wget https://get.chatwoot.app/linux/install.sh
chmod +x install.sh
Inicie a instalação, digite "yes" para SSL, em seguida digite seu dominio e prossiga confimando com yes.
./install.sh --install
Use as opções abaixo
yes
app.dominio.com.br
yes para todos
nano /home/chatwoot/chatwoot/.env
Altere a linha:
DEFAULT_LOCALE=pt_BR
para ENABLE_ACCOUNT_SIGNUP=true
systemctl daemon-reload && systemctl restart chatwoot.target
Acesse: app.seudominio.com.br
Faça seu cadastro
sudo -i -u postgres psql
\c chatwoot_production
update installation_configs set locked = false;
\q
Instalando CodeChat
cd
sudo apt update && apt upgrade -y
git clone https://github.com/code-chat-br/whatsapp-api.git
cd whatsapp-api
cd src
```bash
mv dev-env.yml env.yml
nano env.yml
Altere Linha 72
URL: https://conector.site/webhook/codechat
Altere Linha 73
ENABLED: false
para
ENABLED: true
cd ..
```bash
npm i
npm run build
pm2 start 'npm run start' --name Codechat
sudo nano /etc/nginx/sites-available/codechat
server {
server_name codechat.dominio.com.br;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache_bypass $http_upgrade;
proxy_buffering off;
proxy_cache off;
}
}
sudo ln -s /etc/nginx/sites-available/codechat /etc/nginx/sites-enabled
sudo certbot --nginx
sudo service nginx restart
EXECUTE COMANDO ABAIXO PARA NÃO CAIR QUANDO REINICIAR A VPS
sudo pm2 startup ubuntu -u root && sudo pm2 startup ubuntu -u root --hp /root && sudo pm2 save
Instalando Integrador
cd
sudo apt update && apt upgrade -y
git clone https://github.com/w3nder/chatwoot-codechat
cd chatwoot-codechat
nano .env
PORT = 1234
CHATWOOT_ACCOUNT_ID = NUMEROCONTACHATWOOT
CHATWOOT_TOKEN = TOKENDOCHATWOOT
CHATWOOT_BASE_URL = https://chatwoot.seusite.com.br
CODECHAT_BASE_URL = https://codechat.seusite.com.br
CODECHAT_API_KEY = t8OOEeISKzpmc3jjcMqBWYSaJsafdefer
TOSIGN=true
IMPORT_MESSAGES_SENT=true
npm install pm2 -g
npm install
npm run build
pm2 start dist/app.js --name conector
sudo nano /etc/nginx/sites-available/conector
server {
server_name conector.dominio.com.br;
location / {
proxy_pass http://127.0.0.1:1234;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache_bypass $http_upgrade;
proxy_buffering off;
proxy_cache off;
}
}
sudo ln -s /etc/nginx/sites-available/conector /etc/nginx/sites-enabled
```bash
sudo certbot --nginx
sudo service nginx restart
EXECUTE COMANDO ABAIXO PARA NÃO CAIR QUANDO REINICIAR A VPS
sudo pm2 startup ubuntu -u root && sudo pm2 startup ubuntu -u root --hp /root && sudo pm2 save
Conectando Caixa de Entrada
WEBHOOK CHATWOOT:
Adicione essa url no seu Chatwoot
https://conector.site/webhook/chatwoot
Crie um contato chamado BOT
Adicione numero telefone ao mesmo
+123456
Chame contato BOT escreva
/iniciar