Skip to content

Commit 2f934f6

Browse files
committed
feat(v2.3.5): chatwoot-br custom
1 parent 13f96a3 commit 2f934f6

54 files changed

Lines changed: 14092 additions & 16366 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: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ METRICS_PASSWORD=secure_random_password_here
2121
METRICS_ALLOWED_IPS=127.0.0.1,10.0.0.100,192.168.1.50
2222

2323
# Proxy configuration (optional)
24+
# Supports HTTP and SOCKS proxies for both WebSocket connections and media uploads
25+
# Compatible with WhatsApp media uploads to CDN servers through proxy
2426
PROXY_HOST=
2527
PROXY_PORT=
2628
PROXY_PROTOCOL=
@@ -52,10 +54,10 @@ DEL_INSTANCE=false
5254

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

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

312314

313315
# Set qrcode display limit
314-
QRCODE_LIMIT=30
316+
QRCODE_LIMIT=3
315317
# Color of the QRCode on base64
316318
QRCODE_COLOR='#175197'
317319

@@ -321,15 +323,15 @@ TYPEBOT_ENABLED=false
321323
TYPEBOT_API_VERSION=latest
322324

323325
# Chatwoot - Environment variables
324-
CHATWOOT_ENABLED=false
326+
CHATWOOT_ENABLED=true
325327
# If you leave this option as false, when deleting the message for everyone on WhatsApp, it will not be deleted on Chatwoot.
326328
CHATWOOT_MESSAGE_READ=true
327329
# 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.
328330
CHATWOOT_MESSAGE_DELETE=true
329331
# 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.
330332
CHATWOOT_BOT_CONTACT=true
331333
# 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
334+
CHATWOOT_IMPORT_DATABASE_CONNECTION_URI=postgresql://postgres:P@ssw0rd@localhost:5432/chatwoot_dev?search_path=chatwoot&sslmode=disable
333335
CHATWOOT_IMPORT_PLACEHOLDER_MEDIA_MESSAGE=true
334336

335337
# OpenAI - Environment variables
@@ -347,7 +349,7 @@ EVOAI_ENABLED=false
347349
# Cache - Environment variables
348350
# Redis Cache enabled
349351
CACHE_REDIS_ENABLED=true
350-
CACHE_REDIS_URI=redis://localhost:6379/6
352+
CACHE_REDIS_URI=redis://localhost:6379/2
351353
CACHE_REDIS_TTL=604800
352354
# Prefix serves to differentiate data from one installation to another that are using the same redis
353355
CACHE_REDIS_PREFIX_KEY=evolution
@@ -386,16 +388,18 @@ S3_USE_SSL=true
386388

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

391393
# Define a global apikey to access all instances.
392394
# OBS: This key must be inserted in the request header to create an instance.
393-
AUTHENTICATION_API_KEY=429683C4C977415CAAFCCE10F7D57E11
395+
AUTHENTICATION_API_KEY=00000000-0000-0000-0000-000000000000
394396
# If you leave this option as true, the instances will be exposed in the fetch instances endpoint.
395397
AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true
396398
LANGUAGE=en
397399

