5 virtualenv -p python3 .
7 pip install -r requirements.txt
9 Then edit config.py.example into config.py with your database connection
13 LANG=C.UTF-8 FLASK_DEBUG=1 FLASK_APP=motion.py flask run
20 set FLASK_APP=motion.py
24 For unit testing use config values from config.py.example:
26 python -m unittest tests/test_motion.py
29 The database schema is automatically installed when the table "schema_version" does not exist and the application is started.
33 Within the motion content markdown can be used for formatting e.g.
34 * To add a line break add two lines
35 * to enter a link use `[text](https//domain.tld/link)`
39 To control the access this map is used:
42 map "$host:$ssl_client_serial:$ssl_client_i_dn" $motion_user_role {
43 "host.domain.tld:serialnumber:/issuername" 'username/create:* vote:* cancel:* audit:*';
49 example taken from motions.board.wpia.club:
51 map "$host:$ssl_client_serial:$ssl_client_i_dn" $motion_user_role {
52 "motions.board.wpia.club:0a0000000a1234567890abcdef1234567890abcde:/CN=Orga 2019-2/O=TC InterimCA/OU=TC InterimCAs/C=AT" 'president/create:* vote:* cancel:* audit:*';
61 listen 0.0.0.0:443 ssl;
63 server_name host.domain.tld;
65 ssl_certificate /etc/ssl/private/host.domain.tld.crt;
66 ssl_certificate_key /etc/ssl/private/host.domain.tld.key;
68 ssl_client_certificate /etc/ssl/host.domain.tld.pem;
71 access_log /tmp/host.domain.tld.log motion-cert;
74 fastcgi_param QUERY_STRING $query_string;
75 fastcgi_param REQUEST_METHOD $request_method;
76 fastcgi_param CONTENT_TYPE $content_type;
77 fastcgi_param CONTENT_LENGTH $content_length;
78 fastcgi_param REQUEST_URI $request_uri;
79 fastcgi_param PATH_INFO $document_uri;
80 fastcgi_param REMOTE_ADDR $remote_addr;
81 fastcgi_param REMOTE_PORT $remote_port;
82 fastcgi_param SERVER_NAME $host;
83 fastcgi_param SERVER_PORT '443';
84 fastcgi_param SERVER_PROTOCOL 'https';
85 fastcgi_param USER_ROLES $motion_user_role;
86 fastcgi_pass unix:/motion-socket/motion.fcgi;