README.org 3.99 KB
Newer Older
1 2 3 4 5
* Dependencies

  - werkzeug
  - jinja
  - python2
6
  - python-pdfminer (for pdf2txt, used in metadata reading)
7
  - python-netaddr
8 9 10 11 12 13 14 15 16 17 18

* 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:

Christoph's avatar
Christoph committed
19 20 21 22
   - 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
Christoph's avatar
Christoph committed
23 24 25 26
   - 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
27 28 29 30
   - 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)
Hans-Peter Deifel's avatar
Hans-Peter Deifel committed
31
   - mailfrom :: E-Mail address to use for all sent mails
Christoph's avatar
Christoph committed
32
   - weburl :: base URL of the web service
Hans-Peter Deifel's avatar
Hans-Peter Deifel committed
33 34 35 36 37

   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.
38 39 40 41 42
   - 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.
Hans-Peter Deifel's avatar
Hans-Peter Deifel committed
43
   - delurl :: Base URL of the trashbin
44
   - pdf2txt :: Path to pdf2txt executable (default: "pdf2txt")
45 46 47 48 49 50
   - 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 [[file:themes.txt]].
                      (type: [(String, String)])
51 52 53 54 55 56
   - 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
57 58


59 60 61 62 63 64
   Note, that the various *url config options are acutal URLs, while the *dir
   configs are filesystem paths.

   Example:

   #+BEGIN_EXAMPLE
Christoph's avatar
Christoph committed
65
     admins = {'foo': 'foo@example.com', 'bar': 'bar@example.com'}
66

Christoph's avatar
Christoph committed
67 68 69
     groups = [('INF-.*', [foo]),
               ('.*', [bar])]

70
     root = ['foo@example.com']
71

72
     triggered = [('127.0.0.1', 6666, '\xc0\xff\xee\xba\xbe')]
73

74
     weburl = 'http://eva.example.com/'
75 76 77 78
     moddataurl = '/moderation/files'
     modurl = '/moderation'
     pdfurl = '/public_pdf'
     delurl = '/moderation/del'
79
     mailfrom = "foo@example.com"
80

81
     sendmails = False
82 83 84 85 86 87

     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' ]
88 89 90 91 92 93
   #+END_EXAMPLE

* Hosting
** Mail handler

   The mailhandler script expects an email on stdin. This email has to be sent
Sebastian Hahn's avatar
Sebastian Hahn committed
94
   to ~something+{submit_full, submit-trimmed, admins}@something~ and contain
95 96 97 98 99 100 101 102
   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.

Christoph's avatar
Christoph committed
103 104 105 106 107 108
** 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.

109
** TODO Sending push notifications