diff --git a/config.example.php b/config.example.php index 91d1f7c..5ef3bd4 100644 --- a/config.example.php +++ b/config.example.php @@ -2,13 +2,35 @@ /** * Configuration file for Nano Banana Pro Image Generator * - * Copy this file to config.php and add your API key + * IMPORTANT: Copy this file to config.php and add your Google Gemini API key */ +// Load environment variables from .env file +if (file_exists(__DIR__ . '/env_loader.php')) { + require_once __DIR__ . '/env_loader.php'; +} + // Google Gemini API Key (Nano Banana Pro) // Get your API key from: https://aistudio.google.com/app/apikey define('GEMINI_API_KEY', 'YOUR_API_KEY_HERE'); +// MSAL / Azure AD SSO Configuration +// Always define these constants with defaults if not set +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 configuration ini_set('session.gc_maxlifetime', 3600); // 1 hour ini_set('session.cookie_lifetime', 3600); + +// Error reporting (set to 0 in production) +error_reporting(E_ALL); +ini_set('display_errors', 1); // Temporarily enabled for debugging +ini_set('log_errors', 1); diff --git a/server-check.php b/server-check.php index e39ddc7..9a86323 100644 --- a/server-check.php +++ b/server-check.php @@ -101,7 +101,9 @@ header('Content-Type: text/html; charset=utf-8'); require_once __DIR__ . '/config.php'; echo "
✓ config.php loaded successfully"; echo "
GEMINI_API_KEY: " . (defined('GEMINI_API_KEY') && !empty(GEMINI_API_KEY) ? '✓ SET' : '✗ NOT SET') . "";
- echo " SSO_ENABLED: " . (defined('SSO_ENABLED') ? (SSO_ENABLED ? 'TRUE' : 'FALSE') : '✗ NOT SET') . "";
+ echo " SSO_ENABLED: " . (defined('SSO_ENABLED') ? (SSO_ENABLED ? 'TRUE' : 'FALSE') : '✗ NOT DEFINED') . "";
+ echo " SSO_TENANT_ID: " . (defined('SSO_TENANT_ID') ? (SSO_TENANT_ID ? '✓ SET' : 'EMPTY') : '✗ NOT DEFINED') . "";
+ echo " SSO_CLIENT_ID: " . (defined('SSO_CLIENT_ID') ? (SSO_CLIENT_ID ? '✓ SET' : 'EMPTY') : '✗ NOT DEFINED') . "";
} else {
echo "✗ config.php missing"; }