Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Redis password #331

Closed
earthlyreason opened this issue Jul 12, 2018 · 1 comment
Closed

Support Redis password #331

earthlyreason opened this issue Jul 12, 2018 · 1 comment

Comments

@earthlyreason
Copy link
Contributor

earthlyreason commented Jul 12, 2018

Thanks for creating and maintaining this extension.

We are using ckanext-harvest in a Heroku environment, where the Redis add-on has a URL that includes a u/p, like redis://x:yz@host:port.

It appears that Harvest cannot be used when Redis requires a password.

Would the following patch be an appropriate way to use the ckan.harvest.mq.password setting that is used for the amqp connection?

--- a/ckanext/harvest/queue.py
+++ b/ckanext/harvest/queue.py
@@ -64,6 +64,7 @@ def get_connection_redis():
     import redis
     return redis.StrictRedis(host=config.get('ckan.harvest.mq.hostname', HOSTNAME),
                           port=int(config.get('ckan.harvest.mq.port', REDIS_PORT)),
+                          password=config.get('ckan.harvest.mq.password', None),
                           db=int(config.get('ckan.harvest.mq.redis_db', REDIS_DB)))

Perhaps related is ckan/ckan#3165, which adds a CKAN_REDIS_URL option to core CKAN (as noted in #257). When present, that setting might provide a better default now for the Redis connection.

@amercader
Copy link
Member

Fixed in #332

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants