yxcxc
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user