fix(whatsapp): sandbox chromium by default
This commit is contained in:
@@ -32,6 +32,8 @@ export interface WhatsAppAdapterConfig {
|
||||
dataDir?: string;
|
||||
/** Optional pairing manager for DM pairing codes. */
|
||||
pairingManager?: PairingManager;
|
||||
/** Allow launching Chromium without sandbox (unsafe; use only in high-trust/containerized setups). */
|
||||
allowNoSandbox?: boolean;
|
||||
}
|
||||
|
||||
/** Minimal shape of a whatsapp-web.js message. */
|
||||
@@ -88,11 +90,18 @@ export class WhatsAppAdapter implements ChannelAdapter {
|
||||
dataPath: this.config.dataDir,
|
||||
});
|
||||
|
||||
const puppeteerArgs = this.config.allowNoSandbox
|
||||
? ['--no-sandbox', '--disable-setuid-sandbox']
|
||||
: [];
|
||||
if (this.config.allowNoSandbox) {
|
||||
console.warn('WhatsApp adapter: Chromium sandbox disabled via config (unsafe).');
|
||||
}
|
||||
|
||||
this.client = new Client({
|
||||
authStrategy,
|
||||
puppeteer: {
|
||||
headless: true,
|
||||
args: ['--no-sandbox', '--disable-setuid-sandbox'],
|
||||
args: puppeteerArgs,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user