Skip to content

Commit 98722e7

Browse files
committed
Merge branch 'release/1.3.2'
2 parents 3e3a175 + 683fe4c commit 98722e7

17 files changed

+320
-452
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ lerna-debug.log*
1616
/docker-compose-data
1717
/docker-data
1818

19+
docker-compose.yaml
20+
1921
# Package
2022
/yarn.lock
2123
/package-lock.json

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# 1.3.2 (homolog)
2+
3+
### Fixed
4+
5+
* Fix in update settings that needed to restart after updated
6+
* Correction in the use of the api with mongodb
7+
* Adjustments to search endpoint for contacts, chats, messages and Status messages
8+
* Now when deleting the instance, the data referring to it in mongodb is also deleted
9+
* It is now validated if the instance name contains uppercase and special characters
10+
* For compatibility reasons, container mode has been removed
11+
* Added docker-compose files example
12+
113
# 1.3.1 (2023-07-20 07:48)
214

315
### Fixed

Docker/.env.example

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Server URL - Set your application url
2-
SERVER_URL='http://localhost:8080'
2+
SERVER_URL=http://localhost:8080
33

44
# Cors - * for all or set separate by commas - ex.: 'yourdomain1.com, yourdomain2.com'
5-
CORS_ORIGIN='*'
6-
CORS_METHODS='POST,GET,PUT,DELETE'
5+
CORS_ORIGIN=*
6+
CORS_METHODS=POST,GET,PUT,DELETE
77
CORS_CREDENTIALS=true
88

99
# Determine the logs to be displayed
10-
LOG_LEVEL='ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS'
10+
LOG_LEVEL=ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS
1111
LOG_COLOR=true
1212
# Log Baileys - "fatal" | "error" | "warn" | "info" | "debug" | "trace"
1313
LOG_BAILEYS=error
@@ -31,9 +31,9 @@ CLEAN_STORE_CONTACTS=true
3131
CLEAN_STORE_CHATS=true
3232

3333
# Permanent data storage
34-
DATABASE_ENABLED=false
34+
DATABASE_ENABLED=true
3535
DATABASE_CONNECTION_URI=mongodb://root:root@mongodb:27017/?authSource=admin&readPreference=primary&ssl=false&directConnection=true
36-
DATABASE_CONNECTION_DB_PREFIX_NAME=evolution
36+
DATABASE_CONNECTION_DB_PREFIX_NAME=evdocker
3737

3838
# Choose the data you want to save in the application's database or store
3939
DATABASE_SAVE_DATA_INSTANCE=false
@@ -42,9 +42,9 @@ DATABASE_SAVE_MESSAGE_UPDATE=false
4242
DATABASE_SAVE_DATA_CONTACTS=false
4343
DATABASE_SAVE_DATA_CHATS=false
4444

45-
REDIS_ENABLED=false
45+
REDIS_ENABLED=true
4646
REDIS_URI=redis://redis:6379
47-
REDIS_PREFIX_KEY=evolution
47+
REDIS_PREFIX_KEY=evdocker
4848

4949
# Global Webhook Settings
5050
# Each instance's Webhook URL and events will be requested at the time it is created
@@ -77,7 +77,7 @@ WEBHOOK_EVENTS_CONNECTION_UPDATE=true
7777
WEBHOOK_EVENTS_NEW_JWT_TOKEN=false
7878

7979
# Name that will be displayed on smartphone connection
80-
CONFIG_SESSION_PHONE_CLIENT='Evolution API'
80+
CONFIG_SESSION_PHONE_CLIENT=EvolutionAPI
8181
# Browser Name = chrome | firefox | edge | opera | safari
8282
CONFIG_SESSION_PHONE_NAME=chrome
8383

