From c3d295ac9560fc074606ecbf427ef21e38f1bfb5 Mon Sep 17 00:00:00 2001 From: AyoubSaa <104475632+AyoubSaa@users.noreply.github.com> Date: Sun, 12 Apr 2026 18:05:47 +0000 Subject: [PATCH] docs: Ajouter des guides de configuration pour APM, limitation de taux et console Super Admin --- .../monitoring/apm-and-error-monitoring.mdx | 54 +++++++++++++++++++ .../monitoring/rate-limiting.mdx | 38 +++++++++++++ .../monitoring/super-admin-sidekiq.mdx | 41 ++++++++++++++ .../apm-and-error-monitoring.mdx | 54 +++++++++++++++++++ self-hosted/monitoring copy/rate-limiting.mdx | 38 +++++++++++++ .../monitoring copy/super-admin-sidekiq.mdx | 41 ++++++++++++++ 6 files changed, 266 insertions(+) create mode 100644 self-hosted/configuration/monitoring/apm-and-error-monitoring.mdx create mode 100644 self-hosted/configuration/monitoring/rate-limiting.mdx create mode 100644 self-hosted/configuration/monitoring/super-admin-sidekiq.mdx create mode 100644 self-hosted/monitoring copy/apm-and-error-monitoring.mdx create mode 100644 self-hosted/monitoring copy/rate-limiting.mdx create mode 100644 self-hosted/monitoring copy/super-admin-sidekiq.mdx diff --git a/self-hosted/configuration/monitoring/apm-and-error-monitoring.mdx b/self-hosted/configuration/monitoring/apm-and-error-monitoring.mdx new file mode 100644 index 00000000..e56c43ac --- /dev/null +++ b/self-hosted/configuration/monitoring/apm-and-error-monitoring.mdx @@ -0,0 +1,54 @@ +--- +title: APM and Tracing +description: Configure APM and error monitoring tools for Chatwoot +sidebarTitle: APM and Tracing +--- + +Chatwoot supports various APM and monitoring tools. +You can enable them by configuring the given environment variables. + +## [Sentry](https://sentry.io/) + +Provide your `sentry dsn`. + +```bash +SENTRY_DSN= +``` + +## [Scout](https://scoutapm.com) +Provide values for the following environment variables. Refer [scout documentation](https://scoutapm.com/docs/ruby/configuration) for additional options. +```bash +## https://scoutapm.com/docs/ruby/configuration +# SCOUT_KEY=YOURKEY +# SCOUT_NAME=YOURAPPNAME (Production) +# SCOUT_MONITOR=true +``` + +## [NewRelic](https://newrelic.com/) +Enable Newrelic by configuring the license key. Refer [newrelic documentation](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/) for additional options. + +```bash +# https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/ +# NEW_RELIC_LICENSE_KEY= +``` + +## [DataDog](https://www.datadoghq.com/) + +Datadog requires an agent running on the host machine to which the tracing library can send data. Chatwoot ruby code contains the tracing library, but you need to configure the agent in your host machine/docker environment for the integration to work. + +Enable Datadog in chatwoot by configuring the `trace agent url`. + +```bash +## https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md#environment-variables +# DD_TRACE_AGENT_URL=http://localhost:8126 +``` + +### Running Datadog agent in local via docker +```bash +# to run in your local machine binding to port 8126 +# replace
and dd_site as required + +docker run -d --name dd-agent -v /var/run/docker.sock:/var/run/docker.sock:ro -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -p 8126:8126 -e DD_API_KEY=
-e DD_SITE="datadoghq.com" gcr.io/datadoghq/agent:7 +``` + +Refer Datadog documentation to install the agent in specific environments like [Ubuntu](https://docs.datadoghq.com/agent/basic_agent_usage/ubuntu/?tab=agentv6v7), [Docker](https://docs.datadoghq.com/agent/docker/?tab=standard), [kubernetes](https://docs.datadoghq.com/agent/kubernetes/?tab=helm) etc. \ No newline at end of file diff --git a/self-hosted/configuration/monitoring/rate-limiting.mdx b/self-hosted/configuration/monitoring/rate-limiting.mdx new file mode 100644 index 00000000..779a836e --- /dev/null +++ b/self-hosted/configuration/monitoring/rate-limiting.mdx @@ -0,0 +1,38 @@ +--- +title: Rate Limiting +description: Configure rate limiting to protect your Chatwoot installation from abuse +sidebarTitle: Rate Limiting +--- + +To protect the system from abusive requests, Chatwoot makes use of [`rack_attack`](https://github.com/rack/rack-attack) gem. +You could customize the configuration to suit your needs by updating, [`config/initializers/rack_attack.rb`](https://github.com/chatwoot/chatwoot/blob/develop/config/initializers/rack_attack.rb) + +## Default Rate Limits + +- Chatwoot will throttles requests by IP at `60rpm`, Unless the request is from an allowed IP `['127.0.0.1', '::1']` +- Signup Requests are limited by IP at `5 requests` per `5 minutes`. +- SignIn Requests are limited by IP at `5 requests` per `20 seconds`. +- SignIn Requests are limited by email address at `20 requests` per `5 minutes` for a specific email. +- Reset Password Requests are limited at `5 requests` per `1 hour` for a specific email. + +## Attachment Restrictions + +- `Contact/Inbox Avatar` attachment file types are limited to jpeg, gif and png. +- `Contact/Inbox Avatar` attachment file size is limited to 15MB. +- `Website Channel` message attachments are limited to types ['image/png', 'image/jpeg', 'image/gif', 'image/bmp', 'image/tiff', 'application/pdf', 'audio/mpeg', 'video/mp4', 'audio/ogg', 'text/csv'] +- `Website Channel` message attachments are limited to 40MB size limit. + +## Disabling Rack attack on your instance + +You can control the behaviour of rack attack in your instance via the following environment variables. + +```bash +## Rack Attack configuration +## To prevent and throttle abusive requests. +# Disable if you are getting too many request errors for custom use cases +# ENABLE_RACK_ATTACK=true +# Control the allowed number of requests +# RACK_ATTACK_LIMIT=300 +# Control whether you want to enable rack attack for widget APIs +# ENABLE_RACK_ATTACK_WIDGET_API=true +``` diff --git a/self-hosted/configuration/monitoring/super-admin-sidekiq.mdx b/self-hosted/configuration/monitoring/super-admin-sidekiq.mdx new file mode 100644 index 00000000..2d90fb0d --- /dev/null +++ b/self-hosted/configuration/monitoring/super-admin-sidekiq.mdx @@ -0,0 +1,41 @@ +--- +title: Super Admin Console +description: Guide to accessing and using the Super Admin Console and Sidekiq monitoring +sidebarTitle: Super Admin Console +--- + +You will need a user account with super admin privileges to access the super admin console and Sidekiq console. + + +The first user created during onboarding is a `super admin`. + + +## Access superadmin console + +- Access `/super_admin`. + +## Creating new super admins + +- Use the super admin console and navigate to the user's section +- Click on the new user button, fill in the details, and select the type to be `super admin` + +## Access Sidekiq via the super admin console + +- Access `/super_admin`. +- Authenticate using the admin credentials created during the installation. +- You can access the Sidekiq option on the sidebar. + +## Access Rails console + +Run the following command in your console from the root folder of your Chatwoot Rails app. + +```bash +RAILS_ENV=production bundle exec rails c +``` +If you have `cwctl`, use `cwctl --console`. + +- If you running Chatwoot in a Docker container, you would need to access the shell inside your container first. +- If you are running Chatwoot on Caprover, use the following command to access the command line. +```bash +docker exec -it $(docker ps --filter name=srv-captain--chatwoot-web -q) /bin/sh +``` \ No newline at end of file diff --git a/self-hosted/monitoring copy/apm-and-error-monitoring.mdx b/self-hosted/monitoring copy/apm-and-error-monitoring.mdx new file mode 100644 index 00000000..e56c43ac --- /dev/null +++ b/self-hosted/monitoring copy/apm-and-error-monitoring.mdx @@ -0,0 +1,54 @@ +--- +title: APM and Tracing +description: Configure APM and error monitoring tools for Chatwoot +sidebarTitle: APM and Tracing +--- + +Chatwoot supports various APM and monitoring tools. +You can enable them by configuring the given environment variables. + +## [Sentry](https://sentry.io/) + +Provide your `sentry dsn`. + +```bash +SENTRY_DSN= +``` + +## [Scout](https://scoutapm.com) +Provide values for the following environment variables. Refer [scout documentation](https://scoutapm.com/docs/ruby/configuration) for additional options. +```bash +## https://scoutapm.com/docs/ruby/configuration +# SCOUT_KEY=YOURKEY +# SCOUT_NAME=YOURAPPNAME (Production) +# SCOUT_MONITOR=true +``` + +## [NewRelic](https://newrelic.com/) +Enable Newrelic by configuring the license key. Refer [newrelic documentation](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/) for additional options. + +```bash +# https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/ +# NEW_RELIC_LICENSE_KEY= +``` + +## [DataDog](https://www.datadoghq.com/) + +Datadog requires an agent running on the host machine to which the tracing library can send data. Chatwoot ruby code contains the tracing library, but you need to configure the agent in your host machine/docker environment for the integration to work. + +Enable Datadog in chatwoot by configuring the `trace agent url`. + +```bash +## https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md#environment-variables +# DD_TRACE_AGENT_URL=http://localhost:8126 +``` + +### Running Datadog agent in local via docker +```bash +# to run in your local machine binding to port 8126 +# replace
and dd_site as required + +docker run -d --name dd-agent -v /var/run/docker.sock:/var/run/docker.sock:ro -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -p 8126:8126 -e DD_API_KEY=
-e DD_SITE="datadoghq.com" gcr.io/datadoghq/agent:7 +``` + +Refer Datadog documentation to install the agent in specific environments like [Ubuntu](https://docs.datadoghq.com/agent/basic_agent_usage/ubuntu/?tab=agentv6v7), [Docker](https://docs.datadoghq.com/agent/docker/?tab=standard), [kubernetes](https://docs.datadoghq.com/agent/kubernetes/?tab=helm) etc. \ No newline at end of file diff --git a/self-hosted/monitoring copy/rate-limiting.mdx b/self-hosted/monitoring copy/rate-limiting.mdx new file mode 100644 index 00000000..779a836e --- /dev/null +++ b/self-hosted/monitoring copy/rate-limiting.mdx @@ -0,0 +1,38 @@ +--- +title: Rate Limiting +description: Configure rate limiting to protect your Chatwoot installation from abuse +sidebarTitle: Rate Limiting +--- + +To protect the system from abusive requests, Chatwoot makes use of [`rack_attack`](https://github.com/rack/rack-attack) gem. +You could customize the configuration to suit your needs by updating, [`config/initializers/rack_attack.rb`](https://github.com/chatwoot/chatwoot/blob/develop/config/initializers/rack_attack.rb) + +## Default Rate Limits + +- Chatwoot will throttles requests by IP at `60rpm`, Unless the request is from an allowed IP `['127.0.0.1', '::1']` +- Signup Requests are limited by IP at `5 requests` per `5 minutes`. +- SignIn Requests are limited by IP at `5 requests` per `20 seconds`. +- SignIn Requests are limited by email address at `20 requests` per `5 minutes` for a specific email. +- Reset Password Requests are limited at `5 requests` per `1 hour` for a specific email. + +## Attachment Restrictions + +- `Contact/Inbox Avatar` attachment file types are limited to jpeg, gif and png. +- `Contact/Inbox Avatar` attachment file size is limited to 15MB. +- `Website Channel` message attachments are limited to types ['image/png', 'image/jpeg', 'image/gif', 'image/bmp', 'image/tiff', 'application/pdf', 'audio/mpeg', 'video/mp4', 'audio/ogg', 'text/csv'] +- `Website Channel` message attachments are limited to 40MB size limit. + +## Disabling Rack attack on your instance + +You can control the behaviour of rack attack in your instance via the following environment variables. + +```bash +## Rack Attack configuration +## To prevent and throttle abusive requests. +# Disable if you are getting too many request errors for custom use cases +# ENABLE_RACK_ATTACK=true +# Control the allowed number of requests +# RACK_ATTACK_LIMIT=300 +# Control whether you want to enable rack attack for widget APIs +# ENABLE_RACK_ATTACK_WIDGET_API=true +``` diff --git a/self-hosted/monitoring copy/super-admin-sidekiq.mdx b/self-hosted/monitoring copy/super-admin-sidekiq.mdx new file mode 100644 index 00000000..2d90fb0d --- /dev/null +++ b/self-hosted/monitoring copy/super-admin-sidekiq.mdx @@ -0,0 +1,41 @@ +--- +title: Super Admin Console +description: Guide to accessing and using the Super Admin Console and Sidekiq monitoring +sidebarTitle: Super Admin Console +--- + +You will need a user account with super admin privileges to access the super admin console and Sidekiq console. + + +The first user created during onboarding is a `super admin`. + + +## Access superadmin console + +- Access `/super_admin`. + +## Creating new super admins + +- Use the super admin console and navigate to the user's section +- Click on the new user button, fill in the details, and select the type to be `super admin` + +## Access Sidekiq via the super admin console + +- Access `/super_admin`. +- Authenticate using the admin credentials created during the installation. +- You can access the Sidekiq option on the sidebar. + +## Access Rails console + +Run the following command in your console from the root folder of your Chatwoot Rails app. + +```bash +RAILS_ENV=production bundle exec rails c +``` +If you have `cwctl`, use `cwctl --console`. + +- If you running Chatwoot in a Docker container, you would need to access the shell inside your container first. +- If you are running Chatwoot on Caprover, use the following command to access the command line. +```bash +docker exec -it $(docker ps --filter name=srv-captain--chatwoot-web -q) /bin/sh +``` \ No newline at end of file