ckan / datapusher

A standalone web service that pushes data files from a CKAN site resources into its DataStore
GNU Affero General Public License v3.0
77 stars 155 forks source link

Is it possible to configure a proxy server for datapusher? #60

Open opensas opened 9 years ago

opensas commented 9 years ago

If I understand correctly when adding a resource (either as a link ot uploading a file) datapusher will try to fetch the contents of the file and the add it to the datastore using the data API.

I wonder is there's some way to configure a proxy server for datapusher to use when fetching files. I already have a global configuration on /etc/enviroment but python doesn't seem to take it into account

mattfullerton commented 9 years ago

Yes you can!

Edit the file: /etc/ckan/datapusher.wsgi

And set the same environment variables using Python in there as you do in /etc/environment, like this: os.environ['HTTP_PROXY'] = 'http://myproxyIP:myproxyPORT' os.environ['HTTPS_PROXY'] = os.environ['HTTP_PROXY'] os.environ['http_proxy'] = os.environ['HTTP_PROXY'] os.environ['https_proxy'] = os.environ['HTTP_PROXY']

By the way, the same trick works for /etc/ckan/default/apache.wsgi to get resource_proxy to work behind a proxy.

ThrawnCA commented 2 years ago

This is now supported without globally changing proxies, using the ckan.download_proxy config option. However, in some cases, such as running on an intranet behind a corporate proxy, globally changing it may still be the better choice.