This is an old revision of the document!
Table of Contents
LiquidFeedback
References:
Installation on Debian Wheezy
Our goal is to install LiquidFeedback on a Debian Wheezy, using an Apache VirtualHost and Postgres 9.1 with login/password authentication. We also try to follow the Filesystem Hierarchy Standard for installation directories, etc.
Install the required packages (database, libraries to compile lqfb core tools, LUA language for the frontend, image manipulation tools, etc.):
apt-get install postgresql libpq-dev imagemagick lua5.1 liblua5.1-0-dev ghc libghc6-parsec3-dev
Components
Core | The core consists of a database scheme for the PostgreSQL database, including the algorithms for delegations, feedback and the voting procedure implemented as SQL views and database procedures written in PL/pgSQL. It includes also an external tool to be executed as a cronjob. |
---|---|
Frontend | The frontend is implemented in Lua using the web application framework WebMCP. |
WebMCP | Web application framework written in Lua and C. Instead of using the classical Model-View-Controller (MVC) concept, WebMCP makes use of a so-called Model-View-Action concept. |
RocketWiki | It is a small parser written in Haskell which translates a wiki dialect to HTML. The special “LiquidFeedback Edition” disallow the use of images. |
Download the following archives and save them into a directory (we used /usr/local/download/lqfb/
):
Core tools, WebMCP, RocketWiki and Frontend
Compile the core tools
cd /usr/local/src/ tar zxvf /usr/local/download/lqfb/liquid_feedback_core-v2.1.0.tar.gz cd liquid_feedback_core-v2.1.0/ make
Install core tools
mkdir -p /usr/local/lib/liquid_feedback_core cp core.sql lf_update /usr/local/lib/liquid_feedback_core
Install WebMCP
cd /usr/local/src/ tar zxvf /usr/local/download/lqfb/webmcp-v1.2.5.tar.gz cd webmcp-v1.2.5/ vi Makefile.options make mkdir -p /usr/local/lib/webmcp cp -RL framework/* /usr/local/lib/webmcp/
Install RocketWiki LqFb-Edition
cd /usr/local/src/ tar zxvf /usr/local/download/lqfb/rocketwiki-lqfb-v0.4.tar.gz cd rocketwiki-lqfb-v0.4/ make mkdir -p /usr/local/lib/rocketwiki-lqfb cp rocketwiki-lqfb rocketwiki-lqfb-compat /usr/local/lib/rocketwiki-lqfb/
Install LiquidFeedback-Frontend v2.1.2
cd /usr/local/src/ tar zxvf /usr/local/download/lqfb/liquid_feedback_frontend-v2.1.2.tar.gz cd liquid_feedback_frontend-v2.1.2/ mv liquid_feedback_frontend-v2.1.2 /usr/local/share/liquid_feedback_frontend
chown www-data /usr/local/share/liquid_feedback_frontend/tmp/
cd /usr/local/share/liquid_feedback_frontend/locale/ PATH=/usr/local/lib/rocketwiki-lqfb:$PATH make
Compile binary for fast delivery of member images
cd /usr/local/share/liquid_feedback_frontend/fastpath/ vi getpic.c # Edit: #define GETPIC_CONNINFO "dbname=liquid_feedback" # Edit: #define GETPIC_DEFAULT_AVATAR "/usr/local/share/liquid_feedback_frontend/static/avatar.jpg" make
Create the frontend configuration
cd /usr/local/share/liquid_feedback_frontend/config cp example.lua m5scb campibisenzio5stelle.lua
The configuration name (campibisenzio5stelle
in the example) must be referenced by the web server via the WEBMCP_CONFIG_NAME
environment variable (see below).
Database (the Core)
Create database user and database
su - postgres
psql
CREATE USER liquid_feedback PASSWORD 'MySecret'; CREATE DATABASE liquid_feedback OWNER liquid_feedback LC_COLLATE = 'it_IT.UTF-8' LC_CTYPE = 'it_IT.UTF-8' TEMPLATE template0;
Initialize the database
cd /usr/local/lib/liquid_feedback_core psql -v ON_ERROR_STOP=1 -U liquid_feedback -W -h localhost -f core.sql liquid_feedback
psql -U liquid_feedback -W -h localhost liquid_feedback
INSERT INTO system_setting (member_ttl) VALUES ('1 year'); INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (FALSE, '1 hour', 20, 6); INSERT INTO contingent (polling, time_frame, text_entry_limit, initiative_limit) VALUES (FALSE, '1 day', 80, 12); INSERT INTO policy (INDEX, name, admission_time, discussion_time, verification_time, voting_time, issue_quorum_num, issue_quorum_den, initiative_quorum_num, initiative_quorum_den) VALUES (1, 'Default policy', '8 days', '15 days', '8 days', '15 days', 10, 100, 10, 100); INSERT INTO unit (name) VALUES ('M5S Campi Bisenzio'); INSERT INTO area (unit_id, name) VALUES (1, 'Default area'); INSERT INTO allowed_policy (area_id, policy_id, default_policy) VALUES (1, 1, TRUE);
Here we created a single unit named M5S Campi Bisenzio which contains a single area Default area. A unit is … An area is …
Create the admin account
We register the admin account assigning to it an invite code. The invite is a secret code to be used only once, the user will be asked to enter a password, an email address, etc.
INSERT INTO member (login, name, admin, invite_code) VALUES ('admin', 'Administrator', TRUE, 'vieniqua');
Cronjob
cd /usr/local/lib/liquid_feedback_core ./lf_update "host=localhost dbname=liquid_feedback user=liquid_feedback password=MySecret"
Configuring Apache
Enable required modules:
a2enmod rewrite a2enmod actions
Configure the mail subsystem
Install an MTA software like Exim4 or Postfix and configure it so that the system can send mail to the internet. This is required to send the invite code to new members.
Install a second instance of LiquidFeedback on the same host
Verify if this checklist is complete.
- Create another database.
- Create another Apache VirtualHost and configure
WEBMCP_CONFIG_NAME
. - Create another config in
/usr/local/share/liquid_feedback_frontend/config/
and configureabsolute_base_url
anddatabase
credentials in it.
LiquidFeedback administration
unit | Administrators allow each user partecipate (or not) to the existing units. |
---|---|
area | An unit can contain one or more areas. An user can partecipate to an area and he can delegate the entire area to someone else. |
issue | |
policy |
An user with the admin right can login and click on the admin link. The first task for an administrator is to create invite codes for new users. When creating a new user the admin define the login name (the identification), an email address, the admin right and the units where he can partecipate.