docs: finalize installation instructions and infrastructure for overhauled worker

This commit is contained in:
AyrisAI
2026-05-14 19:14:43 +03:00
parent d815626479
commit 06789a25af
5 changed files with 101 additions and 63 deletions

View File

@@ -1,14 +1,42 @@
# AyrisTech Worker
# AyrisTech Worker (V10.3)
This worker listens to Mailcow Dovecot logs and publishes incoming mail events to Redis.
This worker monitors Mailcow vmail volumes and triggers Next.js webhooks when new mail arrives.
## Features
- Real-time mail event tracking
- Redis Pub/Sub integration
- Dockerized deployment
- Real-time filesystem monitoring with `chokidar`
- Automatic mail decoding via `doveadm`
- Next.js Webhook integration
- Secure secret-based authentication
## Setup
1. Clone the repository
2. Install dependencies: `npm install`
3. Configure `.env` file
4. Run the worker: `npm start`
## Setup Instructions
### 1. Configuration
Create a `.env` file in the root directory (copy from `.env.example` if available):
```env
NEXTJS_WEBHOOK_URL=https://your-nextjs-app.com/api/webhooks/mail-signal
WEBHOOK_SECRET=your_secret_here
```
### 2. Local Installation
```bash
npm install
npm start
```
### 3. Docker Deployment
To run as a container, you must provide access to the Docker socket and the Mailcow volumes:
```bash
docker build -t ayristech-worker .
docker run -d \
--name ayristech-worker \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/lib/docker/volumes/mailcowdockerized_vmail-vol-1/_data/:/var/lib/docker/volumes/mailcowdockerized_vmail-vol-1/_data/ \
--env-file .env \
ayristech-worker
```
## Important Notes
- **Docker Socket**: The worker runs `docker exec` commands, so `/var/run/docker.sock` must be mounted.
- **Vmail Path**: The worker watches `/var/lib/docker/volumes/mailcowdockerized_vmail-vol-1/_data/`. Ensure this volume exists and is mounted at the exact same path inside the container.