NextcloudLogAlert/README.md
2025-01-30 18:39:51 +00:00

62 lines
2.1 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Nextcloud Log Alert 🚀
**Automatisierte Überwachung und Benachrichtigung von Nextcloud-Logs via Discord Webhook**
## 📌 Überblick
Dieses Projekt bietet eine einfache Möglichkeit, Nextcloud-Logeinträge automatisch zu überwachen und relevante Meldungen an einen Discord-Kanal zu senden.
Es nutzt ein Python-Skript, das über einen systemd-Service automatisch gestartet wird und alle 30 Sekunden neue Logeinträge überprüft.
## 🔧 Features
-**Automatische Erkennung neuer Logeinträge** Nur neue Meldungen werden gesendet, um Spam zu vermeiden.
-**Einfache Einrichtung** Ein Bash-Installationsskript erledigt die gesamte Konfiguration.
-**Persistente Konfiguration** Der Discord Webhook wird in einer Konfigurationsdatei gespeichert.
-**Systemd-Integration** Automatischer Start des Services beim Booten.
-**Leichtgewichtig und ressourcenschonend**
## 📥 Installation
### Webhook erstellen:
- https://support.discord.com/hc/de/articles/228383668-Einleitung-in-Webhooks
### 1⃣ Repository klonen
```bash
git clone https://gitea.archer-sys.de/torge.eiben/NextcloudLogAlert
cd NextcloudLogAlert
sudo chmod +x install.sh
sudo chmod +x uninstall.sh
```
### 2⃣ Installationsskript ausführen
```bash
sudo ./install.sh
```
Das Skript erledigt:
- ✅ Erstellung des notwendigen Verzeichnisses (/opt/nextcloud_log_alert)
- ✅ Einrichtung der Konfigurationsdatei (webhook.conf)
- ✅ Aktivierung des systemd-Services
### 3⃣ Discord Webhook hinterlegen
Während der Installation wirst du nach der Webhook-URL für Discord gefragt. Falls du sie später ändern möchtest:
```bash
sudo nano /opt/nextcloud_log_alert/webhook.conf
```
### ⚙️ Konfigurationsdateien
/opt/nextcloud_log_alert/webhook.conf Speichert die Webhook-URL.
/home/data/nextcloud.log Logdatei von Nextcloud, die überwacht wird.
### 🛠 Anpassungen
Falls du den Pfad der Nextcloud-Logdatei ändern möchtest, kannst du dies direkt im Python-Skript tun:
```bash
sudo nano /opt/nextcloud_log_alert/nextcloud_log_alert.py
```
Ändere die Zeile:
```python
LOG_FILE = "/home/data/nextcloud.log"
```
### 📜 Lizenz
MIT License