Update: 2026-07-22 00:48:30

This commit is contained in:
Hamza-Ayed
2026-07-22 00:48:30 +03:00
parent b613022169
commit 521d76c4cf
3 changed files with 24 additions and 11 deletions
+11 -3
View File
@@ -46,13 +46,18 @@ function loadEnvironment(string $filePath): void {
putenv(trim($name) . '=' . trim($value, "\"'"));
}
}
loadEnvironment(dirname(__DIR__) . '/docker/.env');
loadEnvironment(dirname(__DIR__) . '/backend/.env');
loadEnvironment('/home/intaleq-rides/env/.env');
function getInternalSocketKey(): string {
$key = getenv('INTERNAL_SOCKET_KEY');
if ($key) return trim($key);
$path = getenv('INTERNAL_SOCKET_KEY_PATH') ?: '/home/intaleq-rides/.internal_socket_key';
if (file_exists($path)) return trim((string) @file_get_contents($path));
$path = getenv('INTERNAL_SOCKET_KEY_PATH');
if ($path && file_exists($path)) return trim((string) @file_get_contents($path));
if (file_exists('/keys/internal_socket_key')) return trim((string) @file_get_contents('/keys/internal_socket_key'));
if (file_exists('/home/location/.internal_socket_key')) return trim((string) @file_get_contents('/home/location/.internal_socket_key'));
if (file_exists('/home/intaleq-rides/.internal_socket_key')) return trim((string) @file_get_contents('/home/intaleq-rides/.internal_socket_key'));
return '';
}
@@ -63,7 +68,10 @@ function getJwtSecret(): string {
if ($keyPath && file_exists($keyPath)) {
return trim(file_get_contents($keyPath));
}
return getenv('JWT_SECRET_KEY') ?: '';
if (file_exists('/keys/jwt_secret_key')) {
return trim(file_get_contents('/keys/jwt_secret_key'));
}
return getenv('JWT_SECRET_KEY') ?: (getenv('JWT_SECRET') ?: '');
}
if (empty($INTERNAL_KEY)) {