2 Requires Python 3 and a running PostgreSQL installation.
4 For a productive environment use a nginx webserver.
8 virtualenv -p python3 .
10 pip install -r requirements.txt
12 Then edit config.py.example into config.py with your database connection
14 ## Development and debug
18 LANG=C.UTF-8 FLASK_DEBUG=1 FLASK_APP=motion.py flask run
25 set FLASK_APP=motion.py
29 For unit testing use config values from config.py.example:
31 python -m unittest tests/test_motion.py
34 The database schema is automatically installed when the table "schema_version" does not exist and the application is started.
36 The following user rights can be granted:
37 - create: user is able to create a new motion
38 - vote: user is able to vote running motions
39 - cancel: user is able to cancel a running motion
40 - finish: user is able to close a running motion
41 - audit: user is able to see given votes of a finished motion
43 To grant right use the following (here with vote right as example):
44 - on all groups add "vote:*"
45 - on one given group add "vote:group1"
46 - on two given groups add "vote:group1 vote:group2"
50 Within the motion content markdown can be used for formatting e.g.
51 * To add a line break add two lines
52 * to enter a link use `[text](https://domain.tld/link)`
56 To control the access this map is used:
59 map "$host:$ssl_client_serial:$ssl_client_i_dn" $motion_user_role {
60 "host.domain.tld:serialnumber:/issuername" 'username/create:* vote:* cancel:* audit:*';
66 example taken from motions.board.wpia.club:
68 map "$host:$ssl_client_serial:$ssl_client_i_dn" $motion_user_role {
69 "motions.board.wpia.club:0a0000000a1234567890abcdef1234567890abcde:/CN=Orga 2019-2/O=TC InterimCA/OU=TC InterimCAs/C=AT" 'president/create:* vote:* cancel:* audit:*';
78 listen 0.0.0.0:443 ssl;
80 server_name host.domain.tld;
82 ssl_certificate /etc/ssl/private/host.domain.tld.crt;
83 ssl_certificate_key /etc/ssl/private/host.domain.tld.key;
85 ssl_client_certificate /etc/ssl/host.domain.tld.pem;
88 access_log /tmp/host.domain.tld.log motion-cert;
91 fastcgi_param QUERY_STRING $query_string;
92 fastcgi_param REQUEST_METHOD $request_method;
93 fastcgi_param CONTENT_TYPE $content_type;
94 fastcgi_param CONTENT_LENGTH $content_length;
95 fastcgi_param REQUEST_URI $request_uri;
96 fastcgi_param PATH_INFO $document_uri;
97 fastcgi_param REMOTE_ADDR $remote_addr;
98 fastcgi_param REMOTE_PORT $remote_port;
99 fastcgi_param SERVER_NAME $host;
100 fastcgi_param SERVER_PORT '443';
101 fastcgi_param SERVER_PROTOCOL 'https';
102 fastcgi_param USER_ROLES $motion_user_role;
103 fastcgi_pass unix:/motion-socket/motion.fcgi;