Skip to content

Commit 8436600

Browse files
committed
fix: Update Dockerfile
1 parent 0dca009 commit 8436600

File tree

5 files changed

+99
-76
lines changed

5 files changed

+99
-76
lines changed

Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
FROM node:16.18-alpine
22

3-
LABEL version="1.1.3" description="Api to control whatsapp features through http requests."
3+
LABEL version="1.5.0" description="Api to control whatsapp features through http requests."
44
LABEL maintainer="Davidson Gomes" git="https://github.com/DavidsonGomes"
55
LABEL contact="contato@agenciadgcode.com"
66

77
RUN apk update && apk upgrade && \
8-
apk add --no-cache git
8+
apk add --no-cache git tzdata ffmpeg wget curl
99

1010
WORKDIR /evolution
1111

1212
COPY ./package.json .
1313

14+
ENV TZ=America/Sao_Paulo
1415
ENV DOCKER_ENV=true
1516

1617
ENV SERVER_URL=http://localhost:8080
@@ -50,7 +51,7 @@ ENV REDIS_ENABLED=false
5051
ENV REDIS_URI=redis://redis:6379
5152
ENV REDIS_PREFIX_KEY=evolution
5253

53-
ENV WEBHOOK_GLOBAL_URL=<url>
54+
ENV WEBHOOK_GLOBAL_URL=
5455
ENV WEBHOOK_GLOBAL_ENABLED=false
5556

5657
ENV WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false
@@ -105,4 +106,7 @@ COPY . .
105106

106107
RUN npm run build
107108

109+
HEALTHCHECK --interval=1m --retries=250 --start-period=2m \
110+
CMD curl --fail http://$SERVER_URL/ || exit 1
111+
108112
CMD [ "node", "./dist/src/main.js" ]

