liquid_feedback_frontend
diff INSTALL.html @ 1657:4d5f30d8df4a
Updated installation instructions
author | bsw |
---|---|
date | Sun Feb 14 13:12:08 2021 +0100 (2021-02-14) |
parents | 7ea154c9238a |
children | fa9e93235e02 |
line diff
1.1 --- a/INSTALL.html Sun Feb 14 12:46:39 2021 +0100 1.2 +++ b/INSTALL.html Sun Feb 14 13:12:08 2021 +0100 1.3 @@ -1,8 +1,4 @@ 1.4 -<html> 1.5 -<head> 1.6 -<title>LiquidFeedback Installation Instructions</title> 1.7 -</head> 1.8 -<body> 1.9 +<html><head><title>LiquidFeedback Installation Instructions</title></head><body> 1.10 <h1>LiquidFeedback Installation Instructions</h1> 1.11 1.12 <p>This document gives a short outline about the necessary steps to setup a 1.13 @@ -15,15 +11,15 @@ 1.14 1.15 <ul> 1.16 <li>build-essential</li> 1.17 -<li>lua5.2</li> 1.18 -<li>liblua5.2-dev</li> 1.19 -<li>postgresql (including the corresponding server-dev package)</li> 1.20 -<li>libpq-dev</li> 1.21 +<li>postgresql</li> 1.22 +<li>postgresql-server-dev-12</li> 1.23 <li>libbsd-dev</li> 1.24 -<li>pmake or bmake</li> 1.25 +<li>lua5.3</li> 1.26 +<li>liblua5.3-dev</li> 1.27 +<li>mercurial</li> 1.28 +<li>bmake</li> 1.29 +<li>lsb-release</li> 1.30 <li>imagemagick</li> 1.31 -<li>exim4</li> 1.32 -<li>markdown2 (<code>apt-get install python-pip; pip install markdown2</code>)</li> 1.33 </ul> 1.34 1.35 <p>If you're using any other Linux distribution or BSD system, install the 1.36 @@ -31,12 +27,12 @@ 1.37 1.38 <h2>2. Ensure that the user account of your webserver has access to the database</h2> 1.39 1.40 -<p>The useraccount of the webserver (usually <code>www-data</code>) or the Moonbridge server 1.41 -process needs to have access to your PostgreSQL installation. This is done by 1.42 -executing PostgreSQL's shell command <code>createuser</code> as database superuser 1.43 -(usually <code>pgsql</code>, or <code>postgres</code> for Debian installations):</p> 1.44 +<p>The useraccount of Moonbridge server process needs to have access to your 1.45 +PostgreSQL installation. This is done by executing PostgreSQL's shell command 1.46 +<code>createuser</code> as database superuser (usually <code>pgsql</code>, or <code>postgres</code> for 1.47 +Debian installations):</p> 1.48 1.49 -<pre><code>su postgres -s $SHELL 1.50 +<pre><code>su - postgres -s $SHELL 1.51 createuser --no-superuser --createdb --no-createrole www-data 1.52 exit 1.53 </code></pre> 1.54 @@ -46,9 +42,9 @@ 1.55 <p>We recommend to create the database with the same user as your webserver 1.56 (usually <code>www-data</code>) to avoid having to setup database privileges.</p> 1.57 1.58 -<p>The example below installs the database as <code>www-data</code> and stores the two 1.59 -executables <code>lf_update</code> and <code>lf_update_issue_order</code> in the directory 1.60 -<code>/opt/liquid_feedback_core/</code>:</p> 1.61 +<p>The example below installs the database as <code>www-data</code> and stores the three 1.62 +executables <code>lf_update</code>, <code>lf_update_issue_order</code> and 1.63 +<code>lf_update_suggestion_order</code> in the directory <code>/opt/liquid_feedback_core/</code>:</p> 1.64 1.65 <pre><code># Download and unpack LiquidFeedback-Core 1.66 # from http://www.public-software-group.org/pub/projects/liquid_feedback/backend/ 1.67 @@ -58,7 +54,6 @@ 1.68 su www-data -s $SHELL 1.69 cd /opt/liquid_feedback_core 1.70 createdb liquid_feedback 1.71 -createlang plpgsql liquid_feedback # command may be omitted, depending on PostgreSQL version 1.72 psql -v ON_ERROR_STOP=1 -f core.sql liquid_feedback 1.73 </code></pre> 1.74 1.75 @@ -71,15 +66,11 @@ 1.76 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (false, '1 day', 80, 12); 1.77 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 hour', 200, 60); 1.78 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 day', 800, 120); 1.79 -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); 1.80 -INSERT INTO unit (name) VALUES ('Our organization'); 1.81 -INSERT INTO area (unit_id, name) VALUES (1, 'Default area'); 1.82 -INSERT INTO allowed_policy (area_id, policy_id, default_policy) VALUES (1, 1, TRUE); 1.83 </code></pre> 1.84 1.85 -<p>If you want to create an admin user with an empty password (CAUTION!), then execute the following SQL statement:</p> 1.86 +<p>Create an invite code for an admin user:</p> 1.87 1.88 -<pre><code>INSERT INTO member (login, name, admin, password) VALUES ('admin', 'Administrator', TRUE, '$1$/EMPTY/$NEWt7XJg2efKwPm4vectc1'); 1.89 +<pre><code>INSERT INTO member (invite_code, admin) VALUES ('sesam', true); 1.90 </code></pre> 1.91 1.92 <p>Exit the <code>psql</code> interface by typing:</p> 1.93 @@ -104,13 +95,8 @@ 1.94 1.95 <h2>5. Install WebMCP</h2> 1.96 1.97 -<p>Note: Using Debian, it may be necessary to append <code>-I /usr/include/lua5.2</code> at 1.98 -the end of the CFLAGS line in <code>Makefile.options</code> of the WebMCP source 1.99 -distibution:</p> 1.100 - 1.101 <pre><code># Download and unpack WebMCP 1.102 # from http://www.public-software-group.org/pub/projects/webmcp/ 1.103 -vi Makefile.options # Debian requires -I /usr/include/lua5.2 at end of CFLAGS line 1.104 make 1.105 mkdir /opt/webmcp 1.106 cp -RL framework/* /opt/webmcp/ 1.107 @@ -132,8 +118,7 @@ 1.108 1.109 <h2>7. Configure mail system</h2> 1.110 1.111 -<p>It may be necessary to configure your server's mail system, e.g. running 1.112 -<code>dpkg-reconfigure exim4-config</code> on a Debian system.</p> 1.113 +<p>It may be necessary to configure your server's mail system.</p> 1.114 1.115 <h2>8. Configure the LiquidFeedback-Frontend</h2> 1.116 1.117 @@ -146,21 +131,11 @@ 1.118 1.119 <p>The executables <code>lf_update</code>, <code>lf_update_issue_order</code>, and 1.120 <code>lf_update_suggestion_order</code> must be executed regularly. This may be achieved 1.121 -by creating a file named <code>/opt/liquid_feedback_core/lf_updated</code> with the 1.122 +by creating a file named <code>/opt/liquid_feedback_core/lf_update.sh</code> with the 1.123 following contents:</p> 1.124 1.125 <pre><code>#!/bin/sh 1.126 1.127 -PIDFILE="/var/run/lf_updated.pid" 1.128 -PID=$$ 1.129 - 1.130 -if [ -f "${PIDFILE}" ] && kill -CONT $( cat "${PIDFILE}" ); then 1.131 - echo "lf_updated is already running." 1.132 - exit 1 1.133 -fi 1.134 - 1.135 -echo "${PID}" > "${PIDFILE}" 1.136 - 1.137 while true; do 1.138 su - www-data -s /bin/sh -c 'nice /opt/liquid_feedback_core/lf_update dbname=liquid_feedback 2>&1 | logger -t "lf_updated"' 1.139 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"' 1.140 @@ -174,39 +149,63 @@ 1.141 <pre><code>chmod +x /opt/liquid_feedback_core/lf_updated 1.142 </code></pre> 1.143 1.144 -<p>And this file should be started automatically at system boot.</p> 1.145 +<p>And this file should be started automatically at system boot. On systems with 1.146 +systemd, create a file named <code>/etc/systemd/system/liquid_feedback_core.service</code>:</p> 1.147 + 1.148 +<pre><code>[Unit] 1.149 +Description=LiquidFeedback Core update 1.150 + 1.151 +[Service] 1.152 +User=lf 1.153 +ExecStart=/opt/liquid_feedback_core/lf_update.sh 1.154 1.155 -<h2>10. Start the system</h2> 1.156 +[Install] 1.157 +WantedBy=multi-user.target 1.158 +</code></pre> 1.159 + 1.160 +<p>Enable and start the service: 1.161 + systemctl start liquid<em>feedback</em>core 1.162 + systemctl enable liquid<em>feedback</em>core</p> 1.163 + 1.164 +<h2>10. Start the frontend</h2> 1.165 1.166 <p>After <code>lf_update</code> has been executed at least once, you should be able to use 1.167 your LiquidFeedback system.</p> 1.168 1.169 -<p>The server is started by calling:</p> 1.170 +<p>Create a file named "/opt/liquid<em>feedback</em>frontend/run.sh":</p> 1.171 + 1.172 +<pre><code>#/bin/bash 1.173 + 1.174 +su - www-data -c /opt/moonbridge/moonbridge /opt/webmcp/bin/mcp.lua /opt/webmcp/ /opt/liquid_feedback_frontend/ main myconfig 1.175 +</code></pre> 1.176 + 1.177 +<p>Make it executable:</p> 1.178 + 1.179 +<pre><code>chmod +x /opt/liquid_feedback_frontend/run.sh 1.180 +</code></pre> 1.181 + 1.182 +<p>On systemd based systems, create a file named 1.183 +<code>/etc/systemd/system/liquid_feedback_frontend.service</code>:</p> 1.184 1.185 -<pre><code>su www-data -s $SHELL 1.186 -/opt/moonbridge/moonbridge /opt/webmcp/bin/mcp.lua /opt/webmcp/ /opt/liquid_feedback_frontend/ main myconfig 1.187 +<pre><code>[Unit] 1.188 +Description=LiquidFeedback Frontend 1.189 + 1.190 +[Service] 1.191 +User=lf 1.192 +ExecStart=/opt/liquid_feedback_frontend/run.sh 1.193 + 1.194 +[Install] 1.195 +WantedBy=multi-user.target 1.196 </code></pre> 1.197 1.198 +<p>Enable and start the service: 1.199 + systemctl start liquid<em>feedback</em>frontend 1.200 + systemctl enable liquid<em>feedback</em>frontend</p> 1.201 + 1.202 <p>In the latter case, the Moonbridge server will open a TCP port according to 1.203 your configuration. Directly accessing this TCP port through your webbrowser 1.204 is helpful for development purposes. For real-life deployment, however, it is 1.205 recommended to further proxy the application (e.g. using nginx). The proxy can 1.206 also add HTTPS and/or HTTP/2 support (which is not supported by Moonbridge 1.207 itself).</p> 1.208 - 1.209 -<p>To start the Moonbridge as a background process, please refer to the Moonbridge 1.210 -command line options:</p> 1.211 - 1.212 -<pre><code>Get this help message: moonbridge {-h|--help} 1.213 -Usage: moonbridge \ 1.214 - [-b|--background] \ 1.215 - [-d|--debug] \ 1.216 - [-f|--logfacility {DAEMON|USER|0|1|...|7}] \ 1.217 - [-i|--logident <syslog ident> \ 1.218 - [-l|--logfile <logfile>] \ 1.219 - [-p|--pidfile <pidfile>] \ 1.220 - [-s|--stats] \ 1.221 - -- <Lua script> [<cmdline options for Lua script>] 1.222 -</code></pre> 1.223 -</body> 1.224 -</html> 1.225 +</body></html>