From fcf0a420e5306265ec1dfc72eea51fe3c4a853c5 Mon Sep 17 00:00:00 2001 From: tillepille Date: Thu, 17 Dec 2020 18:09:16 +0100 Subject: [PATCH 1/4] add ssl option to redis --- tc_redis/result_storages/redis_result_storage.py | 3 ++- tc_redis/storages/redis_storage.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tc_redis/result_storages/redis_result_storage.py b/tc_redis/result_storages/redis_result_storage.py index a4e6792..7d7711f 100644 --- a/tc_redis/result_storages/redis_result_storage.py +++ b/tc_redis/result_storages/redis_result_storage.py @@ -62,7 +62,8 @@ def reconnect_redis(self): port=self.context.config.REDIS_RESULT_STORAGE_SERVER_PORT, host=self.context.config.REDIS_RESULT_STORAGE_SERVER_HOST, db=self.context.config.REDIS_RESULT_STORAGE_SERVER_DB, - password=self.context.config.REDIS_RESULT_STORAGE_SERVER_PASSWORD + password=self.context.config.REDIS_RESULT_STORAGE_SERVER_PASSWORD, + ssl=self.context.config.REDIS_STORAGE_SERVER_SSL ) if self.shared_client: diff --git a/tc_redis/storages/redis_storage.py b/tc_redis/storages/redis_storage.py index 9c4fc1a..1d4c172 100644 --- a/tc_redis/storages/redis_storage.py +++ b/tc_redis/storages/redis_storage.py @@ -45,7 +45,8 @@ def reconnect_redis(self): port=self.context.config.REDIS_STORAGE_SERVER_PORT, host=self.context.config.REDIS_STORAGE_SERVER_HOST, db=self.context.config.REDIS_STORAGE_SERVER_DB, - password=self.context.config.REDIS_STORAGE_SERVER_PASSWORD + password=self.context.config.REDIS_STORAGE_SERVER_PASSWORD, + ssl=self.context.config.REDIS_STORAGE_SERVER_SSL ) if self.shared_client: From decf66fb979b5493d5c50ece5bb2b07e5b6bb8e3 Mon Sep 17 00:00:00 2001 From: tillepille Date: Thu, 17 Dec 2020 18:09:36 +0100 Subject: [PATCH 2/4] add ssl option to readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 094e4dd..f674d96 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Thumbor redis storage adapters. To use redis as a storage or result storage some values must be configured in `thumbor.conf` ##### Redis Storage + ``` STORAGE='tc_redis.storages.redis_storage' @@ -21,6 +22,7 @@ REDIS_STORAGE_SERVER_PORT = 6379 REDIS_STORAGE_SERVER_HOST = 'localhost' REDIS_STORAGE_SERVER_DB = 0 REDIS_STORAGE_SERVER_PASSWORD = None +REDIS_STORAGE_SERVER_SSL = False ``` ##### Redis Result Storage @@ -33,4 +35,5 @@ REDIS_RESULT_STORAGE_SERVER_PORT = 6379 REDIS_RESULT_STORAGE_SERVER_HOST = 'localhost' REDIS_RESULT_STORAGE_SERVER_DB = 0 REDIS_RESULT_STORAGE_SERVER_PASSWORD = None +REDIS_STORAGE_SERVER_SSL = False ``` From 85c0fcd0e52b5c4db074bdcf2d9dde6aee266d15 Mon Sep 17 00:00:00 2001 From: tillepille Date: Thu, 17 Dec 2020 18:09:50 +0100 Subject: [PATCH 3/4] versioning --- requirements.txt | 2 +- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index e5d10a4..29c6e25 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -redis +redis>=3.5 thumbor>=5.0.0 diff --git a/setup.py b/setup.py index e63d0e9..ac8fe1c 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ def read(fname): setup( name="tc_redis", - version="1.0.1", + version="1.1.0", author="Thumbor Community", description=("Thumbor redis storage adapters"), license="MIT", @@ -29,6 +29,6 @@ def read(fname): ], install_requires=[ 'thumbor>=5.0.0', - 'redis' + 'redis>=3.5' ] ) From 878d5989d72f3af5e4b3ae556cf89df086b05529 Mon Sep 17 00:00:00 2001 From: Tim Schrumpf Date: Wed, 24 Mar 2021 21:44:33 +0100 Subject: [PATCH 4/4] feat: add all SSL options --- README.md | 8 ++++++-- tc_redis/result_storages/redis_result_storage.py | 4 +++- tc_redis/storages/redis_storage.py | 4 +++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f674d96..7b9e672 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,9 @@ REDIS_STORAGE_SERVER_PORT = 6379 REDIS_STORAGE_SERVER_HOST = 'localhost' REDIS_STORAGE_SERVER_DB = 0 REDIS_STORAGE_SERVER_PASSWORD = None -REDIS_STORAGE_SERVER_SSL = False +REDIS_STORAGE_SERVER_SSL_ENABLED = False +REDIS_STORAGE_SERVER_SSL_CERTS = '/path/to/certs' +REDIS_STORAGE_SERVER_SSL_CHECK_DISABLED = False ``` ##### Redis Result Storage @@ -35,5 +37,7 @@ REDIS_RESULT_STORAGE_SERVER_PORT = 6379 REDIS_RESULT_STORAGE_SERVER_HOST = 'localhost' REDIS_RESULT_STORAGE_SERVER_DB = 0 REDIS_RESULT_STORAGE_SERVER_PASSWORD = None -REDIS_STORAGE_SERVER_SSL = False +REDIS_RESULT_STORAGE_SERVER_SSL_ENABLED = False +REDIS_RESULT_STORAGE_SERVER_SSL_CERTS = '/path/to/certs' +REDIS_RESULT_STORAGE_SERVER_SSL_CHECK_DISABLED = False ``` diff --git a/tc_redis/result_storages/redis_result_storage.py b/tc_redis/result_storages/redis_result_storage.py index 7d7711f..663e6dc 100644 --- a/tc_redis/result_storages/redis_result_storage.py +++ b/tc_redis/result_storages/redis_result_storage.py @@ -63,7 +63,9 @@ def reconnect_redis(self): host=self.context.config.REDIS_RESULT_STORAGE_SERVER_HOST, db=self.context.config.REDIS_RESULT_STORAGE_SERVER_DB, password=self.context.config.REDIS_RESULT_STORAGE_SERVER_PASSWORD, - ssl=self.context.config.REDIS_STORAGE_SERVER_SSL + ssl=self.context.config.REDIS_RESULT_STORAGE_SERVER_SSL_ENABLED + ssl_ca_certs=self.context.config.REDIS_RESULT_STORAGE_SERVER_SSL_CERTS + ssl_cert_reqs=self.context.config.REDIS_RESULT_STORAGE_SERVER_SSL_CHECK_DISABLED ) if self.shared_client: diff --git a/tc_redis/storages/redis_storage.py b/tc_redis/storages/redis_storage.py index 1d4c172..29c6694 100644 --- a/tc_redis/storages/redis_storage.py +++ b/tc_redis/storages/redis_storage.py @@ -46,7 +46,9 @@ def reconnect_redis(self): host=self.context.config.REDIS_STORAGE_SERVER_HOST, db=self.context.config.REDIS_STORAGE_SERVER_DB, password=self.context.config.REDIS_STORAGE_SERVER_PASSWORD, - ssl=self.context.config.REDIS_STORAGE_SERVER_SSL + ssl=self.context.config.REDIS_STORAGE_SERVER_SSL_ENABLED + ssl_ca_certs=self.context.config.REDIS_STORAGE_SERVER_SSL_CERTS + ssl_cert_reqs=self.context.config.REDIS_STORAGE_SERVER_SSL_CHECK_DISABLED ) if self.shared_client: