Add chatwoot support system (#353)

Co-authored-by: Andrew Camilleri <kukks@btcpayserver.org>
This commit is contained in:
xpayserver 2021-10-04 08:52:53 +02:00 committed by GitHub
parent 4df7243b4d
commit 3721c651d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 107 additions and 0 deletions

1
.gitignore vendored
View File

@ -299,6 +299,7 @@ Production/.env
Generated/acme.json
Generated/traefik_logs/
Generated/chatwoot_config.env
Generated/error

View File

@ -180,6 +180,7 @@ Available `BTCPAYGEN_ADDITIONAL_FRAGMENTS` currently are:
* [opt-add-tallycoin-connect](docker-compose-generator/docker-fragments/opt-add-tallycoin-connect.yml) for [Tallycoin Connect](https://github.com/djbooth007/tallycoin_connect). Maintained by [dennisreimann](https://github.com/dennisreimann).
* [opt-add-thunderhub](docker-compose-generator/docker-fragments/opt-add-thunderhub.yml) for a LND Lightning Node Manager in your Browser. Maintained by [apotdevin](https://github.com/apotdevin).
* [opt-add-teos](docker-compose-generator/docker-fragments/opt-add-teos.yml) for [The Eye Of Satoshi](https://github.com/talaia-labs/python-teos), a BOLT13 Lightning Watchtower. Use port 9814 on your server or Tor to connect.
* [opt-add-chatwoot](docker-compose-generator/docker-fragments/opt-add-chatwoot.yml) for open source chat support system. ([See the documentation](docs/chatwoot.md))
* [opt-add-zammad](docker-compose-generator/docker-fragments/opt-add-zammad.yml) for [Zammad](https://zammad.com/features), a web based open source helpdesk/customer support system with many features to manage customer communication via several channels like telephone, facebook, twitter, chat and e-mails
* [opt-monero-expose](docker-compose-generator/docker-fragments/opt-monero-expose.yml) to expose monero node's RPC port at 127.0.0.1:18081 to connect your own wallet. Use f.e. ssh port forwarding to forward to your own computer.
* [opt-add-fireflyiii](docker-compose-generator/docker-fragments/opt-add-fireflyiii.yml) ([See the documentation](docs/fireflyiii.md))

View File

@ -107,6 +107,7 @@ Add-on specific variables:
BTCTRANSMUTER_HOST: If btc transmuter is activated with opt-add-btctransmuter, the hostname of your btc transmuter website (eg. store.example.com)
TOR_RELAY_NICKNAME: If tor relay is activated with opt-add-tor-relay, the relay nickname
TOR_RELAY_EMAIL: If tor relay is activated with opt-add-tor-relay, the email for Tor to contact you regarding your relay
CHATWOOT_HOST: If chatwoot is activated with opt-add-chatwoot, the hostname of your chatwoot website (eg. store.example.com)
FIREFLY_HOST: If fireflyiii is activated with opt-add-fireflyiii, the hostname of your libre patron website (eg. firefly.example.com)
END
}
@ -287,6 +288,7 @@ LIBREPATRON_HOST:$LIBREPATRON_HOST
ZAMMAD_HOST:$ZAMMAD_HOST
WOOCOMMERCE_HOST:$WOOCOMMERCE_HOST
BTCTRANSMUTER_HOST:$BTCTRANSMUTER_HOST
CHATWOOT_HOST:$CHATWOOT_HOST
BTCPAY_ENABLE_SSH:$BTCPAY_ENABLE_SSH
BTCPAY_HOST_SSHKEYFILE:$BTCPAY_HOST_SSHKEYFILE
LETSENCRYPT_EMAIL:$LETSENCRYPT_EMAIL

View File

@ -0,0 +1,70 @@
version: "3"
services:
chatwoot:
image: chatwoot/chatwoot:v1.7.0
restart: unless-stopped
container_name: chatwoot
env_file: chatwoot-config.env
environment:
FRONTEND_URL: ${BTCPAY_PROTOCOL:-https}://${CHATWOOT_HOST}
FORCE_SSL: "true"
REDIS_URL: redis://redis:6379
POSTGRES_HOST: postgres
POSTGRES_USERNAME: postgres
RAILS_ENV: production
NODE_ENV: production
RAILS_MAX_THREADS: 5
REDIS_PASSWORD: ""
RAILS_LOG_TO_STDOUT: "true"
LOG_LEVEL: info
LOG_SIZE: 500
IOS_APP_ID: 6C953F3RX2.com.chatwoot.app
LETSENCRYPT_HOST: ${CHATWOOT_HOST}
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL:-<no value>}
VIRTUAL_HOST: ${CHATWOOT_HOST}
VIRTUAL_HOST_NAME: "chatwoot"
VIRTUAL_PORT: 3000
expose:
- "3000"
depends_on:
- postgres
- redis
entrypoint: docker/entrypoints/rails.sh
command: "bundle exec rails s -p 3000 -b 0.0.0.0"
chatwoot_sidekiq:
image: chatwoot/chatwoot:v1.7.0
restart: unless-stopped
env_file: chatwoot-config.env
environment:
FRONTEND_URL: ${BTCPAY_PROTOCOL:-https}://${CHATWOOT_HOST}
FORCE_SSL: "true"
REDIS_URL: redis://redis:6379
POSTGRES_HOST: postgres
POSTGRES_USERNAME: postgres
RAILS_ENV: production
NODE_ENV: production
RAILS_MAX_THREADS: 5
REDIS_PASSWORD: ""
RAILS_LOG_TO_STDOUT: "true"
LOG_LEVEL: info
LOG_SIZE: 500
IOS_APP_ID: 6C953F3RX2.com.chatwoot.app
depends_on:
- postgres
- redis
command: "bundle exec sidekiq -C config/sidekiq.yml"
redis:
image: redis:5.0.2-alpine
restart: unless-stopped
expose:
- "6379"
volumes:
- "redis_datadir:/data"
btcpayserver:
environment:
BTCPAY_EXTERNALSERVICES: "Chatwoot:${BTCPAY_PROTOCOL:-https}://${CHATWOOT_HOST};"
volumes:
redis_datadir:

32
docs/chatwoot.md Normal file
View File

@ -0,0 +1,32 @@
# Chatwoot support
[Chatwoot](https://www.chatwoot.com/) is a customer support tool for instant messaging channels which can help businesses provide exceptional customer support.
## How to use
1. Connect as root to your server
2. create chatwoot configuration file where `{CONFIG DATA HERE}` is replaced by settings from [here](https://www.chatwoot.com/docs/environment-variables)
```bash
sudo su -
cd btcpayserver-docker
cat >> Generated/chatwoot-config.env <<EOL
{CONFIG DATA HERE}
{CONFIG DATA HERE}
EOL
```
3. Add chatwoot as an option to your BTCPay deployment and set the host to use (point DNS to server as well)
```bash
CHATWOOT_HOST="chatwoot.xpayserver.com"
BTCPAYGEN_ADDITIONAL_FRAGMENTS="$BTCPAYGEN_ADDITIONAL_FRAGMENTS;opt-add-chatwoot"
. btcpay-setup.sh -i
```
4. Wait for BTPay to be online and then create the database for chatwoot
```bash
docker exec -ti chatwoot sh -c "export DISABLE_DATABASE_ENVIRONMENT_CHECK=1 && bundle exec rails db:reset"
```
4. Go to chatwoot website at https://chatwoot.xpayserver.com and set up.

View File

@ -101,6 +101,7 @@ BTCPAY_HOST_SSHAUTHORIZEDKEYS=$BTCPAY_HOST_SSHAUTHORIZEDKEYS
LIBREPATRON_HOST=$LIBREPATRON_HOST
ZAMMAD_HOST=$ZAMMAD_HOST
BTCTRANSMUTER_HOST=$BTCTRANSMUTER_HOST
CHATWOOT_HOST=$CHATWOOT_HOST
BTCPAY_CRYPTOS=$BTCPAY_CRYPTOS
WOOCOMMERCE_HOST=$WOOCOMMERCE_HOST
TOR_RELAY_NICKNAME=$TOR_RELAY_NICKNAME