rev |
line source |
bsw@1657
|
1 <html><head><title>LiquidFeedback Installation Instructions</title></head><body>
|
jbe@1046
|
2 <h1>LiquidFeedback Installation Instructions</h1>
|
jbe@1046
|
3
|
jbe@1046
|
4 <p>This document gives a short outline about the necessary steps to setup a
|
jbe@1046
|
5 LiquidFeedback system.</p>
|
jbe@1046
|
6
|
jbe@1046
|
7 <h2>1. Install necessary dependencies</h2>
|
jbe@1046
|
8
|
jbe@1046
|
9 <p>If you're using a Debian system, make sure that the following packages are
|
jbe@1046
|
10 installed:</p>
|
jbe@1046
|
11
|
bsw@1045
|
12 <ul>
|
jbe@1156
|
13 <li>build-essential</li>
|
bsw@1657
|
14 <li>postgresql</li>
|
bsw@1657
|
15 <li>postgresql-server-dev-12</li>
|
jbe@1308
|
16 <li>libbsd-dev</li>
|
bsw@1657
|
17 <li>lua5.3</li>
|
bsw@1657
|
18 <li>liblua5.3-dev</li>
|
bsw@1657
|
19 <li>mercurial</li>
|
bsw@1657
|
20 <li>bmake</li>
|
bsw@1657
|
21 <li>lsb-release</li>
|
bsw@1045
|
22 <li>imagemagick</li>
|
bsw@1839
|
23 <li>sassc</li>
|
bsw@1045
|
24 </ul>
|
jbe@1046
|
25
|
jbe@1046
|
26 <p>If you're using any other Linux distribution or BSD system, install the
|
jbe@1046
|
27 necessary software components accordingly.</p>
|
jbe@1046
|
28
|
jbe@1046
|
29 <h2>2. Ensure that the user account of your webserver has access to the database</h2>
|
jbe@1046
|
30
|
bsw@1657
|
31 <p>The useraccount of Moonbridge server process needs to have access to your
|
bsw@1657
|
32 PostgreSQL installation. This is done by executing PostgreSQL's shell command
|
bsw@1657
|
33 <code>createuser</code> as database superuser (usually <code>pgsql</code>, or <code>postgres</code> for
|
bsw@1657
|
34 Debian installations):</p>
|
jbe@1046
|
35
|
bsw@1657
|
36 <pre><code>su - postgres -s $SHELL
|
jbe@1191
|
37 createuser --no-superuser --createdb --no-createrole www-data
|
jbe@1046
|
38 exit
|
jbe@1046
|
39 </code></pre>
|
jbe@1046
|
40
|
jbe@1046
|
41 <h2>3. Install and configure LiquidFeedback-Core</h2>
|
jbe@1046
|
42
|
jbe@1046
|
43 <p>We recommend to create the database with the same user as your webserver
|
jbe@1046
|
44 (usually <code>www-data</code>) to avoid having to setup database privileges.</p>
|
jbe@1046
|
45
|
bsw@1657
|
46 <p>The example below installs the database as <code>www-data</code> and stores the three
|
bsw@1657
|
47 executables <code>lf_update</code>, <code>lf_update_issue_order</code> and
|
bsw@1657
|
48 <code>lf_update_suggestion_order</code> in the directory <code>/opt/liquid_feedback_core/</code>:</p>
|
jbe@1046
|
49
|
bsw@1045
|
50 <pre><code># Download and unpack LiquidFeedback-Core
|
bsw@1045
|
51 # from http://www.public-software-group.org/pub/projects/liquid_feedback/backend/
|
bsw@1045
|
52 make
|
bsw@1045
|
53 mkdir /opt/liquid_feedback_core
|
jbe@1196
|
54 cp core.sql lf_update lf_update_issue_order lf_update_suggestion_order /opt/liquid_feedback_core
|
jbe@1191
|
55 su www-data -s $SHELL
|
bsw@1045
|
56 cd /opt/liquid_feedback_core
|
bsw@1045
|
57 createdb liquid_feedback
|
jbe@1046
|
58 psql -v ON_ERROR_STOP=1 -f core.sql liquid_feedback
|
jbe@1046
|
59 </code></pre>
|
jbe@1046
|
60
|
bsw@1045
|
61 <p>A simple configuration may look as follows:</p>
|
jbe@1046
|
62
|
bsw@1045
|
63 <pre><code>psql liquid_feedback
|
bsw@1045
|
64
|
jbe@1046
|
65 INSERT INTO system_setting (member_ttl) VALUES ('1 year');
|
jbe@1046
|
66 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (false, '1 hour', 20, 6);
|
jbe@1046
|
67 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (false, '1 day', 80, 12);
|
jbe@1046
|
68 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 hour', 200, 60);
|
jbe@1046
|
69 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 day', 800, 120);
|
jbe@1046
|
70 </code></pre>
|
jbe@1046
|
71
|
bsw@1657
|
72 <p>Create an invite code for an admin user:</p>
|
jbe@1046
|
73
|
bsw@1657
|
74 <pre><code>INSERT INTO member (invite_code, admin) VALUES ('sesam', true);
|
jbe@1046
|
75 </code></pre>
|
jbe@1046
|
76
|
bsw@1045
|
77 <p>Exit the <code>psql</code> interface by typing:</p>
|
jbe@1046
|
78
|
jbe@1046
|
79 <pre><code>\q
|
jbe@1046
|
80 </code></pre>
|
jbe@1046
|
81
|
bsw@1045
|
82 <p>And don't forget to quit the <code>www-data</code> shell:</p>
|
jbe@1046
|
83
|
jbe@1046
|
84 <pre><code>exit
|
jbe@1046
|
85 </code></pre>
|
jbe@1046
|
86
|
jbe@1244
|
87 <h2>4. Install Moonbridge</h2>
|
jbe@1046
|
88
|
jbe@1156
|
89 <pre><code># Download and unpack Moonbridge
|
jbe@1156
|
90 # from http://www.public-software-group.org/pub/projects/moonbridge/
|
jbe@1156
|
91 pmake MOONBR_LUA_PATH=/opt/moonbridge/?.lua
|
jbe@1156
|
92 mkdir /opt/moonbridge
|
jbe@1156
|
93 cp moonbridge /opt/moonbridge/
|
jbe@1156
|
94 cp moonbridge_http.lua /opt/moonbridge/
|
jbe@1156
|
95 </code></pre>
|
jbe@1156
|
96
|
jbe@1156
|
97 <h2>5. Install WebMCP</h2>
|
jbe@1156
|
98
|
bsw@1045
|
99 <pre><code># Download and unpack WebMCP
|
bsw@1045
|
100 # from http://www.public-software-group.org/pub/projects/webmcp/
|
bsw@1045
|
101 make
|
bsw@1045
|
102 mkdir /opt/webmcp
|
jbe@1046
|
103 cp -RL framework/* /opt/webmcp/
|
jbe@1046
|
104 </code></pre>
|
bsw@1045
|
105
|
jbe@1156
|
106 <h2>6. Install the LiquidFeedback-Frontend</h2>
|
bsw@1045
|
107
|
bsw@1045
|
108 <p>Unpack source tree into appropriate directory, e.g. <code>/opt/liquid_feedback_frontend</code>:</p>
|
jbe@1046
|
109
|
bsw@1045
|
110 <pre><code># Download LiquidFeedback-Frontend
|
bsw@1045
|
111 # from http://www.public-software-group.org/pub/projects/liquid_feedback/frontend/
|
jbe@1046
|
112 mv liquid_feedback_frontend-vX.X.X /opt/liquid_feedback_frontend
|
jbe@1046
|
113 </code></pre>
|
jbe@1046
|
114
|
bsw@1045
|
115 <p>Make <code>tmp/</code> directory of LiquidFeedback-Frontend writable for webserver:</p>
|
jbe@1046
|
116
|
jbe@1046
|
117 <pre><code>chown www-data /opt/liquid_feedback_frontend/tmp
|
jbe@1046
|
118 </code></pre>
|
jbe@1046
|
119
|
jbe@1156
|
120 <h2>7. Configure mail system</h2>
|
jbe@1046
|
121
|
bsw@1657
|
122 <p>It may be necessary to configure your server's mail system.</p>
|
jbe@1046
|
123
|
jbe@1244
|
124 <h2>8. Configure the LiquidFeedback-Frontend</h2>
|
jbe@1046
|
125
|
bsw@1045
|
126 <pre><code>cd /opt/liquid_feedback_frontend/config
|
bsw@1045
|
127 cp example.lua myconfig.lua
|
jbe@1046
|
128 # edit myconfig.lua according to your needs
|
jbe@1046
|
129 </code></pre>
|
jbe@1046
|
130
|
jbe@1244
|
131 <h2>9. Setup regular execution of <code>lf_update</code> and related commands </h2>
|
jbe@1046
|
132
|
jbe@1051
|
133 <p>The executables <code>lf_update</code>, <code>lf_update_issue_order</code>, and
|
jbe@1051
|
134 <code>lf_update_suggestion_order</code> must be executed regularly. This may be achieved
|
bsw@1657
|
135 by creating a file named <code>/opt/liquid_feedback_core/lf_update.sh</code> with the
|
jbe@1051
|
136 following contents:</p>
|
jbe@1046
|
137
|
bsw@1045
|
138 <pre><code>#!/bin/sh
|
bsw@1045
|
139
|
bsw@1045
|
140 while true; do
|
bsw@1661
|
141 nice /opt/liquid_feedback_core/lf_update dbname=liquid_feedback 2>&1 | logger -t "lf_core"
|
bsw@1661
|
142 nice /opt/liquid_feedback_core/lf_update_issue_order dbname=liquid_feedback 2>&1 | logger -t "lf_core"
|
bsw@1661
|
143 nice /opt/liquid_feedback_core/lf_update_suggestion_order dbname=liquid_feedback 2>&1 | logger -t "lf_core"
|
bsw@1045
|
144 sleep 5
|
jbe@1046
|
145 done
|
jbe@1046
|
146 </code></pre>
|
jbe@1046
|
147
|
bsw@1045
|
148 <p>This file must be marked as executable:</p>
|
jbe@1046
|
149
|
jbe@1046
|
150 <pre><code>chmod +x /opt/liquid_feedback_core/lf_updated
|
jbe@1046
|
151 </code></pre>
|
jbe@1046
|
152
|
bsw@1657
|
153 <p>And this file should be started automatically at system boot. On systems with
|
bsw@1657
|
154 systemd, create a file named <code>/etc/systemd/system/liquid_feedback_core.service</code>:</p>
|
bsw@1657
|
155
|
bsw@1657
|
156 <pre><code>[Unit]
|
bsw@1657
|
157 Description=LiquidFeedback Core update
|
bsw@1657
|
158
|
bsw@1657
|
159 [Service]
|
bsw@1661
|
160 User=www-data
|
bsw@1657
|
161 ExecStart=/opt/liquid_feedback_core/lf_update.sh
|
jbe@1046
|
162
|
bsw@1657
|
163 [Install]
|
bsw@1657
|
164 WantedBy=multi-user.target
|
bsw@1657
|
165 </code></pre>
|
bsw@1657
|
166
|
bsw@1673
|
167 <p>Enable and start the service:</p>
|
bsw@1673
|
168
|
bsw@1673
|
169 <pre><code>systemctl start liquid_feedback_core
|
bsw@1673
|
170 systemctl enable liquid_feedback_core
|
bsw@1673
|
171 </code></pre>
|
bsw@1657
|
172
|
bsw@1657
|
173 <h2>10. Start the frontend</h2>
|
jbe@1046
|
174
|
jbe@1244
|
175 <p>After <code>lf_update</code> has been executed at least once, you should be able to use
|
jbe@1244
|
176 your LiquidFeedback system.</p>
|
jbe@1046
|
177
|
bsw@1674
|
178 <p>Create a file named <code>/opt/liquid_feedback_frontend/run.sh</code>:</p>
|
bsw@1657
|
179
|
bsw@1657
|
180 <pre><code>#/bin/bash
|
bsw@1657
|
181
|
bsw@1661
|
182 /opt/moonbridge/moonbridge /opt/webmcp/bin/mcp.lua /opt/webmcp/ /opt/liquid_feedback_frontend/ main myconfig 2>&1 | logger -t "lf_frontend"
|
bsw@1657
|
183 </code></pre>
|
bsw@1657
|
184
|
bsw@1657
|
185 <p>Make it executable:</p>
|
bsw@1657
|
186
|
bsw@1657
|
187 <pre><code>chmod +x /opt/liquid_feedback_frontend/run.sh
|
bsw@1657
|
188 </code></pre>
|
bsw@1657
|
189
|
bsw@1657
|
190 <p>On systemd based systems, create a file named
|
bsw@1657
|
191 <code>/etc/systemd/system/liquid_feedback_frontend.service</code>:</p>
|
jbe@1156
|
192
|
bsw@1657
|
193 <pre><code>[Unit]
|
bsw@1657
|
194 Description=LiquidFeedback Frontend
|
bsw@1657
|
195
|
bsw@1657
|
196 [Service]
|
bsw@1661
|
197 User=www-data
|
bsw@1657
|
198 ExecStart=/opt/liquid_feedback_frontend/run.sh
|
bsw@1657
|
199
|
bsw@1657
|
200 [Install]
|
bsw@1657
|
201 WantedBy=multi-user.target
|
jbe@1156
|
202 </code></pre>
|
jbe@1162
|
203
|
bsw@1673
|
204 <p>Enable and start the service:</p>
|
bsw@1673
|
205
|
bsw@1673
|
206 <pre><code>systemctl start liquid_feedback_frontend
|
bsw@1673
|
207 systemctl enable liquid_feedback_frontend
|
bsw@1673
|
208 </code></pre>
|
bsw@1657
|
209
|
jbe@1162
|
210 <p>In the latter case, the Moonbridge server will open a TCP port according to
|
jbe@1162
|
211 your configuration. Directly accessing this TCP port through your webbrowser
|
jbe@1162
|
212 is helpful for development purposes. For real-life deployment, however, it is
|
jbe@1162
|
213 recommended to further proxy the application (e.g. using nginx). The proxy can
|
jbe@1190
|
214 also add HTTPS and/or HTTP/2 support (which is not supported by Moonbridge
|
jbe@1190
|
215 itself).</p>
|
bsw@1657
|
216 </body></html>
|