Fix hardcoded jordan-siro URL in location server and origins

This commit is contained in:
Hamza-Ayed
2026-08-01 18:27:52 +03:00
parent ff91d95dba
commit 998cad6756
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ header("X-XSS-Protection: 1; mode=block");
// CORS مع التحقق من المصدر المسموح // CORS مع التحقق من المصدر المسموح
$envOrigins = array_map('trim', explode(',', getenv('CORS_ALLOWED_ORIGINS') ?: '')); $envOrigins = array_map('trim', explode(',', getenv('CORS_ALLOWED_ORIGINS') ?: ''));
$defaultOrigins = ['https://siromove.com', 'https://admin.siromove.com', 'https://jordan-siro.intaleqapp.com', 'http://localhost', 'http://127.0.0.1']; $defaultOrigins = ['https://siromove.com', 'https://admin.siromove.com', 'https://api.intaleqapp.com', 'http://localhost', 'http://127.0.0.1'];
$allowedOrigins = array_unique(array_merge($envOrigins, $defaultOrigins)); $allowedOrigins = array_unique(array_merge($envOrigins, $defaultOrigins));
$origin = $_SERVER['HTTP_ORIGIN'] ?? ''; $origin = $_SERVER['HTTP_ORIGIN'] ?? '';
if (in_array($origin, $allowedOrigins)) { if (in_array($origin, $allowedOrigins)) {
+1 -1
View File
@@ -9,7 +9,7 @@ header('Content-Type: application/json');
// ✅ FIX H-03: allowlist صارم للـ Admin Origins // ✅ FIX H-03: allowlist صارم للـ Admin Origins
$allowedOrigins = array_filter([ $allowedOrigins = array_filter([
getenv('ALLOWED_ORIGIN') ?: 'https://siromove.com', getenv('ALLOWED_ORIGIN') ?: 'https://siromove.com',
'https://jordan-siro.intaleqapp.com', 'https://api.intaleqapp.com',
'http://localhost', 'http://localhost',
'http://127.0.0.1', 'http://127.0.0.1',
]); ]);
+1 -1
View File
@@ -32,7 +32,7 @@ try {
// 2. طلب بيانات السائقين من سيرفر اللوكيشن (Redis API) // 2. طلب بيانات السائقين من سيرفر اللوكيشن (Redis API)
// — يرجع cache hits لو موجودة، وإلا يرجع IDs فقط // — يرجع cache hits لو موجودة، وإلا يرجع IDs فقط
// ========================================== // ==========================================
$locationServerUrl = getenv('LOCATION_API_URL') ?: 'https://jordan-siro.intaleqapp.com/loction_server/api_get_nearby.php'; $locationServerUrl = getenv('LOCATION_API_URL') ?: 'https://api.intaleqapp.com/loction_server/api_get_nearby.php';
$keyPath = getenv('INTERNAL_SOCKET_KEY_PATH') ?: '/keys/.internal_socket_key'; $keyPath = getenv('INTERNAL_SOCKET_KEY_PATH') ?: '/keys/.internal_socket_key';
$INTERNAL_KEY = getenv('INTERNAL_SOCKET_KEY') ?: (file_exists($keyPath) ? trim((string)@file_get_contents($keyPath)) : (file_exists(__DIR__ . '/../../../loction-keys/.internal_socket_key') ? trim((string)@file_get_contents(__DIR__ . '/../../../loction-keys/.internal_socket_key')) : (file_exists('/home/location/.internal_socket_key') ? trim((string)@file_get_contents('/home/location/.internal_socket_key')) : ''))); $INTERNAL_KEY = getenv('INTERNAL_SOCKET_KEY') ?: (file_exists($keyPath) ? trim((string)@file_get_contents($keyPath)) : (file_exists(__DIR__ . '/../../../loction-keys/.internal_socket_key') ? trim((string)@file_get_contents(__DIR__ . '/../../../loction-keys/.internal_socket_key')) : (file_exists('/home/location/.internal_socket_key') ? trim((string)@file_get_contents('/home/location/.internal_socket_key')) : '')));