mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-16 12:12:55 -06:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
dfb003fd72 | ||
![]() |
5239e431c2 | ||
![]() |
53cc6132f5 | ||
![]() |
0bc1b78db9 | ||
![]() |
2a9412c81a | ||
![]() |
f707cf4109 | ||
![]() |
410cfc8bcb | ||
![]() |
f1a3fd872f |
48
.github/workflows/publish_docker_image_v2.yml
vendored
Normal file
48
.github/workflows/publish_docker_image_v2.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
name: Build Docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v2.0.0
|
||||
|
||||
jobs:
|
||||
build_deploy:
|
||||
name: Build and Deploy
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: atendai/evolution-api
|
||||
tags: v2.0.0-alpha
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
- name: Image digest
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
@ -49,7 +49,7 @@
|
||||
"amqplib": "^0.10.3",
|
||||
"@aws-sdk/client-sqs": "^3.569.0",
|
||||
"axios": "^1.6.5",
|
||||
"@whiskeysockets/baileys": "6.7.4",
|
||||
"@whiskeysockets/baileys": "6.7.5",
|
||||
"class-validator": "^0.14.1",
|
||||
"compression": "^1.7.4",
|
||||
"cors": "^2.8.5",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { CacheEngine } from '../cache/cacheengine';
|
||||
import { configService } from '../config/env.config';
|
||||
import { configService, ProviderSession } from '../config/env.config';
|
||||
import { eventEmitter } from '../config/event.config';
|
||||
import { Logger } from '../config/logger.config';
|
||||
import { dbserver } from '../libs/db.connect';
|
||||
@ -110,7 +110,12 @@ export const repository = new RepositoryBroker(
|
||||
export const cache = new CacheService(new CacheEngine(configService, 'instance').getEngine());
|
||||
const chatwootCache = new CacheService(new CacheEngine(configService, ChatwootService.name).getEngine());
|
||||
const baileysCache = new CacheService(new CacheEngine(configService, 'baileys').getEngine());
|
||||
const providerFiles = new ProviderFiles(configService);
|
||||
|
||||
let providerFiles: ProviderFiles = null;
|
||||
|
||||
if (configService.get<ProviderSession>('PROVIDER')?.ENABLED) {
|
||||
providerFiles = new ProviderFiles(configService);
|
||||
}
|
||||
|
||||
export const waMonitor = new WAMonitoringService(
|
||||
eventEmitter,
|
||||
|
@ -595,9 +595,12 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
browser: number ? ['Chrome (Linux)', session.NAME, release()] : browser,
|
||||
version,
|
||||
markOnlineOnConnect: this.localSettings.always_online,
|
||||
retryRequestDelayMs: 10,
|
||||
connectTimeoutMs: 60_000,
|
||||
qrTimeout: 40_000,
|
||||
retryRequestDelayMs: 350,
|
||||
maxMsgRetryCount: 4,
|
||||
fireInitQueries: true,
|
||||
connectTimeoutMs: 20_000,
|
||||
keepAliveIntervalMs: 30_000,
|
||||
qrTimeout: 45_000,
|
||||
defaultQueryTimeoutMs: undefined,
|
||||
emitOwnEvents: false,
|
||||
shouldIgnoreJid: (jid) => {
|
||||
@ -614,7 +617,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
return this.historySyncNotification(msg);
|
||||
},
|
||||
userDevicesCache: this.userDevicesCache,
|
||||
transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 10 },
|
||||
transactionOpts: { maxCommitRetries: 5, delayBetweenTriesMs: 2500 },
|
||||
patchMessageBeforeSending(message) {
|
||||
if (
|
||||
message.deviceSentMessage?.message?.listMessage?.listType ===
|
||||
@ -770,12 +773,16 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
},
|
||||
logger: P({ level: this.logBaileys }),
|
||||
printQRInTerminal: false,
|
||||
mobile: this.mobile,
|
||||
browser: this.phoneNumber ? ['Chrome (Linux)', session.NAME, release()] : browser,
|
||||
version,
|
||||
markOnlineOnConnect: this.localSettings.always_online,
|
||||
retryRequestDelayMs: 10,
|
||||
connectTimeoutMs: 60_000,
|
||||
qrTimeout: 40_000,
|
||||
retryRequestDelayMs: 350,
|
||||
maxMsgRetryCount: 4,
|
||||
fireInitQueries: true,
|
||||
connectTimeoutMs: 20_000,
|
||||
keepAliveIntervalMs: 30_000,
|
||||
qrTimeout: 45_000,
|
||||
defaultQueryTimeoutMs: undefined,
|
||||
emitOwnEvents: false,
|
||||
shouldIgnoreJid: (jid) => {
|
||||
@ -792,7 +799,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
return this.historySyncNotification(msg);
|
||||
},
|
||||
userDevicesCache: this.userDevicesCache,
|
||||
transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 10 },
|
||||
transactionOpts: { maxCommitRetries: 5, delayBetweenTriesMs: 2500 },
|
||||
patchMessageBeforeSending(message) {
|
||||
if (
|
||||
message.deviceSentMessage?.message?.listMessage?.listType ===
|
||||
|
@ -323,7 +323,7 @@ export class WAMonitoringService {
|
||||
this.logger.verbose('Loading instances');
|
||||
|
||||
try {
|
||||
if (this.providerSession.ENABLED) {
|
||||
if (this.providerSession?.ENABLED) {
|
||||
await this.loadInstancesFromProvider();
|
||||
} else if (this.redis.REDIS.ENABLED && this.redis.REDIS.SAVE_INSTANCES) {
|
||||
await this.loadInstancesFromRedis();
|
||||
|
12
src/main.ts
12
src/main.ts
@ -12,7 +12,7 @@ import { initIO } from './api/integrations/websocket/libs/socket.server';
|
||||
import { ProviderFiles } from './api/provider/sessions';
|
||||
import { HttpStatus, router } from './api/routes/index.router';
|
||||
import { waMonitor } from './api/server.module';
|
||||
import { Auth, configService, Cors, HttpServer, Rabbitmq, Sqs, Webhook } from './config/env.config';
|
||||
import { Auth, configService, Cors, HttpServer, ProviderSession, Rabbitmq, Sqs, Webhook } from './config/env.config';
|
||||
import { onUnexpectedError } from './config/error.config';
|
||||
import { Logger } from './config/logger.config';
|
||||
import { ROOT_DIR } from './config/path.config';
|
||||
@ -27,9 +27,13 @@ async function bootstrap() {
|
||||
const logger = new Logger('SERVER');
|
||||
const app = express();
|
||||
|
||||
const providerFiles = new ProviderFiles(configService);
|
||||
await providerFiles.onModuleInit();
|
||||
logger.info('Provider:Files - ON');
|
||||
let providerFiles: ProviderFiles = null;
|
||||
|
||||
if (configService.get<ProviderSession>('PROVIDER')?.ENABLED) {
|
||||
providerFiles = new ProviderFiles(configService);
|
||||
await providerFiles.onModuleInit();
|
||||
logger.info('Provider:Files - ON');
|
||||
}
|
||||
|
||||
app.use(
|
||||
cors({
|
||||
|
Loading…
Reference in New Issue
Block a user