Dependencies
- werkzeug
- jinja
- python2
- python-pdfminer (for pdf2txt, used in metadata reading)
- python-netaddr
Setup
Base config
see config/__init__.py. The variables should be self explanatory and you shouldn’t have to modify them.
Site config
Create config/local.py. You will have to define the following variables there:
- admins
- A dictionary username -> mailadress for the people moderating the evaluations. The mailaddresses are notified on emails to the admins alias and on new submission
- groups
- A list of (regex, [username]). If the subject (=course) is matched by regex, all users in the list are selected, e.g are displayed the moderation request or sent the relevant mail
- root
- A list of mailadresses of people who should get error message in case something goes wrong.
- triggered
- A list of tuples (address, port, secret), that should get a UDP-datagram if an evaluation gets accepted (see below)
- mailfrom
- E-Mail address to use for all sent mails
- weburl
- base URL of the web service
The following variables are optional:
- sendmails
- Set this to false in config.local if you want to see errors on stderr and don’t want send any mails to admins or submitters.
- moddataurl
- Base URL of the PDF files that are to be moderated. This should point to ‘moddir’ from the config.
- modurl
- Base URL of the moderation interface.
- pdfurl
- Base URL of the public pdfs. This should point to ‘pdfdir’ from the config.
- delurl
- Base URL of the trashbin
- pdf2txt
- Path to pdf2txt executable (default: “pdf2txt”)
- default_theme
- The name of the theme to use if the hostname of a request
is not matched by
themes_by_url
. (type: String) - themes_by_url
- A list of tuples (hostname, theme) that specifies which
theme to use for request to a given hostname. This
overwrites
default_theme
. See also themes.txt. (type: [(String, String)]) - local_networks
- A list of network ranges (as strings) in the format ‘10.0.0.0/8’ or any format described at https://pythonhosted.org/netaddr/ that should be considered “internal” addresses. only these are allowed to access files with the `internal_net_only` meta value set to True
Note, that the various *url config options are acutal URLs, while the *dir configs are filesystem paths.
Example:
admins = {'foo': 'foo@example.com', 'bar': 'bar@example.com'} groups = [('INF-.*', [foo]), ('.*', [bar])] root = ['foo@example.com'] triggered = [('127.0.0.1', 6666, '\xc0\xff\xee\xba\xbe')] weburl = 'http://eva.example.com/' moddataurl = '/moderation/files' modurl = '/moderation' pdfurl = '/public_pdf' delurl = '/moderation/del' mailfrom = "foo@example.com" sendmails = False local_networks = [ '131.188.0.0/16', '2001:638:a000::/45', '192.168.0.0/16', '10.0.0.0/8', '172.16.0.0/12' ]
Hosting
Mail handler
The mailhandler script expects an email on stdin. This email has to be sent
to something+{submit_full, submit-trimmed, admins}@something
and contain
a PDF attachment.
Web application
The file ‘wsgi’ defines a WSGI application for your webserver’s pleasure.
You can execute the script ‘run_testserver.py’ for testing purposes.
Maintenance
During Maintenance write a explanatory text into the file `UPGRADE_IN_PROGRESS` in your base directory. This will disable the website and should still work during maintenance work.