From e5bf70fddb02e45daaf190da5f5964bfc3d237cd Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Thu, 23 Jul 2026 02:14:58 +0300 Subject: [PATCH] Update: 2026-07-23 02:14:58 --- backend/functions.php | 8 ++++---- backend/ride/rides/cancel_ride_by_passenger.php | 2 +- backend/ride/rides/finish_ride_updates.php | 2 +- loction_server/siro/functions.php | 2 +- ride_server/intaleq/ride/rides/getRideStatus.php | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/functions.php b/backend/functions.php index e27a3b9a..33699564 100644 --- a/backend/functions.php +++ b/backend/functions.php @@ -82,7 +82,7 @@ function findBestDrivers($con, $lat, $lng, $carType, $endLat = null, $endLng = n // 🔥 [Fix Hardcoded URL] كان مثبتاً على رابط الإنتاج مباشرة بخلاف كل استدعاء // آخر لسيرفر اللوكيشن في هذا الملف (يعتمد على env)، فأي بيئة غير إنتاج كانت // تضرب سيرفر الإنتاج الحقيقي بالخطأ. - $locationServerUrl = getenv('LOCATION_API_URL') ?: "https://location.intaleq.xyz/api_get_nearby.php"; + $locationServerUrl = getenv('LOCATION_API_URL') ?: "http://nginx/loction_server/api_get_nearby.php"; $INTERNAL_KEY = function_exists('getInternalSocketKey') ? getInternalSocketKey() : ''; $postData = ['lat' => $lat, 'lng' => $lng, 'radius' => 5, 'limit' => 100]; @@ -253,7 +253,7 @@ function getDistanceBetweenPoints($lat1, $lon1, $lat2, $lon2) { } // --- دالة مساعدة لمخاطبة سيرفر السائقين (Location Socket) --- function notifyDriversRideTaken($rideId, $winnerDriverId) { - $url = getenv('LOCATION_SERVER_URL') ?: 'http://location.intaleq.xyz:2021'; + $url = getenv('LOCATION_SERVER_URL') ?: 'http://nginx/loction_server/driver_socket.php'; if (!isAllowedSocketUrl($url)) return; $INTERNAL_KEY = function_exists('getInternalSocketKey') ? getInternalSocketKey() : ''; @@ -275,7 +275,7 @@ function notifyDriversRideTaken($rideId, $winnerDriverId) { curl_close($ch); } function notifyDriversOnLocationServer($drivers_ids_array, $payload, $rideId = null) { - $url = getenv('LOCATION_SERVER_URL') ?: 'http://location.intaleq.xyz:2021'; + $url = getenv('LOCATION_SERVER_URL') ?: 'http://nginx/loction_server/driver_socket.php'; if (!isAllowedSocketUrl($url)) return null; $INTERNAL_KEY = function_exists('getInternalSocketKey') ? getInternalSocketKey() : ''; @@ -311,7 +311,7 @@ function notifyDriversOnLocationServer($drivers_ids_array, $payload, $rideId = n * تخاطب السوكيت الموجود محلياً على نفس السيرفر */ function notifyPassengerOnRideServer($passenger_id, $payload) { - $url = getenv('RIDE_SOCKET_URL') ?: 'http://location.intaleq.xyz:3031'; + $url = getenv('RIDE_SOCKET_URL') ?: 'http://nginx/loction_server/passenger_socket.php'; if (!isAllowedSocketUrl($url)) return null; $INTERNAL_KEY = function_exists('getInternalSocketKey') ? getInternalSocketKey() : ''; diff --git a/backend/ride/rides/cancel_ride_by_passenger.php b/backend/ride/rides/cancel_ride_by_passenger.php index 458ffde2..e1f26f8e 100644 --- a/backend/ride/rides/cancel_ride_by_passenger.php +++ b/backend/ride/rides/cancel_ride_by_passenger.php @@ -82,7 +82,7 @@ try { // 🔥 يُرسل دائماً بغض النظر عن driver_id — إذا كانت الرحلة لم تُقبل بعد // (driver_id = 0)، لوكيشن سيرفر يستخدم ride:offered_drivers:{rideId} // من Redis لإشعار كل السائقين الذين وصلهم عرض هذه الرحلة أصلاً. - $socketUrl = getenv('LOCATION_SERVER_URL') ?: 'http://location.intaleq.xyz:2021'; + $socketUrl = getenv('LOCATION_SERVER_URL') ?: 'http://nginx/loction_server/driver_socket.php'; $internalKeyPath = getenv('INTERNAL_SOCKET_KEY_PATH') ?: ''; $internalKey = ($internalKeyPath && file_exists($internalKeyPath)) ? trim(file_get_contents($internalKeyPath)) : (getenv('INTERNAL_SOCKET_KEY') ?: ''); diff --git a/backend/ride/rides/finish_ride_updates.php b/backend/ride/rides/finish_ride_updates.php index 4044e088..aed117da 100644 --- a/backend/ride/rides/finish_ride_updates.php +++ b/backend/ride/rides/finish_ride_updates.php @@ -30,7 +30,7 @@ require_once __DIR__ . '/streak_helper.php'; // --- Secure S2S Configuration --- define('S2S_SHARED_KEY', getenv('S2S_SHARED_KEY') ); -define('WALLET_PAYMENT_URL', 'https://walletintaleq.intaleq.xyz/v1/main/ride/payment/process_ride_payments.php'); +define('WALLET_PAYMENT_URL', getenv('WALLET_PAYMENT_URL') ?: 'http://nginx/v2/main/ride/payment/process_ride_payments.php'); // ============================================================ // 1. Receive Raw Parameters (NO price from client) diff --git a/loction_server/siro/functions.php b/loction_server/siro/functions.php index c2b7683c..1c658940 100755 --- a/loction_server/siro/functions.php +++ b/loction_server/siro/functions.php @@ -13,7 +13,7 @@ use Firebase\JWT\BeforeValidException; function forwardLocationToPassengerSocket($passengerId, $payload) { if (empty($passengerId)) return; // نفترض أن سيرفر الركاب يعمل محلياً على 3031 - $url = "http://127.0.0.1:3031"; + $url = getenv('RIDE_SOCKET_URL') ?: "http://nginx/loction_server/passenger_socket.php"; $INTERNAL_KEY = trim(file_get_contents('/home/location/.internal_socket_key')); $postData = [ diff --git a/ride_server/intaleq/ride/rides/getRideStatus.php b/ride_server/intaleq/ride/rides/getRideStatus.php index b38a5bcc..cb948b12 100644 --- a/ride_server/intaleq/ride/rides/getRideStatus.php +++ b/ride_server/intaleq/ride/rides/getRideStatus.php @@ -22,7 +22,7 @@ if (empty($id) || $rideId <= 0) { // ── 1. Try Redis via the location server's internal HTTP API ────────────── $status = null; -$locationServerUrl = getenv('LOCATION_SERVER_URL') ?: 'http://location.intaleq.xyz:2021'; +$locationServerUrl = getenv('LOCATION_SERVER_URL') ?: 'http://nginx/loction_server/driver_socket.php'; $internalKey = getInternalSocketKey(); if ($internalKey) {