From 20141ad17b808f79bd65824c7a55f922d1658c31 Mon Sep 17 00:00:00 2001 From: Tour Date: Sat, 6 Dec 2025 19:36:46 +0100 Subject: [PATCH] wapp --- .env.example | 2 +- Dockerfile | 4 ++-- README.md | 6 +++--- docker-compose.yml | 28 ++++++++++++++-------------- package.json | 2 +- server.js | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.env.example b/.env.example index 78acca9..8e0258b 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,5 @@ # Server Configuration -PORT=3000 +PORT=3001 API_KEY=your-strong-api-key-here # Database & Storage diff --git a/Dockerfile b/Dockerfile index b1fac8f..9831367 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,10 +61,10 @@ RUN mkdir -p /app/data /app/media /app/.wwebjs_cache /app/.wwebjs_auth && \ USER whatsapp -EXPOSE 3000 +EXPOSE 3001 # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ - CMD node -e "require('http').get('http://localhost:3000/health', (r) => { process.exit(r.statusCode === 200 ? 0 : 1); }).on('error', () => process.exit(1));" + CMD node -e "require('http').get('http://localhost:3001/health', (r) => { process.exit(r.statusCode === 200 ? 0 : 1); }).on('error', () => process.exit(1));" CMD ["node", "server.js"] diff --git a/README.md b/README.md index 2ccf28a..d049c89 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ npm install npm start ``` -Visit `http://localhost:3000/qr` to scan the WhatsApp QR code. +Visit `http://localhost:3001/qr` to scan the WhatsApp QR code. ### Docker Deployment @@ -29,13 +29,13 @@ Visit `http://localhost:3000/qr` to scan the WhatsApp QR code. docker-compose up -d --build ``` -Visit `http://your-server:3000/qr` to authenticate WhatsApp. +Visit `http://your-server:3001/qr` to authenticate WhatsApp. ## QR Code Authentication The server provides a web interface for easy WhatsApp authentication: -- **URL**: `http://localhost:3000/qr` +- **URL**: `http://localhost:3001/qr` - **Features**: - Real-time QR code display - Live connection status updates diff --git a/docker-compose.yml b/docker-compose.yml index 149788b..62ae8ae 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,16 +1,16 @@ services: - whatjs: + wapp: user: "1000:1000" build: context: . dockerfile: Dockerfile - container_name: whatjs + container_name: wapp restart: unless-stopped networks: - traefik_net environment: # Server configuration - - PORT=3000 + - PORT=3001 - NODE_ENV=production # API Security @@ -26,8 +26,8 @@ services: - REJECT_CALLS=false # WebSocket URL for QR page (set this to your public URL when using Traefik) - # Example: - WS_URL=https://whatjs.yourdomain.com - - WS_URL= + # Example: - WS_URL=https://wapp.appmodel.nl + - WS_URL=https://wapp.appmodel.nl # CORS configuration - CORS_ORIGIN=* @@ -39,17 +39,17 @@ services: - whatsapp-cache:/app/.wwebjs_cache - whatsapp-auth:/app/.wwebjs_auth - # Uncomment labels below when ready to use Traefik - # labels: - # - "traefik.enable=true" - # - "traefik.http.routers.whatjs.rule=Host(`whatjs.yourdomain.com`)" - # - "traefik.http.routers.whatjs.entrypoints=websecure" - # - "traefik.http.routers.whatjs.tls=true" - # - "traefik.http.routers.whatjs.tls.certresolver=letsencrypt" - # - "traefik.http.services.whatjs.loadbalancer.server.port=3000" + # Uncomment labels below when ready to use Traefik + labels: + - "traefik.enable=true" + - "traefik.http.routers.wapp.rule=Host(`wapp.appmodel.nl`)" + - "traefik.http.routers.wapp.entrypoints=websecure" + - "traefik.http.routers.wapp.tls=true" + - "traefik.http.routers.wapp.tls.certresolver=letsencrypt" + - "traefik.http.services.wapp.loadbalancer.server.port=3001" healthcheck: - test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (r) => { process.exit(r.statusCode === 200 ? 0 : 1); }).on('error', () => process.exit(1));"] + test: ["CMD", "node", "-e", "require('http').get('http://localhost:3001/health', (r) => { process.exit(r.statusCode === 200 ? 0 : 1); }).on('error', () => process.exit(1));"] interval: 30s timeout: 10s retries: 3 diff --git a/package.json b/package.json index b6d1d36..0be3466 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "whatsapp-web-server", + "name": "wapp", "version": "1.0.0", "description": "WhatsApp automation server with API and database", "main": "server.js", diff --git a/server.js b/server.js index 35c9dfc..e44ab5d 100644 --- a/server.js +++ b/server.js @@ -12,7 +12,7 @@ const QRCode = require('qrcode') // --- CONFIGURATION --- const config = { - port : process.env.PORT || 3000, + port : process.env.PORT || 3001, dbPath : process.env.DB_PATH || path.join(__dirname, 'data', 'whatsapp.db'), mediaPath : process.env.MEDIA_PATH || path.join(__dirname, 'media'), headless : process.env.HEADLESS !== 'false',