Files
BlueMastoFeed/README.md

115 lines
4.4 KiB
Markdown
Raw Normal View History

2025-05-25 09:37:47 +02:00
# 📰 BlueMastoFeed RSS zu Mastodon & Bluesky Poster
2025-05-24 16:50:42 +02:00
2025-05-25 09:37:47 +02:00
**BlueMastoFeed** ist ein Docker-basiertes Tool, das regelmäßig einen RSS-Feed ausliest und neue Beiträge automatisch auf **Mastodon** und **Bluesky** veröffentlicht.
2025-05-24 16:50:42 +02:00
## Features
- RSS-Feed regelmäßig auslesen
- Postfilterung nach Alter (`MAX_POST_AGE_DAYS`)
- Verhindert doppelte Posts mit Hilfe einer persistierten ID-Liste
- Posten auf:
- ✅ Mastodon
- ✅ Bluesky
- ✅ Beides (konfigurierbar über `.env`)
- Optionaler E-Mail-Versand bei Erfolg oder Fehler
- Healthcheck-Endpoint auf Port 8000
2025-05-24 16:50:42 +02:00
## Voraussetzungen
2025-05-25 09:37:47 +02:00
- Docker (Version **20.10** oder höher)
2025-05-24 16:50:42 +02:00
- Zugangsdaten für Mastodon & Bluesky
2025-05-25 09:37:47 +02:00
- Gültige RSS-Feed-URL
2025-05-24 16:50:42 +02:00
2025-05-25 09:37:47 +02:00
## Einrichtung für Produktivbetrieb
### 1. Datenverzeichnis auf dem Host erstellen
```bash
mkdir -p /opt/bluemastofeed/data
```
### 2. Container mit Umgebungsvariablen starten
```bash
docker run -d \
--name bluemastofeed \
-e FEED_URL=https://example.com/rss.xml \
-e MASTODON_API_BASE_URL=https://mastodon.social \
-e MASTODON_ACCESS_TOKEN=your_mastodon_access_token \
-e BSKY_IDENTIFIER=your_handle.bsky.social \
-e BSKY_PASSWORD=your_bluesky_password \
-v /opt/bluemastofeed/data:/data \
dev.ksite.de/ralf.kirchner/bluemastofeed:latest
```
## Einrichtung für Entwicklung
### 1. Repository klonen
2025-05-24 16:50:42 +02:00
```bash
2025-05-24 18:10:14 +02:00
git clone https://dev.ksite.de/ralf.kirchner/BlueMastoFeed.git
cd BlueMastoFeed
2025-05-24 16:50:42 +02:00
```
2025-05-25 09:37:47 +02:00
### 2. `.env`-Datei erstellen
2025-05-24 16:50:42 +02:00
2025-05-25 09:37:47 +02:00
Erstelle im Projektverzeichnis eine Datei namens `.env` mit folgendem Inhalt:
2025-05-24 16:50:42 +02:00
```env
2025-05-25 09:37:47 +02:00
FEED_URL=https://example.com/rss.xml
2025-05-24 16:50:42 +02:00
MASTODON_API_BASE_URL=https://mastodon.social
MASTODON_ACCESS_TOKEN=your_mastodon_token
BSKY_IDENTIFIER=your_bsky_handle
BSKY_PASSWORD=your_bsky_password
```
2025-05-25 09:37:47 +02:00
### 3. Docker-Image lokal bauen
2025-05-24 16:50:42 +02:00
```bash
2025-05-24 18:10:14 +02:00
docker build -t bluemastofeed .
2025-05-24 16:50:42 +02:00
```
2025-05-25 09:37:47 +02:00
### 4. Container starten
2025-05-24 16:50:42 +02:00
```bash
docker run -d \
--name rss-poster \
--env-file .env \
-v $(pwd)/data:/data \
2025-05-24 18:10:14 +02:00
bluemastofeed
2025-05-24 16:50:42 +02:00
```
2025-05-25 09:37:47 +02:00
## Umgebungsvariablen
Die folgenden Umgebungsvariablen steuern das Verhalten des Containers. Sie können entweder direkt beim Start übergeben oder über eine `.env`-Datei definiert werden.
| Variable | Beschreibung | Beispielwert | Standardwert |
| ----------------------- | ------------------------------------------------------------ | -------------------------- | -------------- |
| `FEED_URL` | URL zum RSS- oder Atom-Feed | `https://example.com/feed` | _erforderlich_ |
| `MAX_POST_AGE_DAYS` | Maximales Alter eines Beitrags (in Tagen), der gepostet werden darf | `0` = nur heutige Beiträge | `0` |
| `POST_TARGETS` | Zielplattform(en): `mastodon`, `bluesky`, `both` | `mastodon` = nur Mastodon | `both` |
| `MASTODON_API_BASE_URL` | Basis-URL deiner Mastodon-Instanz | `https://mastodon.social` | _erforderlich_ |
| `MASTODON_ACCESS_TOKEN` | Access Token für die Mastodon API | `abc123...` | _erforderlich_ |
| `BSKY_IDENTIFIER` | Bluesky-Handle | `name.bsky.social` | _erforderlich_ |
| `BSKY_PASSWORD` | Passwort für das Bluesky-Konto | `passwort123` | _erforderlich_ |
| `INTERVAL_MINUTES` | Zeitintervall in Minuten zwischen den Feed-Prüfungen | `30` | `30` |
| `EMAIL_MODE` | Wann eine Status-E-Mail gesendet werden soll (`none`, `errors`, `all`) | `errors` | `errors` |
| `SMTP_HOST` | SMTP-Server für Status-E-Mails | `smtp.example.com` | _optional_ |
| `SMTP_PORT` | Port des SMTP-Servers | `587` | `587` |
| `SMTP_USER` | Benutzername für SMTP | `user@example.com` | _optional_ |
| `SMTP_PASSWORD` | Passwort für SMTP | `sicherespasswort` | _optional_ |
| `EMAIL_FROM` | Absenderadresse für E-Mails | `noreply@example.com` | _optional_ |
| `EMAIL_TO` | Empfängeradresse für E-Mails | `admin@example.com` | _optional_ |