6
This commit is contained in:
@@ -218,7 +218,7 @@ class JwtService
|
||||
// ── Internal API Key — للـ get_connect.php ─────────────
|
||||
public static function validateInternalKey(): void
|
||||
{
|
||||
$keyPath = '/home/intaleq-api/.internal_socket_key';
|
||||
$keyPath = getenv('INTERNAL_SOCKET_KEY_PATH');
|
||||
$sent = $_SERVER['HTTP_X_INTERNAL_KEY'] ?? '';
|
||||
$expected = (file_exists($keyPath) ? trim(file_get_contents($keyPath)) : '') ?: 'Intaleq_Secure_Bridge_Key_2026_@!socket';
|
||||
|
||||
|
||||
@@ -76,10 +76,11 @@ require_once __DIR__ . '/Auth/JwtService.php';
|
||||
|
||||
// 6. تهيئة Encryption Helper العام (للتوافقية)
|
||||
// يتم استخدام .enckey (32 بايت) لتشفير البيانات
|
||||
$encKey = trim(@file_get_contents('/home/intaleq-api/.enckey') ?: '');
|
||||
if (!$encKey) {
|
||||
$encKey = getenv('ENC_KEY') ?: '';
|
||||
}
|
||||
$encKeyPath = getenv('ENCRYPTION_KEY_PATH');
|
||||
$encKey = trim(@file_get_contents($encKeyPath) ?: '');
|
||||
if (!$encKey) {
|
||||
$encKey = getenv('ENC_KEY') ?: '';
|
||||
}
|
||||
|
||||
if (!$encKey || strlen($encKey) !== 32) {
|
||||
error_log("[FATAL] Encryption key (.enckey) is missing or invalid length (must be 32 bytes).");
|
||||
|
||||
Reference in New Issue
Block a user