chore: simplify to plain JS worker.js and finalize install instructions
This commit is contained in:
36
README.md
36
README.md
@@ -1,42 +1,40 @@
|
||||
# AyrisTech Worker (V10.3)
|
||||
# AyrisTech Mail Worker (V10.3)
|
||||
|
||||
This worker monitors Mailcow vmail volumes and triggers Next.js webhooks when new mail arrives.
|
||||
Mailcow Dovecot loglarını ve dosya sistemini izleyerek yeni gelen mailleri Next.js webhook'una ileten servis.
|
||||
|
||||
## Features
|
||||
- Real-time filesystem monitoring with `chokidar`
|
||||
- Automatic mail decoding via `doveadm`
|
||||
- Next.js Webhook integration
|
||||
- Secure secret-based authentication
|
||||
## Kurulum
|
||||
|
||||
## Setup Instructions
|
||||
|
||||
### 1. Configuration
|
||||
Create a `.env` file in the root directory (copy from `.env.example` if available):
|
||||
### 1. Dosyaları Hazırlayın
|
||||
Proje dizinine gidin ve `.env` dosyasını düzenleyin:
|
||||
```env
|
||||
NEXTJS_WEBHOOK_URL=https://your-nextjs-app.com/api/webhooks/mail-signal
|
||||
WEBHOOK_SECRET=your_secret_here
|
||||
NEXTJS_WEBHOOK_URL=https://webmail.ayris.tech/api/webhooks/mail-signal
|
||||
WEBHOOK_SECRET=besiktasK1903*
|
||||
```
|
||||
|
||||
### 2. Local Installation
|
||||
### 2. Yerel Çalıştırma
|
||||
Node.js (v18+) yüklü olduğundan emin olun:
|
||||
```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:
|
||||
### 3. Docker ile Çalıştırma
|
||||
En güvenli ve kolay yöntem Docker konteyneri olarak çalıştırmaktır:
|
||||
|
||||
```bash
|
||||
# Resmi oluşturun
|
||||
docker build -t ayristech-worker .
|
||||
|
||||
# Konteyneri başlatın
|
||||
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 \
|
||||
--restart unless-stopped \
|
||||
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.
|
||||
## Önemli Notlar
|
||||
- **Docker Socket**: Servis `docker exec` komutu kullandığı için `/var/run/docker.sock` mount edilmelidir.
|
||||
- **Vmail Volümü**: Mailcow'un mail dosyalarını sakladığı volüm `/var/lib/docker/volumes/mailcowdockerized_vmail-vol-1/_data/` yoluna mount edilmelidir.
|
||||
|
||||
Reference in New Issue
Block a user