{"action":"created","issue":{"url":"https://api.github.com/repos/NYUCCL/psiTurk/issues/226","repository_url":"https://api.github.com/repos/NYUCCL/psiTurk","labels_url":"https://api.github.com/repos/NYUCCL/psiTurk/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/NYUCCL/psiTurk/issues/226/comments","events_url":"https://api.github.com/repos/NYUCCL/psiTurk/issues/226/events","html_url":"https://github.com/NYUCCL/psiTurk/pull/226","id":150456955,"number":226,"title":"Use own ad server","user":{"login":"deargle","id":1174653,"avatar_url":"https://avatars.githubusercontent.com/u/1174653?v=3","gravatar_id":"","url":"https://api.github.com/users/deargle","html_url":"https://github.com/deargle","followers_url":"https://api.github.com/users/deargle/followers","following_url":"https://api.github.com/users/deargle/following{/other_user}","gists_url":"https://api.github.com/users/deargle/gists{/gist_id}","starred_url":"https://api.github.com/users/deargle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deargle/subscriptions","organizations_url":"https://api.github.com/users/deargle/orgs","repos_url":"https://api.github.com/users/deargle/repos","events_url":"https://api.github.com/users/deargle/events{/privacy}","received_events_url":"https://api.github.com/users/deargle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2016-04-22T19:53:34Z","updated_at":"2016-05-02T20:55:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/NYUCCL/psiTurk/pulls/226","html_url":"https://github.com/NYUCCL/psiTurk/pull/226","diff_url":"https://github.com/NYUCCL/psiTurk/pull/226.diff","patch_url":"https://github.com/NYUCCL/psiTurk/pull/226.patch"},"body":"Okay here goes. This is functionality for toggling the use of the psiturk ad server. Look in the new comments in psiturk/default_configs/local_config_defaults.txt for an overview of the changes. See [this gist][the gist] for an example config. Here's a summary of the process:\r\n\r\n1. You can say whether you want to use psiturk's ad server. Default is `true`.\r\n2. If you don't, then just say so and also set an `ad_location` url in the config for the location of your psiturk ad route. This url should point to a proxy server running in front psiturk/gunicorn. I used nginx. See [the gist referenced above][the gist] for a config that works for psiturk (and for flask/gunicorn/nginx in general). Your proxy server will need to handle SSL. You will need to get your own certs right now if you want to do this.\r\n3. You can optionally also have gunicorn work with SSL. If you want to to do this, set paths to both `keyfile` and `certfile` in the `[Server Parameters]` section. Assuming your process has permissions necessary to read the keyfile, they'll be loaded into gunicorn (see [the same gist as before][the gist] for an example of launching psiturk with sudo while still using the proper virtualenv binaries). If you do this, make sure that you switch the url of your proxy_pass in nginx to use the `https://` protocol.\r\n\r\n[the gist]: https://gist.github.com/deargle/5d8c01660a77b8090a2cd24efcda2c59\r\n\r\nSome other changes:\r\n\r\n1. I also copied the slightly-updated styles.css from psiturk.org to the static/css files so that formatting on the \"thanks-mturksubmit.html\" file matches what happens if using the psiturk ad server. Sorry for the spacing creating lots of line changes, blame vim auto-formatting.\r\n2. I'm bringing back `closepopup.html` from the dead. Also bringing back the old `thanks.html` and calling it `thanks-mturksubmit.html` so that it has the nice submit button thing. Leaving the 2.0 `thanks.html` alone.\r\n\r\nEven if this isn't merged, it demonstrates how to go about the process.\r\n\r\nAlso see #121 "},"comment":{"url":"https://api.github.com/repos/NYUCCL/psiTurk/issues/comments/216360629","html_url":"https://github.com/NYUCCL/psiTurk/pull/226#issuecomment-216360629","issue_url":"https://api.github.com/repos/NYUCCL/psiTurk/issues/226","id":216360629,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars.githubusercontent.com/u/2354108?v=3","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2016-05-02T20:55:51Z","updated_at":"2016-05-02T20:55:51Z","body":"\n[![Coverage Status](https://coveralls.io/builds/6017850/badge)](https://coveralls.io/builds/6017850)\n\nCoverage decreased (-0.1%) to 13.569% when pulling **2b2d5651e06f89330a99c572d1709125c6a19fb6 on deargle:use-own-ad-server** into **418f098eaebf29a8f6f5c07eff852fb8a7f9b049 on NYUCCL:master**.\n"}}