From ac9cd464ffdf58038f4c67b672019217e5b8e49a Mon Sep 17 00:00:00 2001 From: AyrisAI Date: Thu, 14 May 2026 19:19:06 +0300 Subject: [PATCH] docs: add .env.example and English documentation to README --- .env.example | 2 ++ README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..bbcd979 --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +NEXTJS_WEBHOOK_URL=https://your-domain.com/api/webhooks/mail-signal +WEBHOOK_SECRET=your_strong_secret_here diff --git a/README.md b/README.md index 84f634f..04421cc 100644 --- a/README.md +++ b/README.md @@ -38,3 +38,46 @@ docker run -d \ ## Ö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. + +--- + +# AyrisTech Mail Worker (V10.3) - English + +Service that monitors Mailcow Dovecot logs and filesystem to forward new incoming emails to a Next.js webhook. + +## Installation + +### 1. Prepare Files +Go to the project directory and edit the `.env` file (refer to `.env.example`): +```env +NEXTJS_WEBHOOK_URL=https://your-domain.com/api/webhooks/mail-signal +WEBHOOK_SECRET=your_strong_secret_here +``` + +### 2. Run Locally +Ensure Node.js (v18+) is installed: +```bash +npm install +npm start +``` + +### 3. Run with Docker +The most secure and easy method is to run as a Docker container: + +```bash +# Build the image +docker build -t ayristech-worker . + +# Start the container +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 service uses the `docker exec` command, so `/var/run/docker.sock` must be mounted. +- **Vmail Volume**: The volume where Mailcow stores email files must be mounted to the path `/var/lib/docker/volumes/mailcowdockerized_vmail-vol-1/_data/`.