398400
# Define a global proxy to be used if the instance does not have one
401+
# Supports HTTP and SOCKS proxies for both WebSocket connections and media uploads
402+
# Compatible with WhatsApp media uploads to CDN servers through proxy
399403
# PROXY_HOST=
400404
# PROXY_PORT=80
401405
# PROXY_PROTOCOL=http
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
name: Build Docker Image
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "v[0-9]+.[0-9]+.[0-9]+"
8+
9+
jobs:
10+
create-runner-amd:
11+
name: Create Hetzner Cloud AMD runner
12+
runs-on: ubuntu-latest
13+
outputs:
14+
label: ${{ steps.create-hcloud-runner.outputs.label }}
15+
server_id: ${{ steps.create-hcloud-runner.outputs.server_id }}
16+
steps:
17+
- name: Create runner
18+
id: create-hcloud-runner
19+
uses: Cyclenerd/hcloud-github-runner@v1
20+
with:
21+
mode: create
22+
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
23+
hcloud_token: ${{ secrets.HCLOUD_TOKEN }}
24+
server_type: cx32
25+
location: hel1 # Helsinki, Finland
26+
image: docker-ce # Docker CE
27+
28+
create-runner-arm:
29+
name: Create Hetzner Cloud ARM runner
30+
runs-on: ubuntu-latest
31+
outputs:
32+
label: ${{ steps.create-hcloud-runner.outputs.label }}
33+
server_id: ${{ steps.create-hcloud-runner.outputs.server_id }}
34+
steps:
35+
- name: Create runner
36+
id: create-hcloud-runner
37+
uses: Cyclenerd/hcloud-github-runner@v1
38+
with:
39+
mode: create
40+
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
41+
hcloud_token: ${{ secrets.HCLOUD_TOKEN }}
42+
server_type: cax21
43+
location: hel1 # Helsinki, Finland
44+
image: docker-ce # Docker CE
45+
46+
build-and-push-amd:
47+
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
48+
environment: production
49+
needs: create-runner-amd # required to start the main job when the runner is ready
50+
runs-on: ${{ needs.create-runner-amd.outputs.label }} # run the job on the newly created runner
51+
permissions:
52+
contents: read
53+
packages: write
54+
steps:
55+
- uses: actions/checkout@v4
56+
- name: Login GitHub Container Registry
57+
uses: docker/login-action@v3
58+
with:
59+
registry: ghcr.io
60+
username: ${{ github.actor }}
61+
password: ${{ secrets.GITHUB_TOKEN }}
62+
- name: Set up Docker Buildx
63+
uses: docker/setup-buildx-action@v3
64+
- name: Extract version parts
65+
id: version
66+
if: startsWith(github.ref, 'refs/tags/v')
67+
run: |
68+
VERSION=${{ github.ref_name }}
69+
echo "full=$VERSION" >> $GITHUB_OUTPUT
70+
echo "major=$(echo $VERSION | cut -d. -f1)" >> $GITHUB_OUTPUT
71+
echo "minor=$(echo $VERSION | cut -d. -f1-2)" >> $GITHUB_OUTPUT
72+
- name: Build and push
73+
uses: docker/build-push-action@v5
74+
with:
75+
push: true
76+
context: .
77+
file: ./Dockerfile
78+
tags: |
79+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-amd
80+
81+
build-and-push-arm:
82+
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
83+
environment: production
84+
needs: create-runner-arm # required to start the main job when the runner is ready
85+
runs-on: ${{ needs.create-runner-arm.outputs.label }} # run the job on the newly created runner
86+
permissions:
87+
contents: read
88+
packages: write
89+
steps:
90+
- uses: actions/checkout@v4
91+
- name: Login GitHub Container Registry
92+
uses: docker/login-action@v3
93+
with:
94+
registry: ghcr.io
95+
username: ${{ github.actor }}
96+
password: ${{ secrets.GITHUB_TOKEN }}
97+
- name: Set up Docker Buildx
98+
uses: docker/setup-buildx-action@v3
99+
- name: Extract version parts
100+
id: version
101+
if: startsWith(github.ref, 'refs/tags/v')
102+
run: |
103+
VERSION=${{ github.ref_name }}
104+
echo "full=$VERSION" >> $GITHUB_OUTPUT
105+
echo "major=$(echo $VERSION | cut -d. -f1)" >> $GITHUB_OUTPUT
106+
echo "minor=$(echo $VERSION | cut -d. -f1-2)" >> $GITHUB_OUTPUT
107+
- name: Build and push
108+
uses: docker/build-push-action@v5
109+
with:
110+
push: true
111+
context: .
112+
file: ./Dockerfile
113+
tags: |
114+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-arm
115+
116+
merge-manifest:
117+
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
118+
runs-on: ubuntu-latest
119+
needs: [build-and-push-amd, build-and-push-arm]
120+
permissions:
121+
contents: read
122+
packages: write
123+
steps:
124+
- name: Login GitHub Container Registry
125+
uses: docker/login-action@v3
126+
with:
127+
registry: ghcr.io
128+
username: ${{ github.actor }}
129+
password: ${{ secrets.GITHUB_TOKEN }}
130+
- name: Set up Docker Buildx
131+
uses: docker/setup-buildx-action@v3
132+
- name: Extract version parts
133+
id: version
134+
if: startsWith(github.ref, 'refs/tags/v')
135+
run: |
136+
VERSION=${{ github.ref_name }}
137+
echo "full=$VERSION" >> $GITHUB_OUTPUT
138+
echo "major=$(echo $VERSION | cut -d. -f1)" >> $GITHUB_OUTPUT
139+
echo "minor=$(echo $VERSION | cut -d. -f1-2)" >> $GITHUB_OUTPUT
140+
- name: Create Versioned Manifest (GHCR) (${{ github.ref_name }})
141+
run: |
142+
docker buildx imagetools create -t ghcr.io/${{ github.repository }}:${{ github.ref_name }} \
143+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-amd \
144+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-arm
145+
- name: Create Major Version Manifest (GHCR)
146+
if: startsWith(github.ref, 'refs/tags/v')
147+
run: |
148+
docker buildx imagetools create -t ghcr.io/${{ github.repository }}:${{ steps.version.outputs.major }} \
149+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-amd \
150+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-arm
151+
- name: Create Minor Version Manifest (GHCR)
152+
if: startsWith(github.ref, 'refs/tags/v')
153+
run: |
154+
docker buildx imagetools create -t ghcr.io/${{ github.repository }}:${{ steps.version.outputs.minor }} \
155+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-amd \
156+
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-arm
157+
158+
delete-runner-amd:
159+
name: Delete Hetzner Cloud AMD runner
160+
needs:
161+
- create-runner-amd # required to get output from the create-runner-amd job
162+
- build-and-push-amd # required to wait when the main job is done
163+
runs-on: ubuntu-latest
164+
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
165+
steps:
166+
- name: Delete runner
167+
uses: Cyclenerd/hcloud-github-runner@v1
168+
with:
169+
mode: delete
170+
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
171+
hcloud_token: ${{ secrets.HCLOUD_TOKEN }}
172+
name: ${{ needs.create-runner-amd.outputs.label }}
173+
server_id: ${{ needs.create-runner-amd.outputs.server_id }}
174+
175+
delete-runner-arm:
176+
name: Delete Hetzner Cloud ARM runner
177+
needs:
178+
- create-runner-arm # required to get output from the create-runner-arm job
179+
- build-and-push-arm # required to wait when the main job is done
180+
runs-on: ubuntu-latest
181+
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
182+
steps:
183+
- name: Delete runner
184+
uses: Cyclenerd/hcloud-github-runner@v1
185+
with:
186+
mode: delete
187+
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
188+
hcloud_token: ${{ secrets.HCLOUD_TOKEN }}
189+
name: ${{ needs.create-runner-arm.outputs.label }}
190+
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)