File paperless-ngx-fix-redis-passwords.patch of Package paperless-ngx
From 3e0d9420e1804729c80a7a5ccd5c0975438644f7 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@cryptomilk.org>
Date: Wed, 4 Mar 2026 09:09:41 +0100
Subject: [PATCH] Fix: use maxsplit=1 in Redis URL parsing to handle URLs with
multiple colons
URLs like unix://user:password@/path/to/redis.sock contain more than one
colon, causing the bare split(":") to return 3+ values and raising a
ValueError when unpacking into two variables.
---
src/paperless/settings.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/paperless/settings.py b/src/paperless/settings.py
index 37cf0ecfa..eb8d07647 100644
--- a/src/paperless/settings.py
+++ b/src/paperless/settings.py
@@ -128,7 +128,7 @@ def _parse_redis_url(env_redis: str | None) -> tuple[str, str]:
if "unix" in env_redis.lower():
# channels_redis socket format, looks like:
# "unix:///path/to/redis.sock"
- _, path = env_redis.split(":")
+ _, path = env_redis.split(":", 1)
# Optionally setting a db number
if "?db=" in env_redis:
path, number = path.split("?db=")
@@ -139,7 +139,7 @@ def _parse_redis_url(env_redis: str | None) -> tuple[str, str]:
elif "+socket" in env_redis.lower():
# celery socket style, looks like:
# "redis+socket:///path/to/redis.sock"
- _, path = env_redis.split(":")
+ _, path = env_redis.split(":", 1)
if "?virtual_host=" in env_redis:
# Virtual host (aka db number)
path, number = path.split("?virtual_host=")
--
2.53.0