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