docs: update deployment from Mac Mini launchd to nextcloud PM2
This commit is contained in:
parent
2be27f70f1
commit
1e61e314a6
1 changed files with 22 additions and 23 deletions
59
README.md
59
README.md
|
|
@ -16,7 +16,7 @@ De bot gebruikt een **speciale groep** (Dienst opvragen EdGPT-EBS) waarin **elk
|
||||||
## Vereisten
|
## Vereisten
|
||||||
|
|
||||||
- [Node.js](https://nodejs.org/) 18+
|
- [Node.js](https://nodejs.org/) 18+
|
||||||
- [wwebjs-api](https://github.com/pedroslopez/whatsapp-web.js) Docker container (poort 3000)
|
- [wwebjs-api](https://github.com/pedroslopez/whatsapp-web.js) Docker container op nextcloud (poort 3001)
|
||||||
- WhatsApp sessie "EdGpt" actief in wwebjs-api
|
- WhatsApp sessie "EdGpt" actief in wwebjs-api
|
||||||
|
|
||||||
## Installatie
|
## Installatie
|
||||||
|
|
@ -33,7 +33,7 @@ Kopieer `.env.example` naar `.env` en vul de waarden in:
|
||||||
|
|
||||||
```env
|
```env
|
||||||
# WhatsApp API
|
# WhatsApp API
|
||||||
WHATSAPP_API_ENDPOINT=http://localhost:3000
|
WHATSAPP_API_ENDPOINT=http://192.168.5.252:3001
|
||||||
WHATSAPP_SESSION=EdGpt
|
WHATSAPP_SESSION=EdGpt
|
||||||
|
|
||||||
# Webhook
|
# Webhook
|
||||||
|
|
@ -53,7 +53,7 @@ ADMIN_NUMBER=31620248011@c.us
|
||||||
In de `.env` van wwebjs-api:
|
In de `.env` van wwebjs-api:
|
||||||
|
|
||||||
```env
|
```env
|
||||||
BASE_WEBHOOK_URL=http://host.docker.internal:3002/webhook
|
BASE_WEBHOOK_URL=http://192.168.5.252:3002/webhook
|
||||||
ENABLE_LOCAL_CALLBACK_EXAMPLE=FALSE
|
ENABLE_LOCAL_CALLBACK_EXAMPLE=FALSE
|
||||||
ENABLE_WEBHOOK=TRUE
|
ENABLE_WEBHOOK=TRUE
|
||||||
```
|
```
|
||||||
|
|
@ -84,49 +84,48 @@ Beide zijn uitgesloten van git via `.gitignore`.
|
||||||
|
|
||||||
## Gebruik
|
## Gebruik
|
||||||
|
|
||||||
### Starten
|
### Starten (nextcloud — huidig)
|
||||||
|
|
||||||
De bot draait als macOS LaunchDaemon (`/Library/LaunchDaemons/nl.eddydevink.dienst-bot.plist`) met `RunAtLoad` en `KeepAlive`.
|
De bot draait op **nextcloud** via **PM2** (gemigreerd van Mac Mini LaunchDaemon, juni 2026).
|
||||||
De LaunchDaemon start via `run-dienst-bot.sh`, een wrapper die bij elke start de
|
|
||||||
code signing signature van Node.js herstelt. Dit voorkomt uitval na een `brew upgrade node`.
|
|
||||||
|
|
||||||
Herstarten:
|
|
||||||
```bash
|
```bash
|
||||||
sudo launchctl bootout system /Library/LaunchDaemons/nl.eddydevink.dienst-bot.plist
|
# SSH naar nextcloud
|
||||||
sudo launchctl bootstrap system /Library/LaunchDaemons/nl.eddydevink.dienst-bot.plist
|
ssh aiaiaiaiagent@nextcloud
|
||||||
|
|
||||||
|
# Starten
|
||||||
|
cd ~/whatsapp-scripts/dienst_echo_whatsappgroep
|
||||||
|
pm2 start src/index.js --name dienst-bot
|
||||||
|
pm2 save
|
||||||
```
|
```
|
||||||
|
|
||||||
### Stoppen
|
### Stoppen
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo launchctl bootout system /Library/LaunchDaemons/nl.eddydevink.dienst-bot.plist
|
pm2 stop dienst-bot
|
||||||
|
```
|
||||||
|
|
||||||
|
### Herstarten
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pm2 restart dienst-bot
|
||||||
|
```
|
||||||
|
|
||||||
|
### Status
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pm2 status
|
||||||
```
|
```
|
||||||
|
|
||||||
### Logs bekijken
|
### Logs bekijken
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
tail -f /Users/eddy/.pm2/logs/dienst-bot-out.log
|
pm2 logs dienst-bot
|
||||||
tail -f /Users/eddy/.pm2/logs/dienst-bot-error.log
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Of met PM2:
|
### Oude Mac Mini (niet meer actief)
|
||||||
|
|
||||||
```bash
|
Plist: `/Library/LaunchDaemons/nl.eddydevink.dienst-bot.plist` → `.disabled`
|
||||||
npx pm2 start src/index.js --name dienst-bot
|
Wrapper: `run-dienst-bot.sh` (codesign fix voor Homebrew Node)
|
||||||
npx pm2 save
|
|
||||||
```
|
|
||||||
|
|
||||||
### Stoppen
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npx pm2 stop dienst-bot
|
|
||||||
```
|
|
||||||
|
|
||||||
### Logs bekijken
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npx pm2 logs dienst-bot
|
|
||||||
```
|
|
||||||
|
|
||||||
## Projectstructuur
|
## Projectstructuur
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue