Saltar a contenido

Chatwoot

image-20210506104427925

¿Que es este repositorio?

Este repositorio te permitirá desplegar Chatwoot que es una alternativa a Intercom, Zendesk y Salesforce Service Cloud. Además de ayudar a garantizar una excelente experiencia del cliente, aumenta la productividad de su equipo de soporte y les proporciona datos procesables. Se integra con múltiples canales de conversación como el chat en vivo del sitio web, el correo electrónico, las páginas de Facebook, Twitter, WhatsApp, etc, todo desde un lugar centralizado.

Configuración

cd /root/containers
git clone https://github.com/HiveAgile/chatwoot.git
cd chatwoot

hiveagilectl install chatwoot

CHATWOOD_HOST=chat.hiveagile.dev


# Used to verify the integrity of signed cookies. so ensure a secure value is set
SECRET_KEY_BASE=Fk9Eyq9KdYaAqjPLKKS0diMNFTS5zxIE

# Replace with the URL you are planning to use for your app
FRONTEND_URL=https://{CHATWOOD_HOST}

# If the variable is set, all non-authenticated pages would fallback to the default locale.
# Whenever a new account is created, the default language will be DEFAULT_LOCALE instead of en
DEFAULT_LOCALE=es

# If you plan to use CDN for your assets, set Asset CDN Host
ASSET_CDN_HOST=

# Force all access to the app over SSL, default is set to false
FORCE_SSL=true

# This lets you control new sign ups on your chatwoot installation
# true : default option, allows sign ups
# false : disables all the end points related to sign ups
# api_only: disables the UI for signup, but you can create sign ups via the account apis
ENABLE_ACCOUNT_SIGNUP=false

# Redis config
REDIS_URL=redis://redis:6379
# If you are using docker-compose, set this variable's value to be any string,
# which will be the password for the redis service running inside the docker-compose
# to make it secure
REDIS_PASSWORD=
# Redis Sentinel can be used by passing list of sentinel host and ports e,g. sentinel_host1:port1,sentinel_host2:port2
REDIS_SENTINELS=
# Redis sentinel master name is required when using sentinel, default value is "mymaster".
# You can find list of master using "SENTINEL masters" command
REDIS_SENTINEL_MASTER_NAME=

# Redis premium breakage in heroku fix
# enable the following configuration
# ref: https://github.com/chatwoot/chatwoot/issues/2420
# REDIS_OPENSSL_VERIFY_MODE=none

# Postgres Database config variables
POSTGRES_HOST=postgres
POSTGRES_USERNAME=postgres
POSTGRES_PASSWORD=a7rE1TiBLCXUjWXj
POSTGRES_DB=chatwoot_production
RAILS_ENV=development
RAILS_MAX_THREADS=5

# The email from which all outgoing emails are sent
# could user either  `email@yourdomain.com` or `BrandName <email@yourdomain.com>`
MAILER_SENDER_EMAIL="Chatwoot <chat@hiveagile.club>"


#SMTP domain key is set up for HELO checking
SMTP_DOMAIN=chatwoot.com
# the default value is set "mailhog" and is used by docker-compose for development environments,
# Set the value as "localhost" or your SMTP address in other environments
SMTP_ADDRESS=mail.hiveagile.club
SMTP_PORT=587
SMTP_USERNAME=chat@hiveagile.club
SMTP_PASSWORD=hpLEySUFX4OaMESM
# plain,login,cram_md5
SMTP_AUTHENTICATION=cram_md5
SMTP_ENABLE_STARTTLS_AUTO=true
# Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert', see http://api.rubyonrails.org/classes/ActionMailer/Base.html
SMTP_OPENSSL_VERIFY_MODE=peer
# Comment out the following environment variables if required by your SMTP server
# SMTP_TLS=
# SMTP_SSL=

# Mail Incoming
# This is the domain set for the reply emails when conversation continuity is enabled
MAILER_INBOUND_EMAIL_DOMAIN=
# Set this to appropriate ingress channel with regards to incoming emails
# Possible values are :
# relay for Exim, Postfix, Qmail
# mailgun for Mailgun
# mandrill for Mandrill
# postmark for Postmark
# sendgrid for Sendgrid
RAILS_INBOUND_EMAIL_SERVICE=
# Use one of the following based on the email ingress service
# Ref: https://edgeguides.rubyonrails.org/action_mailbox_basics.html
RAILS_INBOUND_EMAIL_PASSWORD=
MAILGUN_INGRESS_SIGNING_KEY=
MANDRILL_INGRESS_API_KEY=

# Storage
ACTIVE_STORAGE_SERVICE=local

# Amazon S3
# documentation: https://www.chatwoot.com/docs/configuring-s3-bucket-as-cloud-storage
S3_BUCKET_NAME=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=


# Log settings
# Disable if you want to write logs to a file
RAILS_LOG_TO_STDOUT=true
LOG_LEVEL=info
LOG_SIZE=500

### This environment variables are only required if you are setting up social media channels

# Facebook
# documentation: https://www.chatwoot.com/docs/facebook-setup
FB_VERIFY_TOKEN=
FB_APP_SECRET=
FB_APP_ID=

# https://developers.facebook.com/docs/messenger-platform/instagram/get-started#app-dashboard
IG_VERIFY_TOKEN=

