Update driver and rider socket URLs to jordan-siro.intaleqapp.com for Docker setup
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user