Files
tsv08kulmbach-website/config/config.example.php
fs bee19a2ddc Cron-Zeilen für beide Syncs dokumentiert
CLAUDE.md und die Header von instagram-sync.php wie
matchcenter-sync.php verweisen für die Cron-Einrichtung auf
config.example.php — dort standen sie nie. Nachgetragen inkl.
Pfad-Platzhaltern und Hinweis auf den PHP-Binary-Pfad bei All-Inkl.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 23:30:11 +02:00

80 lines
4.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
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.
<?php
/**
* Vorlage für config/config.php — kopieren und Werte eintragen:
* cp config/config.example.php config/config.php
*
* config.php ist gitignored und liegt außerhalb des Webroots (zusätzlich per .htaccess gesperrt).
*
* ---------------------------------------------------------------------------
* CRONJOBS (im KAS anlegen, Typ „eigener Cronjob“ / Shell)
* ---------------------------------------------------------------------------
* SITE=/www/htdocs/<KAS-User>/tsv08kulmbach (echten Pfad einsetzen: pwd auf dem Server)
* PHP=/usr/bin/php (All-Inkl ggf. /usr/local/bin/php8.2 — `which php8.2` prüft es)
*
* # Instagram-Feed: 2×/Tag (versetzte Minuten, damit die Läufe sich nicht überlappen)
* 17 6,18 * * * cd $SITE && $PHP bin/instagram-sync.php >> storage/logs/instagram.log 2>&1
*
* # Matchcenter: 2×/Tag als Grundtakt
* 37 7,19 * * * cd $SITE && $PHP bin/matchcenter-sync.php >> storage/logs/matchcenter.log 2>&1
*
* # Matchcenter am Spieltag-Nachmittag/Abend ½-stündlich (Sa+So 1321 Uhr),
* # damit Ergebnisse und Tabelle zeitnah stehen.
* 7,37 13-21 * * 6,0 cd $SITE && $PHP bin/matchcenter-sync.php >> storage/logs/matchcenter.log 2>&1
*
* Beide Skripte sind CLI-only, sperren sich per Lock gegen Parallelläufe und lassen bei
* jedem Fehler den letzten guten Cache stehen — ein fehlgeschlagener Lauf schadet nie.
* Erstlauf nach dem Deploy einmal von Hand anstoßen (füllt Cache + Bilder/Wappen).
*/
return [
// Kanonische Basis-URL ohne trailing slash (für Canonical, OG, Sitemap).
'base_url' => 'https://www.tsv08kulmbach.de',
// 'production' oder 'development' (steuert Fehleranzeige).
'env' => 'production',
// Geheimer Schlüssel für die HMAC-Time-Trap der Formulare.
// Generieren mit: php -r "echo bin2hex(random_bytes(32));"
'app_secret' => 'CHANGE_ME',
// All-Inkl SMTP (Postfach im KAS anlegen; Host = <KAS-Login>.kasserver.com).
// Verbindung testen ohne Mailversand: php bin/smtp-test.php
'smtp' => [
'host' => 'w01ca75d.kasserver.com',
'port' => 587, // STARTTLS
'username' => 'noreply@tsv08kulmbach.de', // volle Postfach-Adresse
'password' => 'POSTFACH_PASSWORT',
// Absender: das authentifizierte Postfach (gleiche Domain, sonst lehnt All-Inkl ab).
'from' => 'noreply@tsv08kulmbach.de',
'from_name' => 'TSV 08 Kulmbach',
// Empfänger der Formular-Mails.
'to' => 'info@tsv08kulmbach.de',
],
// Instagram-Scraper (bin/instagram-sync.php).
'instagram' => [
'username' => 'tsv08kulmbach',
'max_posts' => 9,
],
// Matchcenter-Scraper (bin/matchcenter-sync.php) — Spielplan/Ergebnisse/Tabelle
// aus der öffentlichen BFV-Widget-JSON-API. Die IDs sind keine Geheimnisse
// (sie steckten schon im alten BFV-Widget-Embed) und dürfen hier stehen.
'matchcenter' => [
// Referer für die BFV-Requests (gegen HTTP 418).
'referer' => 'https://widget-prod.bfv.de/',
'max_upcoming' => 5, // anstehende Spiele pro Team + im globalen Slider
'max_results' => 5, // letzte Ergebnisse pro Team
// key = Schlüssel in data/teams.json (für kuratierten Namen/Liga/Slug),
// team_id = BFV permanentId (saison-stabil). compound_id = Wettbewerbs-ID
// der Tabelle — nur Fallback: der Scraper leitet die aktuelle compoundId
// automatisch aus der Matches-API ab, sodass eine neue Saison von selbst
// übernommen wird. compound_id nur pflegen, falls die Auto-Erkennung mal fehlt.
'teams' => [
['key' => 'erste-mannschaft', 'team_id' => '016PKHIPIO000000VV0AG811VUDIC8D7', 'compound_id' => '02TBKEVREG000006VS5489BTVVQ0O654-G'],
['key' => 'zweite-mannschaft', 'team_id' => '016PCRVRJC000000VV0AG811VTE5EA5R', 'compound_id' => '02TD8CKMD8000006VS5489BTVTLPPK10-G'],
['key' => 'damen', 'team_id' => '01HLQ7QVES000000VV0AG80NVVKQLCU9', 'compound_id' => '02TK5AGFE0000004VS5489BUVVPGA9RV-G'],
],
],
];