liquid_feedback_frontend

view INSTALL.mkd @ 1298:5a3a2ce27c5a

Added tag v3.2.0 for changeset 9ecd059eee79
author jbe
date Sun Apr 24 21:34:56 2016 +0200 (2016-04-24)
parents 78d3be54cfe0
children 7ea154c9238a
line source
1 LiquidFeedback Installation Instructions
2 ========================================
4 This document gives a short outline about the necessary steps to setup a
5 LiquidFeedback system.
8 1. Install necessary dependencies
9 ---------------------------------
11 If you're using a Debian system, make sure that the following packages are
12 installed:
14 * build-essential
15 * lua5.2
16 * liblua5.2-dev
17 * postgresql
18 * libpq-dev
19 * pmake or bmake
20 * imagemagick
21 * exim4
22 * markdown2 (``apt-get install python-pip; pip install markdown2``)
24 If you're using any other Linux distribution or BSD system, install the
25 necessary software components accordingly.
28 2. Ensure that the user account of your webserver has access to the database
29 ----------------------------------------------------------------------------
31 The useraccount of the webserver (usually `www-data`) or the Moonbridge server
32 process needs to have access to your PostgreSQL installation. This is done by
33 executing PostgreSQL's shell command `createuser` as database superuser
34 (usually `pgsql`, or `postgres` for Debian installations):
36 su postgres -s $SHELL
37 createuser --no-superuser --createdb --no-createrole www-data
38 exit
41 3. Install and configure LiquidFeedback-Core
42 --------------------------------------------
44 We recommend to create the database with the same user as your webserver
45 (usually `www-data`) to avoid having to setup database privileges.
47 The example below installs the database as `www-data` and stores the two
48 executables `lf_update` and `lf_update_issue_order` in the directory
49 `/opt/liquid_feedback_core/`:
51 # Download and unpack LiquidFeedback-Core
52 # from http://www.public-software-group.org/pub/projects/liquid_feedback/backend/
53 make
54 mkdir /opt/liquid_feedback_core
55 cp core.sql lf_update lf_update_issue_order lf_update_suggestion_order /opt/liquid_feedback_core
56 su www-data -s $SHELL
57 cd /opt/liquid_feedback_core
58 createdb liquid_feedback
59 createlang plpgsql liquid_feedback # command may be omitted, depending on PostgreSQL version
60 psql -v ON_ERROR_STOP=1 -f core.sql liquid_feedback
62 A simple configuration may look as follows:
64 psql liquid_feedback
66 INSERT INTO system_setting (member_ttl) VALUES ('1 year');
67 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (false, '1 hour', 20, 6);
68 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (false, '1 day', 80, 12);
69 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 hour', 200, 60);
70 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 day', 800, 120);
71 INSERT INTO policy (index, name, min_admission_time, max_admission_time, discussion_time, verification_time, voting_time, issue_quorum_num, issue_quorum_den, initiative_quorum_num, initiative_quorum_den) VALUES (1, 'Default policy', '4 days', '8 days', '15 days', '8 days', '15 days', 10, 100, 10, 100);
72 INSERT INTO unit (name) VALUES ('Our organization');
73 INSERT INTO area (unit_id, name) VALUES (1, 'Default area');
74 INSERT INTO allowed_policy (area_id, policy_id, default_policy) VALUES (1, 1, TRUE);
76 If you want to create an admin user with an empty password (CAUTION!), then execute the following SQL statement:
78 INSERT INTO member (login, name, admin, password) VALUES ('admin', 'Administrator', TRUE, '$1$/EMPTY/$NEWt7XJg2efKwPm4vectc1');
80 Exit the `psql` interface by typing:
82 \q
84 And don't forget to quit the `www-data` shell:
86 exit
89 4. Install Moonbridge
90 ---------------------
92 # Download and unpack Moonbridge
93 # from http://www.public-software-group.org/pub/projects/moonbridge/
94 pmake MOONBR_LUA_PATH=/opt/moonbridge/?.lua
95 mkdir /opt/moonbridge
96 cp moonbridge /opt/moonbridge/
97 cp moonbridge_http.lua /opt/moonbridge/
100 5. Install WebMCP
101 -----------------
103 Note: Using Debian, it may be necessary to append `-I /usr/include/lua5.2` at
104 the end of the CFLAGS line in `Makefile.options` of the WebMCP source
105 distibution:
107 # Download and unpack WebMCP
108 # from http://www.public-software-group.org/pub/projects/webmcp/
109 vi Makefile.options # Debian requires -I /usr/include/lua5.2 at end of CFLAGS line
110 make
111 mkdir /opt/webmcp
112 cp -RL framework/* /opt/webmcp/
115 6. Install the LiquidFeedback-Frontend
116 --------------------------------------
118 Unpack source tree into appropriate directory, e.g. `/opt/liquid_feedback_frontend`:
120 # Download LiquidFeedback-Frontend
121 # from http://www.public-software-group.org/pub/projects/liquid_feedback/frontend/
122 mv liquid_feedback_frontend-vX.X.X /opt/liquid_feedback_frontend
124 Make `tmp/` directory of LiquidFeedback-Frontend writable for webserver:
126 chown www-data /opt/liquid_feedback_frontend/tmp
129 7. Configure mail system
130 ------------------------
132 It may be necessary to configure your server's mail system, e.g. running
133 `dpkg-reconfigure exim4-config` on a Debian system.
136 8. Configure the LiquidFeedback-Frontend
137 ----------------------------------------
139 cd /opt/liquid_feedback_frontend/config
140 cp example.lua myconfig.lua
141 # edit myconfig.lua according to your needs
144 9. Setup regular execution of `lf_update` and related commands
145 --------------------------------------------------------------
147 The executables `lf_update`, `lf_update_issue_order`, and
148 `lf_update_suggestion_order` must be executed regularly. This may be achieved
149 by creating a file named `/opt/liquid_feedback_core/lf_updated` with the
150 following contents:
152 #!/bin/sh
154 PIDFILE="/var/run/lf_updated.pid"
155 PID=$$
157 if [ -f "${PIDFILE}" ] && kill -CONT $( cat "${PIDFILE}" ); then
158 echo "lf_updated is already running."
159 exit 1
160 fi
162 echo "${PID}" > "${PIDFILE}"
164 while true; do
165 su - www-data -s /bin/sh -c 'nice /opt/liquid_feedback_core/lf_update dbname=liquid_feedback 2>&1 | logger -t "lf_updated"'
166 su - www-data -s /bin/sh -c 'nice /opt/liquid_feedback_core/lf_update_issue_order dbname=liquid_feedback 2>&1 | logger -t "lf_updated"'
167 su - www-data -s /bin/sh -c 'nice /opt/liquid_feedback_core/lf_update_suggestion_order dbname=liquid_feedback 2>&1 | logger -t "lf_updated"'
168 sleep 5
169 done
171 This file must be marked as executable:
173 chmod +x /opt/liquid_feedback_core/lf_updated
175 And this file should be started automatically at system boot.
178 10. Start the system
179 --------------------
181 After `lf_update` has been executed at least once, you should be able to use
182 your LiquidFeedback system.
184 The server is started by calling:
186 su www-data -s $SHELL
187 /opt/moonbridge/moonbridge /opt/webmcp/bin/mcp.lua /opt/webmcp/ /opt/liquid_feedback_frontend/ main myconfig
189 In the latter case, the Moonbridge server will open a TCP port according to
190 your configuration. Directly accessing this TCP port through your webbrowser
191 is helpful for development purposes. For real-life deployment, however, it is
192 recommended to further proxy the application (e.g. using nginx). The proxy can
193 also add HTTPS and/or HTTP/2 support (which is not supported by Moonbridge
194 itself).
196 To start the Moonbridge as a background process, please refer to the Moonbridge
197 command line options:
199 Get this help message: moonbridge {-h|--help}
200 Usage: moonbridge \
201 [-b|--background] \
202 [-d|--debug] \
203 [-f|--logfacility {DAEMON|USER|0|1|...|7}] \
204 [-i|--logident <syslog ident> \
205 [-l|--logfile <logfile>] \
206 [-p|--pidfile <pidfile>] \
207 [-s|--stats] \
208 -- <Lua script> [<cmdline options for Lua script>]

Impressum / About Us