From 901f429b9ca4314efa327e95146dd62dca9228a6 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Wed, 22 Jul 2026 04:15:18 +0300 Subject: [PATCH] Update driver and rider socket URLs to jordan-siro.intaleqapp.com for Docker setup --- loction_server/driver_socket.php | 40 ++++++++++++++++++++++++----- siro_driver/lib/constant/links.dart | 4 +-- siro_rider/lib/constant/links.dart | 2 +- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/loction_server/driver_socket.php b/loction_server/driver_socket.php index 35b6d9ef..89d6d2fc 100755 --- a/loction_server/driver_socket.php +++ b/loction_server/driver_socket.php @@ -55,7 +55,17 @@ function loadEnvironment(string $filePath): void { logMsg('✅ Environment loaded.'); } -loadEnvironment('/home/location/env/.env'); +// Try Docker .env first, then legacy path +$envPaths = [ + __DIR__ . '/../docker/.env', + '/home/location/env/.env', +]; +foreach ($envPaths as $envPath) { + if (file_exists($envPath)) { + loadEnvironment($envPath); + break; + } +} // ============================================================ // 🔐 مفاتيح الأمان @@ -77,10 +87,22 @@ function getJwtSecret(): string { } return getenv('JWT_SECRET_KEY') ?: ''; } -$redisPass = trim((string) @file_get_contents('/home/location/.reds_pass_key')); +// Redis password: try env var, then Docker keys, then legacy path, then null (Docker Redis has no password) +$redisPass = null; +$redisPassPaths = [ + getenv('REDIS_PASS_KEY_PATH') ?: '', + '/keys/.reds_pass_key', + '/home/location/.reds_pass_key', +]; +foreach ($redisPassPaths as $rpp) { + if (!empty($rpp) && file_exists($rpp)) { + $redisPass = trim((string) @file_get_contents($rpp)); + break; + } +} -if (empty($INTERNAL_KEY)) logMsg('❌ CRITICAL: Internal key missing!'); -if (empty($redisPass)) logMsg('❌ CRITICAL: Redis password missing!'); +if (empty($INTERNAL_KEY)) logMsg('⚠️ Internal key not found (non-critical in Docker)'); +if (empty($redisPass)) logMsg('ℹ️ Redis password not set (OK for Docker — no auth required)'); // ============================================================ // 🗄️ Redis Singleton @@ -102,13 +124,17 @@ function getRedis(): ?RedisClient { try { $redisHost = getenv('REDIS_HOST') ?: ($_ENV['REDIS_HOST'] ?? (file_exists('/.dockerenv') ? 'redis' : '127.0.0.1')); - $client = new RedisClient([ + $config = [ 'scheme' => 'tcp', 'host' => $redisHost, 'port' => (int)(getenv('REDIS_PORT') ?: 6379), - 'password' => $redisPass, 'read_write_timeout' => 0, - ]); + ]; + // Only include password if it's actually set (Docker Redis has no password) + if (!empty($redisPass)) { + $config['password'] = $redisPass; + } + $client = new RedisClient($config); $client->connect(); $redis = $client; return $redis; diff --git a/siro_driver/lib/constant/links.dart b/siro_driver/lib/constant/links.dart index 0be09cc6..648768d8 100755 --- a/siro_driver/lib/constant/links.dart +++ b/siro_driver/lib/constant/links.dart @@ -63,9 +63,9 @@ class AppLink { case 'Egypt': return 'https://location-egypt.siromove.com'; case 'Jordan': - return 'https://location.intaleq.xyz'; + return 'https://jordan-siro.intaleqapp.com'; default: - return 'https://location-jordan.siromove.com'; // You can change the default to location.intaleq.xyz if needed + return 'https://location-jordan.siromove.com'; } } diff --git a/siro_rider/lib/constant/links.dart b/siro_rider/lib/constant/links.dart index 0b742f47..5da29d1b 100644 --- a/siro_rider/lib/constant/links.dart +++ b/siro_rider/lib/constant/links.dart @@ -152,7 +152,7 @@ class AppLink { case 'Egypt': return 'https://api-egypt.siromove.com'; case 'Jordan': - return 'https://rides.intaleq.xyz'; + return 'https://jordan-siro.intaleqapp.com'; default: return 'https://api.siromove.com'; }