Skip to content
Benjamin Gilbert edited this page Aug 5, 2013 · 4 revisions

Setting up a JSON Blaster

  1. Install opendiamond.
  • If installing from source, you will need Tornado, SockJS-tornado, the Python Imaging Library, python-dateutil, python-magic, simplejson, M2Crypto, PycURL, validictory, and TCP Wrappers.
  • If installing from RPM, you will need the opendiamond-blaster package.
  1. Edit .diamond/blaster_config in the home directory of the user that will run the JSON Blaster. blaster_config uses Python syntax and blaster --help lists the available settings. At a minimum, you need to set baseurl. For example:

     baseurl = 'http://blaster.example.com:8080/'
     # Disable the example web interface (recommended for production servers)
     enable_testui = False
    
  2. If you will be running the Blaster behind nginx, configure nginx to pass through the request scheme and remote IP address using the X-Scheme and X-Real-IP request headers:

     proxy_set_header X-Real-IP $remote_addr;
     proxy_set_header X-Scheme $scheme;
    

Then configure the Blaster accordingly:

    listen = 'localhost:8080'
    reverse_proxy = True

To prevent nginx from timing out evaluation requests when expensive filters are run, you should also increase the nginx proxy timeout:

    proxy_read_timeout 3600s;
  1. Use TCP Wrappers to configure the set of web applications that can create new searches through the Blaster. For example, to allow only localhost to create searches, add the following to /etc/hosts.deny:

     blaster: ALL EXCEPT 127.0.0.1
    

Listing hostnames in hosts.allow or hosts.deny will cause a DNS lookup for every incoming connection, so IP addresses are preferred.

  1. Start the Blaster by executing blaster.