Update: 2026-08-01 18:52:11

This commit is contained in:
Hamza-Ayed
2026-08-01 18:52:12 +03:00
parent b30fe7e96d
commit 86b5666595
6 changed files with 21 additions and 11 deletions
+8 -3
View File
@@ -90,19 +90,24 @@ function getJwtSecret(): string {
// 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') ?: '',
__DIR__ . '/../loction-keys/.reds_pass_key',
'/keys/.reds_pass_key',
'/home/location/.reds_pass_key',
'/home/location/.reds_pass_key'
];
foreach ($redisPassPaths as $rpp) {
if (!empty($rpp) && file_exists($rpp)) {
if (file_exists($rpp)) {
$redisPass = trim((string) @file_get_contents($rpp));
break;
}
}
if (empty($redisPass)) {
$redisPass = getenv('REDIS_MAIN_PASSWORD') ?: ($_ENV['REDIS_MAIN_PASSWORD'] ?? (getenv('REDIS_PASSWORD') ?: ($_ENV['REDIS_PASSWORD'] ?? null)));
}
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)');
else logMsg('✅ Redis password loaded successfully');
// ============================================================
// 🗄️ Redis Singleton