mirror of
https://github.com/complexcaresolutions/cms.c2sgmbh.git
synced 2026-03-17 17:24:12 +00:00
docs: update Redis auth, PM2 config, and eviction policy documentation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d50d3cd208
commit
7446318bf3
5 changed files with 13 additions and 7 deletions
|
|
@ -167,7 +167,7 @@ Beispiel: `src/migrations/20260109_020000_add_blogwoman_collections.ts`
|
|||
- **Plugin ImportMap:** Nach Plugin-Änderungen `pnpm payload generate:importmap`
|
||||
- **User-Tenant-Zuweisung:** Neue User müssen manuell Tenants zugewiesen bekommen
|
||||
- **Admin Login:** Custom Route mit Audit-Logging (`src/app/(payload)/api/users/login/route.ts`)
|
||||
- **Queue Worker:** Benötigt `tsx` als devDependency (TypeScript via PM2)
|
||||
- **Queue Worker:** PM2 nutzt `node_modules/tsx/dist/cli.mjs` direkt (nicht `npx`), `exec_mode: 'fork'`
|
||||
- **PgBouncer:** Transaction-Mode kann Migrationen stören → `./scripts/db-direct.sh`
|
||||
- **TRUST_PROXY=true:** PFLICHT hinter Reverse-Proxy, sonst funktionieren Rate-Limiting und IP-Allowlists nicht
|
||||
- **CSRF_SECRET:** PFLICHT in Production (oder PAYLOAD_SECRET) - Server startet nicht ohne
|
||||
|
|
@ -374,6 +374,7 @@ Wichtigste Variablen (vollständige Liste in `.env`):
|
|||
| `TRUST_PROXY` | `true` hinter Reverse-Proxy | Ja |
|
||||
| `CSRF_SECRET` | CSRF-Token Secret (oder PAYLOAD_SECRET) | Prod |
|
||||
| `CRON_SECRET` | Auth für Cron-Endpoints | Ja |
|
||||
| `REDIS_PASSWORD` | Redis Authentifizierung | Ja |
|
||||
| `REDIS_URL` | Redis Cache (localhost:6379) | Optional |
|
||||
| `META_APP_ID/SECRET` | Facebook/Instagram OAuth | Für Community |
|
||||
| `GOOGLE_CLIENT_ID/SECRET` | YouTube OAuth | Für YouTube |
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ const status = await getPdfJobStatus(job.id)
|
|||
- `QUEUE_RETENTION_CONCURRENCY`: Parallele Retention-Jobs (default: 1)
|
||||
- `QUEUE_DEFAULT_RETRY`: Retry-Versuche (default: 3)
|
||||
- `QUEUE_REDIS_DB`: Redis-Datenbank für Queue (default: 1)
|
||||
- `REDIS_PASSWORD`: Redis-Authentifizierung (Pflicht)
|
||||
|
||||
**Dateien:**
|
||||
- `src/lib/queue/queue-service.ts` - Zentrale Queue-Verwaltung
|
||||
|
|
@ -181,6 +182,8 @@ Scheduler (Cron) → Retention Queue (BullMQ) → Retention Worker
|
|||
|
||||
## Redis Caching
|
||||
|
||||
Redis erfordert Authentifizierung (`REDIS_PASSWORD`). Eviction-Policy: `noeviction` (BullMQ-Anforderung — verhindert Datenverlust bei Queue-Jobs).
|
||||
|
||||
```typescript
|
||||
import { redis } from '@/lib/redis'
|
||||
|
||||
|
|
|
|||
|
|
@ -304,12 +304,12 @@ module.exports = {
|
|||
},
|
||||
{
|
||||
name: 'queue-worker',
|
||||
script: './scripts/run-queue-worker.ts',
|
||||
interpreter: 'node',
|
||||
interpreter_args: '--import tsx',
|
||||
script: 'node_modules/tsx/dist/cli.mjs',
|
||||
args: 'scripts/run-queue-worker.ts',
|
||||
exec_mode: 'fork',
|
||||
cwd: '/home/payload/payload-cms',
|
||||
instances: 1,
|
||||
max_memory_restart: '500M'
|
||||
max_memory_restart: '768M'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -399,6 +399,7 @@ PORT=3001
|
|||
|
||||
# Redis
|
||||
REDIS_URL=redis://localhost:6379
|
||||
REDIS_PASSWORD=***
|
||||
|
||||
# Security
|
||||
CSRF_SECRET=***
|
||||
|
|
@ -422,6 +423,7 @@ PORT=3000
|
|||
|
||||
# Redis
|
||||
REDIS_URL=redis://localhost:6379
|
||||
REDIS_PASSWORD=***
|
||||
|
||||
# Security
|
||||
CSRF_SECRET=***
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ curl -I https://cms.c2sgmbh.de/admin
|
|||
curl -I https://cms.c2sgmbh.de/api
|
||||
|
||||
# Redis verbunden?
|
||||
redis-cli ping
|
||||
redis-cli -a $REDIS_PASSWORD ping
|
||||
```
|
||||
|
||||
---
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ systemctl status frontend-*
|
|||
| PostgreSQL 17 | postgres | 5432 | localhost | ✅ Läuft |
|
||||
| Payload CMS | payload | 3001 | https://cms.c2sgmbh.de | ✅ Läuft |
|
||||
| Umami Analytics | umami | 3000 | https://analytics.c2sgmbh.de | ✅ Läuft |
|
||||
| Redis Cache | redis | 6379 | localhost | ✅ Läuft |
|
||||
| Redis Cache | redis | 6379 | localhost (auth: REDIS_PASSWORD, policy: noeviction) | ✅ Läuft |
|
||||
| Nginx | root | 80/443 | Reverse Proxy | ✅ Läuft |
|
||||
|
||||
### Deploy
|
||||
|
|
|
|||
Loading…
Reference in a new issue