Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf3385f624 | ||
|
|
0346c5e7b9 | ||
|
|
443652b0a7 | ||
|
|
1e73c3dc6a | ||
|
|
afa9d4208f | ||
|
|
64eda25b5d | ||
|
|
cfc6c931a3 | ||
|
|
35bc56c948 | ||
|
|
371bde4c3e | ||
|
|
9497e2900e | ||
|
|
51bbc9998a | ||
|
|
057f7bce56 | ||
|
|
52412fb4cc | ||
|
|
a57f3443de | ||
|
|
9b2537e7c7 | ||
|
|
a378ad4c3d |
No files matched your search
@@ -22,6 +22,7 @@ WHATSAPP_SWAGGER_ENABLED=True
|
||||
# WhatsApp engine (WEBJS is default, GOWS or NOWEB for better performance)
|
||||
WHATSAPP_DEFAULT_ENGINE=WEBJS
|
||||
|
||||
# "Firefox (YourApp)" in Linked Devices
|
||||
# WAHA_CLIENT_DEVICE_NAME=YourApp
|
||||
|
||||
# Base URL for the API (used for webhooks, file URLs, etc.)
|
||||
|
||||
@@ -100,7 +100,51 @@ jobs:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
|
||||
- name: Build
|
||||
- name: Build (attempt 1)
|
||||
id: build1
|
||||
continue-on-error: true
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
platforms: ${{ matrix.platform }}
|
||||
build-args: |
|
||||
USE_BROWSER=${{ matrix.browser }}
|
||||
WHATSAPP_DEFAULT_ENGINE=${{ matrix.engine }}
|
||||
push: false
|
||||
load: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
- name: Wait to retry build
|
||||
if: steps.build1.outcome == 'failure'
|
||||
run: |
|
||||
sleep 10
|
||||
|
||||
- name: Build (attempt 2)
|
||||
id: build2
|
||||
if: steps.build1.outcome == 'failure'
|
||||
continue-on-error: true
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
platforms: ${{ matrix.platform }}
|
||||
build-args: |
|
||||
USE_BROWSER=${{ matrix.browser }}
|
||||
WHATSAPP_DEFAULT_ENGINE=${{ matrix.engine }}
|
||||
push: false
|
||||
load: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
- name: Wait to retry build
|
||||
if: steps.build2.outcome == 'failure'
|
||||
run: |
|
||||
sleep 10
|
||||
|
||||
- name: Build (attempt 3)
|
||||
if: steps.build2.outcome == 'failure'
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
|
||||
@@ -71,8 +71,60 @@ jobs:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
|
||||
- name: Build
|
||||
- name: Build (attempt 1)
|
||||
id: build1
|
||||
if: ${{ steps.recent.outputs.has_recent == 'true' }}
|
||||
continue-on-error: true
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
platforms: ${{ matrix.platform }}
|
||||
build-args: |
|
||||
USE_BROWSER=${{ matrix.browser }}
|
||||
WHATSAPP_DEFAULT_ENGINE=${{ matrix.engine }}
|
||||
push: false
|
||||
load: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
- name: Wait to retry build
|
||||
if:
|
||||
${{ steps.recent.outputs.has_recent == 'true' && steps.build1.outcome
|
||||
== 'failure' }}
|
||||
run: |
|
||||
sleep 10
|
||||
|
||||
- name: Build (attempt 2)
|
||||
id: build2
|
||||
if:
|
||||
${{ steps.recent.outputs.has_recent == 'true' && steps.build1.outcome
|
||||
== 'failure' }}
|
||||
continue-on-error: true
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
platforms: ${{ matrix.platform }}
|
||||
build-args: |
|
||||
USE_BROWSER=${{ matrix.browser }}
|
||||
WHATSAPP_DEFAULT_ENGINE=${{ matrix.engine }}
|
||||
push: false
|
||||
load: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
- name: Wait to retry build
|
||||
if:
|
||||
${{ steps.recent.outputs.has_recent == 'true' && steps.build2.outcome
|
||||
== 'failure' }}
|
||||
run: |
|
||||
sleep 10
|
||||
|
||||
- name: Build (attempt 3)
|
||||
if:
|
||||
${{ steps.recent.outputs.has_recent == 'true' && steps.build2.outcome
|
||||
== 'failure' }}
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
|
||||
@@ -40,7 +40,7 @@ export class AxiosLogging {
|
||||
|
||||
// Log debug for 2xx/3xx responses
|
||||
this.logger.debug(`${methodStr} ${status}:OK ${url}`);
|
||||
if (type.startsWith('application/json')) {
|
||||
if (type?.startsWith('application/json')) {
|
||||
const data = JSON.stringify(response.data);
|
||||
this.logger.trace(`${methodStr} ${status}:OK ${url} ${data}`);
|
||||
} else {
|
||||
|
||||
@@ -9,6 +9,13 @@ describe('parseMentionsFromText', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('handles empty content safely', () => {
|
||||
expect(parseMentionsFromText(null)).toEqual({
|
||||
text: null,
|
||||
mentions: null,
|
||||
});
|
||||
});
|
||||
|
||||
it('parses @all and removes it from the text', () => {
|
||||
const input = 'Hello @all';
|
||||
expect(parseMentionsFromText(input)).toEqual({
|
||||
@@ -108,8 +115,16 @@ describe('parseMentionsFromText', () => {
|
||||
it('parses @lid mentions without c.us suffix', () => {
|
||||
const input = 'Notify @123123@lid now';
|
||||
expect(parseMentionsFromText(input)).toEqual({
|
||||
text: 'Notify @123123@lid now',
|
||||
text: 'Notify @123123 now',
|
||||
mentions: ['123123@lid'],
|
||||
});
|
||||
});
|
||||
|
||||
it('replaces @lid suffix with plain ids', () => {
|
||||
const input = '@123456@lid please ping @654321@lid.';
|
||||
expect(parseMentionsFromText(input)).toEqual({
|
||||
text: '@123456 please ping @654321.',
|
||||
mentions: ['123456@lid', '654321@lid'],
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -15,7 +15,15 @@ export interface ParsedMentions {
|
||||
* @param text - The message text
|
||||
* @returns Parsed mentions with cleaned text
|
||||
*/
|
||||
export function parseMentionsFromText(text: string): ParsedMentions {
|
||||
export function parseMentionsFromText(
|
||||
text: string | null | undefined,
|
||||
): ParsedMentions {
|
||||
if (!text) {
|
||||
return {
|
||||
text: text,
|
||||
mentions: null,
|
||||
};
|
||||
}
|
||||
const mentions: string[] = [];
|
||||
let content = text;
|
||||
|
||||
@@ -40,6 +48,10 @@ export function parseMentionsFromText(text: string): ParsedMentions {
|
||||
mentions.push(formattedLid);
|
||||
}
|
||||
}
|
||||
if (mentions.length > 0) {
|
||||
const lidRegexReplace = /(^|\s)@(\d{6,15})@lid\b/g;
|
||||
content = content.replace(lidRegexReplace, '$1@$2').trim();
|
||||
}
|
||||
|
||||
// Regex to match @ followed by phone number
|
||||
// Matches: @558591203123, @5585991203123, etc.
|
||||
|
||||
@@ -124,7 +124,7 @@ class WEBJSHelper implements IEngineHelper {
|
||||
return {
|
||||
timestamp: new Date(message.timestamp * 1000),
|
||||
from_me: message.fromMe,
|
||||
chat_id: message.from,
|
||||
chat_id: message.id.remote,
|
||||
message_id: message.id.id,
|
||||
participant: message.author || null,
|
||||
};
|
||||
|
||||
@@ -381,6 +381,7 @@ export abstract class WhatsappSession {
|
||||
'--disable-default-apps',
|
||||
'--disable-dev-shm-usage',
|
||||
'--disable-extensions',
|
||||
'--disable-metrics',
|
||||
// '--disable-features=site-per-process', // COMMENTED to test WEBJS stability
|
||||
'--disable-gpu', // COMMENTED to test WEBJS stability
|
||||
'--disable-offer-store-unmasked-wallet-cards',
|
||||
|
||||
@@ -142,7 +142,7 @@ export function ReportGeneratedValue() {
|
||||
'Save these values to your environment (.env or WAHA_*) to reuse them; new keys are generated on every start otherwise.',
|
||||
);
|
||||
console.warn('');
|
||||
console.warn("cat <<'EOF' > .env");
|
||||
console.warn("cat <<'EOF' >> .env");
|
||||
console.warn('');
|
||||
for (const key of values) {
|
||||
console.warn(`${key.param}=${key.value}`);
|
||||
|
||||
@@ -36,7 +36,7 @@ export class WebjsClientCore extends Client {
|
||||
) {
|
||||
super(options);
|
||||
// Wait until it's READY and inject more utils
|
||||
this.on(Events.READY, async () => {
|
||||
this.on(Events.AUTHENTICATED, async () => {
|
||||
await this.attachCustomEventListeners();
|
||||
await this.injectWaha();
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { WhatsappConfigService } from '@waha/config.service';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class MediaLocalStorageConfig {
|
||||
@@ -12,7 +13,14 @@ export class MediaLocalStorageConfig {
|
||||
}
|
||||
|
||||
get filesFolder(): string {
|
||||
return this.config.get('WHATSAPP_FILES_FOLDER', '/tmp/whatsapp-files');
|
||||
const configured = this.config.get('WHATSAPP_FILES_FOLDER', '');
|
||||
if (!configured) {
|
||||
return '/tmp/whatsapp-files';
|
||||
}
|
||||
if (path.isAbsolute(configured)) {
|
||||
return configured;
|
||||
}
|
||||
return path.resolve(process.cwd(), configured);
|
||||
}
|
||||
|
||||
get filesLifetime(): number {
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ function getPlatform() {
|
||||
}
|
||||
|
||||
export const VERSION: WAHAEnvironment = {
|
||||
version: '2026.1.2',
|
||||
version: '2026.1.3',
|
||||
engine: getEngineName(),
|
||||
tier: getWAHAVersion(),
|
||||
browser: getBrowser(),
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"waha": {
|
||||
"gows": {
|
||||
"repo": "devlikeapro/gows",
|
||||
"ref": "v1.0.29"
|
||||
"ref": "v1.0.30"
|
||||
},
|
||||
"dashboard": {
|
||||
"repo": "devlikeapro/dashboard",
|
||||
|
||||
@@ -7,7 +7,7 @@ __metadata:
|
||||
|
||||
"@adiwajshing/baileys@github:devlikeapro/Baileys#fork-master-2025-12-17":
|
||||
version: 7.0.0-rc.9
|
||||
resolution: "@adiwajshing/baileys@https://github.com/devlikeapro/Baileys.git#commit=3d54943ebd83c56f1b5739c4d28da3f9af01020a"
|
||||
resolution: "@adiwajshing/baileys@https://github.com/devlikeapro/Baileys.git#commit=21289d1c97dd4b6b0c2585c0f77cecc486fb9f2f"
|
||||
dependencies:
|
||||
"@cacheable/node-cache": "npm:^1.4.0"
|
||||
"@hapi/boom": "npm:^9.1.3"
|
||||
@@ -31,7 +31,7 @@ __metadata:
|
||||
optional: true
|
||||
link-preview-js:
|
||||
optional: true
|
||||
checksum: 10/6ec9803fea06e359f1e883c1e050b511350ec272cfb9e3fc3a14c1346ccc8bc18c4bfb3d22f90877d5aaf4f973b02cb8fda9f5a7ab801138d17e766c36b05dfc
|
||||
checksum: 10/6d3cbdbbb490356b89d65310244a8120f650641efbfd43f6fea4c5296c17d75feaeb7d870ee2ba77015b97c94c7ffd1950d0e6466b5c0dbc5eae020e68cf85d5
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -12756,7 +12756,7 @@ __metadata:
|
||||
|
||||
"whatsapp-web.js@github:devlikeapro/whatsapp-web.js#fork-main-2025-12-17":
|
||||
version: 1.34.3
|
||||
resolution: "whatsapp-web.js@https://github.com/devlikeapro/whatsapp-web.js.git#commit=8823818e1db005aeca3cb75cf48622493c5e4cd2"
|
||||
resolution: "whatsapp-web.js@https://github.com/devlikeapro/whatsapp-web.js.git#commit=766bb3957a81338250ee830d34cfceec278e545e"
|
||||
dependencies:
|
||||
"@pedroslopez/moduleraid": "npm:^5.0.2"
|
||||
archiver: "npm:^5.3.1"
|
||||
@@ -12774,7 +12774,7 @@ __metadata:
|
||||
optional: true
|
||||
unzipper:
|
||||
optional: true
|
||||
checksum: 10/3bcbb476ccf1fc330beccb67b26720b212a37d74d166291c346430feef955a85ffb5948f3802a7f14f9f620fbd7edcd292b049b54e77c80ce9c5f7f2c2474878
|
||||
checksum: 10/cb54d6192bd5d24c5521d1d5599fc7da65e87c3dfc595cab708b7335e95842d31fd7c0d84a7c479202de55bda67c4dcaec802150568e5f35815b6b07fd669d57
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in new issue
Block a user