@@ -88,22 +88,12 @@ QRCODE_LIMIT=30
8888
# We recommend using the apikey because it will allow you to use a custom token,
8989
# if you use jwt, a random token will be generated and may be expired and you will have to generate a new token
9090
# jwt or 'apikey'
91-
AUTHENTICATION_TYPE='apikey'
91+
AUTHENTICATION_TYPE=apikey
9292
## Define a global apikey to access all instances.
9393
### OBS: This key must be inserted in the request header to create an instance.
94-
AUTHENTICATION_API_KEY='B6D711FCDE4D4FD5936544120E713976'
94+
AUTHENTICATION_API_KEY=B6D711FCDE4D4FD5936544120E713976
9595
AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true
9696
## Set the secret key to encrypt and decrypt your token and its expiration time
9797
# seconds - 3600s ===1h | zero (0) - never expires
9898
AUTHENTICATION_JWT_EXPIRIN_IN=0
99-
AUTHENTICATION_JWT_SECRET='L0YWtjb2w554WFqPG'
100-
# Set the instance name and webhook url to create an instance in init the application
101-
# With this option activated, you work with a url per webhook event, respecting the local url and the name of each event
102-
# container or server
103-
AUTHENTICATION_INSTANCE_MODE=server
104-
# if you are using container mode, set the container name and the webhook url to default instance
105-
AUTHENTICATION_INSTANCE_NAME=evolution
106-
AUTHENTICATION_INSTANCE_WEBHOOK_URL=''
107-
AUTHENTICATION_INSTANCE_CHATWOOT_ACCOUNT_ID=1
108-
AUTHENTICATION_INSTANCE_CHATWOOT_TOKEN=123456
109-
AUTHENTICATION_INSTANCE_CHATWOOT_URL=''
99+
AUTHENTICATION_JWT_SECRET='L=0YWt]b2w[WF>#>:&E`'

Docker/redis/docker-compose.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@ services:
1212
- evolution_redis:/data
1313
ports:
1414
- 6379:6379
15-
16-
rebrow:
17-
image: marian/rebrow
18-
ports:
19-
- 5001:5001
20-
links:
21-
- redis
2215

2316
volumes:
2417
evolution_redis:

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ COPY ./package.json .
1313

1414
ENV DOCKER_ENV=true
1515

16-
ENV SERVER_URL='http://localhost:8080'
16+
ENV SERVER_URL=http://localhost:8080
1717

1818
ENV CORS_ORIGIN=*
1919
ENV CORS_METHODS=POST,GET,PUT,DELETE
@@ -77,7 +77,7 @@ ENV WEBHOOK_EVENTS_CONNECTION_UPDATE=true
7777

7878
ENV WEBHOOK_EVENTS_NEW_JWT_TOKEN=false
7979

80-
ENV CONFIG_SESSION_PHONE_CLIENT='Evolution API'
80+
ENV CONFIG_SESSION_PHONE_CLIENT=EvolutionAPI
8181
ENV CONFIG_SESSION_PHONE_NAME=chrome
8282

