Skip to content

Commit a920a2b

Browse files
committed
feat(v2.3.3): chatwoot-br customs
1 parent d48fbc3 commit a920a2b

53 files changed

Lines changed: 13950 additions & 15152 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.DS_Store

-6 KB
Binary file not shown.

.devcontainer/devcontainer.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
3+
{
4+
"name": "Node.js & TypeScript",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
7+
"features": {
8+
"ghcr.io/itsmechlark/features/postgresql:1": {},
9+
"ghcr.io/itsmechlark/features/redis-server:1": {}
10+
},
11+
12+
// Features to add to the dev container. More info: https://containers.dev/features.
13+
// "features": {},
14+
15+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
16+
// "forwardPorts": [],
17+
18+
// Use 'postCreateCommand' to run commands after the container is created.
19+
"postCreateCommand": "sudo corepack enable pnpm yarn && corepack prepare pnpm@latest --activate && corepack prepare yarn@stable --activate",
20+
21+
// Configure tool-specific properties.
22+
"customizations": {
23+
"vscode": {
24+
"extensions": [
25+
"bradlc.vscode-tailwindcss",
26+
"ms-vscode.vscode-typescript-next"
27+
]
28+
}
29+
}
30+
31+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
32+
// "remoteUser": "root"
33+
}

.env.example

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ DEL_INSTANCE=false
5252

5353
# Provider: postgresql | mysql | psql_bouncer
5454
DATABASE_PROVIDER=postgresql
55-
DATABASE_CONNECTION_URI='postgresql://user:pass@postgres:5432/evolution_db?schema=evolution_api'
55+
DATABASE_CONNECTION_URI='postgresql://postgres:P@ssw0rd@localhost:5432/chatwoot_dev?schema=evolution'
5656
# Client name for the database connection
5757
# It is used to separate an API installation from another that uses the same database.
58-
DATABASE_CONNECTION_CLIENT_NAME=evolution_exchange
58+
DATABASE_CONNECTION_CLIENT_NAME=dev
5959

6060
# Bouncer connection: used only when the database provider is set to 'psql_bouncer'.
6161
# Defines the PostgreSQL URL with pgbouncer enabled (pgbouncer=true).
@@ -311,7 +311,7 @@ CONFIG_SESSION_PHONE_NAME=Chrome
311311

312312

313313
# Set qrcode display limit
314-
QRCODE_LIMIT=30
314+
QRCODE_LIMIT=3
315315
# Color of the QRCode on base64
316316
QRCODE_COLOR='#175197'
317317

@@ -321,15 +321,15 @@ TYPEBOT_ENABLED=false
321321
TYPEBOT_API_VERSION=latest
322322

323323
# Chatwoot - Environment variables
324-
CHATWOOT_ENABLED=false
324+
CHATWOOT_ENABLED=true
325325
# If you leave this option as false, when deleting the message for everyone on WhatsApp, it will not be deleted on Chatwoot.
326326
CHATWOOT_MESSAGE_READ=true
327327
# If you leave this option as true, when sending a message in Chatwoot, the client's last message will be marked as read on WhatsApp.
328328
CHATWOOT_MESSAGE_DELETE=true
329329
# If you leave this option as true, a contact will be created on Chatwoot to provide the QR Code and update messages about the instance.
330330
CHATWOOT_BOT_CONTACT=true
331331
# This db connection is used to import messages from whatsapp to chatwoot database
332-
CHATWOOT_IMPORT_DATABASE_CONNECTION_URI=postgresql://user:passwprd@host:5432/chatwoot?sslmode=disable
332+
CHATWOOT_IMPORT_DATABASE_CONNECTION_URI=postgresql://postgres:P@ssw0rd@localhost:5432/chatwoot_dev?search_path=chatwoot&sslmode=disable
333333
CHATWOOT_IMPORT_PLACEHOLDER_MEDIA_MESSAGE=true
334334

335335
# OpenAI - Environment variables
@@ -347,7 +347,7 @@ EVOAI_ENABLED=false
347347
# Cache - Environment variables
348348
# Redis Cache enabled
349349
CACHE_REDIS_ENABLED=true
350-
CACHE_REDIS_URI=redis://localhost:6379/6
350+
CACHE_REDIS_URI=redis://localhost:6379/2
351351
CACHE_REDIS_TTL=604800
352352
# Prefix serves to differentiate data from one installation to another that are using the same redis
353353
CACHE_REDIS_PREFIX_KEY=evolution
@@ -386,11 +386,11 @@ S3_USE_SSL=true
386386

387387
# Evolution Audio Converter - Environment variables - https://github.com/EvolutionAPI/evolution-audio-converter
388388
# API_AUDIO_CONVERTER=http://localhost:4040/process-audio
389-
# API_AUDIO_CONVERTER_KEY=429683C4C977415CAAFCCE10F7D57E11
389+
# API_AUDIO_CONVERTER_KEY=00000000-0000-0000-0000-000000000000
390390

