forked from vertelab/odootools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·90 lines (75 loc) · 4.12 KB
/
install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
################################################################################
# #
# Installation of Odootools - Tools to help manage an Odoo installation #
# #
# #
# #
################################################################################
echo "Performing basic prerequisite checks ..."
# User odoo shouldn't exist or should have been created by the Odoo installation
# procedures such as via the deb-package
grep --quiet -E '/home/odoo:' /etc/passwd # Indication odoo user have been
# created the wrong way.
if [ $? -eq 0 ]; then
echo "Warning! An odoo user seems to be present with the wrong home folder."
echo "This user might conflict with the Odoo 14 installation process."
echo "Exiting..."
exit 1
fi
# ---------------------------------------------------------------------------- #
# Odoo
echo "Installing Odoo"
if [ ! -d /etc/odoo ]; then # Install Odoo (only one time)
# this package is missing in 16.04
#wget https://launchpad.net/ubuntu/+archive/primary/+files/python-support_1.0.15_all.deb
#sudo dpkg -i python-support_1.0.15_all.deb
sudo add-apt-repository universe
sudo wget -O - https://nightly.odoo.com/odoo.key | sudo apt-key add -
echo "deb http://nightly.odoo.com/14.0/nightly/deb/ ./" | sudo tee /etc/apt/sources.list.d/odoo.list > /dev/null
sudo apt update
sudo apt -y install odoo
# Generate a good password
sudo sed -i "s|^admin_passwd = .*|admin_passwd = $(openssl rand -base64 32)|g" /etc/odoo/odoo.conf
sudo wget -O /etc/odoo/odoo.tools https://raw.githubusercontent.com/vertelab/odootools/14.0/odoo.tools
# Move BAD l10n_se
mv /usr/lib/python3/dist-packages/odoo/addons/l10n_se /usr/lib/python3/dist-packages/odoo/addons/l10n_se-bad
# Making odoo a more reqular user
# It can be useful when doing some operations.
echo "Enabling bash login for the odoo user..."
sudo sed -i 's|/var/lib/odoo:/usr/sbin/nologin|/var/lib/odoo:/bin/bash|g' /etc/passwd
if [ $? -eq 0 ]; then
echo "Bash login enabled for user 'odoo'"
else
echo "Failed to enable Bash login for user 'odoo'"
echo "Continuing installation." # Failure is not a dealbreaker for odootools
fi
# TODO: Add passwd or accept only sudo for switching user.
fi
if [ ! -d /usr/share/core-odoo ]; then
sudo ln -s /usr/lib/python3/dist-packages/odoo/ /usr/share/core-odoo
fi
# Additional packages
echo "Installing additional packages"
sudo apt -y install git python3-pip build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libjpeg-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libpq-dev
# Python with dependencies
echo "Installing Python modules"
sudo -H pip3 install wheel
wget -O /tmp/requirements.txt https://raw.githubusercontent.com/odoo/odoo/14.0/requirements.txt
sudo -H pip3 install -r /tmp/requirements.txt
# wkhtmltopdf
sudo -H pip3 install openpyxl
sudo apt -y install xfonts-base xfonts-75dpi
wget -O /tmp/wkhtmltox_0.12.6-1.focal_amd64.deb https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
sudo dpkg -i /tmp/wkhtmltox_0.12.6-1.focal_amd64.deb
sudo rm -f /tmp/wkhtmltox_0.12.6-1.focal_amd64.deb
# sudo su postgres createuser odoo -s
# Odootools
sudo wget -O /etc/profile.d/odootools.sh https://raw.githubusercontent.com/vertelab/odootools/14.0/odootools.sh
sudo wget -O /etc/bash_completion.d/odoo https://raw.githubusercontent.com/vertelab/odootools/14.0/bash_completion.odoo
sudo wget -O /usr/local/bin/odooextras.py https://raw.githubusercontent.com/vertelab/odootools/14.0/odooextras.py
# daily backup
sudo wget -O /etc/cron.daily/db_backup https://raw.githubusercontent.com/vertelab/odootools/14.0/db_backup
sudo chmod a+x /etc/cron.daily/db_backup
. /etc/profile.d/odootools.sh
. /etc/bash_completion