Extras/chatwoot/_Evolution__Configurar_Admin.json

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"string": [
88
{
99
"name": "api_access_token",
10-
"value": "CHATWOOT_USER_TOKEN"
10+
"value": "CHATWOOT_ADMIN_USER_TOKEN"
1111
},
1212
{
1313
"name": "chatwoot_url",
@@ -16,6 +16,14 @@
1616
{
1717
"name": "n8n_url",
1818
"value": "https://N8N_URL"
19+
},
20+
{
21+
"name": "organization",
22+
"value": "ORGANIZATION_NAME"
23+
},
24+
{
25+
"name": "logo",
26+
"value": "ORGANIZATION_LOGO"
1927
}
2028
]
2129
},
@@ -26,7 +34,7 @@
2634
"type": "n8n-nodes-base.set",
2735
"typeVersion": 2,
2836
"position": [
29-
1840,
37+
1820,
3038
880
3139
]
3240
},
@@ -45,15 +53,15 @@
4553
},
4654
"sendBody": true,
4755
"specifyBody": "json",
48-
"jsonBody": "={\n \"inbox_id\": {{ $('Cria Inbox Start').item.json[\"id\"] }},\n \"name\": \"EvolutionAPI\",\n \"phone_number\": \"+123456\",\n \"avatar_url\": \"https://evolution-api.com/files/evolution-api-favicon.png\"\n}",
56+
"jsonBody": "={\n \"inbox_id\": {{ $('Cria Inbox Start').item.json[\"id\"] }},\n \"name\": \"Bot {{ $('Info Base').item.json[\"organization\"] }}\",\n \"phone_number\": \"+123456\",\n \"avatar_url\": \"{{ $('Info Base').item.json[\"logo\"] }}\"\n}",
4957
"options": {}
5058
},
5159
"id": "61742c2d-d195-4a68-a2eb-a36839b6376a",
5260
"name": "Cria Contato Bot",
5361
"type": "n8n-nodes-base.httpRequest",
5462
"typeVersion": 3,
5563
"position": [
56-
2240,
64+
2220,
5765
880
5866
]
5967
},
@@ -72,15 +80,15 @@
7280
},
7381
"sendBody": true,
7482
"specifyBody": "json",
75-
"jsonBody": "={\n \"name\": \"StartEvolution\",\n \"channel\": {\n \"type\": \"api\",\n \"website_url\": \"\"\n }\n}",
83+
"jsonBody": "={\n \"name\": \"Start {{ $('Info Base').item.json[\"organization\"] }}\",\n \"channel\": {\n \"type\": \"api\",\n \"website_url\": \"\"\n }\n}",
7684
"options": {}
7785
},
7886
"id": "866ddf42-2d5f-4bf2-8552-2379a5cdc2a5",
7987
"name": "Cria Inbox Start",
8088
"type": "n8n-nodes-base.httpRequest",
8189
"typeVersion": 3,
8290
"position": [
83-
2040,
91+
2020,
8492
880
8593
]
8694
},
@@ -118,7 +126,7 @@
118126
"type": "n8n-nodes-base.httpRequest",
119127
"typeVersion": 3,
120128
"position": [
121-
2440,
129+
2420,
122130
880
123131
]
124132
},
@@ -137,22 +145,22 @@
137145
},
138146
"sendBody": true,
139147
"specifyBody": "json",
140-
"jsonBody": "={\n \"name\": \"Create Inbox EvolutionAPI\",\n \"description\": \"Create Inbox EvolutionAPI\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": \n [\n {\n \"action_name\": \"send_webhook_event\",\n \"action_params\": [\"{{ $('Info Base').item.json[\"n8n_url\"] }}/webhook/inbox_whatsapp?utoken={{ $('Info Base').item.json[\"api_access_token\"] }}\"]\n }\n ],\n \"conditions\": \n [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"start:\"]\n },\n \n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"query_operator\": \"or\",\n \"values\": [\"+123456\"]\n },\n\n\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"new_instance:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\"+123456\"]\n }\n ]\n}",
148+
"jsonBody": "={\n \"name\": \"Create Inbox {{ $('Info Base').item.json[\"organization\"] }}\",\n \"description\": \"Create Inbox EvolutionAPI\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": \n [\n {\n \"action_name\": \"send_webhook_event\",\n \"action_params\": [\"{{ $('Info Base').item.json[\"n8n_url\"] }}/webhook/inbox_whatsapp?utoken={{ $('Info Base').item.json[\"api_access_token\"] }}&organization={{ $('Info Base').item.json[\"organization\"] }}\"]\n }\n ],\n \"conditions\": \n [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"start:\"]\n },\n \n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"query_operator\": \"or\",\n \"values\": [\"+123456\"]\n },\n\n\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"new_instance:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\"+123456\"]\n }\n ]\n}",
141149
"options": {}
142150
},
143151
"id": "d89ed76c-a5e9-42e6-b55b-e779e9a33a53",
144152
"name": "Cria Automação Inboxes",
145153
"type": "n8n-nodes-base.httpRequest",
146154
"typeVersion": 3,
147155
"position": [
148-
2660,
156+
2620,
149157
880
150158
]
151159
},
152160
{
153161
"parameters": {
154162
"content": "## Workflow Para Configurar admin\n**Aqui você prepara o Chatwoot Principal com um usuário (Superadmin) que poderá criar empresas e caixas de entrada**\n**Instruções**\n**No node Info Base, configure as variáveis de seu Chatwoot e N8N**\n**Obs: A variável api_access_token é o token do usuário que irá poder criar as empresas**",
155-
"width": 1129.7777777777778
163+
"width": 894.6435495898575
156164
},
157165
"id": "a4597492-843a-44c7-836a-f30c91d46a20",
158166
"name": "Sticky Note",
@@ -224,7 +232,7 @@
224232
},
225233
"active": false,
226234
"settings": {},
227-
"versionId": "4f0e166f-00fb-4ce6-989e-03c036351e35",
235+
"versionId": "5275c59f-9230-4149-9107-e87c86759427",
228236
"id": "HmHVbJIXCOd57rBU",
229237
"meta": {
230238
"instanceId": "4ff16e963c7f5197d7e99e6239192860914312fea0ce2a9a7fd14d74a0a0e906"

Extras/chatwoot/_Evolution__Criador_de_Empresas.json

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -128,24 +128,24 @@
128128
"type": "n8n-nodes-base.httpRequest",
129129
"typeVersion": 3,
130130
"position": [
131-
2380,
131+
2360,
132132
840
133133
]
134134
},
135135
{
136136
"parameters": {
137-
"fromEmail": "contato@agenciadgcode.com",
137+
"fromEmail": "={{ $('Info Base').item.json[\"from_email\"] }}",
138138
"toEmail": "={{ $('LimpaDados').item.json.email }}",
139-
"subject": "Bem vindo ao Chatwoot",
140-
"text": "=Olá seja bem vindo:\n\nAbaixo segue seus dados de acesso iniciais:\n\nURL: {{ $('Info Base').item.json[\"chatwoot_url\"] }}\n\nLoging: {{ $('LimpaDados').item.json[\"email\"] }}\n\nSenha: {{ $('LimpaDados').item.json[\"password\"] }}",
139+
"subject": "=Bem vindo à {{ $('Info Base').item.json[\"organization\"] }}",
140+
"text": "=Olá seja bem vindo:\n\nAbaixo segue seus dados de acesso:\n\nURL: {{ $('Info Base').item.json[\"chatwoot_url\"] }}\n\nuser: {{ $('LimpaDados').item.json[\"email\"] }}\n\nSenha: {{ $('LimpaDados').item.json[\"password\"] }}",
141141
"options": {}
142142
},
143143
"id": "2d0b3e35-6e51-4e9b-90b4-6382dc6fec88",
144144
"name": "Send Email",
145145
"type": "n8n-nodes-base.emailSend",
146146
"typeVersion": 2,
147147
"position": [
148-
3180,
148+
3160,
149149
840
150150
],
151151
"credentials": {
@@ -161,7 +161,7 @@
161161
"string": [
162162
{
163163
"name": "api_access_token",
164-
"value": "TOKEN PLATAFORM"
164+
"value": "CHATWOOT_PLATFORM_TOKEN"
165165
},
166166
{
167167
"name": "chatwoot_url",
@@ -171,6 +171,18 @@
171171
"name": "n8n_url",
172172
"value": "https://N8N_URL"
173173
},
174+
{
175+
"name": "organization",
176+
"value": "ORGANIZATION_NAME"
177+
},
178+
{
179+
"name": "logo",
180+
"value": "ORGANIZATION_LOGO"
181+
},
182+
{
183+
"name": "from_email",
184+
"value": "FROM_EMAIL"
185+
},
174186
{
175187
"name": "name",
176188
"value": "={{ $json.name_company }}"
@@ -249,15 +261,15 @@
249261
},
250262
"sendBody": true,
251263
"specifyBody": "json",
252-
"jsonBody": "={\n \"inbox_id\": {{ $('Cria Inbox Start').item.json[\"id\"] }},\n \"name\": \"EvolutionAPI\",\n \"phone_number\": \"+123456\",\n \"avatar_url\": \"https://evolution-api.com/files/evolution-api-favicon.png\"\n}",
264+
"jsonBody": "={\n \"inbox_id\": {{ $('Cria Inbox Start').item.json[\"id\"] }},\n \"name\": \"Bot {{ $('Info Base').item.json[\"organization\"] }}\",\n \"phone_number\": \"+123456\",\n \"avatar_url\": \"{{ $('Info Base').item.json[\"logo\"] }}\"\n}",
253265
"options": {}
254266
},
255267
"id": "974e672e-fa4a-44ab-b6df-7aacd2bdb329",
256268
"name": "Cria Contato Bot",
257269
"type": "n8n-nodes-base.httpRequest",
258270
"typeVersion": 3,
259271
"position": [
260-
2800,
272+
2760,
261273
840
262274
]
263275
},
@@ -276,15 +288,15 @@
276288
},
277289
"sendBody": true,
278290
"specifyBody": "json",
279-
"jsonBody": "={\n \"name\": \"Create Inbox EvolutionAPI\",\n \"description\": \"Create Inbox EvolutionAPI\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": \n [\n {\n \"action_name\": \"send_webhook_event\",\n \"action_params\": [\"{{ $('Info Base').item.json[\"n8n_url\"] }}/webhook/inbox_whatsapp?utoken={{ $('Cria Usuario').item.json.access_token }}\"]\n }\n ],\n \"conditions\": \n [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"start:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"query_operator\": \"or\",\n \"values\": [\"+123456\"]\n },\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"new_instance:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\"+123456\"]\n }\n ]\n}",
291+
"jsonBody": "={\n \"name\": \"Create Inbox {{ $('Info Base').item.json[\"organization\"] }}\",\n \"description\": \"Create Inbox EvolutionAPI\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": \n [\n {\n \"action_name\": \"send_webhook_event\",\n \"action_params\": [\"{{ $('Info Base').item.json[\"n8n_url\"] }}/webhook/inbox_whatsapp?utoken={{ $('Cria Usuario').item.json.access_token }}&organization={{ $('Info Base').item.json[\"organization\"] }}\"]\n }\n ],\n \"conditions\": \n [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"start:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"query_operator\": \"or\",\n \"values\": [\"+123456\"]\n },\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"new_instance:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\"+123456\"]\n }\n ]\n}",
280292
"options": {}
281293
},
282294
"id": "fb5597d4-0af1-461b-912b-7671a88c8368",
283295
"name": "Cria Automação",
284296
"type": "n8n-nodes-base.httpRequest",
285297
"typeVersion": 3,
286298
"position": [
287-
3000,
299+
2960,
288300
840
289301
]
290302
},
@@ -303,15 +315,15 @@
303315
},
304316
"sendBody": true,
305317
"specifyBody": "json",
306-
"jsonBody": "={\n \"name\": \"StartEvolution\",\n \"channel\": {\n \"type\": \"api\",\n \"website_url\": \"\"\n }\n}",
318+
"jsonBody": "={\n \"name\": \"Start {{ $('Info Base').item.json[\"organization\"] }}\",\n \"channel\": {\n \"type\": \"api\",\n \"website_url\": \"\"\n }\n}",
307319
"options": {}
308320
},
309321
"id": "a09bc90a-d643-422c-90ae-f8baa41ee532",
310322
"name": "Cria Inbox Start",
311323
"type": "n8n-nodes-base.httpRequest",
312324
"typeVersion": 3,
313325
"position": [
314-
2600,
326+
2560,
315327
840
316328
]
317329
},
@@ -435,7 +447,7 @@
435447
},
436448
"active": true,
437449
"settings": {},
438-
"versionId": "5638171c-d64e-404f-b0f1-c8fbe4ec6fb0",
450+
"versionId": "98d3de5d-b1b2-4e13-b6e6-07fa827f54fd",
439451
"id": "mVLlfZvGjtR8SZLT",
440452
"meta": {
441453
"instanceId": "4ff16e963c7f5197d7e99e6239192860914312fea0ce2a9a7fd14d74a0a0e906"

0 commit comments

Comments
 (0)