-
Notifications
You must be signed in to change notification settings - Fork 4
Setting up web access to DiscourseDB
Chris Bogart edited this page Dec 6, 2017
·
1 revision
Elements needed:
- The discoursedb-api-rest subproject (under github.com/discoursedb/discoursedb-core) as a REST data server
- The front end browser (github.com/discoursedb/discoursedb-browser)
- Brat, for annotation: http://brat.nlplab.org/
- mysql (see https://github.com/DiscourseDB/discoursedb-core/wiki/General-Info-and-Setup)
Configuration:
-
SSL
- Create key and certificate files.
-
discoursedb-api-rest configuration (custom.properties)
- Register with Google as an application, and put the client_secret, client_id, and url in
- choose a port number to use
- mysql password and username
- brat data directory
- ssl files and passwords as needed
-
brat configuration
- Set up its global password/username to something unique, and run standalone.py
-
nginx or apache
- We've set up brat and the browser to work through nginx; we can run them on any numbered port and forward them to port 80, so that discourseDB will work from networks where lots of ports are blocked (eg. University guest wifi like eduroam)
- ssl key and cert file needed to serve https
listen 80 default_server;
listen 443 ssl;
ssl_certificate combined.cert;
ssl_certificate_key key.pem;
add_header Strict-Transport-Security max-age=0;
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
ssl_prefer_server_ciphers on;
server_name _;
location ^~ /brat/ {
rewrite ^/brat(/.*)$ $1 break;
proxy_pass http://localhost:8001/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host:80;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port 80;
proxy_redirect off;
}
location ^~ /browsing/ {
proxy_pass https://localhost:5398/browsing/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host:443;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port 443;
proxy_connect_timeout 10000;
proxy_send_timeout 10000;
proxy_read_timeout 10000;
send_timeout 10000;
}
location ^~ /discoursedb/ {
alias /usr2/scratch/discoursedb_v08/discoursedb-browser/;
index index.xhtml;
#allow 128.2.0.0/16;
#allow 128.237.0.0/16;
#deny all;
}
- browser
- put index.js and index.html in a directory served as a web page
- index.js's first line needs to reference the URL that the REST interface is served at