Add poll expiry, reminder mail and polls admin CLI
CI / Deploy / PHP 8.4 (push) Successful in 1m57s
CI / Deploy / PHP 8.5 (push) Successful in 2m9s
CI / Deploy / test (push) Successful in 1s
CI / Deploy / deploy (push) Skipped

Polls are deleted POLL_RETENTION_DAYS (default 90) after creation by the
cron job `bin/cake polls cleanup`. POLL_REMINDER_DAYS (default 14) before
that the owner gets a one-time reminder mail (expiry_reminded_at).

New commands: polls list, show (admin link only with --link), delete,
remind, cleanup. The expiry date is shown in the creation mail and the
dashboard. Docs: README, AGENTS.md, .env.example.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Sonnet 5.5 committed 2026-11-16 12:46:12 +01:00
1 parent 4caff47a09
commit a19cd8339e
20 files changed
+976 -1

No files matched your search

+24
View File
@@ -125,6 +125,8 @@ haben Vorrang vor der Datei.
| `SHOW_ADMIN_LINK_AFTER_CREATE` | Nur für Entwicklung |
| `THROTTLE_CREATE_PER_HOUR`, `THROTTLE_RECOVER_PER_HOUR` | Umfragen bzw. Wiederherstellungs-Mails pro IP und Stunde (0 = aus) |
| `THROTTLE_VOTES_PER_MINUTE` | Antworten pro IP und Minute (0 = aus). Hoch lassen: Oft teilt sich ein ganzer Saal eine IP |
| `POLL_RETENTION_DAYS` | Umfragen werden so viele Tage nach dem Anlegen vom Cronjob gelöscht (Standard 90, 0 = nie) |
| `POLL_REMINDER_DAYS` | So viele Tage vorher bekommt der Besitzer eine Erinnerungsmail (Standard 14, 0 = keine, muss kleiner als die Laufzeit sein) |
| `POLL_INTERVAL_MS` | Aktualisierungsintervall der Live-Ansichten |
| `EMBED_HEARTBEAT_SECONDS`, `EMBED_TIMEOUT_SECONDS` | Eingebettete Folien: Lebenszeichen-Intervall und Zeit bis zur automatischen Pause |
| `EMBED_FRAME_ANCESTORS` | Welche Seiten Folien einbetten dürfen (CSP `frame-ancestors`), z. B. `https://*.canva.com`; `*` = alle |
@@ -247,6 +249,28 @@ entfernt `bin/cake images_cleanup` (`--dry-run` zeigt sie nur an).
Bei Updates: Code aktualisieren, `composer install --no-dev`, Migrationen und `cache clear_all` wiederholen.
### Umfragen verwalten und aufräumen (CLI)
| Befehl | Zweck |
|---|---|
| `bin/cake polls list [--expired] [--email=text] [--sort=created\|activity\|title]` | Umfragen mit E-Mail, Ablaufdatum und Erinnerung |
| `bin/cake polls show <id\|code> [--link]` | Details; mit `--link` auch der geheime Admin-Link (nur auf Wunsch) |
| `bin/cake polls delete <id\|code> [--yes]` | Eine Umfrage samt Folien, Antworten und Bildern löschen (fragt nach) |
| `bin/cake polls remind [--dry-run]` | Erinnerungsmails für bald ablaufende Umfragen (je Umfrage einmal) |
| `bin/cake polls cleanup [--dry-run]` | Der Cronjob: erst erinnern, dann abgelaufene Umfragen löschen, danach verwaiste Bilddateien |
Eine Umfrage läuft `POLL_RETENTION_DAYS` Tage (Standard 90) nach dem Anlegen ab und wird dann gelöscht, unabhängig davon,
wie oft sie genutzt wurde. `POLL_REMINDER_DAYS` Tage vorher (Standard 14, 0 = keine Erinnerung) bekommt der Besitzer
einmalig eine Mail mit Ablaufdatum und Admin-Link, um die Ergebnisse als PDF zu sichern. Das Ablaufdatum steht außerdem in
der Anlege-Mail und im Dashboard (Karte „Sicherheit“). Es wird berechnet, eine Änderung der Einstellung gilt also sofort
für alle Umfragen. Ein einziger Cronjob erledigt Erinnern und Löschen (täglich 3:17 Uhr):
```
17 3 * * * cd /pfad/zu/plenario && php bin/cake.php polls cleanup --quiet
```
Vorher mit `polls cleanup --dry-run` prüfen, was gelöscht würde. Im Container: `docker compose exec plenario bin/cake polls cleanup`.
## Automatisches Deployment (Gitea Actions)
[.gitea/workflows/ci.yml](.gitea/workflows/ci.yml) testet jeden Push (PHPUnit + phpcs).