Erweiterte Features (2/2): Cleanup/DSGVO, Webhooks, REST-API, Backup, CI, Docker
- Auto-Cleanup/DSGVO: cron_cleanup.php (token-geschützt) löscht abgelaufene Voucher, Audit-Log, Login-Versuche und Reset-Tokens nach konfigurierbaren Fristen - Webhooks: includes/Notifier.php (Slack/Teams/generisch), Auslösung bei Voucher-Erstellung (Web + API) - REST-API: includes/ApiKey.php (SHA-256, Präfix-Lookup), api/bootstrap.php, api/vouchers.php (GET/POST), api/sites.php; admin/api_keys.php zur Verwaltung - Config-Backup/Restore: admin/backup.php (JSON Export/Import, Cron-Token geschützt) - admin/integrations.php: Trusted-Proxy, Webhook, Cleanup-Fristen - CI: .github/workflows/ci.yml (php -l auf 7.4 & 8.2, lang-Validierung) - Docker: Dockerfile, docker-compose.yml (MariaDB), entrypoint (config aus ENV), .dockerignore - Nav + i18n (DE/EN) für alle neuen Admin-Seiten
This commit is contained in:
parent
eec28f77b8
commit
9463486225
18 changed files with 972 additions and 0 deletions
29
docker/entrypoint.sh
Normal file
29
docker/entrypoint.sh
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
CONFIG=/var/www/html/config.php
|
||||
|
||||
# config.php aus Umgebungsvariablen erzeugen, falls noch nicht vorhanden und
|
||||
# DB-Variablen gesetzt sind. Sonst kann der Web-Installer (install.php) genutzt
|
||||
# werden. APP_KEY wird einmalig generiert und sollte als ENV persistiert werden.
|
||||
if [ ! -f "$CONFIG" ] && [ -n "$DB_HOST" ] && [ -n "$DB_NAME" ]; then
|
||||
if [ -z "$APP_KEY" ]; then
|
||||
APP_KEY=$(php -r 'echo base64_encode(random_bytes(32));')
|
||||
echo "[entrypoint] WARN: kein APP_KEY gesetzt – generiere einmaligen Schluessel."
|
||||
echo "[entrypoint] Fuer dauerhaften Betrieb APP_KEY als ENV setzen: $APP_KEY"
|
||||
fi
|
||||
cat > "$CONFIG" <<PHP
|
||||
<?php
|
||||
define('DB_HOST', getenv('DB_HOST') ?: '${DB_HOST}');
|
||||
define('DB_NAME', getenv('DB_NAME') ?: '${DB_NAME}');
|
||||
define('DB_USER', getenv('DB_USER') ?: '${DB_USER}');
|
||||
define('DB_PASS', getenv('DB_PASS') ?: '${DB_PASS}');
|
||||
define('APP_KEY', getenv('APP_KEY') ?: '${APP_KEY}');
|
||||
define('SESSION_LIFETIME', (int)(getenv('SESSION_LIFETIME') ?: 3600));
|
||||
date_default_timezone_set(getenv('TZ') ?: 'Europe/Berlin');
|
||||
PHP
|
||||
chown www-data:www-data "$CONFIG"
|
||||
echo "[entrypoint] config.php aus ENV erzeugt."
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue