liquid_feedback_frontend
changeset 1657:4d5f30d8df4a
Updated installation instructions
author | bsw |
---|---|
date | Sun Feb 14 13:12:08 2021 +0100 (2021-02-14) |
parents | 3fb752f4afcb |
children | c08690678b2d |
files | INSTALL.html INSTALL.mkd make-doc.sh |
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>
2.1 --- a/INSTALL.mkd Sun Feb 14 12:46:39 2021 +0100 2.2 +++ b/INSTALL.mkd Sun Feb 14 13:12:08 2021 +0100 2.3 @@ -12,15 +12,15 @@ 2.4 installed: 2.5 2.6 * build-essential 2.7 - * lua5.2 2.8 - * liblua5.2-dev 2.9 - * postgresql (including the corresponding server-dev package) 2.10 - * libpq-dev 2.11 + * postgresql 2.12 + * postgresql-server-dev-12 2.13 * libbsd-dev 2.14 - * pmake or bmake 2.15 + * lua5.3 2.16 + * liblua5.3-dev 2.17 + * mercurial 2.18 + * bmake 2.19 + * lsb-release 2.20 * imagemagick 2.21 - * exim4 2.22 - * markdown2 (``apt-get install python-pip; pip install markdown2``) 2.23 2.24 If you're using any other Linux distribution or BSD system, install the 2.25 necessary software components accordingly. 2.26 @@ -29,12 +29,12 @@ 2.27 2. Ensure that the user account of your webserver has access to the database 2.28 ---------------------------------------------------------------------------- 2.29 2.30 -The useraccount of the webserver (usually `www-data`) or the Moonbridge server 2.31 -process needs to have access to your PostgreSQL installation. This is done by 2.32 -executing PostgreSQL's shell command `createuser` as database superuser 2.33 -(usually `pgsql`, or `postgres` for Debian installations): 2.34 +The useraccount of Moonbridge server process needs to have access to your 2.35 +PostgreSQL installation. This is done by executing PostgreSQL's shell command 2.36 +`createuser` as database superuser (usually `pgsql`, or `postgres` for 2.37 +Debian installations): 2.38 2.39 - su postgres -s $SHELL 2.40 + su - postgres -s $SHELL 2.41 createuser --no-superuser --createdb --no-createrole www-data 2.42 exit 2.43 2.44 @@ -45,9 +45,9 @@ 2.45 We recommend to create the database with the same user as your webserver 2.46 (usually `www-data`) to avoid having to setup database privileges. 2.47 2.48 -The example below installs the database as `www-data` and stores the two 2.49 -executables `lf_update` and `lf_update_issue_order` in the directory 2.50 -`/opt/liquid_feedback_core/`: 2.51 +The example below installs the database as `www-data` and stores the three 2.52 +executables `lf_update`, `lf_update_issue_order` and 2.53 +`lf_update_suggestion_order` in the directory `/opt/liquid_feedback_core/`: 2.54 2.55 # Download and unpack LiquidFeedback-Core 2.56 # from http://www.public-software-group.org/pub/projects/liquid_feedback/backend/ 2.57 @@ -57,7 +57,6 @@ 2.58 su www-data -s $SHELL 2.59 cd /opt/liquid_feedback_core 2.60 createdb liquid_feedback 2.61 - createlang plpgsql liquid_feedback # command may be omitted, depending on PostgreSQL version 2.62 psql -v ON_ERROR_STOP=1 -f core.sql liquid_feedback 2.63 2.64 A simple configuration may look as follows: 2.65 @@ -69,14 +68,10 @@ 2.66 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (false, '1 day', 80, 12); 2.67 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 hour', 200, 60); 2.68 INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 day', 800, 120); 2.69 - 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); 2.70 - INSERT INTO unit (name) VALUES ('Our organization'); 2.71 - INSERT INTO area (unit_id, name) VALUES (1, 'Default area'); 2.72 - INSERT INTO allowed_policy (area_id, policy_id, default_policy) VALUES (1, 1, TRUE); 2.73 2.74 -If you want to create an admin user with an empty password (CAUTION!), then execute the following SQL statement: 2.75 +Create an invite code for an admin user: 2.76 2.77 - INSERT INTO member (login, name, admin, password) VALUES ('admin', 'Administrator', TRUE, '$1$/EMPTY/$NEWt7XJg2efKwPm4vectc1'); 2.78 + INSERT INTO member (invite_code, admin) VALUES ('sesam', true); 2.79 2.80 Exit the `psql` interface by typing: 2.81 2.82 @@ -101,13 +96,8 @@ 2.83 5. Install WebMCP 2.84 ----------------- 2.85 2.86 -Note: Using Debian, it may be necessary to append `-I /usr/include/lua5.2` at 2.87 -the end of the CFLAGS line in `Makefile.options` of the WebMCP source 2.88 -distibution: 2.89 - 2.90 # Download and unpack WebMCP 2.91 # from http://www.public-software-group.org/pub/projects/webmcp/ 2.92 - vi Makefile.options # Debian requires -I /usr/include/lua5.2 at end of CFLAGS line 2.93 make 2.94 mkdir /opt/webmcp 2.95 cp -RL framework/* /opt/webmcp/ 2.96 @@ -130,8 +120,7 @@ 2.97 7. Configure mail system 2.98 ------------------------ 2.99 2.100 -It may be necessary to configure your server's mail system, e.g. running 2.101 -`dpkg-reconfigure exim4-config` on a Debian system. 2.102 +It may be necessary to configure your server's mail system. 2.103 2.104 2.105 8. Configure the LiquidFeedback-Frontend 2.106 @@ -147,21 +136,11 @@ 2.107 2.108 The executables `lf_update`, `lf_update_issue_order`, and 2.109 `lf_update_suggestion_order` must be executed regularly. This may be achieved 2.110 -by creating a file named `/opt/liquid_feedback_core/lf_updated` with the 2.111 +by creating a file named `/opt/liquid_feedback_core/lf_update.sh` with the 2.112 following contents: 2.113 2.114 #!/bin/sh 2.115 2.116 - PIDFILE="/var/run/lf_updated.pid" 2.117 - PID=$$ 2.118 - 2.119 - if [ -f "${PIDFILE}" ] && kill -CONT $( cat "${PIDFILE}" ); then 2.120 - echo "lf_updated is already running." 2.121 - exit 1 2.122 - fi 2.123 - 2.124 - echo "${PID}" > "${PIDFILE}" 2.125 - 2.126 while true; do 2.127 su - www-data -s /bin/sh -c 'nice /opt/liquid_feedback_core/lf_update dbname=liquid_feedback 2>&1 | logger -t "lf_updated"' 2.128 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"' 2.129 @@ -173,19 +152,57 @@ 2.130 2.131 chmod +x /opt/liquid_feedback_core/lf_updated 2.132 2.133 -And this file should be started automatically at system boot. 2.134 +And this file should be started automatically at system boot. On systems with 2.135 +systemd, create a file named `/etc/systemd/system/liquid_feedback_core.service`: 2.136 + 2.137 + [Unit] 2.138 + Description=LiquidFeedback Core update 2.139 + 2.140 + [Service] 2.141 + User=lf 2.142 + ExecStart=/opt/liquid_feedback_core/lf_update.sh 2.143 + 2.144 + [Install] 2.145 + WantedBy=multi-user.target 2.146 + 2.147 +Enable and start the service: 2.148 + systemctl start liquid_feedback_core 2.149 + systemctl enable liquid_feedback_core 2.150 2.151 2.152 -10. Start the system 2.153 --------------------- 2.154 +10. Start the frontend 2.155 +---------------------- 2.156 2.157 After `lf_update` has been executed at least once, you should be able to use 2.158 your LiquidFeedback system. 2.159 2.160 -The server is started by calling: 2.161 +Create a file named "/opt/liquid_feedback_frontend/run.sh": 2.162 + 2.163 + #/bin/bash 2.164 + 2.165 + su - www-data -c /opt/moonbridge/moonbridge /opt/webmcp/bin/mcp.lua /opt/webmcp/ /opt/liquid_feedback_frontend/ main myconfig 2.166 + 2.167 +Make it executable: 2.168 + 2.169 + chmod +x /opt/liquid_feedback_frontend/run.sh 2.170 + 2.171 +On systemd based systems, create a file named 2.172 +`/etc/systemd/system/liquid_feedback_frontend.service`: 2.173 2.174 - su www-data -s $SHELL 2.175 - /opt/moonbridge/moonbridge /opt/webmcp/bin/mcp.lua /opt/webmcp/ /opt/liquid_feedback_frontend/ main myconfig 2.176 + [Unit] 2.177 + Description=LiquidFeedback Frontend 2.178 + 2.179 + [Service] 2.180 + User=lf 2.181 + ExecStart=/opt/liquid_feedback_frontend/run.sh 2.182 + 2.183 + [Install] 2.184 + WantedBy=multi-user.target 2.185 + 2.186 +Enable and start the service: 2.187 + systemctl start liquid_feedback_frontend 2.188 + systemctl enable liquid_feedback_frontend 2.189 + 2.190 2.191 In the latter case, the Moonbridge server will open a TCP port according to 2.192 your configuration. Directly accessing this TCP port through your webbrowser 2.193 @@ -194,18 +211,4 @@ 2.194 also add HTTPS and/or HTTP/2 support (which is not supported by Moonbridge 2.195 itself). 2.196 2.197 -To start the Moonbridge as a background process, please refer to the Moonbridge 2.198 -command line options: 2.199 2.200 - Get this help message: moonbridge {-h|--help} 2.201 - Usage: moonbridge \ 2.202 - [-b|--background] \ 2.203 - [-d|--debug] \ 2.204 - [-f|--logfacility {DAEMON|USER|0|1|...|7}] \ 2.205 - [-i|--logident <syslog ident> \ 2.206 - [-l|--logfile <logfile>] \ 2.207 - [-p|--pidfile <pidfile>] \ 2.208 - [-s|--stats] \ 2.209 - -- <Lua script> [<cmdline options for Lua script>] 2.210 - 2.211 -
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/make-doc.sh Sun Feb 14 13:12:08 2021 +0100 3.3 @@ -0,0 +1,8 @@ 3.4 +#!/bin/sh 3.5 +# 3.6 +# This command can be used to update the INSTALL.html file after changing the 3.7 +# INSTALL.mkd file. 3.8 + 3.9 +echo "<html><head><title>"`grep '[^ \t\r\n][^ \t\r\n]*' INSTALL.mkd | head -n 1`"</title></head><body>" > INSTALL.html 3.10 +markdown2 INSTALL.mkd >> INSTALL.html 3.11 +echo "</body></html>" >> INSTALL.html