All backend PHP files require config.php as their first include. It was gitignored and missing, causing PHP fatal errors that produced empty responses — breaking JSON parsing in the frontend. The new config.php has no hardcoded secrets; it reads all values (GEMINI_API_KEY, KLING_ACCESS_KEY, KLING_SECRET_KEY, SSO_*) from the .env file via env_loader.php. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
959 B
PHP
36 lines
959 B
PHP
<?php
|
|
/**
|
|
* Runtime configuration - reads all settings from the .env file.
|
|
* No secrets are stored here; keep this file committed to git.
|
|
*/
|
|
|
|
if (file_exists(__DIR__ . '/env_loader.php')) {
|
|
require_once __DIR__ . '/env_loader.php';
|
|
}
|
|
|
|
// Google Gemini
|
|
define('GEMINI_API_KEY', getenv('GEMINI_API_KEY') ?: '');
|
|
|
|
// Kling AI
|
|
define('KLING_ACCESS_KEY', getenv('KLING_ACCESS_KEY') ?: '');
|
|
define('KLING_SECRET_KEY', getenv('KLING_SECRET_KEY') ?: '');
|
|
|
|
// Azure AD SSO
|
|
if (!defined('SSO_ENABLED')) {
|
|
define('SSO_ENABLED', getenv('SSO_ENABLED') === 'true');
|
|
}
|
|
if (!defined('SSO_TENANT_ID')) {
|
|
define('SSO_TENANT_ID', getenv('SSO_TENANT_ID') ?: '');
|
|
}
|
|
if (!defined('SSO_CLIENT_ID')) {
|
|
define('SSO_CLIENT_ID', getenv('SSO_CLIENT_ID') ?: '');
|
|
}
|
|
|
|
// Session lifetime
|
|
ini_set('session.gc_maxlifetime', 3600);
|
|
ini_set('session.cookie_lifetime', 3600);
|
|
|
|
// Error reporting
|
|
error_reporting(E_ALL);
|
|
ini_set('display_errors', 0);
|
|
ini_set('log_errors', 1);
|