How to install Flectra HQ

,

Hi,

this is a howto of installing Flectra HQ, a crm fork of odoo.
Thanks to @fausp, who provided a lot of technical info in Flectra HQ - Open Source fork of Odoo 11
It’s an inital draft, there may be too much RPM installs or some packages available in epel that are installed from source actually so don’t mind posting corrections so I can improve the howto.

Tested on a fresh NS 7.4, just copy/paste the following into your terminal:

cd ~
adduser --system --shell=/bin/bash --home-dir=/opt/flectra --user-group flectra
yum -y groupinstall "development tools"
yum -y install https://centos7.iuscommunity.org/ius-release.rpm
yum -y install python36u python36u-pip python36u-devel wget unzip nethserver-postgresql postgresql-devel npm nodejs git libjpeg-devel libxml2-devel libxslt-devel openldap-devel cyrus-sasl-devel
pip3.6 install --upgrade pip
ln -s /usr/bin/python3.6 /usr/bin/python3
wget -nc https://gitlab.com/flectra-hq/flectra/repository/master/archive.zip
unzip -nq archive.zip
mkdir -p /opt/flectra
mkdir -p /etc/flectra
mkdir -p /var/log/flectra
mv flectra-master* flectra
mv flectra /opt/flectra/
chown flectra:flectra /opt/flectra/ -R && chown flectra:flectra /var/log/flectra/ -R
cd /opt/flectra/flectra && pip3.6 install -r requirements.txt
npm install -g less less-plugin-clean-css -y
mkdir /opt/wkhtmltox && cd /opt/wkhtmltox && wget -nc https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
cd /opt/wkhtmltox/wkhtmltox
cp -R /opt/wkhtmltox/wkhtmltox/* /usr/local/
ln -s /usr/local/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
ln -s /usr/local/bin/wkhtmltoimage /usr/bin/wkhtmltoimage
mkdir /opt/geolite && cd /opt/geolite && wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoLiteCity.dat.gz
mkdir /usr/share/GeoIP
mv /opt/geolite/GeoLiteCity.dat /usr/share/GeoIP
postgresql-setup initdb
systemctl enable --now postgresql
su - postgres -c "createuser -s flectra"
su - postgres -c "psql -c \"alter user flectra with encrypted password 'flectra';\""
su - flectra -c "/opt/flectra/flectra/flectra-bin --addons-path=/opt/flectra/flectra/addons -s --stop-after-init"
mv /opt/flectra/.flectrarc /etc/flectra/flectra.conf
sed -i "s,^\(logfile = \).*,\1"/var/log/flectra/flectra-server.log"," /etc/flectra/flectra.conf
sed -i "s,^\(logrotate = \).*,\1"True"," /etc/flectra/flectra.conf
sed -i "s,^\(proxy_mode = \).*,\1"True"," /etc/flectra/flectra.conf
sed -i "s,^\(db_host = \).*,\1"localhost"," /etc/flectra/flectra.conf
sed -i "s,^\(db_name = \).*,\1"flectra"," /etc/flectra/flectra.conf
sed -i "s,^\(db_password = \).*,\1"flectra"," /etc/flectra/flectra.conf
sed -i "s,^\(db_template = \).*,\1"template0"," /etc/flectra/flectra.conf
sed -i "s,^\(db_user = \).*,\1"flectra"," /etc/flectra/flectra.conf
ln -s /opt/flectra/flectra/flectra-bin /usr/bin/flectra

cat << EOF > /usr/lib/systemd/system/flectra.service
[Unit]
Description=Flectra
Wants=network.target

[Service]
Type=simple
User=flectra
Group=flectra
ExecStart=/usr/bin/flectra --config /etc/flectra/flectra.conf --logfile /var/log/flectra/flectra-server.log

[Install]
WantedBy=multi-user.target
EOF

config set fw_flectra service status enabled TCPPort 7073 access green
signal-event firewall-adjust
systemctl enable --now flectra

Browse to http://YOURNETHSERVER:7073 and login with admin/admin…

3 Likes

Awsome !!! - That’s awful good, Markus ! :grin:

I just had to open the firewall on red, to be able to work over my VPN…

Looks great !

Great effort to install it. But I am a bit reluctant towards this application, especially after reading Odoo story about Flectra.
I am far from a legal expert, but it looks suspicious to say the least. Looks like Flectra did copy (parts of) proprietary code from Odoo modules and distributed them as LGPL.
I would love to hear FSF point of view on this.
Just sent a tweet to FSF about this: https://twitter.com/robb_nl/status/954049909975633920

4 Likes

Yes, you are right. We have to be absolutely sure that everything is legal. Hopefully it is…

That looks bad, though its coming from an odoo source, maybe hard to take seriously with9out third party evidence, of course odoo is going to complain, lets see how it works out.

I contacted FSF trhough twitter, but didn’t receive a response on that tweet from FSF. However, Odoo did pick up the tweet and an Odoo partner responded:

Martin T.
@mart__e
Replying to @robb_nl

Taking proprietary code and publishing it is forbidden by most copyright laws, not really a license issue.
11:42am · 19 Jan 2018 · Twitter Web Client
1
Reply

Reply
Retweet
Like
Options 

Reply to @mart__e @robb_nl
robb_nl’s avatar
Rob Bosch @robb_nl
1d
Replying to @mart__e

@fsf Exacly my thoughts on this. However, this is only Odoo point of view. I couldn’t find any response from FlectraHQ yet. Nor statements that they are actualy publishing their own code. What would be the advice regarding use of Flectra software until there is legal clarity?

Reply
Retweet
Like
More options

mart__e’s avatar
Martin T. @mart__e
1d
Replying to @robb_nl

my answer is not on a specific case. If you take source code under an intellectual property and publish it without the owner consent, you are breaking the law in most countries. Nobody is really arguing about that.

At the same time I also wrote an email to the legal list of FSFE (European sister organisation of FSF)
I would like to hear your opinion on the following subject:

First a bit of background. I am a member of the NethServer community. NethServer is an opensource distribution based on CenOS that wants to provide an easy to manage server environment. Part of the options of NethServer is installing modules with a 1-click effort. Some of these modules are considered ‘core’ modules and privided through the official NethServer repository.

However, if an application can be installed on CentOS, it is likely it will run on NethServer too. Recently, one of our members pointed to Flectra. Flectra is a fork from Odoo, an opensource CRM tool. Odoo is quite modular and some modules are not opensource.

However, It looks like Flectra copied code from proprietary modules of Odoo into their fork and published this code under LGPL3.

This is the story according to Odoo: Copyright Infringement Lawsuit | Flectra vs Odoo

I am far from being a lawyer, but the story by Odoo looks like Flectra is committing copyright crime. To protect the NethServer project from any outside legal problems, I would like to hear your opinion on this matter.

Best regards,

Rob Bosch

I did receive an answer from them:

IANAL

If the claims are true, then Flectra did violate the proprietary copyright of the commercial Odoo modules. By distributing them, Flectra risks being responsible for damages to Odoo.

In general, this is not a problem with something being Open Source, but with appropriating some code where the authors did not license it under a FOSS license. It does not matter if the same functionality is available somewhere else. It also does not matter if somebody thinks Odoo tries to protect ideas. If code is copied verbatim (as the diffs seem to indicate), this is a concrete use of the code, covered by the original license. The claims of Mr Patel seem to be attempts to distract from the root problem.

Being part of an open source community to a large part means accepting community norms. It seems this is not the case here. Actually on both sides - releasing open core code claiming it is open source in spirit (as Odoo does) creates the tension in the first place. I see fault on both sides. But the copyright violation is a concrete issue that is probably independent from the social aspects.

Best,

Mirko.

Mirko Boehm | mirko@kde.org | KDE e.V.
FSFE Fellowship Representative, FSFE Team Germany
Qt Certified Specialist and Trainer
Request a meeting: Mirko Boehm | MeetMe

Reading this response from FSFE, I can only conclude that the issue between Flectra and Odoo is not 100% black and white. Both sides have a point, but as long there is no legal clarity, we should leave things be as they are. IMO we can’t affort to get involved in some kind of lawsuite between 2 fighting parties.

2 Likes

mrmarkuz
And the script to upgrade to Centos installation on 7.5?

I didn’t follow flectra since the legal problems…but I’ll have a look at it asap

2 Likes

I couldn’t make it work on bare metal in a first try but It’s working with docker:

https://hub.docker.com/r/flectrahq/flectra/

I’ll test some more…

EDIT:

I found that the script is still working in 7.5, I tested it on a fresh VM

On a clean CentOS 7.5 or NS 7.5? On clean it does not work because there is no Database installation in the script. If you add a DB installation it still does not work.
Docker will be in this case is not easy.

The script works on NethServer 7.5.

1 Like

It is interesting to know from you what is missing in the minimum version of Centos, in order for everything to work

IIRC Nethserver does some preconfiguration in postgresql like root access without pw which may be missing in centos to make the script work. I’ll have a look at it asap…

1 Like

Howto install flectra on minimal centos

The issues are with selinux, firewalld (which are not used in NethServer) and postgres.

Disable firewall. For production please keep security in mind and configure the firewall instead of disabling it.

systemctl disable firewalld --now

Disable selinux:

Edit /etc/selinux/config and set SELINUX=disabled. Reboot the system.

Install and prepare postgres:

yum -y install postgresql postgresql-server
postgresql-setup initdb

Edit /var/lib/pgsql/data/pg_hba.conf and replace the lines at the end to look like this:

# "local" is for Unix domain socket connections only
local   all         postgres                          ident
local   all         all                               md5
# IPv4 local connections:
host    all         all         127.0.0.1/32          md5
# IPv6 local connections:
host all all ::1/128 md5

Restart postgres:

systemctl restart postgresql

Go on with the rest of the installation (same except of e-smith commands):

yum -y install python36u python36u-pip python36u-devel wget unzip postgresql-devel npm nodejs git libjpeg-devel libxml2-devel libxslt-devel openldap-devel cyrus-sasl-devel
pip3.6 install --upgrade pip
ln -s /usr/bin/python3.6 /usr/bin/python3
wget -nc https://gitlab.com/flectra-hq/flectra/repository/master/archive.zip
unzip -nq archive.zip
mkdir -p /opt/flectra
mkdir -p /etc/flectra
mkdir -p /var/log/flectra
mv flectra-master* flectra
mv flectra /opt/flectra/
chown flectra:flectra /opt/flectra/ -R && chown flectra:flectra /var/log/flectra/ -R
cd /opt/flectra/flectra && pip3.6 install -r requirements.txt
npm install -g less less-plugin-clean-css -y
mkdir /opt/wkhtmltox && cd /opt/wkhtmltox && wget -nc https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
cd /opt/wkhtmltox/wkhtmltox
cp -R /opt/wkhtmltox/wkhtmltox/* /usr/local/
ln -s /usr/local/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
ln -s /usr/local/bin/wkhtmltoimage /usr/bin/wkhtmltoimage
mkdir /opt/geolite && cd /opt/geolite && wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoLiteCity.dat.gz
mkdir /usr/share/GeoIP
mv /opt/geolite/GeoLiteCity.dat /usr/share/GeoIP
postgresql-setup initdb
systemctl enable --now postgresql
su - postgres -c "createuser -s flectra"
su - postgres -c "psql -c \"alter user flectra with encrypted password 'flectra';\""
su - flectra -c "/opt/flectra/flectra/flectra-bin --addons-path=/opt/flectra/flectra/addons -s --stop-after-init"
mv /opt/flectra/.flectrarc /etc/flectra/flectra.conf
sed -i "s,^\(logfile = \).*,\1"/var/log/flectra/flectra-server.log"," /etc/flectra/flectra.conf
sed -i "s,^\(logrotate = \).*,\1"True"," /etc/flectra/flectra.conf
sed -i "s,^\(proxy_mode = \).*,\1"True"," /etc/flectra/flectra.conf
sed -i "s,^\(db_host = \).*,\1"localhost"," /etc/flectra/flectra.conf
sed -i "s,^\(db_name = \).*,\1"flectra"," /etc/flectra/flectra.conf
sed -i "s,^\(db_password = \).*,\1"flectra"," /etc/flectra/flectra.conf
sed -i "s,^\(db_template = \).*,\1"template0"," /etc/flectra/flectra.conf
sed -i "s,^\(db_user = \).*,\1"flectra"," /etc/flectra/flectra.conf
ln -s /opt/flectra/flectra/flectra-bin /usr/bin/flectra

cat << EOF > /usr/lib/systemd/system/flectra.service
[Unit]
Description=Flectra
Wants=network.target

[Service]
Type=simple
User=flectra
Group=flectra
ExecStart=/usr/bin/flectra --config /etc/flectra/flectra.conf --logfile /var/log/flectra/flectra-server.log

[Install]
WantedBy=multi-user.target
EOF
systemctl enable --now flectra
2 Likes

Just a longshot, but if you happen to have SavaPage installed, which uses PGSQL too, would that interfere in any way? or is it just the database you use?
I’ve seen the pg_hba.conf adjustment for SavaPage too… Are they similar or mutual usable?

This is a “how to install flectra on minimal centos”. I should have pointed that out more, I’ll edit my post.

1 Like

Ah, clear, so not on NS… thnx for the info

Hi! What you have chosen instead of the electra?
Odoo?

I don’t really have a favourite erp/crm but there are some alternatives like odoo and others:

I wasn’t able to integrate Odoo 11 but I’ll give it another try…

And many more, if you like one of them we could think about integrating it to Nethserver.

https://alternativeto.net/software/openerp/

2 Likes

FYI, issue between Odoo and Flectra seem to be resolved.

3 Likes