summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.org>2015-10-03 16:56:33 +0200
committerTimotej Lazar <timotej.lazar@araneo.org>2015-10-03 16:57:02 +0200
commit089d5ff860dfca2c1eae483ed0b855661fd95235 (patch)
treef391dbe18a578aeb416c6752cfbe57a9764567cd
parentfa35e4e4f4705d6def8aa03841431d709465238b (diff)
Update and clean up installation instructions
-rw-r--r--readme.md81
1 files changed, 48 insertions, 33 deletions
diff --git a/readme.md b/readme.md
index 36142b0..ca7d814 100644
--- a/readme.md
+++ b/readme.md
@@ -1,25 +1,19 @@
Installation
============
-Install the following packages:
+These instructions assume you are running Debian Jessie. Install dependencies:
- - apache2
- - nodejs (>= 10.0.22)
- - python3 (>= 3.4)
- - python3-ply
- - python3-psycopg2
- - python3-termcolor
- - swi-prolog-nox (>= 7.2)
+ apt install apache2 nodejs npm python3 python3-ply python3-psycopg2 python3-termcolor
SWI prolog
----------
-To use the correct SWI prolog package (>= 7.2) on Debian, add a custom
+To use the correct SWI prolog package (>= 7.3) on Debian, add a custom
repository by creating the file /etc/apt/sources.list.d/prolog.list
containing the following 2 lines:
-deb http://ppa.launchpad.net/swi-prolog/stable/ubuntu trusty main
-deb-src http://ppa.launchpad.net/swi-prolog/stable/ubuntu trusty main
+deb http://ppa.launchpad.net/swi-prolog/devel/ubuntu trusty main
+deb-src http://ppa.launchpad.net/swi-prolog/devel/ubuntu trusty main
After that run the following sequence of shell statements to update
the package cache, register the new repository's key, and again refresh
@@ -33,44 +27,65 @@ libseccomp
----------
A new version of libseccomp (≥ 2.2) with Python bindings is needed to sandbox
-Python interpreters. This is not available yet in most distributions, so fetch
-the latest sources with
+Python interpreters. This is not available yet in most distributions. You can
+download custom-built packages for Debian Jessie at
- git clone https://github.com/seccomp/libseccomp
+ http://codeq.si/libseccomp2_2.2.3-2_amd64.deb
+ http://codeq.si/seccomp_2.2.3-2_amd64.deb
+
+and install them using
+
+ dpkg --install libseccomp2_2.2.3-2_amd64.deb seccomp_2.2.3-2_amd64.deb
-then build and install it with
+Alternatively, fetch the latest sources with
- ./configure --enable-python
- make
- make install
+ git clone https://github.com/seccomp/libseccomp
+
+and configure with --enable-python.
nodejs
------
-Run "npm install" inside the "web" directory to install all dependencies (they
-will be installed inside the "web" directory)
+Run "npm install" inside the codeq-server/web directory to install all
+dependencies (they will be installed inside the web directory)
Settings
========
- - point webroot to codeq-web
- - set up reverse proxy for /ws/ to the node server:
- - using the command a2enmod enable apache modules: proxy, proxy_http, proxy_wstunnel, rewrite
- - add to the apache configuration the following directives:
- RewriteEngine on
- RewriteCond %{REQUEST_URI} ^/ws/ [NC]
- RewriteCond %{QUERY_STRING} transport=websocket [NC]
- RewriteRule /(.*) ws://localhost:8083/$1 [P,L]
- ProxyPass /ws/ http://localhost:8083/ws/
- ProxyPassReverse /ws/ http://localhost:8083/ws/
- - set problems path via environment variable CODEQ_PROBLEMS (defaults to /var/local/codeq-problems)
- - set DB settings via environment variables CODEQ_DB_HOST, CODEQ_DB_DATABASE, CODEQ_DB_USER and CODEQ_DB_PASS
+Replace $webroot in this section with the path to codeq-web repo. Remember to
+grant read access to $webroot to the apache user.
+
+Set environment variables:
+
+ CODEQ_PROBLEMS=<path to codeq-problems repo>
+ CODEQ_WEB_OUTPUT=$webroot/data
+ CODEQ_DB_HOST=<address of database server>
+ CODEQ_DB_DATABASE=<database name, default is 'codeq'>
+ CODEQ_DB_USER=<database user, default is 'codeq'>
+ CODEQ_DB_PASS=<database password, default is 'c0d3q'>
+
+Set up apache:
+
+ a2enmod proxy proxy_http proxy_wstunnel rewrite
+
+Add the following directives to the VirtualHost configuration:
+
+ DocumentRoot "$webroot"
+ <Directory "$webroot">
+ Require all granted
+ </Directory>
+
+ RewriteEngine on
+ RewriteCond %{REQUEST_URI} ^/ws/ [NC]
+ RewriteCond %{QUERY_STRING} transport=websocket [NC]
+ RewriteRule /(.*) ws://localhost:8083/$1 [P,L]
+ ProxyPass /ws/ http://localhost:8083/ws/
+ ProxyPassReverse /ws/ http://localhost:8083/ws/
Running
=======
- first build static JSON data with scripts/build_web_resources.py, read its heading comment for details
- - the output of the script must go to the data subdirectory of where you have codeq-web
- run the prolog interpreter server: swipl prolog/runner/main.pl
- run the session daemon: python3 daemon.py
- run the web server for client communication: node web/main.js