This commit is contained in:
2026-01-12 22:35:43 +01:00
parent 7a7e09f6ec
commit 239c2605d9
2 changed files with 184 additions and 7 deletions

View File

@@ -29,22 +29,23 @@ use App\App;
// 1) App-Konfiguration holen
$appConfig = App::get()->config();
$dbConfig = $appConfig->db ?? [];
// 2) Bridge-spezifische Konfiguration auf Basis der App-Config
$bridgeConfig = [
'token' => getenv('EMAILTEMPLATE_BRIDGE_TOKEN') ?: 'kgIqdL9aNWsFWy6mhSRpnuLc1EbZ62sGCcJAwjjlqqznEGE13szhksWUan0cEdjE',
'db' => [
'dsn' => $appConfig->db['dsn'] ?? '',
'user' => $appConfig->db['user'] ?? '',
'pass' => $appConfig->db['password'] ?? '',
'options' => $appConfig->db['options'] ?? [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
'dsn' => getenv('EMAILTEMPLATE_BRIDGE_DSN') ?: ($dbConfig['dsn'] ?? ''),
'user' => getenv('EMAILTEMPLATE_BRIDGE_DB_USER') ?: ($dbConfig['user'] ?? ''),
'pass' => getenv('EMAILTEMPLATE_BRIDGE_DB_PASS') ?: ($dbConfig['password'] ?? ''),
'options' => $dbConfig['options'] ?? [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
],
],
// Optional: Tabellen-Whitelist
'tables_allow' => [], // z.B. ['customers', 'orders']
'tables_allow' => ['event', 'mail_accounts', 'users', 'verification_codes'], // z.B. ['customers', 'orders']
];
@@ -185,4 +186,4 @@ try {
]);
} catch (Throwable $e) {
bridgeRespond(['ok' => false, 'error' => 'Schema fetch failed', 'detail' => $e->getMessage()], 500);
}
}