391391
# Define a global apikey to access all instances.
392392
# OBS: This key must be inserted in the request header to create an instance.
393-
AUTHENTICATION_API_KEY=429683C4C977415CAAFCCE10F7D57E11
393+
AUTHENTICATION_API_KEY=00000000-0000-0000-0000-000000000000
394394
# If you leave this option as true, the instances will be exposed in the fetch instances endpoint.
395395
AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true
396396
LANGUAGE=en
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
name: Build Docker Image
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "v[0-9]+.[0-9]+.[0-9]+"
8+
branches-ignore:
9+
- "*"
10+
11+
jobs:
12+
create-runner-amd:
13+
name: Create Hetzner Cloud AMD runner
14+
runs-on: ubuntu-latest
15+
outputs:
16+
label: ${{ steps.create-hcloud-runner.outputs.label }}
17+
server_id: ${{ steps.create-hcloud-runner.outputs.server_id }}
18+
steps:
19+
- name: Create runner
20+
id: create-hcloud-runner
21+
uses: Cyclenerd/hcloud-github-runner@v1
22+
with:
23+
mode: create
24+
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
25+
hcloud_token: ${{ secrets.HCLOUD_TOKEN }}
26+
server_type: cx32
27+
location: hel1 # Helsinki, Finland
28+
image: docker-ce # Docker CE
29+
30+
create-runner-arm:
31+
name: Create Hetzner Cloud ARM runner
32+
runs-on: ubuntu-latest
33+
outputs:
34+
label: ${{ steps.create-hcloud-runner.outputs.label }}
35+
server_id: ${{ steps.create-hcloud-runner.outputs.server_id }}
36+
steps:
37+
- name: Create runner
38+
id: create-hcloud-runner
39+
uses: Cyclenerd/hcloud-github-runner@v1
40+
with:
41+
mode: create
42+
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
43+
hcloud_token: ${{ secrets.HCLOUD_TOKEN }}
44+
server_type: cax21
45+
location: hel1 # Helsinki, Finland
46+
image: docker-ce # Docker CE
47+
48+
build-and-push-amd:
49+
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
50+
environment: production
51+
needs: create-runner-amd # required to start the main job when the runner is ready
52+
runs-on: ${{ needs.create-runner-amd.outputs.label }} # run the job on the newly created runner
53+
permissions:
54+
contents: read
55+
packages: write
56+
steps:
57+
- uses: actions/checkout@v4
58+
- name: Login GitHub Container Registry
59+
uses: docker/login-action@v3
60+
with:
61+
registry: ghcr.io
62+
username: ${{ github.actor }}
63+
password: ${{ secrets.GITHUB_TOKEN }}
64+
- name: Set up Docker Buildx
65+
uses: docker/setup-buildx-action@v3
66+
- name: Extract version parts
67+
id: version
68+
if: startsWith(github.ref, 'refs/tags/v')
69+
run: |
70+
VERSION=${{ github.ref_name }}
71+
echo "full=$VERSION" >> $GITHUB_OUTPUT
72+
echo "major=$(echo $VERSION | cut -d. -f1)" >> $GITHUB_OUTPUT
73+
echo "minor=$(echo $VERSION | cut -d. -f1-2)" >> $GITHUB_OUTPUT
74+
- name: Build and push
75+
uses: docker/build-push-action@v5
76+
with:
77+
push: true
78+
context: .
79+
file: ./Dockerfile
80+
tags: |
81+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-amd
82+
83+
build-and-push-arm:
84+
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
85+
environment: production
86+
needs: create-runner-arm # required to start the main job when the runner is ready
87+
runs-on: ${{ needs.create-runner-arm.outputs.label }} # run the job on the newly created runner
88+
permissions:
89+
contents: read
90+
packages: write
91+
steps:
92+
- uses: actions/checkout@v4
93+
- name: Login GitHub Container Registry
94+
uses: docker/login-action@v3
95+
with:
96+
registry: ghcr.io
97+
username: ${{ github.actor }}
98+
password: ${{ secrets.GITHUB_TOKEN }}
99+
- name: Set up Docker Buildx
100+
uses: docker/setup-buildx-action@v3
101+
- name: Extract version parts
102+
id: version
103+
if: startsWith(github.ref, 'refs/tags/v')
104+
run: |
105+
VERSION=${{ github.ref_name }}
106+
echo "full=$VERSION" >> $GITHUB_OUTPUT
107+
echo "major=$(echo $VERSION | cut -d. -f1)" >> $GITHUB_OUTPUT
108+
echo "minor=$(echo $VERSION | cut -d. -f1-2)" >> $GITHUB_OUTPUT
109+
- name: Build and push
110+
uses: docker/build-push-action@v5
111+
with:
112+
push: true
113+
context: .
114+
file: ./Dockerfile
115+
tags: |
116+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-arm
117+
118+
merge-manifest:
119+
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
120+
runs-on: ubuntu-latest
121+
needs: [build-and-push-amd, build-and-push-arm]
122+
permissions:
123+
contents: read
124+
packages: write
125+
steps:
126+
- name: Login GitHub Container Registry
127+
uses: docker/login-action@v3
128+
with:
129+
registry: ghcr.io
130+
username: ${{ github.actor }}
131+
password: ${{ secrets.GITHUB_TOKEN }}
132+
- name: Set up Docker Buildx
133+
uses: docker/setup-buildx-action@v3
134+
- name: Extract version parts
135+
id: version
136+
if: startsWith(github.ref, 'refs/tags/v')
137+
run: |
138+
VERSION=${{ github.ref_name }}
139+
echo "full=$VERSION" >> $GITHUB_OUTPUT
140+
echo "major=$(echo $VERSION | cut -d. -f1)" >> $GITHUB_OUTPUT
141+
echo "minor=$(echo $VERSION | cut -d. -f1-2)" >> $GITHUB_OUTPUT
142+
- name: Create Versioned Manifest (GHCR) (${{ github.ref_name }})
143+
run: |
144+
docker buildx imagetools create -t ghcr.io/${{ github.repository }}:${{ github.ref_name }} \
145+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-amd \
146+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-arm
147+
- name: Create Major Version Manifest (GHCR)
148+
if: startsWith(github.ref, 'refs/tags/v')
149+
run: |
150+
docker buildx imagetools create -t ghcr.io/${{ github.repository }}:${{ steps.version.outputs.major }} \
151+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-amd \
152+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-arm
153+
- name: Create Minor Version Manifest (GHCR)
154+
if: startsWith(github.ref, 'refs/tags/v')
155+
run: |
156+
docker buildx imagetools create -t ghcr.io/${{ github.repository }}:${{ steps.version.outputs.minor }} \
157+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-amd \
158+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-arm
159+
160+
delete-runner-amd:
161+
name: Delete Hetzner Cloud AMD runner
162+
needs:
163+
- create-runner-amd # required to get output from the create-runner-amd job
164+
- build-and-push-amd # required to wait when the main job is done
165+
runs-on: ubuntu-latest
166+
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
167+
steps:
168+
- name: Delete runner
169+
uses: Cyclenerd/hcloud-github-runner@v1
170+
with:
171+
mode: delete
172+
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
173+
hcloud_token: ${{ secrets.HCLOUD_TOKEN }}
174+
name: ${{ needs.create-runner-amd.outputs.label }}
175+
server_id: ${{ needs.create-runner-amd.outputs.server_id }}
176+
177+
delete-runner-arm:
178+
name: Delete Hetzner Cloud ARM runner
179+
needs:
180+
- create-runner-arm # required to get output from the create-runner-arm job
181+
- build-and-push-arm # required to wait when the main job is done
182+
runs-on: ubuntu-latest
183+
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
184+
steps:
185+
- name: Delete runner
186+
uses: Cyclenerd/hcloud-github-runner@v1
187+
with:
188+
mode: delete
189+
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
190+
hcloud_token: ${{ secrets.HCLOUD_TOKEN }}
191+
name: ${{ needs.create-runner-arm.outputs.label }}
192+
server_id: ${{ needs.create-runner-arm.outputs.server_id }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release Charts
2+
3+
on:
4+
push:
5+
branches:
6+
- next
7+
8+
jobs:
9+
release:
10+
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
11+
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
12+
permissions:
13+
contents: write
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Configure Git
22+
run: |
23+
git config user.name "$GITHUB_ACTOR"
24+
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
25+
26+
- name: Install Helm
27+
uses: azure/setup-helm@v4.3.0
28+
29+
- name: Run chart-releaser
30+
uses: helm/chart-releaser-action@v1.7.0
31+
env:
32+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/check_code_quality.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: Check Code Quality
22

33
on:
4-
pull_request:
5-
branches: [ main, develop ]
6-
push:
7-
branches: [ main, develop ]
4+
workflow_dispatch:
85

96
jobs:
107
check-lint-and-build:

.github/workflows/publish_docker_image.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Build Docker image
22

33
on:
4-
push:
5-
tags:
6-
- "*.*.*"
4+
workflow_dispatch:
75

86
jobs:
97
build_deploy:

.github/workflows/publish_docker_image_homolog.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Build Docker image
22

33
on:
4-
push:
5-
branches:
6-
- develop
4+
workflow_dispatch:
75

86
jobs:
97
build_deploy:

.github/workflows/publish_docker_image_latest.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Build Docker image
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
workflow_dispatch:
75

86
jobs:
97
build_deploy:

.github/workflows/security.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
name: Security Scan
22

33
on:
4-
push:
5-
branches: [ main, develop ]
6-
pull_request:
7-
branches: [ main, develop ]
8-
schedule:
9-
- cron: '0 0 * * 1' # Weekly on Mondays
4+
workflow_dispatch:
105

116
jobs:
127
codeql:

0 commit comments

Comments
 (0)