mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-16 04:02:54 -06:00
fixed docker files and quoted message option
This commit is contained in:
parent
f2d0a8eb8c
commit
485c8c3113
@ -1,5 +1,7 @@
|
|||||||
FROM node:16.18-alpine
|
FROM node:16.18-alpine
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
RUN apk update && apk upgrade && \
|
RUN apk update && apk upgrade && \
|
||||||
apk add --no-cache git
|
apk add --no-cache git
|
||||||
|
|
||||||
|
@ -7,13 +7,14 @@ networks:
|
|||||||
services:
|
services:
|
||||||
api:
|
api:
|
||||||
container_name: evolution_api
|
container_name: evolution_api
|
||||||
build:
|
image: evolution/api:local
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
ports:
|
ports:
|
||||||
- 8083:8080
|
- 8080:8080
|
||||||
# volumes:
|
volumes:
|
||||||
# - /data/instances:/evolution/instances
|
- ./docker-data/instances:/evolution/instances
|
||||||
|
depends_on:
|
||||||
|
- mongodb
|
||||||
|
- redis
|
||||||
environment:
|
environment:
|
||||||
# Determine how long the instance should be deleted from memory in case of no connection.
|
# Determine how long the instance should be deleted from memory in case of no connection.
|
||||||
# Default time: 5 minutes
|
# Default time: 5 minutes
|
||||||
@ -25,7 +26,7 @@ services:
|
|||||||
- STORE_CONTACTS=true
|
- STORE_CONTACTS=true
|
||||||
- STORE_CHATS=true
|
- STORE_CHATS=true
|
||||||
# Permanent data storage
|
# Permanent data storage
|
||||||
- DATABASE_ENABLED=false
|
- DATABASE_ENABLED=true
|
||||||
- DATABASE_CONNECTION_URI=mongodb://root:root@mongodb:27017/?authSource=admin&readPreference=primary&ssl=false&directConnection=true
|
- DATABASE_CONNECTION_URI=mongodb://root:root@mongodb:27017/?authSource=admin&readPreference=primary&ssl=false&directConnection=true
|
||||||
- DATABASE_CONNECTION_DB_PREFIX_NAME=evolution
|
- DATABASE_CONNECTION_DB_PREFIX_NAME=evolution
|
||||||
# Choose the data you want to save in the application's database or store
|
# Choose the data you want to save in the application's database or store
|
||||||
@ -35,7 +36,7 @@ services:
|
|||||||
- DATABASE_SAVE_MESSAGE_UPDATE=false
|
- DATABASE_SAVE_MESSAGE_UPDATE=false
|
||||||
- DATABASE_SAVE_DATA_CONTACTS=true
|
- DATABASE_SAVE_DATA_CONTACTS=true
|
||||||
- DATABASE_SAVE_DATA_CHATS=true
|
- DATABASE_SAVE_DATA_CHATS=true
|
||||||
- REDIS_ENABLED=false
|
- REDIS_ENABLED=true
|
||||||
- REDIS_URI=redis://redis:6379
|
- REDIS_URI=redis://redis:6379
|
||||||
- REDIS_PREFIX_KEY=evolution
|
- REDIS_PREFIX_KEY=evolution
|
||||||
# Webhook Settings
|
# Webhook Settings
|
||||||
@ -76,7 +77,7 @@ services:
|
|||||||
# OBS: This key must be inserted in the request header to create an instance.
|
# OBS: This key must be inserted in the request header to create an instance.
|
||||||
- AUTHENTICATION_API_KEY=B6D711FCDE4D4FD5936544120E713976
|
- AUTHENTICATION_API_KEY=B6D711FCDE4D4FD5936544120E713976
|
||||||
# Expose the api key on return from fetch instances
|
# Expose the api key on return from fetch instances
|
||||||
- AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true
|
- AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=false
|
||||||
# Set the secret key to encrypt and decrypt your token and its expiration time.
|
# Set the secret key to encrypt and decrypt your token and its expiration time.
|
||||||
- AUTHENTICATION_JWT_EXPIRIN_IN=0 # seconds - 3600s === 1h | zero (0) - never expires
|
- AUTHENTICATION_JWT_EXPIRIN_IN=0 # seconds - 3600s === 1h | zero (0) - never expires
|
||||||
# Set the instance name and webhook url to create an instance in init the application
|
# Set the instance name and webhook url to create an instance in init the application
|
||||||
@ -90,33 +91,31 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- evolution-net
|
- evolution-net
|
||||||
expose:
|
expose:
|
||||||
- 8083
|
- 8080
|
||||||
|
|
||||||
# mongodb:
|
mongodb:
|
||||||
# container_name: mongodb
|
container_name: mongodb
|
||||||
# image: mongo
|
image: mongo
|
||||||
# restart: always
|
restart: always
|
||||||
# volumes:
|
volumes:
|
||||||
# - /data/mongodb:/data/db
|
- ./docker-data/mongodb/data:/data/db
|
||||||
# ports:
|
- ./docker-data/mongodb/configdb:/data/configdb
|
||||||
# - 27017:27017
|
ports:
|
||||||
# environment:
|
- 27017:27017
|
||||||
# MONGO_INITDB_ROOT_USERNAME: root
|
environment:
|
||||||
# MONGO_INITDB_ROOT_PASSWORD: root
|
MONGO_INITDB_ROOT_USERNAME: root
|
||||||
# networks:
|
MONGO_INITDB_ROOT_PASSWORD: root
|
||||||
# - evolution-net
|
networks:
|
||||||
# expose:
|
- evolution-net
|
||||||
# - 27017
|
expose:
|
||||||
|
- 27017
|
||||||
|
|
||||||
# redis:
|
redis:
|
||||||
# container_name: redis
|
image: redis:latest
|
||||||
# image: redis:latest
|
volumes:
|
||||||
# restart: always
|
- ./docker-data/redis:/data
|
||||||
# volumes:
|
container_name: redis
|
||||||
# - /data/redis:/data
|
ports:
|
||||||
# ports:
|
- 6379:6379
|
||||||
# - 6379:6379
|
networks:
|
||||||
# networks:
|
- evolution-net
|
||||||
# - evolution-net
|
|
||||||
# expose:
|
|
||||||
# - 6379
|
|
7
docker.sh
Normal file → Executable file
7
docker.sh
Normal file → Executable file
@ -8,8 +8,11 @@ then
|
|||||||
docker network create -d bridge ${NET}
|
docker network create -d bridge ${NET}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo mkdir -p /data/instances
|
sudo mkdir -p ./docker-data/instances
|
||||||
|
sudo mkdir -p ./docker-data/mongodb
|
||||||
|
sudo mkdir -p ./docker-data/mongodb/data
|
||||||
|
sudo mkdir -p ./docker-data/mongodb/configdb
|
||||||
|
|
||||||
docker build -t ${IMAGE} .
|
docker build -t ${IMAGE} .
|
||||||
|
|
||||||
docker run -d --restart 'always' --name 'evolution_api' --mount 'type=bind,source=/data/instances,target=/evolution/instances' --publish '8083:8083' --hostname 'evolution' --network ${NET} ${IMAGE}
|
docker compose up -d
|
@ -7,7 +7,7 @@
|
|||||||
# Choose the server type for the application
|
# Choose the server type for the application
|
||||||
SERVER:
|
SERVER:
|
||||||
TYPE: http # https
|
TYPE: http # https
|
||||||
PORT: 8083 # 443
|
PORT: 8080 # 443
|
||||||
|
|
||||||
CORS:
|
CORS:
|
||||||
ORIGIN:
|
ORIGIN:
|
||||||
|
@ -81,7 +81,6 @@ const quotedOptionsSchema: JSONSchema7 = {
|
|||||||
required: ['id', 'remoteJid', 'fromMe'],
|
required: ['id', 'remoteJid', 'fromMe'],
|
||||||
...isNotEmpty('id', 'remoteJid'),
|
...isNotEmpty('id', 'remoteJid'),
|
||||||
},
|
},
|
||||||
message: { type: 'object' },
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ export class WAMonitoringService {
|
|||||||
let apikey: string;
|
let apikey: string;
|
||||||
if (this.configService.get<Auth>('AUTHENTICATION').EXPOSE_IN_FETCH_INSTANCES) {
|
if (this.configService.get<Auth>('AUTHENTICATION').EXPOSE_IN_FETCH_INSTANCES) {
|
||||||
const tokenStore = await this.repository.auth.find(key);
|
const tokenStore = await this.repository.auth.find(key);
|
||||||
apikey = tokenStore.apikey || '';
|
apikey = tokenStore.apikey || 'Apikey not found';
|
||||||
|
|
||||||
instances.push({
|
instances.push({
|
||||||
instance: {
|
instance: {
|
||||||
|
@ -983,7 +983,12 @@ export class WAStartupService {
|
|||||||
|
|
||||||
const messageSent = await (async () => {
|
const messageSent = await (async () => {
|
||||||
const option = {
|
const option = {
|
||||||
quoted,
|
quoted: {
|
||||||
|
key: quoted.key,
|
||||||
|
message: {
|
||||||
|
conversation: 'message',
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!message['audio'] && !message['poll'] && !message['linkPreview']) {
|
if (!message['audio'] && !message['poll'] && !message['linkPreview']) {
|
||||||
|
Loading…
Reference in New Issue
Block a user