8383
ENV QRCODE_LIMIT=30
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ services:
1010
volumes:
1111
- evolution_instances:/evolution/instances
1212
- evolution_store:/evolution/store
13+
networks:
14+
- evolution-net
1315
env_file:
1416
- ./Docker/.env
1517
command: ['node', './dist/src/main.js']
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
version: '3.3'
2+
3+
services:
4+
api:
5+
container_name: evolution_api
6+
image: evolution/api:local
7+
restart: always
8+
ports:
9+
- 8080:8080
10+
volumes:
11+
- evolution_instances:/evolution/instances
12+
- evolution_store:/evolution/store
13+
networks:
14+
- evolution-net
15+
env_file:
16+
- ./Docker/.env
17+
command: ['node', './dist/src/main.js']
18+
expose:
19+
- 8080
20+
21+
mongodb:
22+
container_name: mongodb
23+
image: mongo
24+
restart: always
25+
ports:
26+
- 27017:27017
27+
environment:
28+
- MONGO_INITDB_ROOT_USERNAME=root
29+
- MONGO_INITDB_ROOT_PASSWORD=root
30+
- PUID=1000
31+
- PGID=1000
32+
volumes:
33+
- evolution_mongodb_data:/data/db
34+
- evolution_mongodb_configdb:/data/configdb
35+
networks:
36+
- evolution-net
37+
expose:
38+
- 27017
39+
40+
mongo-express:
41+
image: mongo-express
42+
networks:
43+
- evolution-net
44+
environment:
45+
ME_CONFIG_BASICAUTH_USERNAME: root
46+
ME_CONFIG_BASICAUTH_PASSWORD: root
47+
ME_CONFIG_MONGODB_SERVER: mongodb
48+
ME_CONFIG_MONGODB_ADMINUSERNAME: root
49+
ME_CONFIG_MONGODB_ADMINPASSWORD: root
50+
ports:
51+
- 8081:8081
52+
links:
53+
- mongodb
54+
55+
redis:
56+
image: redis:latest
57+
container_name: redis
58+
command: >
59+
redis-server
60+
--port 6379
61+
--appendonly yes
62+
volumes:
63+
- evolution_redis:/data
64+
networks:
65+
- evolution-net
66+
ports:
67+
- 6379:6379
68+
69+
volumes:
70+
evolution_instances:
71+
evolution_store:
72+
evolution_mongodb_data:
73+
evolution_mongodb_configdb:
74+
evolution_redis:
75+
76+
networks:
77+
evolution-net:
78+
external: true
79+

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "evolution-api",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"description": "Rest api for communication with WhatsApp",
55
"main": "./dist/src/main.js",
66
"scripts": {

src/config/env.config.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,12 @@ export type EventsWebhook = {
9494

9595
export type ApiKey = { KEY: string };
9696
export type Jwt = { EXPIRIN_IN: number; SECRET: string };
97-
export type Instance = {
98-
NAME: string;
99-
WEBHOOK_URL: string;
100-
MODE: string;
101-
CHATWOOT_ACCOUNT_ID: string;
102-
CHATWOOT_TOKEN: string;
103-
CHATWOOT_URL: string;
104-
};
97+
10598
export type Auth = {
10699
API_KEY: ApiKey;
107100
EXPOSE_IN_FETCH_INSTANCES: boolean;
108101
JWT: Jwt;
109102
TYPE: 'jwt' | 'apikey';
110-
INSTANCE: Instance;
111103
};
112104

113105
export type DelInstance = number | boolean;
@@ -276,15 +268,6 @@ export class ConfigService {
276268
: 3600,
277269
SECRET: process.env.AUTHENTICATION_JWT_SECRET,
278270
},
279-
INSTANCE: {
280-
NAME: process.env.AUTHENTICATION_INSTANCE_NAME,
281-
WEBHOOK_URL: process.env.AUTHENTICATION_INSTANCE_WEBHOOK_URL,
282-
MODE: process.env.AUTHENTICATION_INSTANCE_MODE,
283-
CHATWOOT_ACCOUNT_ID:
284-
process.env.AUTHENTICATION_INSTANCE_CHATWOOT_ACCOUNT_ID || '',
285-
CHATWOOT_TOKEN: process.env.AUTHENTICATION_INSTANCE_CHATWOOT_TOKEN || '',
286-
CHATWOOT_URL: process.env.AUTHENTICATION_INSTANCE_CHATWOOT_URL || '',
287-
},
288271
},
289272
};
290273
}

src/dev-env.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,4 @@ AUTHENTICATION:
136136
# Set the secret key to encrypt and decrypt your token and its expiration time.
137137
JWT:
138138
EXPIRIN_IN: 0 # seconds - 3600s === 1h | zero (0) - never expires
139-
SECRET: L=0YWt]b2w[WF>#>:&E`
140-
# Set the instance name and webhook url to create an instance in init the application
141-
INSTANCE:
142-
# With this option activated, you work with a url per webhook event, respecting the local url and the name of each event
143-
MODE: server # container or server
144-
# if you are using container mode, set the container name and the webhook url to default instance
145-
NAME: evolution
146-
WEBHOOK_URL: <url>
147-
CHATWOOT_ACCOUNT_ID: 1
148-
CHATWOOT_TOKEN: 123456
149-
CHATWOOT_URL: <url>
139+
SECRET: L=0YWt]b2w[WF>#>:&E`

0 commit comments

Comments
 (0)