# Twitter
# documentation: https://www.chatwoot.com/docs/twitter-app-setup
TWITTER_APP_ID=
TWITTER_CONSUMER_KEY=
TWITTER_CONSUMER_SECRET=
TWITTER_ENVIRONMENT=

#slack integration
SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=

### Change this env variable only if you are using a custom build mobile app
## Mobile app env variables
IOS_APP_ID=L7YLMN4634.com.chatwoot.app
ANDROID_BUNDLE_ID=com.chatwoot.app

# https://developers.google.com/android/guides/client-auth (use keytool to print the fingerprint in the first section)
ANDROID_SHA256_CERT_FINGERPRINT=AC:73:8E:DE:EB:56:EA:CC:10:87:02:A7:65:37:7B:38:D4:5D:D4:53:F8:3B:FB:D3:C6:28:64:1D:AA:08:1E:D8


### Smart App Banner
# https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html
# You can find your app-id in https://itunesconnect.apple.com
#IOS_APP_IDENTIFIER=1495796682

## Push Notification
## generate a new key value here : https://d3v.one/vapid-key-generator/
# VAPID_PUBLIC_KEY=
# VAPID_PRIVATE_KEY=
#
# for mobile apps
# FCM_SERVER_KEY=

## Bot Customizations
USE_INBOX_AVATAR_FOR_BOT=true


### APM and Error Monitoring configurations
## Sentry
# SENTRY_DSN=

## Scout
## https://scoutapm.com/docs/ruby/configuration
# SCOUT_KEY=YOURKEY
# SCOUT_NAME=YOURAPPNAME (Production)
# SCOUT_MONITOR=true

## NewRelic
# https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/
# NEW_RELIC_LICENSE_KEY=

## Datadog
## https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md#environment-variables
# DD_TRACE_AGENT_URL=



## IP look up configuration
## ref https://github.com/alexreisner/geocoder/blob/master/README_API_GUIDE.md
## works only on accounts with ip look up feature enabled
# IP_LOOKUP_SERVICE=geoip2
# maxmindb api key to use geoip2 service
# IP_LOOKUP_API_KEY=

## Rack Attack configuration
## To prevent and throttle abusive requests
# ENABLE_RACK_ATTACK=true


## Running chatwoot as an API only server
## setting this value to true will disable the frontend dashboard endpoints
# CW_API_ONLY_SERVER=false

## Development Only Config
# if you want to use letter_opener for local emails
# LETTER_OPENER=true
# meant to be used in github codespaces
# WEBPACKER_DEV_SERVER_PUBLIC=

# If you want to use official mobile app,
# the notifications would be relayed via a Chatwoot server
ENABLE_PUSH_RELAY_SERVER=true

Hay un montón de variables pero hay muchas que no hace falta que las cambies, te voy a indicar las variables principales a modificar.

CHATWOOD_HOST

Está variable indica el subdominio donde estará funcionando Chatwood, recuerda apuntar previamente el registro DNS de tipo A para que te funcione.

MAILER_SENDER_EMAIL

Esta variable define el nombre del sender que usara para envíar los correos electrónicos

#SMTP domain key is set up for HELO checking

Busca esta parte en la configuración es el lugar donde debes configurar el correo electrónico.

# Mail Incoming

En esta sección puedes configurar el correo de entrada

# Amazon S3

Está sección es para la configuración del storage en Amazon S3 para que se guarden los adjuntos directamente allí

documentation: https://www.chatwoot.com/docs/configuring-s3-bucket-as-cloud-storage

# Facebook

Documentación: https://www.chatwoot.com/docs/facebook-setup

FB_VERIFY_TOKEN=
FB_APP_SECRET=
FB_APP_ID=

Instagram

Documentación: https://developers.facebook.com/docs/messenger-platform/instagram/get-started#app-dashboard

IG_VERIFY_TOKEN=

# Twitter

Documentación: https://www.chatwoot.com/docs/twitter-app-setup

TWITTER_APP_ID=
TWITTER_CONSUMER_KEY=
TWITTER_CONSUMER_SECRET=
TWITTER_ENVIRONMENT=

#slack integration

SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=

USO

Una vez editado el fichero .env puesdes ejecutar el contenedor como normalmente.

cd /root/containers/chatwoot
docker-compose up -d
make prepare

Con esto ya tenemos inicial funcionando, ya acceder desde el dominio que definiste en CHATWOOD_HOST

Configurar en HestiaCP

Una vez tengas ya configurado el virtualhost con el docker-proxy activado puedes ejecutar el siguiente comando para que te funcione.

``` cd /root/containers/chatwoot bash hestia_config.sh

Al ejecutar este comando añadira un parametro necesario para que funcione cuando esta nginx como reverseproxy.


### Actualizar versión

Para actualizar la versión de chatwoot debes ejecutar los siguientes comandos.
Es muy importante el ultimo comando ya que actualiza la base de datos.

cd /root/containers/chatwoot docker-compose down docker-compose pull docker-compose up -d make prepare



## Actualizaciones automáticas (Opcional)

Puedes usar watchtower que actualiza todos los contenedores que estan como latest

Esto es algo que pongo en todas las aplicaciones pero no hace falta que se instale cada vez.

docker run -d \ --name watchtower \ -v /var/run/docker.sock:/var/run/docker.sock \ containrrr/watchtower -i 30 ```

Invitación a mi Canal.

Estás invitado a mi canal de telegram, donde publico más soluciones como esta.

Telegram-iconhttps://t.me/aitorroma


ko-fi