From 3721c651d6320d1cee058b7ea55c191398a894f9 Mon Sep 17 00:00:00 2001 From: xpayserver <67416048+xpayserver@users.noreply.github.com> Date: Mon, 4 Oct 2021 08:52:53 +0200 Subject: [PATCH] Add chatwoot support system (#353) Co-authored-by: Andrew Camilleri --- .gitignore | 1 + README.md | 1 + btcpay-setup.sh | 2 + .../docker-fragments/opt-add-chatwoot.yml | 70 +++++++++++++++++++ docs/chatwoot.md | 32 +++++++++ helpers.sh | 1 + 6 files changed, 107 insertions(+) create mode 100644 docker-compose-generator/docker-fragments/opt-add-chatwoot.yml create mode 100644 docs/chatwoot.md diff --git a/.gitignore b/.gitignore index 1e8d83c..edec872 100644 --- a/.gitignore +++ b/.gitignore @@ -299,6 +299,7 @@ Production/.env Generated/acme.json Generated/traefik_logs/ +Generated/chatwoot_config.env Generated/error diff --git a/README.md b/README.md index 786ed34..97e0477 100644 --- a/README.md +++ b/README.md @@ -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)) diff --git a/btcpay-setup.sh b/btcpay-setup.sh index 10198e5..24db2be 100755 --- a/btcpay-setup.sh +++ b/btcpay-setup.sh @@ -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 diff --git a/docker-compose-generator/docker-fragments/opt-add-chatwoot.yml b/docker-compose-generator/docker-fragments/opt-add-chatwoot.yml new file mode 100644 index 0000000..025abed --- /dev/null +++ b/docker-compose-generator/docker-fragments/opt-add-chatwoot.yml @@ -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:-} + 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: \ No newline at end of file diff --git a/docs/chatwoot.md b/docs/chatwoot.md new file mode 100644 index 0000000..370634d --- /dev/null +++ b/docs/chatwoot.md @@ -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 <