liquid_feedback_frontend

view INSTALL.mkd @ 1308:7ea154c9238a

Added libbsd-dev and postgresql server-dev package to list of necessary packages to be installed for compiling/running on Debian
author jbe
date Thu Jun 23 03:30:57 2016 +0200 (2016-06-23)
parents 78d3be54cfe0
children 4d5f30d8df4a
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 (including the corresponding server-dev package)
18 * libpq-dev
19 * libbsd-dev
20 * pmake or bmake
21 * imagemagick
22 * exim4
23 * markdown2 (``apt-get install python-pip; pip install markdown2``)
25 If you're using any other Linux distribution or BSD system, install the
26 necessary software components accordingly.
29 2. Ensure that the user account of your webserver has access to the database
30 ----------------------------------------------------------------------------
32 The useraccount of the webserver (usually `www-data`) or the Moonbridge server
33 process needs to have access to your PostgreSQL installation. This is done by
34 executing PostgreSQL's shell command `createuser` as database superuser
35 (usually `pgsql`, or `postgres` for Debian installations):
37 su postgres -s $SHELL
38 createuser --no-superuser --createdb --no-createrole www-data
39 exit
42 3. Install and configure LiquidFeedback-Core
43 --------------------------------------------
45 We recommend to create the database with the same user as your webserver
46 (usually `www-data`) to avoid having to setup database privileges.
48 The example below installs the database as `www-data` and stores the two
49 executables `lf_update` and `lf_update_issue_order` in the directory
50 `/opt/liquid_feedback_core/`:
52 # Download and unpack LiquidFeedback-Core
53 # from http://www.public-software-group.org/pub/projects/liquid_feedback/backend/
54 make
55 mkdir /opt/liquid_feedback_core
56 cp core.sql lf_update lf_update_issue_order lf_update_suggestion_order /opt/liquid_feedback_core
57 su www-data -s $SHELL
58 cd /opt/liquid_feedback_core
59 createdb liquid_feedback
60 createlang plpgsql liquid_feedback # command may be omitted, depending on PostgreSQL version
61 psql -v ON_ERROR_STOP=1 -f core.sql liquid_feedback
63 A simple configuration may look as follows:
65 psql liquid_feedback
67 INSERT INTO system_setting (member_ttl) VALUES ('1 year');
68 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (false, '1 hour', 20, 6);
69 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (false, '1 day', 80, 12);
70 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 hour', 200, 60);
71 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 day', 800, 120);
72 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);
73 INSERT INTO unit (name) VALUES ('Our organization');
74 INSERT INTO area (unit_id, name) VALUES (1, 'Default area');
75 INSERT INTO allowed_policy (area_id, policy_id, default_policy) VALUES (1, 1, TRUE);
77 If you want to create an admin user with an empty password (CAUTION!), then execute the following SQL statement:
79 INSERT INTO member (login, name, admin, password) VALUES ('admin', 'Administrator', TRUE, '$1$/EMPTY/$NEWt7XJg2efKwPm4vectc1');
81 Exit the `psql` interface by typing:
83 \q
85 And don't forget to quit the `www-data` shell:
87 exit
90 4. Install Moonbridge
91 ---------------------
93 # Download and unpack Moonbridge
94 # from http://www.public-software-group.org/pub/projects/moonbridge/
95 pmake MOONBR_LUA_PATH=/opt/moonbridge/?.lua
96 mkdir /opt/moonbridge
97 cp moonbridge /opt/moonbridge/
98 cp moonbridge_http.lua /opt/moonbridge/
101 5. Install WebMCP
102 -----------------
104 Note: Using Debian, it may be necessary to append `-I /usr/include/lua5.2` at
105 the end of the CFLAGS line in `Makefile.options` of the WebMCP source
106 distibution:
108 # Download and unpack WebMCP
109 # from http://www.public-software-group.org/pub/projects/webmcp/
110 vi Makefile.options # Debian requires -I /usr/include/lua5.2 at end of CFLAGS line
111 make
112 mkdir /opt/webmcp
113 cp -RL framework/* /opt/webmcp/
116 6. Install the LiquidFeedback-Frontend
117 --------------------------------------
119 Unpack source tree into appropriate directory, e.g. `/opt/liquid_feedback_frontend`:
121 # Download LiquidFeedback-Frontend
122 # from http://www.public-software-group.org/pub/projects/liquid_feedback/frontend/
123 mv liquid_feedback_frontend-vX.X.X /opt/liquid_feedback_frontend
125 Make `tmp/` directory of LiquidFeedback-Frontend writable for webserver:
127 chown www-data /opt/liquid_feedback_frontend/tmp
130 7. Configure mail system
131 ------------------------
133 It may be necessary to configure your server's mail system, e.g. running
134 `dpkg-reconfigure exim4-config` on a Debian system.
137 8. Configure the LiquidFeedback-Frontend
138 ----------------------------------------
140 cd /opt/liquid_feedback_frontend/config
141 cp example.lua myconfig.lua
142 # edit myconfig.lua according to your needs
145 9. Setup regular execution of `lf_update` and related commands
146 --------------------------------------------------------------
148 The executables `lf_update`, `lf_update_issue_order`, and
149 `lf_update_suggestion_order` must be executed regularly. This may be achieved
150 by creating a file named `/opt/liquid_feedback_core/lf_updated` with the
151 following contents:
153 #!/bin/sh
155 PIDFILE="/var/run/lf_updated.pid"
156 PID=$$
158 if [ -f "${PIDFILE}" ] && kill -CONT $( cat "${PIDFILE}" ); then
159 echo "lf_updated is already running."
160 exit 1
161 fi
163 echo "${PID}" > "${PIDFILE}"
165 while true; do
166 su - www-data -s /bin/sh -c 'nice /opt/liquid_feedback_core/lf_update dbname=liquid_feedback 2>&1 | logger -t "lf_updated"'
167 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"'
168 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"'
169 sleep 5
170 done
172 This file must be marked as executable:
174 chmod +x /opt/liquid_feedback_core/lf_updated
176 And this file should be started automatically at system boot.
179 10. Start the system
180 --------------------
182 After `lf_update` has been executed at least once, you should be able to use
183 your LiquidFeedback system.
185 The server is started by calling:
187 su www-data -s $SHELL
188 /opt/moonbridge/moonbridge /opt/webmcp/bin/mcp.lua /opt/webmcp/ /opt/liquid_feedback_frontend/ main myconfig
190 In the latter case, the Moonbridge server will open a TCP port according to
191 your configuration. Directly accessing this TCP port through your webbrowser
192 is helpful for development purposes. For real-life deployment, however, it is
193 recommended to further proxy the application (e.g. using nginx). The proxy can
194 also add HTTPS and/or HTTP/2 support (which is not supported by Moonbridge
195 itself).
197 To start the Moonbridge as a background process, please refer to the Moonbridge
198 command line options:
200 Get this help message: moonbridge {-h|--help}
201 Usage: moonbridge \
202 [-b|--background] \
203 [-d|--debug] \
204 [-f|--logfacility {DAEMON|USER|0|1|...|7}] \
205 [-i|--logident <syslog ident> \
206 [-l|--logfile <logfile>] \
207 [-p|--pidfile <pidfile>] \
208 [-s|--stats] \
209 -- <Lua script> [<cmdline options for Lua script>]

Impressum / About Us