# HG changeset patch # User bsw # Date 1613304728 -3600 # Node ID 4d5f30d8df4a4343ff628e18512bfcf518b10bed # Parent 3fb752f4afcb071ad6e1eb462ae80abf1a422f77 Updated installation instructions diff -r 3fb752f4afcb -r 4d5f30d8df4a INSTALL.html --- a/INSTALL.html Sun Feb 14 12:46:39 2021 +0100 +++ b/INSTALL.html Sun Feb 14 13:12:08 2021 +0100 @@ -1,8 +1,4 @@ - -
-This document gives a short outline about the necessary steps to setup a @@ -15,15 +11,15 @@
apt-get install python-pip; pip install markdown2
)If you're using any other Linux distribution or BSD system, install the @@ -31,12 +27,12 @@
The useraccount of the webserver (usually www-data
) or the Moonbridge server
-process needs to have access to your PostgreSQL installation. This is done by
-executing PostgreSQL's shell command createuser
as database superuser
-(usually pgsql
, or postgres
for Debian installations):
The useraccount of Moonbridge server process needs to have access to your
+PostgreSQL installation. This is done by executing PostgreSQL's shell command
+createuser
as database superuser (usually pgsql
, or postgres
for
+Debian installations):
su postgres -s $SHELL
+su - postgres -s $SHELL
createuser --no-superuser --createdb --no-createrole www-data
exit
@@ -46,9 +42,9 @@
We recommend to create the database with the same user as your webserver
(usually www-data
) to avoid having to setup database privileges.
-The example below installs the database as www-data
and stores the two
-executables lf_update
and lf_update_issue_order
in the directory
-/opt/liquid_feedback_core/
:
+The example below installs the database as www-data
and stores the three
+executables lf_update
, lf_update_issue_order
and
+lf_update_suggestion_order
in the directory /opt/liquid_feedback_core/
:
# Download and unpack LiquidFeedback-Core
# from http://www.public-software-group.org/pub/projects/liquid_feedback/backend/
@@ -58,7 +54,6 @@
su www-data -s $SHELL
cd /opt/liquid_feedback_core
createdb liquid_feedback
-createlang plpgsql liquid_feedback # command may be omitted, depending on PostgreSQL version
psql -v ON_ERROR_STOP=1 -f core.sql liquid_feedback
@@ -71,15 +66,11 @@
INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (false, '1 day', 80, 12);
INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 hour', 200, 60);
INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 day', 800, 120);
-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);
-INSERT INTO unit (name) VALUES ('Our organization');
-INSERT INTO area (unit_id, name) VALUES (1, 'Default area');
-INSERT INTO allowed_policy (area_id, policy_id, default_policy) VALUES (1, 1, TRUE);
-If you want to create an admin user with an empty password (CAUTION!), then execute the following SQL statement:
+Create an invite code for an admin user:
-INSERT INTO member (login, name, admin, password) VALUES ('admin', 'Administrator', TRUE, '$1$/EMPTY/$NEWt7XJg2efKwPm4vectc1');
+INSERT INTO member (invite_code, admin) VALUES ('sesam', true);
Exit the psql
interface by typing:
@@ -104,13 +95,8 @@
5. Install WebMCP
-Note: Using Debian, it may be necessary to append -I /usr/include/lua5.2
at
-the end of the CFLAGS line in Makefile.options
of the WebMCP source
-distibution:
-
# Download and unpack WebMCP
# from http://www.public-software-group.org/pub/projects/webmcp/
-vi Makefile.options # Debian requires -I /usr/include/lua5.2 at end of CFLAGS line
make
mkdir /opt/webmcp
cp -RL framework/* /opt/webmcp/
@@ -132,8 +118,7 @@
7. Configure mail system
-It may be necessary to configure your server's mail system, e.g. running
-dpkg-reconfigure exim4-config
on a Debian system.
+It may be necessary to configure your server's mail system.
8. Configure the LiquidFeedback-Frontend
@@ -146,21 +131,11 @@
The executables lf_update
, lf_update_issue_order
, and
lf_update_suggestion_order
must be executed regularly. This may be achieved
-by creating a file named /opt/liquid_feedback_core/lf_updated
with the
+by creating a file named /opt/liquid_feedback_core/lf_update.sh
with the
following contents:
#!/bin/sh
-PIDFILE="/var/run/lf_updated.pid"
-PID=$$
-
-if [ -f "${PIDFILE}" ] && kill -CONT $( cat "${PIDFILE}" ); then
- echo "lf_updated is already running."
- exit 1
-fi
-
-echo "${PID}" > "${PIDFILE}"
-
while true; do
su - www-data -s /bin/sh -c 'nice /opt/liquid_feedback_core/lf_update dbname=liquid_feedback 2>&1 | logger -t "lf_updated"'
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"'
@@ -174,39 +149,63 @@
chmod +x /opt/liquid_feedback_core/lf_updated
-And this file should be started automatically at system boot.
+And this file should be started automatically at system boot. On systems with
+systemd, create a file named /etc/systemd/system/liquid_feedback_core.service
:
+
+[Unit]
+Description=LiquidFeedback Core update
+
+[Service]
+User=lf
+ExecStart=/opt/liquid_feedback_core/lf_update.sh
-10. Start the system
+[Install]
+WantedBy=multi-user.target
+
+
+Enable and start the service:
+ systemctl start liquidfeedbackcore
+ systemctl enable liquidfeedbackcore
+
+10. Start the frontend
After lf_update
has been executed at least once, you should be able to use
your LiquidFeedback system.
-The server is started by calling:
+Create a file named "/opt/liquidfeedbackfrontend/run.sh":
+
+#/bin/bash
+
+su - www-data -c /opt/moonbridge/moonbridge /opt/webmcp/bin/mcp.lua /opt/webmcp/ /opt/liquid_feedback_frontend/ main myconfig
+
+
+Make it executable:
+
+chmod +x /opt/liquid_feedback_frontend/run.sh
+
+
+On systemd based systems, create a file named
+/etc/systemd/system/liquid_feedback_frontend.service
:
-su www-data -s $SHELL
-/opt/moonbridge/moonbridge /opt/webmcp/bin/mcp.lua /opt/webmcp/ /opt/liquid_feedback_frontend/ main myconfig
+[Unit]
+Description=LiquidFeedback Frontend
+
+[Service]
+User=lf
+ExecStart=/opt/liquid_feedback_frontend/run.sh
+
+[Install]
+WantedBy=multi-user.target
+Enable and start the service:
+ systemctl start liquidfeedbackfrontend
+ systemctl enable liquidfeedbackfrontend
+
In the latter case, the Moonbridge server will open a TCP port according to
your configuration. Directly accessing this TCP port through your webbrowser
is helpful for development purposes. For real-life deployment, however, it is
recommended to further proxy the application (e.g. using nginx). The proxy can
also add HTTPS and/or HTTP/2 support (which is not supported by Moonbridge
itself).
-
-To start the Moonbridge as a background process, please refer to the Moonbridge
-command line options:
-
-Get this help message: moonbridge {-h|--help}
-Usage: moonbridge \
- [-b|--background] \
- [-d|--debug] \
- [-f|--logfacility {DAEMON|USER|0|1|...|7}] \
- [-i|--logident <syslog ident> \
- [-l|--logfile <logfile>] \
- [-p|--pidfile <pidfile>] \
- [-s|--stats] \
- -- <Lua script> [<cmdline options for Lua script>]
-
-
-
+
diff -r 3fb752f4afcb -r 4d5f30d8df4a INSTALL.mkd
--- a/INSTALL.mkd Sun Feb 14 12:46:39 2021 +0100
+++ b/INSTALL.mkd Sun Feb 14 13:12:08 2021 +0100
@@ -12,15 +12,15 @@
installed:
* build-essential
- * lua5.2
- * liblua5.2-dev
- * postgresql (including the corresponding server-dev package)
- * libpq-dev
+ * postgresql
+ * postgresql-server-dev-12
* libbsd-dev
- * pmake or bmake
+ * lua5.3
+ * liblua5.3-dev
+ * mercurial
+ * bmake
+ * lsb-release
* imagemagick
- * exim4
- * markdown2 (``apt-get install python-pip; pip install markdown2``)
If you're using any other Linux distribution or BSD system, install the
necessary software components accordingly.
@@ -29,12 +29,12 @@
2. Ensure that the user account of your webserver has access to the database
----------------------------------------------------------------------------
-The useraccount of the webserver (usually `www-data`) or the Moonbridge server
-process needs to have access to your PostgreSQL installation. This is done by
-executing PostgreSQL's shell command `createuser` as database superuser
-(usually `pgsql`, or `postgres` for Debian installations):
+The useraccount of Moonbridge server process needs to have access to your
+PostgreSQL installation. This is done by executing PostgreSQL's shell command
+`createuser` as database superuser (usually `pgsql`, or `postgres` for
+Debian installations):
- su postgres -s $SHELL
+ su - postgres -s $SHELL
createuser --no-superuser --createdb --no-createrole www-data
exit
@@ -45,9 +45,9 @@
We recommend to create the database with the same user as your webserver
(usually `www-data`) to avoid having to setup database privileges.
-The example below installs the database as `www-data` and stores the two
-executables `lf_update` and `lf_update_issue_order` in the directory
-`/opt/liquid_feedback_core/`:
+The example below installs the database as `www-data` and stores the three
+executables `lf_update`, `lf_update_issue_order` and
+`lf_update_suggestion_order` in the directory `/opt/liquid_feedback_core/`:
# Download and unpack LiquidFeedback-Core
# from http://www.public-software-group.org/pub/projects/liquid_feedback/backend/
@@ -57,7 +57,6 @@
su www-data -s $SHELL
cd /opt/liquid_feedback_core
createdb liquid_feedback
- createlang plpgsql liquid_feedback # command may be omitted, depending on PostgreSQL version
psql -v ON_ERROR_STOP=1 -f core.sql liquid_feedback
A simple configuration may look as follows:
@@ -69,14 +68,10 @@
INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (false, '1 day', 80, 12);
INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 hour', 200, 60);
INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (true, '1 day', 800, 120);
- 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);
- INSERT INTO unit (name) VALUES ('Our organization');
- INSERT INTO area (unit_id, name) VALUES (1, 'Default area');
- INSERT INTO allowed_policy (area_id, policy_id, default_policy) VALUES (1, 1, TRUE);
-If you want to create an admin user with an empty password (CAUTION!), then execute the following SQL statement:
+Create an invite code for an admin user:
- INSERT INTO member (login, name, admin, password) VALUES ('admin', 'Administrator', TRUE, '$1$/EMPTY/$NEWt7XJg2efKwPm4vectc1');
+ INSERT INTO member (invite_code, admin) VALUES ('sesam', true);
Exit the `psql` interface by typing:
@@ -101,13 +96,8 @@
5. Install WebMCP
-----------------
-Note: Using Debian, it may be necessary to append `-I /usr/include/lua5.2` at
-the end of the CFLAGS line in `Makefile.options` of the WebMCP source
-distibution:
-
# Download and unpack WebMCP
# from http://www.public-software-group.org/pub/projects/webmcp/
- vi Makefile.options # Debian requires -I /usr/include/lua5.2 at end of CFLAGS line
make
mkdir /opt/webmcp
cp -RL framework/* /opt/webmcp/
@@ -130,8 +120,7 @@
7. Configure mail system
------------------------
-It may be necessary to configure your server's mail system, e.g. running
-`dpkg-reconfigure exim4-config` on a Debian system.
+It may be necessary to configure your server's mail system.
8. Configure the LiquidFeedback-Frontend
@@ -147,21 +136,11 @@
The executables `lf_update`, `lf_update_issue_order`, and
`lf_update_suggestion_order` must be executed regularly. This may be achieved
-by creating a file named `/opt/liquid_feedback_core/lf_updated` with the
+by creating a file named `/opt/liquid_feedback_core/lf_update.sh` with the
following contents:
#!/bin/sh
- PIDFILE="/var/run/lf_updated.pid"
- PID=$$
-
- if [ -f "${PIDFILE}" ] && kill -CONT $( cat "${PIDFILE}" ); then
- echo "lf_updated is already running."
- exit 1
- fi
-
- echo "${PID}" > "${PIDFILE}"
-
while true; do
su - www-data -s /bin/sh -c 'nice /opt/liquid_feedback_core/lf_update dbname=liquid_feedback 2>&1 | logger -t "lf_updated"'
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"'
@@ -173,19 +152,57 @@
chmod +x /opt/liquid_feedback_core/lf_updated
-And this file should be started automatically at system boot.
+And this file should be started automatically at system boot. On systems with
+systemd, create a file named `/etc/systemd/system/liquid_feedback_core.service`:
+
+ [Unit]
+ Description=LiquidFeedback Core update
+
+ [Service]
+ User=lf
+ ExecStart=/opt/liquid_feedback_core/lf_update.sh
+
+ [Install]
+ WantedBy=multi-user.target
+
+Enable and start the service:
+ systemctl start liquid_feedback_core
+ systemctl enable liquid_feedback_core
-10. Start the system
---------------------
+10. Start the frontend
+----------------------
After `lf_update` has been executed at least once, you should be able to use
your LiquidFeedback system.
-The server is started by calling:
+Create a file named "/opt/liquid_feedback_frontend/run.sh":
+
+ #/bin/bash
+
+ su - www-data -c /opt/moonbridge/moonbridge /opt/webmcp/bin/mcp.lua /opt/webmcp/ /opt/liquid_feedback_frontend/ main myconfig
+
+Make it executable:
+
+ chmod +x /opt/liquid_feedback_frontend/run.sh
+
+On systemd based systems, create a file named
+`/etc/systemd/system/liquid_feedback_frontend.service`:
- su www-data -s $SHELL
- /opt/moonbridge/moonbridge /opt/webmcp/bin/mcp.lua /opt/webmcp/ /opt/liquid_feedback_frontend/ main myconfig
+ [Unit]
+ Description=LiquidFeedback Frontend
+
+ [Service]
+ User=lf
+ ExecStart=/opt/liquid_feedback_frontend/run.sh
+
+ [Install]
+ WantedBy=multi-user.target
+
+Enable and start the service:
+ systemctl start liquid_feedback_frontend
+ systemctl enable liquid_feedback_frontend
+
In the latter case, the Moonbridge server will open a TCP port according to
your configuration. Directly accessing this TCP port through your webbrowser
@@ -194,18 +211,4 @@
also add HTTPS and/or HTTP/2 support (which is not supported by Moonbridge
itself).
-To start the Moonbridge as a background process, please refer to the Moonbridge
-command line options:
- Get this help message: moonbridge {-h|--help}
- Usage: moonbridge \
- [-b|--background] \
- [-d|--debug] \
- [-f|--logfacility {DAEMON|USER|0|1|...|7}] \
- [-i|--logident \
- [-l|--logfile ] \
- [-p|--pidfile ] \
- [-s|--stats] \
- -- []
-
-
diff -r 3fb752f4afcb -r 4d5f30d8df4a make-doc.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make-doc.sh Sun Feb 14 13:12:08 2021 +0100
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# This command can be used to update the INSTALL.html file after changing the
+# INSTALL.mkd file.
+
+echo ""`grep '[^ \t\r\n][^ \t\r\n]*' INSTALL.mkd | head -n 1`" " > INSTALL.html
+markdown2 INSTALL.mkd >> INSTALL.html
+echo "" >> INSTALL.html