Skip to content

Commit 3092e95

Browse files
Add. Chatwoot and instuctions.
1 parent 31e4c74 commit 3092e95

File tree

4 files changed

+345
-1
lines changed

4 files changed

+345
-1
lines changed

Applications/chatwoot/.env

Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
# Learn about the various environment variables at
2+
# https://www.chatwoot.com/docs/self-hosted/configuration/environment-variables/#rails-production-variables
3+
4+
# Used to verify the integrity of signed cookies. so ensure a secure value is set
5+
# SECRET_KEY_BASE should be alphanumeric. Avoid special characters or symbols.
6+
# Use `rake secret` to generate this variable
7+
SECRET_KEY_BASE=
8+
9+
10+
# Replace with the URL you are planning to use for your app
11+
FRONTEND_URL=https://chatwoot.yourdomain.com
12+
# To use a dedicated URL for help center pages
13+
# HELPCENTER_URL=http://0.0.0.0:3000
14+
15+
# If the variable is set, all non-authenticated pages would fallback to the default locale.
16+
# Whenever a new account is created, the default language will be DEFAULT_LOCALE instead of en
17+
DEFAULT_LOCALE=pt_BR
18+
19+
# If you plan to use CDN for your assets, set Asset CDN Host
20+
ASSET_CDN_HOST=
21+
22+
# Force all access to the app over SSL, default is set to false
23+
FORCE_SSL=true
24+
25+
# This lets you control new sign ups on your chatwoot installation
26+
# true : default option, allows sign ups
27+
# false : disables all the end points related to sign ups
28+
# api_only: disables the UI for signup, but you can create sign ups via the account apis
29+
ENABLE_ACCOUNT_SIGNUP=false
30+
31+
# Redis config
32+
# specify the configs via single URL or individual variables
33+
# ref: https://www.iana.org/assignments/uri-schemes/prov/redis
34+
# You can also use the following format for the URL: redis://:password@host:port/db_number
35+
REDIS_URL=redis://redis:6379
36+
# If you are using docker-compose, set this variable's value to be any string,
37+
# which will be the password for the redis service running inside the docker-compose
38+
# to make it secure
39+
REDIS_PASSWORD=yourpassredis
40+
# Redis Sentinel can be used by passing list of sentinel host and ports e,g. sentinel_host1:port1,sentinel_host2:port2
41+
REDIS_SENTINELS=
42+
# Redis sentinel master name is required when using sentinel, default value is "mymaster".
43+
# You can find list of master using "SENTINEL masters" command
44+
REDIS_SENTINEL_MASTER_NAME=
45+
46+
# By default Chatwoot will pass REDIS_PASSWORD as the password value for sentinels
47+
# Use the following environment variable to customize passwords for sentinels.
48+
# Use empty string if sentinels are configured with out passwords
49+
# REDIS_SENTINEL_PASSWORD=
50+
51+
# Redis premium breakage in heroku fix
52+
# enable the following configuration
53+
# ref: https://github.com/chatwoot/chatwoot/issues/2420
54+
# REDIS_OPENSSL_VERIFY_MODE=none
55+
56+
# Postgres Database config variables
57+
# You can leave POSTGRES_DATABASE blank. The default name of
58+
# the database in the production environment is chatwoot_production
59+
# POSTGRES_DATABASE=
60+
POSTGRES_HOST=postgres
61+
POSTGRES_USERNAME=administrator
62+
POSTGRES_PASSWORD=yourpassword
63+
RAILS_ENV=production
64+
# Changes the Postgres query timeout limit. The default is 14 seconds. Modify only when required.
65+
# POSTGRES_STATEMENT_TIMEOUT=14s
66+
RAILS_MAX_THREADS=5
67+
68+
# The email from which all outgoing emails are sent
69+
# could user either `email@yourdomain.com` or `BrandName <email@yourdomain.com>`
70+
MAILER_SENDER_EMAIL=Chatwoot <accounts@chatwoot.com>
71+
72+
#SMTP domain key is set up for HELO checking
73+
SMTP_DOMAIN=chatwoot.com
74+
# Set the value to "mailhog" if using docker-compose for development environments,
75+
# Set the value as "localhost" or your SMTP address in other environments
76+
# If SMTP_ADDRESS is empty, Chatwoot would try to use sendmail(postfix)
77+
SMTP_ADDRESS=
78+
SMTP_PORT=1025
79+
SMTP_USERNAME=
80+
SMTP_PASSWORD=
81+
# plain,login,cram_md5
82+
SMTP_AUTHENTICATION=
83+
SMTP_ENABLE_STARTTLS_AUTO=true
84+
# Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert', see http://api.rubyonrails.org/classes/ActionMailer/Base.html
85+
SMTP_OPENSSL_VERIFY_MODE=peer
86+
# Comment out the following environment variables if required by your SMTP server
87+
# SMTP_TLS=
88+
# SMTP_SSL=
89+
# SMTP_OPEN_TIMEOUT
90+
# SMTP_READ_TIMEOUT
91+
92+
# Mail Incoming
93+
# This is the domain set for the reply emails when conversation continuity is enabled
94+
MAILER_INBOUND_EMAIL_DOMAIN=
95+
# Set this to the appropriate ingress channel with regards to incoming emails
96+
# Possible values are :
97+
# relay for Exim, Postfix, Qmail
98+
# mailgun for Mailgun
99+
# mandrill for Mandrill
100+
# postmark for Postmark
101+
# sendgrid for Sendgrid
102+
RAILS_INBOUND_EMAIL_SERVICE=
103+
# Use one of the following based on the email ingress service
104+
# Ref: https://edgeguides.rubyonrails.org/action_mailbox_basics.html
105+
# Set this to a password of your choice and use it in the Inbound webhook
106+
RAILS_INBOUND_EMAIL_PASSWORD=
107+
108+
MAILGUN_INGRESS_SIGNING_KEY=
109+
MANDRILL_INGRESS_API_KEY=
110+
111+
# Creating Your Inbound Webhook Instructions for Postmark and Sendgrid:
112+
# Inbound webhook URL format:
113+
# https://actionmailbox:[YOUR_RAILS_INBOUND_EMAIL_PASSWORD]@[YOUR_CHATWOOT_DOMAIN.COM]/rails/action_mailbox/[RAILS_INBOUND_EMAIL_SERVICE]/inbound_emails
114+
# Note: Replace the values inside the brackets; do not include the brackets themselves.
115+
# Example: https://actionmailbox:mYRandomPassword3@chatwoot.example.com/rails/action_mailbox/postmark/inbound_emails
116+
# For Postmark
117+
# Ensure the 'Include raw email content in JSON payload' checkbox is selected in the inbound webhook section.
118+
119+
# Storage
120+
ACTIVE_STORAGE_SERVICE=local
121+
122+
# Amazon S3
123+
# documentation: https://www.chatwoot.com/docs/configuring-s3-bucket-as-cloud-storage
124+
S3_BUCKET_NAME=
125+
AWS_ACCESS_KEY_ID=
126+
AWS_SECRET_ACCESS_KEY=
127+
AWS_REGION=
128+
129+
# Log settings
130+
# Disable if you want to write logs to a file
131+
RAILS_LOG_TO_STDOUT=true
132+
LOG_LEVEL=info
133+
LOG_SIZE=500
134+
# Configure this environment variable if you want to use lograge instead of rails logger
135+
#LOGRAGE_ENABLED=true
136+
137+
### This environment variables are only required if you are setting up social media channels
138+
139+
# Facebook
140+
# documentation: https://www.chatwoot.com/docs/facebook-setup
141+
FB_VERIFY_TOKEN=
142+
FB_APP_SECRET=
143+
FB_APP_ID=
144+
145+
# https://developers.facebook.com/docs/messenger-platform/instagram/get-started#app-dashboard
146+
IG_VERIFY_TOKEN=
147+
148+
# Twitter
149+
# documentation: https://www.chatwoot.com/docs/twitter-app-setup
150+
TWITTER_APP_ID=
151+
TWITTER_CONSUMER_KEY=
152+
TWITTER_CONSUMER_SECRET=
153+
TWITTER_ENVIRONMENT=
154+
155+
#slack integration
156+
SLACK_CLIENT_ID=
157+
SLACK_CLIENT_SECRET=
158+
159+
# Google OAuth
160+
GOOGLE_OAUTH_CLIENT_ID=
161+
GOOGLE_OAUTH_CLIENT_SECRET=
162+
GOOGLE_OAUTH_CALLBACK_URL=
163+
164+
### Change this env variable only if you are using a custom build mobile app
165+
## Mobile app env variables
166+
IOS_APP_ID=L7YLMN4634.com.chatwoot.app
167+
ANDROID_BUNDLE_ID=com.chatwoot.app
168+
169+
# https://developers.google.com/android/guides/client-auth (use keytool to print the fingerprint in the first section)
170+
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
171+
172+
### Smart App Banner
173+
# https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html
174+
# You can find your app-id in https://itunesconnect.apple.com
175+
#IOS_APP_IDENTIFIER=1495796682
176+
177+
## Push Notification
178+
## generate a new key value here : https://d3v.one/vapid-key-generator/
179+
# VAPID_PUBLIC_KEY=
180+
# VAPID_PRIVATE_KEY=
181+
#
182+
# for mobile apps
183+
# FCM_SERVER_KEY=
184+
185+
### APM and Error Monitoring configurations
186+
## Elastic APM
187+
## https://www.elastic.co/guide/en/apm/agent/ruby/current/getting-started-rails.html
188+
# ELASTIC_APM_SERVER_URL=
189+
# ELASTIC_APM_SECRET_TOKEN=
190+
191+
## Sentry
192+
# SENTRY_DSN=
193+
194+
195+
## Scout
196+
## https://scoutapm.com/docs/ruby/configuration
197+
# SCOUT_KEY=YOURKEY
198+
# SCOUT_NAME=YOURAPPNAME (Production)
199+
# SCOUT_MONITOR=true
200+
201+
## NewRelic
202+
# https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/
203+
# NEW_RELIC_LICENSE_KEY=
204+
# Set this to true to allow newrelic apm to send logs.
205+
# This is turned off by default.
206+
# NEW_RELIC_APPLICATION_LOGGING_ENABLED=
207+
208+
## Datadog
209+
## https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md#environment-variables
210+
# DD_TRACE_AGENT_URL=
211+
212+
# MaxMindDB API key to download GeoLite2 City database
213+
# IP_LOOKUP_API_KEY=
214+
215+
## Rack Attack configuration
216+
## To prevent and throttle abusive requests
217+
# ENABLE_RACK_ATTACK=true
218+
# RACK_ATTACK_LIMIT=300
219+
# ENABLE_RACK_ATTACK_WIDGET_API=true
220+
221+
## Running chatwoot as an API only server
222+
## setting this value to true will disable the frontend dashboard endpoints
223+
# CW_API_ONLY_SERVER=false
224+
225+
## Development Only Config
226+
# if you want to use letter_opener for local emails
227+
# LETTER_OPENER=true
228+
# meant to be used in github codespaces
229+
# WEBPACKER_DEV_SERVER_PUBLIC=
230+
231+
# If you want to use official mobile app,
232+
# the notifications would be relayed via a Chatwoot server
233+
ENABLE_PUSH_RELAY_SERVER=true
234+
235+
# Stripe API key
236+
STRIPE_SECRET_KEY=
237+
STRIPE_WEBHOOK_SECRET=
238+
239+
# Set to true if you want to upload files to cloud storage using the signed url
240+
# Make sure to follow https://edgeguides.rubyonrails.org/active_storage_overview.html#cross-origin-resource-sharing-cors-configuration on the cloud storage after setting this to true.
241+
DIRECT_UPLOADS_ENABLED=
242+
243+
#MS OAUTH creds
244+
AZURE_APP_ID=
245+
AZURE_APP_SECRET=
246+
247+
## Advanced configurations
248+
## Change these values to fine tune performance
249+
# control the concurrency setting of sidekiq
250+
# SIDEKIQ_CONCURRENCY=10
251+
252+
253+
# AI powered features
254+
## OpenAI key
255+
# OPENAI_API_KEY=
256+
257+
# Housekeeping/Performance related configurations
258+
# Set to true if you want to remove stale contact inboxes
259+
# contact_inboxes with no conversation older than 90 days will be removed
260+
# REMOVE_STALE_CONTACT_INBOX_JOB_STATUS=false
261+
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
networks:
2+
applications:
3+
external: true
4+
name: applications
5+
databases:
6+
external: true
7+
name: databases
8+
production:
9+
external: true
10+
name: production
11+
services:
12+
rails:
13+
image: chatwoot/chatwoot:latest
14+
container_name: rails
15+
env_file: .env
16+
volumes:
17+
- /data/storage:/app/storage
18+
entrypoint: docker/entrypoints/rails.sh
19+
command: ["bundle", "exec", "rails", "s", "-p", "3000", "-b", "0.0.0.0"]
20+
restart: always
21+
ports:
22+
- "3000:3000"
23+
environment:
24+
- NODE_ENV=production
25+
- RAILS_ENV=production
26+
- INSTALLATION_ENV=docker
27+
networks:
28+
- applications
29+
- databases
30+
- production
31+
labels:
32+
- "traefik.enable=true"
33+
- "traefik.http.routers.chatwoot.rule=Host(`chatwoot.yourdomain.com`)"
34+
- "traefik.http.routers.chatwoot.entrypoints=websecure"
35+
- "traefik.http.services.chatwoot.loadbalancer.server.port=3000"
36+
- "traefik.docker.network=production"
37+
38+
sidekiq:
39+
image: chatwoot/chatwoot:latest
40+
container_name: sidekiq
41+
env_file: .env
42+
volumes:
43+
- /data/storage:/app/storage
44+
command: ["bundle", "exec", "sidekiq", "-C", "config/sidekiq.yml"]
45+
restart: always
46+
environment:
47+
- NODE_ENV=production
48+
- RAILS_ENV=production
49+
- INSTALLATION_ENV=docker
50+
networks:
51+
- applications
52+
- databases
53+
- production

Applications/chatwoot/readme.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
3+
Para Obter a Key do Chatwoot execute:
4+
5+
```bash
6+
docker exec -it rails bundle exec rails secret
7+
```
8+
9+
Isso imprimirá no terminal uma chave como:
10+
11+
```bash
12+
3ad45296452d56050430d92c87927205ac90bc378caf840b653f82642b55f07a75014466f099b65cb0460777aba31dbfd9a6aae50225675bbf01261952f5c50b
13+
```
14+
15+
Basta copiar e colar no .env da sua instalação como:
16+
17+
```bash
18+
SECRET_KEY_BASE=3ad45296... (restante da chave)
19+
```
20+
21+
---
22+
23+
Para rodar as migrations no banco de dados do Chatwoot (em produção com Docker), use o comando abaixo dentro do container rails
24+
25+
```bash
26+
docker exec -it rails bundle exec rails db:migrate RAILS_ENV=production
27+
```
28+
29+
💡 Certifique-se de que o banco esteja acessível (PostgreSQL no container postgres) e que as variáveis .env estejam corretamente configuradas.
30+

Databases/postgresql/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ volumes:
1313

1414
services:
1515
postgres:
16-
image: postgres:latest
16+
image: ankane/pgvector
1717
container_name: postgres
1818
restart: unless-stopped
1919
env_file:

0 commit comments

Comments
 (0)