From 34fe7f0deb3a172b012004de051bf78ae4876969 Mon Sep 17 00:00:00 2001 From: "Yenthe V.G" Date: Mon, 8 Oct 2018 10:14:25 +0200 Subject: [PATCH 01/17] [ADD] installscript: add MIT license to be transparant --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..5116bb6b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Yenthe V.G + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 24fd6fcd85deee115c4006082c723351d8e81cff Mon Sep 17 00:00:00 2001 From: Matkach <34516217+Matkach@users.noreply.github.com> Date: Wed, 31 Jul 2019 23:50:14 +0200 Subject: [PATCH 02/17] Update odoo_install.sh The script is in beta-mode ... and it's not yet tested. --- odoo_install.sh | 618 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 537 insertions(+), 81 deletions(-) diff --git a/odoo_install.sh b/odoo_install.sh index e6a73448..752d1e26 100644 --- a/odoo_install.sh +++ b/odoo_install.sh @@ -1,37 +1,227 @@ #!/bin/bash -################################################################################ -# Script for installing Odoo on Ubuntu 14.04, 15.04, 16.04 and 18.04 (could be used for other version too) -# Author: Yenthe Van Ginneken -#------------------------------------------------------------------------------- -# This script will install Odoo on your Ubuntu 16.04 server. It can install multiple Odoo instances -# in one Ubuntu because of the different xmlrpc_ports -#------------------------------------------------------------------------------- -# Make a new file: -# sudo nano odoo-install.sh -# Place this content in it and then make the file executable: -# sudo chmod +x odoo-install.sh -# Execute the script to install Odoo: -# ./odoo-install -################################################################################ - -OE_USER="odoo" -OE_HOME="/$OE_USER" -OE_HOME_EXT="/$OE_USER/${OE_USER}-server" -# The default port where this Odoo instance will run under (provided you use the command -c in the terminal) -# Set to true if you want to install it, false if you don't need it or have it already installed. +############################################################################################################################## +# Script for automated Odoo installation +# Author: Dushko Davchev (Matkach) +#----------------------------------------------------------------------------------------------------------------------------- +# This script is based on the installation script of Yenthe V.G (https://github.com/Yenthe666/InstallScript) +# Inspired by his work I have created similar interactive script for automated Odoo installation on both CentOS and Ubuntu servers. +############################################################################################################################## + +check_os(){ + echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" +} + +operativen=`check_os \`uname\`` +kernel=`uname -r` +bit_proc=`uname -m` + +if [ "{$operativen}" == "windowsnt" ]; then + operativen=windows +elif [ "{$operativen}" == "darwin" ]; then + operativen=mac +else + operativen=`uname` + if [ "${operativen}" = "SunOS" ] ; then + operativen=Solaris + ARCH=`uname -p` + OSSTR="${operativen} ${verzija}(${ARCH} `uname -v`)" + elif [ "${operativen}" = "AIX" ] ; then + OSSTR="${operativen} `oslevel` (`oslevel -r`)" + elif [ "${operativen}" = "Linux" ] ; then + if [ -f /etc/redhat-release ] ; then + distro_baziran_na='RedHat' + distro=`cat /etc/redhat-release |sed s/\ release.*//` + code_name=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//` + verzija=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//` + elif [ -f /etc/SuSE-release ] ; then + distro_baziran_na='SuSe' + code_name=`cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//` + verzija=`cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //` + elif [ -f /etc/mandrake-release ] ; then + distro_baziran_na='Mandrake' + code_name=`cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//` + verzija=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//` + elif [ -f /etc/debian_version ] ; then + distro_baziran_na='Debian' + distro=`cat /etc/lsb-release | grep '^DISTRIB_ID' | awk -F= '{ print $2 }'` + code_name=`cat /etc/lsb-release | grep '^DISTRIB_CODENAME' | awk -F= '{ print $2 }'` + verzija=`cat /etc/lsb-release | grep '^DISTRIB_RELEASE' | awk -F= '{ print $2 }'` + fi + if [ -f /etc/UnitedLinux-release ] ; then + distro="${distro}[`cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//`]" + fi + operativen=`check_os $operativen` + distro_baziran_na=`check_os $distro_baziran_na` + +echo +#echo "You are using $distro version $verzija which is supported for Odoo installation" + + fi +fi + +LPURPLE='\033[1;35m' +RED='\033[0;31m' +GREEN='\033[0;32m' +OGRANGE='\033[0;33m' +BLUE='\033[0;34m' +YELLOW='\033[1;33m' +NC='\033[0m' + +#-------------------------------------------------- +# Questions for the user +#-------------------------------------------------- +echo +echo -e "Please insert the information required for the ${LPURPLE}Odoo${NC} installation." +echo "" + +echo -n "Insert Odoo user name (default: odoo): " +read ODOO_USER + +ODOO_USER="${ODOO_USER:-odoo}" + +echo +echo -e "You have selected the ${BLUE}$ODOO_USER${NC} as username" +echo "" + +echo -n "Insert Odoo location (default: /opt/$ODOO_USER): " +read LOCATION + +LOCATION="${LOCATION:-/opt/$ODOO_USER}" + + if [[ $LOCATION == / ]] || [[ $LOCATION == /* ]] ; + then + ODOO_HOME="$LOCATION/$ODOO_USER" + else + ODOO_HOME="/$LOCATION/$ODOO_USER" + fi + +mkdir -p $ODOO_HOME + +echo +echo -e "You have selected the following location ${BLUE}$LOCATION${NC}" +echo "" + +echo +while ! [[ "$ODOO_PORT" =~ ^[0-9]+$ ]] +do + +echo -n "Inset Odoo port number (default: 8069) : " +read ODOO_PORT +echo + +ODOO_PORT="${ODOO_PORT:-8069}" + +done + +echo +echo -e "You have selected the following port number: ${BLUE}$ODOO_PORT${NC}" +echo "" + +echo +while true; do +echo +echo -e "Select the Odoo version: " +echo "" +echo -e "${GREEN}1${NC}) Odoo version ${LPURPLE}12.0${NC}" +echo "" +echo -e "${GREEN}2${NC}) Odoo version ${LPURPLE}11.0${NC}" +echo "" +echo -e "${GREEN}3${NC}) Odoo version ${LPURPLE}10.0${NC}" +echo "" +echo -e "${GREEN}4${NC}) Odoo version ${LPURPLE}9.0${NC}" +echo "" +echo -ne "Choose a number from ${GREEN}1${NC} to ${GREEN}4${NC}: " +read SELECT_VERSION + +echo + +case $SELECT_VERSION in + 1) + ODOO_VERSION="12.0" + break + ;; + 2) + ODOO_VERSION="11.0" + break + ;; + 3) + ODOO_VERSION="10.0" + break + ;; + 4) + ODOO_VERSION="9.0" + break + ;; + q) + echo "The quit option was selected, and the script has stopped. Goodbye, until the next time." + exit -1 + break + ;; + Q) + echo "The quit option was selected, and the script has stopped. Goodbye, until the next time." + exit -1 + break + ;; + *) + echo -e "The ${RED}$SELECT_VERSION${NC} is not a valid choice. Choose from ${GREEN}1${NC} to ${GREEN}4${NC} or type q for quit." + ;; +esac +done + +echo +echo -e "You have selected the ${LPURPLE}Odoo${NC} version ${LPURPLE}$ODOO_VERSION ${NC}" +echo "" + +echo +while true; do +echo -ne "Please select your ${LPURPLE}Odoo${NC} Edition. " +echo "" +echo -e "${GREEN}1${NC}) - ${LPURPLE}Enterprise edition${NC}" +echo "" +echo -e "${GREEN}2${NC}) - ${LPURPLE}Community Edition{NC}" +echo "" +echo -ne "Please select your choice: " +read ODOO_EDITON + +echo + +case $ODOO_EDITON in + 1) + ENTERPRISE_EDITON="Y" + echo "" + echo -e "You have choose the ${LPURPLE}Enterprise Edition${NC}" + break + ;; + 2) + ENTERPRISE_EDITON="N" + echo "" + echo -e "You have choose the ${LPURPLE}Community Edition${NC}" + break + ;; + q) + echo -e "The quit option was selected, and the script has stopped. Goodbye, until the next time." + exit -1 + break + ;; + Q) + echo -e "The quit option was selected, and the script has stopped. Goodbye, until the next time." + exit -1 + break + ;; + *) + echo -e "The ${RED}$ODOO_EDITON${NC} is not a valid choice. Please select from the offered options ${GREEN}1${NC}/${GREEN}2${NC} or you can type ${GREEN}q${NC} for quit." + ;; +esac +done + +echo +echo -ne "Please insert your ${LPURPLE}Odoo Master Password${NC}: " +read -s ODOO_MASTER_PASSWD +echo + +ODOO_HOME_EXT="$ODOO_HOME/$ODOO_USER" +ODOO_CONFIG="/etc/$ODOO_USER.conf" INSTALL_WKHTMLTOPDF="True" -# Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this.) -OE_PORT="8069" -# Choose the Odoo version which you want to install. For example: 12.0, 11.0, 10.0 or saas-18. When using 'master' the master version will be installed. -# IMPORTANT! This script contains extra libraries that are specifically needed for Odoo 12.0 -OE_VERSION="12.0" -# Set this to True if you want to install the Odoo enterprise version! -IS_ENTERPRISE="False" -# set the superadmin password -OE_SUPERADMIN="admin" -OE_CONFIG="${OE_USER}-server" - -## ### WKHTMLTOPDF download links ## === Ubuntu Trusty x64 & x32 === (for other distributions please replace these two links, ## in order to have correct version of wkhtmltox installed, for a danger note refer to @@ -39,6 +229,195 @@ OE_CONFIG="${OE_USER}-server" WKHTMLTOX_X64=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_amd64.deb WKHTMLTOX_X32=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_i386.deb +echo +echo "" +echo -e "---------------------- ${RED}WARNING${NC} ----------------------------" +echo "The script is in beta-mode ... and it's not yet tested! :] " +echo "-----------------------------------------------------------" +echo + +function install_odoo_centos { + +#-------------------------------------------------- +# Update Server +#-------------------------------------------------- + +echo -e "\n---- Update Server ----" + +sudo yum update -y +sudo yum upgrade -y + +#-------------------------------------------------- +# Install Dependencies +#-------------------------------------------------- + +echo -e "\n--- Dependencies & Tools --" + +sudo yum install epel-release wget git gcc libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel -y + +echo -e "\n--- Installing Python --" + +sudo yum install python-pip -y +sudo pip install --upgrade pip +sudo pip install --upgrade setuptools +#sudo pip install Babel decorator docutils ebaysdk feedparser gevent greenlet jcconv Jinja2 lxml Mako MarkupSafe mock ofxparse passlib Pillow psutil psycogreen psycopg2-binary pydot pyparsing pyPdf pyserial Python-Chart python-dateutil python-ldap python-openid pytz pyusb PyYAML qrcode reportlab requests six suds-jurko vatnumber vobject Werkzeug wsgiref XlsxWriter xlwt xlrd +sudo pip install -r https://github.com/odoo/odoo/raw/$ODOO_VERSION/requirements.txt + +sudo yum install python36 -y + +echo -e "\n---- Install python packages ----" + +sudo yum install python36-devel libxslt-devel libxml2-devel openldap-devel python36-setuptools python-devel -y +python3.6 -m ensurepip +#sudo pip3 install pypdf2 Babel passlib Werkzeug decorator python-dateutil pyyaml psycopg2-binary psutil html2text docutils lxml pillow reportlab ninja2 requests gdata XlsxWriter vobject python-openid pyparsing pydot mock mako Jinja2 ebaysdk feedparser xlwt psycogreen suds-jurko pytz pyusb greenlet xlrd num2words +sudo pip3 install -r https://github.com/odoo/odoo/raw/$ODOO_VERSION/requirements.txt + +echo -e "\n--- Install other required packages" +sudo yum install nodejs npm -y +sudo npm install -g less +sudo npm install -g less-plugin-clean-css +sudo npm install -g rtlcss + +#-------------------------------------------------- +# Install PostgreSQL Server +#-------------------------------------------------- + +echo -e "\n---- Install PostgreSQL Server ----" +sudo yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat96-9.6-3.noarch.rpm -y +sudo yum install postgresql96 postgresql96-server postgresql96-contrib postgresql96-libs -y + +echo -e "\n---- Creating the ODOO PostgreSQL Database ----" +sudo /usr/pgsql-9.6/bin/postgresql96-setup initdb + +echo -e "\n---- Enable & Start the ODOO PostgreSQL Database ----" +sudo systemctl start postgresql-9.6.service +sudo systemctl enable postgresql-9.6.service + +#-------------------------------------------------- +# Creating Odoo and PostgreSQL users +#-------------------------------------------------- + +echo -e "\n---- Creating PostgreSQL user ----" +sudo su - postgres -c "createuser -s $ODOO_USER" + +echo -e "\n---- Creating Odoo user ----" +sudo useradd -m -U -r -d $ODOO_HOME -s /bin/bash $ODOO_USER + +#-------------------------------------------------- +# Install Wkhtmltopdf +#-------------------------------------------------- +sudo yum install wkhtmltopdf -y + +echo -e "\n---- Create Log directory ----" +sudo mkdir /var/log/$ODOO_USER + +#-------------------------------------------------- +# Install ODOO +#-------------------------------------------------- +echo -e "\n==== Installing ODOO Server ====" +sudo git clone --depth 1 --branch $ODOO_VERSION https://www.github.com/odoo/odoo $ODOO_HOME_EXT/ + +if [ $ENTERPRISE_EDITON = "Y" ]; then + # Odoo Enterprise install! + echo -e "\n--- Create symlink for node" + sudo ln -s /usr/bin/nodejs /usr/bin/node + sudo mkdir $ODOO_HOME/enterprise + sudo mkdir $ODOO_HOME/enterprise/addons + + GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $ODOO_VERSION https://www.github.com/odoo/enterprise "$ODOO_HOME/enterprise/addons" 2>&1) + while [[ $GITHUB_RESPONSE == *"Authentication"* ]]; do + echo "------------------------WARNING------------------------------" + echo "Your authentication with Github has failed! Please try again." + printf "In order to clone and install the Odoo enterprise version you \nneed to be an offical Odoo partner and you need access to\nhttp://github.com/odoo/enterprise.\n" + echo "TIP: Press ctrl+c to stop this script." + echo "-------------------------------------------------------------" + echo " " + GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $ODOO_VERSION https://www.github.com/odoo/enterprise "$ODOO_HOME/enterprise/addons" 2>&1) + done + + echo -e "\n---- Added Enterprise code under $ODOO_HOME/enterprise/addons ----" + echo -e "\n---- Installing Enterprise specific libraries ----" + sudo pip3 install num2words ofxparse + sudo yum install nodejs npm + sudo npm install -g less + sudo npm install -g less-plugin-clean-css +fi + +echo -e "\n---- Create custom module directory ----" + +sudo mv $ODOO_HOME_EXT/odoo.py $ODOO_HOME_EXT/odoo-bin +sudo mkdir $ODOO_HOME/custom +sudo mkdir $ODOO_HOME/custom/addons + +echo -e "\n---- Create server config file" + +sudo su root -c "touch '$ODOO_CONFIG'" + +sudo su root -c "echo "[options]" >> $ODOO_CONFIG" +sudo su root -c "echo ';This is the password that allows database operations:' >> $ODOO_CONFIG" +sudo su root -c "echo 'admin_passwd = $ODOO_MASTER_PASSWD' >> $ODOO_CONFIG" +sudo su root -c "echo 'xmlrpc_port = $ODOO_PORT' >> $ODOO_CONFIG" +sudo su root -c "echo 'logfile = /var/log/$ODOO_USER/$ODOO_USER.log' >> $ODOO_CONFIG" +if [ $ENTERPRISE_EDITON = "Y" ]; then + sudo su root -c "echo 'addons_path=$ODOO_HOME/enterprise/addons,$ODOO_HOME_EXT/addons' >> $ODOO_CONFIG" +else + sudo su root -c "echo 'addons_path=$ODOO_HOME_EXT/addons,$ODOO_HOME/custom/addons' >> $ODOO_CONFIG" +fi + +sudo chmod 640 $ODOO_CONFIG + +echo -e "\n---- Creating systemd config file" +sudo touch /etc/systemd/system/$ODOO_USER.service + +sudo su root -c "echo "[Unit]" >> /etc/systemd/system/$ODOO_USER.service" +sudo su root -c "echo 'Description=Odoo server' >> /etc/systemd/system/$ODOO_USER.service" +sudo su root -c "echo '#Requires=postgresql-9.6.service' >> /etc/systemd/system/$ODOO_USER.service" +sudo su root -c "echo '#After=network.target postgresql-9.6.service' >> /etc/systemd/system/$ODOO_USER.service" +sudo su root -c "echo "[Service]" >> /etc/systemd/system/$ODOO_USER.service" +sudo su root -c "echo 'Type=simple' >> /etc/systemd/system/$ODOO_USER.service" +sudo su root -c "echo 'SyslogIdentifier=odoo12' >> /etc/systemd/system/$ODOO_USER.service" +sudo su root -c "echo 'PermissionsStartOnly=true' >> /etc/systemd/system/$ODOO_USER.service" +sudo su root -c "echo 'User=$ODOO_USER' >> /etc/systemd/system/$ODOO_USER.service" +sudo su root -c "echo 'Group=$ODOO_USER' >> /etc/systemd/system/$ODOO_USER.service" +sudo su root -c "echo 'ExecStart=$ODOO_HOME/$ODOO_USER/odoo-bin -c /etc/$ODOO_USER.conf' >> /etc/systemd/system/$ODOO_USER.service" +sudo su root -c "echo 'StandardOutput=journal+console' >> /etc/systemd/system/$ODOO_USER.service" +sudo su root -c "echo "[Install]" >> /etc/systemd/system/$ODOO_USER.service" +sudo su root -c "echo 'WantedBy=multi-user.target' >> /etc/systemd/system/$ODOO_USER.service" + +echo -e "\n---- Start ODOO on Startup" +sudo chmod +x /etc/systemd/system/$ODOO_USER.service +sudo systemctl daemon-reload + +sudo chown -R $ODOO_USER: $ODOO_HOME +sudo chown $ODOO_USER: $ODOO_CONFIG + +echo -e "\n---- Starting Odoo Service" + +sudo systemctl start $ODOO_USER.service +sudo systemctl enable $ODOO_USER.service + + + +echo "-----------------------------------------------------------" +echo "Done! The Odoo server is up and running. Specifications:" +echo "-----------------------------------------------------------" +echo "Port: $ODOO_PORT" +echo "Master password: $ODOO_MASTER_PASSWD" +echo "User service: $ODOO_USER" +echo "User PostgreSQL: $ODOO_USER" +echo "Addons folder: $ODOO_HOME_EXT/addons and $ODOO_HOME/custom/addons" +echo "Start Odoo service: service $ODOO_USER start" +echo "Stop Odoo service: service $ODOO_USER stop" +echo "Restart Odoo service: service $ODOO_USER restart" +echo "-----------------------------------------------------------" + +echo " " +echo "---------------------- WARNING ----------------------------" +echo "The script is in beta-mode ... and it's not yet tested! :] " +echo "-----------------------------------------------------------" +} + +function install_odoo_ubuntu { #-------------------------------------------------- # Update Server #-------------------------------------------------- @@ -57,7 +436,7 @@ echo -e "\n---- Install PostgreSQL Server ----" sudo apt-get install postgresql -y echo -e "\n---- Creating the ODOO PostgreSQL User ----" -sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true +sudo su - postgres -c "createuser -s $ODOO_USER" 2> /dev/null || true #-------------------------------------------------- # Install Dependencies @@ -66,7 +445,7 @@ echo -e "\n--- Installing Python 3 + pip3 --" sudo apt-get install git python3 python3-pip build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libpng12-0 gdebi -y echo -e "\n---- Install python packages/requirements ----" -sudo pip3 install -r https://github.com/odoo/odoo/raw/${OE_VERSION}/requirements.txt +sudo pip3 install -r https://github.com/odoo/odoo/raw/${ODOO_VERSION}/requirements.txt echo -e "\n---- Installing nodeJS NPM and rtlcss for LTR support ----" sudo apt-get install nodejs npm @@ -92,28 +471,28 @@ else fi echo -e "\n---- Create ODOO system user ----" -sudo adduser --system --quiet --shell=/bin/bash --home=$OE_HOME --gecos 'ODOO' --group $OE_USER +sudo adduser --system --quiet --shell=/bin/bash --home=$ODOO_HOME --gecos 'ODOO' --group $ODOO_USER #The user should also be added to the sudo'ers group. -sudo adduser $OE_USER sudo +sudo adduser $ODOO_USER sudo echo -e "\n---- Create Log directory ----" -sudo mkdir /var/log/$OE_USER -sudo chown $OE_USER:$OE_USER /var/log/$OE_USER +sudo mkdir /var/log/$ODOO_USER +sudo chown $ODOO_USER:$ODOO_USER /var/log/$ODOO_USER #-------------------------------------------------- # Install ODOO #-------------------------------------------------- echo -e "\n==== Installing ODOO Server ====" -sudo git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/odoo $OE_HOME_EXT/ +sudo git clone --depth 1 --branch $ODOO_VERSION https://www.github.com/odoo/odoo $ODOO_HOME_EXT/ -if [ $IS_ENTERPRISE = "True" ]; then +if [ $ENTERPRISE_EDITON = "Y" ]; then # Odoo Enterprise install! echo -e "\n--- Create symlink for node" sudo ln -s /usr/bin/nodejs /usr/bin/node - sudo su $OE_USER -c "mkdir $OE_HOME/enterprise" - sudo su $OE_USER -c "mkdir $OE_HOME/enterprise/addons" + sudo su $ODOO_USER -c "mkdir $ODOO_HOME/enterprise" + sudo su $ODOO_USER -c "mkdir $ODOO_HOME/enterprise/addons" - GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1) + GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $ODOO_VERSION https://www.github.com/odoo/enterprise "$ODOO_HOME/enterprise/addons" 2>&1) while [[ $GITHUB_RESPONSE == *"Authentication"* ]]; do echo "------------------------WARNING------------------------------" echo "Your authentication with Github has failed! Please try again." @@ -121,10 +500,10 @@ if [ $IS_ENTERPRISE = "True" ]; then echo "TIP: Press ctrl+c to stop this script." echo "-------------------------------------------------------------" echo " " - GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1) + GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $ODOO_VERSION https://www.github.com/odoo/enterprise "$ODOO_HOME/enterprise/addons" 2>&1) done - echo -e "\n---- Added Enterprise code under $OE_HOME/enterprise/addons ----" + echo -e "\n---- Added Enterprise code under $ODOO_HOME/enterprise/addons ----" echo -e "\n---- Installing Enterprise specific libraries ----" sudo pip3 install num2words ofxparse sudo npm install -g less @@ -132,42 +511,42 @@ if [ $IS_ENTERPRISE = "True" ]; then fi echo -e "\n---- Create custom module directory ----" -sudo su $OE_USER -c "mkdir $OE_HOME/custom" -sudo su $OE_USER -c "mkdir $OE_HOME/custom/addons" +sudo su $ODOO_USER -c "mkdir $ODOO_HOME/custom" +sudo su $ODOO_USER -c "mkdir $ODOO_HOME/custom/addons" echo -e "\n---- Setting permissions on home folder ----" -sudo chown -R $OE_USER:$OE_USER $OE_HOME/* +sudo chown -R $ODOO_USER:$ODOO_USER $ODOO_HOME/* echo -e "* Create server config file" -sudo touch /etc/${OE_CONFIG}.conf +sudo touch /etc/${ODOO_CONFIG}.conf echo -e "* Creating server config file" -sudo su root -c "printf '[options] \n; This is the password that allows database operations:\n' >> /etc/${OE_CONFIG}.conf" -sudo su root -c "printf 'admin_passwd = ${OE_SUPERADMIN}\n' >> /etc/${OE_CONFIG}.conf" -sudo su root -c "printf 'xmlrpc_port = ${OE_PORT}\n' >> /etc/${OE_CONFIG}.conf" -sudo su root -c "printf 'logfile = /var/log/${OE_USER}/${OE_CONFIG}.log\n' >> /etc/${OE_CONFIG}.conf" -if [ $IS_ENTERPRISE = "True" ]; then - sudo su root -c "printf 'addons_path=${OE_HOME}/enterprise/addons,${OE_HOME_EXT}/addons\n' >> /etc/${OE_CONFIG}.conf" +sudo su root -c "printf '[options] \n; This is the password that allows database operations:\n' >> /etc/${ODOO_CONFIG}.conf" +sudo su root -c "printf 'admin_passwd = ${ODOO_MASTER_PASSWD}\n' >> /etc/${ODOO_CONFIG}.conf" +sudo su root -c "printf 'xmlrpc_port = ${ODOO_PORT}\n' >> /etc/${ODOO_CONFIG}.conf" +sudo su root -c "printf 'logfile = /var/log/${ODOO_USER}/${ODOO_CONFIG}.log\n' >> /etc/${ODOO_CONFIG}.conf" +if [ $ENTERPRISE_EDITON = "Y" ]; then + sudo su root -c "printf 'addons_path=${ODOO_HOME}/enterprise/addons,${ODOO_HOME_EXT}/addons\n' >> /etc/${ODOO_CONFIG}.conf" else - sudo su root -c "printf 'addons_path=${OE_HOME_EXT}/addons,${OE_HOME}/custom/addons\n' >> /etc/${OE_CONFIG}.conf" + sudo su root -c "printf 'addons_path=${ODOO_HOME_EXT}/addons,${ODOO_HOME}/custom/addons\n' >> /etc/${ODOO_CONFIG}.conf" fi -sudo chown $OE_USER:$OE_USER /etc/${OE_CONFIG}.conf -sudo chmod 640 /etc/${OE_CONFIG}.conf +sudo chown $ODOO_USER:$ODOO_USER /etc/${ODOO_CONFIG}.conf +sudo chmod 640 /etc/${ODOO_CONFIG}.conf echo -e "* Create startup file" -sudo su root -c "echo '#!/bin/sh' >> $OE_HOME_EXT/start.sh" -sudo su root -c "echo 'sudo -u $OE_USER $OE_HOME_EXT/openerp-server --config=/etc/${OE_CONFIG}.conf' >> $OE_HOME_EXT/start.sh" -sudo chmod 755 $OE_HOME_EXT/start.sh +sudo su root -c "echo '#!/bin/sh' >> $ODOO_HOME_EXT/start.sh" +sudo su root -c "echo 'sudo -u $ODOO_USER $ODOO_HOME_EXT/openerp-server --config=/etc/${ODOO_CONFIG}.conf' >> $ODOO_HOME_EXT/start.sh" +sudo chmod 755 $ODOO_HOME_EXT/start.sh #-------------------------------------------------- # Adding ODOO as a deamon (initscript) #-------------------------------------------------- echo -e "* Create init file" -cat < ~/$OE_CONFIG +cat < ~/$ODOO_CONFIG #!/bin/sh ### BEGIN INIT INFO -# Provides: $OE_CONFIG +# Provides: $ODOO_CONFIG # Required-Start: \$remote_fs \$syslog # Required-Stop: \$remote_fs \$syslog # Should-Start: \$network @@ -178,13 +557,13 @@ cat < ~/$OE_CONFIG # Description: ODOO Business Applications ### END INIT INFO PATH=/bin:/sbin:/usr/bin -DAEMON=$OE_HOME_EXT/odoo-bin -NAME=$OE_CONFIG -DESC=$OE_CONFIG +DAEMON=$ODOO_HOME_EXT/odoo-bin +NAME=$ODOO_CONFIG +DESC=$ODOO_CONFIG # Specify the user name (Default: odoo). -USER=$OE_USER +USER=$ODOO_USER # Specify an alternate config file (Default: /etc/openerp-server.conf). -CONFIGFILE="/etc/${OE_CONFIG}.conf" +CONFIGFILE="/etc/${ODOO_CONFIG}.conf" # pidfile PIDFILE=/var/run/\${NAME}.pid # Additional options that are passed to the Daemon. @@ -231,23 +610,100 @@ exit 0 EOF echo -e "* Security Init File" -sudo mv ~/$OE_CONFIG /etc/init.d/$OE_CONFIG -sudo chmod 755 /etc/init.d/$OE_CONFIG -sudo chown root: /etc/init.d/$OE_CONFIG +sudo mv ~/$ODOO_CONFIG /etc/init.d/$ODOO_CONFIG +sudo chmod 755 /etc/init.d/$ODOO_CONFIG +sudo chown root: /etc/init.d/$ODOO_CONFIG echo -e "* Start ODOO on Startup" -sudo update-rc.d $OE_CONFIG defaults +sudo update-rc.d $ODOO_CONFIG defaults echo -e "* Starting Odoo Service" -sudo su root -c "/etc/init.d/$OE_CONFIG start" +sudo su root -c "/etc/init.d/$ODOO_CONFIG start" echo "-----------------------------------------------------------" echo "Done! The Odoo server is up and running. Specifications:" -echo "Port: $OE_PORT" -echo "User service: $OE_USER" -echo "User PostgreSQL: $OE_USER" -echo "Code location: $OE_USER" -echo "Addons folder: $OE_USER/$OE_CONFIG/addons/" -echo "Start Odoo service: sudo service $OE_CONFIG start" -echo "Stop Odoo service: sudo service $OE_CONFIG stop" -echo "Restart Odoo service: sudo service $OE_CONFIG restart" +echo "Port: $ODOO_PORT" +echo "User service: $ODOO_USER" +echo "User PostgreSQL: $ODOO_USER" +echo "Code location: $ODOO_USER" +echo "Addons folder: $ODOO_USER/$ODOO_CONFIG/addons/" +echo "Start Odoo service: sudo service $ODOO_CONFIG start" +echo "Stop Odoo service: sudo service $ODOO_CONFIG stop" +echo "Restart Odoo service: sudo service $ODOO_CONFIG restart" +echo "-----------------------------------------------------------" + +} + +echo +while true; do +echo "---------------------------------------------------------------" +echo "Your Odoo will be installed with the following specifications: " +echo "---------------------------------------------------------------" +echo "Odoo username: $ODOO_USER" +echo "Location will be at: $ODOO_HOME" +echo "Odoo port number: $ODOO_PORT" +echo "Odoo Master password: $ODOO_MASTER_PASSWD" +echo "Addons folder: $ODOO_HOME_EXT/addons and $ODOO_HOME/custom/addons" +echo "Start Odoo service: service $ODOO_USER start" +echo "Stop Odoo service: service $ODOO_USER stop" +echo "Restart Odoo service: service $ODOO_USER restart" +echo "" echo "-----------------------------------------------------------" +echo -n "Do you want to proceed with the installation (y/n)? " +read FINAL_QUESTION +echo "-----------------------------------------------------------" + +echo + +case $FINAL_QUESTION in + Y) + ODOO_INSTALL="Y" + echo "" + echo -e "Please wait. The installation will begin shortly" + break + ;; + y) + ODOO_INSTALL="y" + echo "" + echo -e "Please wait. The installation will begin shortly" + break + ;; + N) + ODOO_INSTALL="n" + echo "" + echo -e "You have choose NO. Bye Bye." + exit -1 + break + ;; + n) + ODOO_INSTALL="N" + echo "" + echo -e "You have choose NO. Bye Bye." + exit -1 + break + ;; + q) + echo -e "The quit option was selected, and the script has stopped. Goodbye, until the next time." + exit -1 + break + ;; + Q) + echo -e "The quit option was selected, and the script has stopped. Goodbye, until the next time." + exit -1 + break + ;; + *) + echo -e "The ${RED}$FINAL_QUESTION${NC} is not a valid choice, try with ${GREEN}Y${NC}/${GREEN}N${NC} or type ${GREEN}q${NC} for quit." + ;; +esac +done + +if [ "$ODOO_INSTALL" = y ] || [ "$ODOO_INSTALL" = Y ] || [ "$distro" = "CentOS Linux" ] + then + install_odoo_centos +else + if [ "$ODOO_INSTALL" = y ] || [ "$ODOO_INSTALL" = Y ] || [ "$distro" = "Ubuntu" ] || [ "$distro" = "Debian" ]; then + install_odoo_ubuntu + else + echo "This script is not supported for your OS" + fi +fi From 1787e01558d16ce9a9cc90acd6004a573195aca6 Mon Sep 17 00:00:00 2001 From: Matkach <34516217+Matkach@users.noreply.github.com> Date: Thu, 1 Aug 2019 00:34:01 +0200 Subject: [PATCH 03/17] Update odoo_install.sh --- odoo_install.sh | 618 +++++++----------------------------------------- 1 file changed, 81 insertions(+), 537 deletions(-) diff --git a/odoo_install.sh b/odoo_install.sh index 752d1e26..e6a73448 100644 --- a/odoo_install.sh +++ b/odoo_install.sh @@ -1,227 +1,37 @@ #!/bin/bash -############################################################################################################################## -# Script for automated Odoo installation -# Author: Dushko Davchev (Matkach) -#----------------------------------------------------------------------------------------------------------------------------- -# This script is based on the installation script of Yenthe V.G (https://github.com/Yenthe666/InstallScript) -# Inspired by his work I have created similar interactive script for automated Odoo installation on both CentOS and Ubuntu servers. -############################################################################################################################## - -check_os(){ - echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" -} - -operativen=`check_os \`uname\`` -kernel=`uname -r` -bit_proc=`uname -m` - -if [ "{$operativen}" == "windowsnt" ]; then - operativen=windows -elif [ "{$operativen}" == "darwin" ]; then - operativen=mac -else - operativen=`uname` - if [ "${operativen}" = "SunOS" ] ; then - operativen=Solaris - ARCH=`uname -p` - OSSTR="${operativen} ${verzija}(${ARCH} `uname -v`)" - elif [ "${operativen}" = "AIX" ] ; then - OSSTR="${operativen} `oslevel` (`oslevel -r`)" - elif [ "${operativen}" = "Linux" ] ; then - if [ -f /etc/redhat-release ] ; then - distro_baziran_na='RedHat' - distro=`cat /etc/redhat-release |sed s/\ release.*//` - code_name=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//` - verzija=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//` - elif [ -f /etc/SuSE-release ] ; then - distro_baziran_na='SuSe' - code_name=`cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//` - verzija=`cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //` - elif [ -f /etc/mandrake-release ] ; then - distro_baziran_na='Mandrake' - code_name=`cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//` - verzija=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//` - elif [ -f /etc/debian_version ] ; then - distro_baziran_na='Debian' - distro=`cat /etc/lsb-release | grep '^DISTRIB_ID' | awk -F= '{ print $2 }'` - code_name=`cat /etc/lsb-release | grep '^DISTRIB_CODENAME' | awk -F= '{ print $2 }'` - verzija=`cat /etc/lsb-release | grep '^DISTRIB_RELEASE' | awk -F= '{ print $2 }'` - fi - if [ -f /etc/UnitedLinux-release ] ; then - distro="${distro}[`cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//`]" - fi - operativen=`check_os $operativen` - distro_baziran_na=`check_os $distro_baziran_na` - -echo -#echo "You are using $distro version $verzija which is supported for Odoo installation" - - fi -fi - -LPURPLE='\033[1;35m' -RED='\033[0;31m' -GREEN='\033[0;32m' -OGRANGE='\033[0;33m' -BLUE='\033[0;34m' -YELLOW='\033[1;33m' -NC='\033[0m' - -#-------------------------------------------------- -# Questions for the user -#-------------------------------------------------- -echo -echo -e "Please insert the information required for the ${LPURPLE}Odoo${NC} installation." -echo "" - -echo -n "Insert Odoo user name (default: odoo): " -read ODOO_USER - -ODOO_USER="${ODOO_USER:-odoo}" - -echo -echo -e "You have selected the ${BLUE}$ODOO_USER${NC} as username" -echo "" - -echo -n "Insert Odoo location (default: /opt/$ODOO_USER): " -read LOCATION - -LOCATION="${LOCATION:-/opt/$ODOO_USER}" - - if [[ $LOCATION == / ]] || [[ $LOCATION == /* ]] ; - then - ODOO_HOME="$LOCATION/$ODOO_USER" - else - ODOO_HOME="/$LOCATION/$ODOO_USER" - fi - -mkdir -p $ODOO_HOME - -echo -echo -e "You have selected the following location ${BLUE}$LOCATION${NC}" -echo "" - -echo -while ! [[ "$ODOO_PORT" =~ ^[0-9]+$ ]] -do - -echo -n "Inset Odoo port number (default: 8069) : " -read ODOO_PORT -echo - -ODOO_PORT="${ODOO_PORT:-8069}" - -done - -echo -echo -e "You have selected the following port number: ${BLUE}$ODOO_PORT${NC}" -echo "" - -echo -while true; do -echo -echo -e "Select the Odoo version: " -echo "" -echo -e "${GREEN}1${NC}) Odoo version ${LPURPLE}12.0${NC}" -echo "" -echo -e "${GREEN}2${NC}) Odoo version ${LPURPLE}11.0${NC}" -echo "" -echo -e "${GREEN}3${NC}) Odoo version ${LPURPLE}10.0${NC}" -echo "" -echo -e "${GREEN}4${NC}) Odoo version ${LPURPLE}9.0${NC}" -echo "" -echo -ne "Choose a number from ${GREEN}1${NC} to ${GREEN}4${NC}: " -read SELECT_VERSION - -echo - -case $SELECT_VERSION in - 1) - ODOO_VERSION="12.0" - break - ;; - 2) - ODOO_VERSION="11.0" - break - ;; - 3) - ODOO_VERSION="10.0" - break - ;; - 4) - ODOO_VERSION="9.0" - break - ;; - q) - echo "The quit option was selected, and the script has stopped. Goodbye, until the next time." - exit -1 - break - ;; - Q) - echo "The quit option was selected, and the script has stopped. Goodbye, until the next time." - exit -1 - break - ;; - *) - echo -e "The ${RED}$SELECT_VERSION${NC} is not a valid choice. Choose from ${GREEN}1${NC} to ${GREEN}4${NC} or type q for quit." - ;; -esac -done - -echo -echo -e "You have selected the ${LPURPLE}Odoo${NC} version ${LPURPLE}$ODOO_VERSION ${NC}" -echo "" - -echo -while true; do -echo -ne "Please select your ${LPURPLE}Odoo${NC} Edition. " -echo "" -echo -e "${GREEN}1${NC}) - ${LPURPLE}Enterprise edition${NC}" -echo "" -echo -e "${GREEN}2${NC}) - ${LPURPLE}Community Edition{NC}" -echo "" -echo -ne "Please select your choice: " -read ODOO_EDITON - -echo - -case $ODOO_EDITON in - 1) - ENTERPRISE_EDITON="Y" - echo "" - echo -e "You have choose the ${LPURPLE}Enterprise Edition${NC}" - break - ;; - 2) - ENTERPRISE_EDITON="N" - echo "" - echo -e "You have choose the ${LPURPLE}Community Edition${NC}" - break - ;; - q) - echo -e "The quit option was selected, and the script has stopped. Goodbye, until the next time." - exit -1 - break - ;; - Q) - echo -e "The quit option was selected, and the script has stopped. Goodbye, until the next time." - exit -1 - break - ;; - *) - echo -e "The ${RED}$ODOO_EDITON${NC} is not a valid choice. Please select from the offered options ${GREEN}1${NC}/${GREEN}2${NC} or you can type ${GREEN}q${NC} for quit." - ;; -esac -done - -echo -echo -ne "Please insert your ${LPURPLE}Odoo Master Password${NC}: " -read -s ODOO_MASTER_PASSWD -echo - -ODOO_HOME_EXT="$ODOO_HOME/$ODOO_USER" -ODOO_CONFIG="/etc/$ODOO_USER.conf" +################################################################################ +# Script for installing Odoo on Ubuntu 14.04, 15.04, 16.04 and 18.04 (could be used for other version too) +# Author: Yenthe Van Ginneken +#------------------------------------------------------------------------------- +# This script will install Odoo on your Ubuntu 16.04 server. It can install multiple Odoo instances +# in one Ubuntu because of the different xmlrpc_ports +#------------------------------------------------------------------------------- +# Make a new file: +# sudo nano odoo-install.sh +# Place this content in it and then make the file executable: +# sudo chmod +x odoo-install.sh +# Execute the script to install Odoo: +# ./odoo-install +################################################################################ + +OE_USER="odoo" +OE_HOME="/$OE_USER" +OE_HOME_EXT="/$OE_USER/${OE_USER}-server" +# The default port where this Odoo instance will run under (provided you use the command -c in the terminal) +# Set to true if you want to install it, false if you don't need it or have it already installed. INSTALL_WKHTMLTOPDF="True" +# Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this.) +OE_PORT="8069" +# Choose the Odoo version which you want to install. For example: 12.0, 11.0, 10.0 or saas-18. When using 'master' the master version will be installed. +# IMPORTANT! This script contains extra libraries that are specifically needed for Odoo 12.0 +OE_VERSION="12.0" +# Set this to True if you want to install the Odoo enterprise version! +IS_ENTERPRISE="False" +# set the superadmin password +OE_SUPERADMIN="admin" +OE_CONFIG="${OE_USER}-server" + +## ### WKHTMLTOPDF download links ## === Ubuntu Trusty x64 & x32 === (for other distributions please replace these two links, ## in order to have correct version of wkhtmltox installed, for a danger note refer to @@ -229,195 +39,6 @@ INSTALL_WKHTMLTOPDF="True" WKHTMLTOX_X64=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_amd64.deb WKHTMLTOX_X32=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_i386.deb -echo -echo "" -echo -e "---------------------- ${RED}WARNING${NC} ----------------------------" -echo "The script is in beta-mode ... and it's not yet tested! :] " -echo "-----------------------------------------------------------" -echo - -function install_odoo_centos { - -#-------------------------------------------------- -# Update Server -#-------------------------------------------------- - -echo -e "\n---- Update Server ----" - -sudo yum update -y -sudo yum upgrade -y - -#-------------------------------------------------- -# Install Dependencies -#-------------------------------------------------- - -echo -e "\n--- Dependencies & Tools --" - -sudo yum install epel-release wget git gcc libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel -y - -echo -e "\n--- Installing Python --" - -sudo yum install python-pip -y -sudo pip install --upgrade pip -sudo pip install --upgrade setuptools -#sudo pip install Babel decorator docutils ebaysdk feedparser gevent greenlet jcconv Jinja2 lxml Mako MarkupSafe mock ofxparse passlib Pillow psutil psycogreen psycopg2-binary pydot pyparsing pyPdf pyserial Python-Chart python-dateutil python-ldap python-openid pytz pyusb PyYAML qrcode reportlab requests six suds-jurko vatnumber vobject Werkzeug wsgiref XlsxWriter xlwt xlrd -sudo pip install -r https://github.com/odoo/odoo/raw/$ODOO_VERSION/requirements.txt - -sudo yum install python36 -y - -echo -e "\n---- Install python packages ----" - -sudo yum install python36-devel libxslt-devel libxml2-devel openldap-devel python36-setuptools python-devel -y -python3.6 -m ensurepip -#sudo pip3 install pypdf2 Babel passlib Werkzeug decorator python-dateutil pyyaml psycopg2-binary psutil html2text docutils lxml pillow reportlab ninja2 requests gdata XlsxWriter vobject python-openid pyparsing pydot mock mako Jinja2 ebaysdk feedparser xlwt psycogreen suds-jurko pytz pyusb greenlet xlrd num2words -sudo pip3 install -r https://github.com/odoo/odoo/raw/$ODOO_VERSION/requirements.txt - -echo -e "\n--- Install other required packages" -sudo yum install nodejs npm -y -sudo npm install -g less -sudo npm install -g less-plugin-clean-css -sudo npm install -g rtlcss - -#-------------------------------------------------- -# Install PostgreSQL Server -#-------------------------------------------------- - -echo -e "\n---- Install PostgreSQL Server ----" -sudo yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat96-9.6-3.noarch.rpm -y -sudo yum install postgresql96 postgresql96-server postgresql96-contrib postgresql96-libs -y - -echo -e "\n---- Creating the ODOO PostgreSQL Database ----" -sudo /usr/pgsql-9.6/bin/postgresql96-setup initdb - -echo -e "\n---- Enable & Start the ODOO PostgreSQL Database ----" -sudo systemctl start postgresql-9.6.service -sudo systemctl enable postgresql-9.6.service - -#-------------------------------------------------- -# Creating Odoo and PostgreSQL users -#-------------------------------------------------- - -echo -e "\n---- Creating PostgreSQL user ----" -sudo su - postgres -c "createuser -s $ODOO_USER" - -echo -e "\n---- Creating Odoo user ----" -sudo useradd -m -U -r -d $ODOO_HOME -s /bin/bash $ODOO_USER - -#-------------------------------------------------- -# Install Wkhtmltopdf -#-------------------------------------------------- -sudo yum install wkhtmltopdf -y - -echo -e "\n---- Create Log directory ----" -sudo mkdir /var/log/$ODOO_USER - -#-------------------------------------------------- -# Install ODOO -#-------------------------------------------------- -echo -e "\n==== Installing ODOO Server ====" -sudo git clone --depth 1 --branch $ODOO_VERSION https://www.github.com/odoo/odoo $ODOO_HOME_EXT/ - -if [ $ENTERPRISE_EDITON = "Y" ]; then - # Odoo Enterprise install! - echo -e "\n--- Create symlink for node" - sudo ln -s /usr/bin/nodejs /usr/bin/node - sudo mkdir $ODOO_HOME/enterprise - sudo mkdir $ODOO_HOME/enterprise/addons - - GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $ODOO_VERSION https://www.github.com/odoo/enterprise "$ODOO_HOME/enterprise/addons" 2>&1) - while [[ $GITHUB_RESPONSE == *"Authentication"* ]]; do - echo "------------------------WARNING------------------------------" - echo "Your authentication with Github has failed! Please try again." - printf "In order to clone and install the Odoo enterprise version you \nneed to be an offical Odoo partner and you need access to\nhttp://github.com/odoo/enterprise.\n" - echo "TIP: Press ctrl+c to stop this script." - echo "-------------------------------------------------------------" - echo " " - GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $ODOO_VERSION https://www.github.com/odoo/enterprise "$ODOO_HOME/enterprise/addons" 2>&1) - done - - echo -e "\n---- Added Enterprise code under $ODOO_HOME/enterprise/addons ----" - echo -e "\n---- Installing Enterprise specific libraries ----" - sudo pip3 install num2words ofxparse - sudo yum install nodejs npm - sudo npm install -g less - sudo npm install -g less-plugin-clean-css -fi - -echo -e "\n---- Create custom module directory ----" - -sudo mv $ODOO_HOME_EXT/odoo.py $ODOO_HOME_EXT/odoo-bin -sudo mkdir $ODOO_HOME/custom -sudo mkdir $ODOO_HOME/custom/addons - -echo -e "\n---- Create server config file" - -sudo su root -c "touch '$ODOO_CONFIG'" - -sudo su root -c "echo "[options]" >> $ODOO_CONFIG" -sudo su root -c "echo ';This is the password that allows database operations:' >> $ODOO_CONFIG" -sudo su root -c "echo 'admin_passwd = $ODOO_MASTER_PASSWD' >> $ODOO_CONFIG" -sudo su root -c "echo 'xmlrpc_port = $ODOO_PORT' >> $ODOO_CONFIG" -sudo su root -c "echo 'logfile = /var/log/$ODOO_USER/$ODOO_USER.log' >> $ODOO_CONFIG" -if [ $ENTERPRISE_EDITON = "Y" ]; then - sudo su root -c "echo 'addons_path=$ODOO_HOME/enterprise/addons,$ODOO_HOME_EXT/addons' >> $ODOO_CONFIG" -else - sudo su root -c "echo 'addons_path=$ODOO_HOME_EXT/addons,$ODOO_HOME/custom/addons' >> $ODOO_CONFIG" -fi - -sudo chmod 640 $ODOO_CONFIG - -echo -e "\n---- Creating systemd config file" -sudo touch /etc/systemd/system/$ODOO_USER.service - -sudo su root -c "echo "[Unit]" >> /etc/systemd/system/$ODOO_USER.service" -sudo su root -c "echo 'Description=Odoo server' >> /etc/systemd/system/$ODOO_USER.service" -sudo su root -c "echo '#Requires=postgresql-9.6.service' >> /etc/systemd/system/$ODOO_USER.service" -sudo su root -c "echo '#After=network.target postgresql-9.6.service' >> /etc/systemd/system/$ODOO_USER.service" -sudo su root -c "echo "[Service]" >> /etc/systemd/system/$ODOO_USER.service" -sudo su root -c "echo 'Type=simple' >> /etc/systemd/system/$ODOO_USER.service" -sudo su root -c "echo 'SyslogIdentifier=odoo12' >> /etc/systemd/system/$ODOO_USER.service" -sudo su root -c "echo 'PermissionsStartOnly=true' >> /etc/systemd/system/$ODOO_USER.service" -sudo su root -c "echo 'User=$ODOO_USER' >> /etc/systemd/system/$ODOO_USER.service" -sudo su root -c "echo 'Group=$ODOO_USER' >> /etc/systemd/system/$ODOO_USER.service" -sudo su root -c "echo 'ExecStart=$ODOO_HOME/$ODOO_USER/odoo-bin -c /etc/$ODOO_USER.conf' >> /etc/systemd/system/$ODOO_USER.service" -sudo su root -c "echo 'StandardOutput=journal+console' >> /etc/systemd/system/$ODOO_USER.service" -sudo su root -c "echo "[Install]" >> /etc/systemd/system/$ODOO_USER.service" -sudo su root -c "echo 'WantedBy=multi-user.target' >> /etc/systemd/system/$ODOO_USER.service" - -echo -e "\n---- Start ODOO on Startup" -sudo chmod +x /etc/systemd/system/$ODOO_USER.service -sudo systemctl daemon-reload - -sudo chown -R $ODOO_USER: $ODOO_HOME -sudo chown $ODOO_USER: $ODOO_CONFIG - -echo -e "\n---- Starting Odoo Service" - -sudo systemctl start $ODOO_USER.service -sudo systemctl enable $ODOO_USER.service - - - -echo "-----------------------------------------------------------" -echo "Done! The Odoo server is up and running. Specifications:" -echo "-----------------------------------------------------------" -echo "Port: $ODOO_PORT" -echo "Master password: $ODOO_MASTER_PASSWD" -echo "User service: $ODOO_USER" -echo "User PostgreSQL: $ODOO_USER" -echo "Addons folder: $ODOO_HOME_EXT/addons and $ODOO_HOME/custom/addons" -echo "Start Odoo service: service $ODOO_USER start" -echo "Stop Odoo service: service $ODOO_USER stop" -echo "Restart Odoo service: service $ODOO_USER restart" -echo "-----------------------------------------------------------" - -echo " " -echo "---------------------- WARNING ----------------------------" -echo "The script is in beta-mode ... and it's not yet tested! :] " -echo "-----------------------------------------------------------" -} - -function install_odoo_ubuntu { #-------------------------------------------------- # Update Server #-------------------------------------------------- @@ -436,7 +57,7 @@ echo -e "\n---- Install PostgreSQL Server ----" sudo apt-get install postgresql -y echo -e "\n---- Creating the ODOO PostgreSQL User ----" -sudo su - postgres -c "createuser -s $ODOO_USER" 2> /dev/null || true +sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true #-------------------------------------------------- # Install Dependencies @@ -445,7 +66,7 @@ echo -e "\n--- Installing Python 3 + pip3 --" sudo apt-get install git python3 python3-pip build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libpng12-0 gdebi -y echo -e "\n---- Install python packages/requirements ----" -sudo pip3 install -r https://github.com/odoo/odoo/raw/${ODOO_VERSION}/requirements.txt +sudo pip3 install -r https://github.com/odoo/odoo/raw/${OE_VERSION}/requirements.txt echo -e "\n---- Installing nodeJS NPM and rtlcss for LTR support ----" sudo apt-get install nodejs npm @@ -471,28 +92,28 @@ else fi echo -e "\n---- Create ODOO system user ----" -sudo adduser --system --quiet --shell=/bin/bash --home=$ODOO_HOME --gecos 'ODOO' --group $ODOO_USER +sudo adduser --system --quiet --shell=/bin/bash --home=$OE_HOME --gecos 'ODOO' --group $OE_USER #The user should also be added to the sudo'ers group. -sudo adduser $ODOO_USER sudo +sudo adduser $OE_USER sudo echo -e "\n---- Create Log directory ----" -sudo mkdir /var/log/$ODOO_USER -sudo chown $ODOO_USER:$ODOO_USER /var/log/$ODOO_USER +sudo mkdir /var/log/$OE_USER +sudo chown $OE_USER:$OE_USER /var/log/$OE_USER #-------------------------------------------------- # Install ODOO #-------------------------------------------------- echo -e "\n==== Installing ODOO Server ====" -sudo git clone --depth 1 --branch $ODOO_VERSION https://www.github.com/odoo/odoo $ODOO_HOME_EXT/ +sudo git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/odoo $OE_HOME_EXT/ -if [ $ENTERPRISE_EDITON = "Y" ]; then +if [ $IS_ENTERPRISE = "True" ]; then # Odoo Enterprise install! echo -e "\n--- Create symlink for node" sudo ln -s /usr/bin/nodejs /usr/bin/node - sudo su $ODOO_USER -c "mkdir $ODOO_HOME/enterprise" - sudo su $ODOO_USER -c "mkdir $ODOO_HOME/enterprise/addons" + sudo su $OE_USER -c "mkdir $OE_HOME/enterprise" + sudo su $OE_USER -c "mkdir $OE_HOME/enterprise/addons" - GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $ODOO_VERSION https://www.github.com/odoo/enterprise "$ODOO_HOME/enterprise/addons" 2>&1) + GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1) while [[ $GITHUB_RESPONSE == *"Authentication"* ]]; do echo "------------------------WARNING------------------------------" echo "Your authentication with Github has failed! Please try again." @@ -500,10 +121,10 @@ if [ $ENTERPRISE_EDITON = "Y" ]; then echo "TIP: Press ctrl+c to stop this script." echo "-------------------------------------------------------------" echo " " - GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $ODOO_VERSION https://www.github.com/odoo/enterprise "$ODOO_HOME/enterprise/addons" 2>&1) + GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1) done - echo -e "\n---- Added Enterprise code under $ODOO_HOME/enterprise/addons ----" + echo -e "\n---- Added Enterprise code under $OE_HOME/enterprise/addons ----" echo -e "\n---- Installing Enterprise specific libraries ----" sudo pip3 install num2words ofxparse sudo npm install -g less @@ -511,42 +132,42 @@ if [ $ENTERPRISE_EDITON = "Y" ]; then fi echo -e "\n---- Create custom module directory ----" -sudo su $ODOO_USER -c "mkdir $ODOO_HOME/custom" -sudo su $ODOO_USER -c "mkdir $ODOO_HOME/custom/addons" +sudo su $OE_USER -c "mkdir $OE_HOME/custom" +sudo su $OE_USER -c "mkdir $OE_HOME/custom/addons" echo -e "\n---- Setting permissions on home folder ----" -sudo chown -R $ODOO_USER:$ODOO_USER $ODOO_HOME/* +sudo chown -R $OE_USER:$OE_USER $OE_HOME/* echo -e "* Create server config file" -sudo touch /etc/${ODOO_CONFIG}.conf +sudo touch /etc/${OE_CONFIG}.conf echo -e "* Creating server config file" -sudo su root -c "printf '[options] \n; This is the password that allows database operations:\n' >> /etc/${ODOO_CONFIG}.conf" -sudo su root -c "printf 'admin_passwd = ${ODOO_MASTER_PASSWD}\n' >> /etc/${ODOO_CONFIG}.conf" -sudo su root -c "printf 'xmlrpc_port = ${ODOO_PORT}\n' >> /etc/${ODOO_CONFIG}.conf" -sudo su root -c "printf 'logfile = /var/log/${ODOO_USER}/${ODOO_CONFIG}.log\n' >> /etc/${ODOO_CONFIG}.conf" -if [ $ENTERPRISE_EDITON = "Y" ]; then - sudo su root -c "printf 'addons_path=${ODOO_HOME}/enterprise/addons,${ODOO_HOME_EXT}/addons\n' >> /etc/${ODOO_CONFIG}.conf" +sudo su root -c "printf '[options] \n; This is the password that allows database operations:\n' >> /etc/${OE_CONFIG}.conf" +sudo su root -c "printf 'admin_passwd = ${OE_SUPERADMIN}\n' >> /etc/${OE_CONFIG}.conf" +sudo su root -c "printf 'xmlrpc_port = ${OE_PORT}\n' >> /etc/${OE_CONFIG}.conf" +sudo su root -c "printf 'logfile = /var/log/${OE_USER}/${OE_CONFIG}.log\n' >> /etc/${OE_CONFIG}.conf" +if [ $IS_ENTERPRISE = "True" ]; then + sudo su root -c "printf 'addons_path=${OE_HOME}/enterprise/addons,${OE_HOME_EXT}/addons\n' >> /etc/${OE_CONFIG}.conf" else - sudo su root -c "printf 'addons_path=${ODOO_HOME_EXT}/addons,${ODOO_HOME}/custom/addons\n' >> /etc/${ODOO_CONFIG}.conf" + sudo su root -c "printf 'addons_path=${OE_HOME_EXT}/addons,${OE_HOME}/custom/addons\n' >> /etc/${OE_CONFIG}.conf" fi -sudo chown $ODOO_USER:$ODOO_USER /etc/${ODOO_CONFIG}.conf -sudo chmod 640 /etc/${ODOO_CONFIG}.conf +sudo chown $OE_USER:$OE_USER /etc/${OE_CONFIG}.conf +sudo chmod 640 /etc/${OE_CONFIG}.conf echo -e "* Create startup file" -sudo su root -c "echo '#!/bin/sh' >> $ODOO_HOME_EXT/start.sh" -sudo su root -c "echo 'sudo -u $ODOO_USER $ODOO_HOME_EXT/openerp-server --config=/etc/${ODOO_CONFIG}.conf' >> $ODOO_HOME_EXT/start.sh" -sudo chmod 755 $ODOO_HOME_EXT/start.sh +sudo su root -c "echo '#!/bin/sh' >> $OE_HOME_EXT/start.sh" +sudo su root -c "echo 'sudo -u $OE_USER $OE_HOME_EXT/openerp-server --config=/etc/${OE_CONFIG}.conf' >> $OE_HOME_EXT/start.sh" +sudo chmod 755 $OE_HOME_EXT/start.sh #-------------------------------------------------- # Adding ODOO as a deamon (initscript) #-------------------------------------------------- echo -e "* Create init file" -cat < ~/$ODOO_CONFIG +cat < ~/$OE_CONFIG #!/bin/sh ### BEGIN INIT INFO -# Provides: $ODOO_CONFIG +# Provides: $OE_CONFIG # Required-Start: \$remote_fs \$syslog # Required-Stop: \$remote_fs \$syslog # Should-Start: \$network @@ -557,13 +178,13 @@ cat < ~/$ODOO_CONFIG # Description: ODOO Business Applications ### END INIT INFO PATH=/bin:/sbin:/usr/bin -DAEMON=$ODOO_HOME_EXT/odoo-bin -NAME=$ODOO_CONFIG -DESC=$ODOO_CONFIG +DAEMON=$OE_HOME_EXT/odoo-bin +NAME=$OE_CONFIG +DESC=$OE_CONFIG # Specify the user name (Default: odoo). -USER=$ODOO_USER +USER=$OE_USER # Specify an alternate config file (Default: /etc/openerp-server.conf). -CONFIGFILE="/etc/${ODOO_CONFIG}.conf" +CONFIGFILE="/etc/${OE_CONFIG}.conf" # pidfile PIDFILE=/var/run/\${NAME}.pid # Additional options that are passed to the Daemon. @@ -610,100 +231,23 @@ exit 0 EOF echo -e "* Security Init File" -sudo mv ~/$ODOO_CONFIG /etc/init.d/$ODOO_CONFIG -sudo chmod 755 /etc/init.d/$ODOO_CONFIG -sudo chown root: /etc/init.d/$ODOO_CONFIG +sudo mv ~/$OE_CONFIG /etc/init.d/$OE_CONFIG +sudo chmod 755 /etc/init.d/$OE_CONFIG +sudo chown root: /etc/init.d/$OE_CONFIG echo -e "* Start ODOO on Startup" -sudo update-rc.d $ODOO_CONFIG defaults +sudo update-rc.d $OE_CONFIG defaults echo -e "* Starting Odoo Service" -sudo su root -c "/etc/init.d/$ODOO_CONFIG start" +sudo su root -c "/etc/init.d/$OE_CONFIG start" echo "-----------------------------------------------------------" echo "Done! The Odoo server is up and running. Specifications:" -echo "Port: $ODOO_PORT" -echo "User service: $ODOO_USER" -echo "User PostgreSQL: $ODOO_USER" -echo "Code location: $ODOO_USER" -echo "Addons folder: $ODOO_USER/$ODOO_CONFIG/addons/" -echo "Start Odoo service: sudo service $ODOO_CONFIG start" -echo "Stop Odoo service: sudo service $ODOO_CONFIG stop" -echo "Restart Odoo service: sudo service $ODOO_CONFIG restart" -echo "-----------------------------------------------------------" - -} - -echo -while true; do -echo "---------------------------------------------------------------" -echo "Your Odoo will be installed with the following specifications: " -echo "---------------------------------------------------------------" -echo "Odoo username: $ODOO_USER" -echo "Location will be at: $ODOO_HOME" -echo "Odoo port number: $ODOO_PORT" -echo "Odoo Master password: $ODOO_MASTER_PASSWD" -echo "Addons folder: $ODOO_HOME_EXT/addons and $ODOO_HOME/custom/addons" -echo "Start Odoo service: service $ODOO_USER start" -echo "Stop Odoo service: service $ODOO_USER stop" -echo "Restart Odoo service: service $ODOO_USER restart" -echo "" +echo "Port: $OE_PORT" +echo "User service: $OE_USER" +echo "User PostgreSQL: $OE_USER" +echo "Code location: $OE_USER" +echo "Addons folder: $OE_USER/$OE_CONFIG/addons/" +echo "Start Odoo service: sudo service $OE_CONFIG start" +echo "Stop Odoo service: sudo service $OE_CONFIG stop" +echo "Restart Odoo service: sudo service $OE_CONFIG restart" echo "-----------------------------------------------------------" -echo -n "Do you want to proceed with the installation (y/n)? " -read FINAL_QUESTION -echo "-----------------------------------------------------------" - -echo - -case $FINAL_QUESTION in - Y) - ODOO_INSTALL="Y" - echo "" - echo -e "Please wait. The installation will begin shortly" - break - ;; - y) - ODOO_INSTALL="y" - echo "" - echo -e "Please wait. The installation will begin shortly" - break - ;; - N) - ODOO_INSTALL="n" - echo "" - echo -e "You have choose NO. Bye Bye." - exit -1 - break - ;; - n) - ODOO_INSTALL="N" - echo "" - echo -e "You have choose NO. Bye Bye." - exit -1 - break - ;; - q) - echo -e "The quit option was selected, and the script has stopped. Goodbye, until the next time." - exit -1 - break - ;; - Q) - echo -e "The quit option was selected, and the script has stopped. Goodbye, until the next time." - exit -1 - break - ;; - *) - echo -e "The ${RED}$FINAL_QUESTION${NC} is not a valid choice, try with ${GREEN}Y${NC}/${GREEN}N${NC} or type ${GREEN}q${NC} for quit." - ;; -esac -done - -if [ "$ODOO_INSTALL" = y ] || [ "$ODOO_INSTALL" = Y ] || [ "$distro" = "CentOS Linux" ] - then - install_odoo_centos -else - if [ "$ODOO_INSTALL" = y ] || [ "$ODOO_INSTALL" = Y ] || [ "$distro" = "Ubuntu" ] || [ "$distro" = "Debian" ]; then - install_odoo_ubuntu - else - echo "This script is not supported for your OS" - fi -fi From c58004a878b38bafa73e7923c108fc64bd5f912c Mon Sep 17 00:00:00 2001 From: Ash Downing Date: Mon, 18 Nov 2019 07:32:27 -0600 Subject: [PATCH 04/17] Update odoo_install.sh --- odoo_install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/odoo_install.sh b/odoo_install.sh index 86c7967d..d3ee0449 100644 --- a/odoo_install.sh +++ b/odoo_install.sh @@ -68,8 +68,8 @@ sudo apt-get install git python3 python3-pip build-essential wget python3-dev py echo -e "\n---- Install python packages/requirements ----" sudo pip3 install -r https://github.com/odoo/odoo/raw/${OE_VERSION}/requirements.txt -echo -e "\n---- Installing nodeJS NPM and rtlcss for LTR support ----" -sudo apt-get install nodejs npm -y +echo -e "\n---- Installing rtlcss for LTR support ----" +# sudo apt-get install nodejs npm -y sudo npm install -g rtlcss #-------------------------------------------------- From ed994cba3e443263b4ed63739e640a41ffdfc99e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fco=2E=20Javier=20Clavero=20=C3=81lvarez?= Date: Sat, 5 Sep 2020 18:10:35 +0200 Subject: [PATCH 05/17] [ADD] odoo_install_centos7: install script for Centos 7 --- odoo_install_centos7.sh | 357 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 357 insertions(+) create mode 100644 odoo_install_centos7.sh diff --git a/odoo_install_centos7.sh b/odoo_install_centos7.sh new file mode 100644 index 00000000..fb49ce51 --- /dev/null +++ b/odoo_install_centos7.sh @@ -0,0 +1,357 @@ +#!/usr/bin/env bash +################################################################################ +# Script for installing Odoo on Centos 7 +# Based on installation script by Yenthe Van Ginneken https://github.com/Yenthe666/InstallScript +# Author: Fco. Javier Clavero Álvarez +#------------------------------------------------------------------------------- +# This script will install Odoo on your Centos 7 server. It can install multiple Odoo instances +# in one Centos because of the different xmlrpc_ports +#------------------------------------------------------------------------------- +# Make a new file: +# nano odoo-install.sh +# Place this content in it and then make the file executable: +# chmod +x odoo-install.sh +# Execute the script to install Odoo: +# ./odoo-install +################################################################################ + +OE_USER="odoo" +OE_HOME="/$OE_USER" +OE_HOME_EXT="/$OE_USER/${OE_USER}-server" +# The default port where this Odoo instance will run under (provided you use the command -c in the terminal) +# Set to true if you want to install it, false if you don't need it or have it already installed. +INSTALL_WKHTMLTOPDF="True" +# Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this.) +OE_PORT="8069" +# Choose the Odoo version which you want to install. For example: 13.0, 12.0, 11.0 or saas-18. When using 'master' the master version will be installed. +# IMPORTANT! This script contains extra libraries that are specifically needed for Odoo 13.0 +OE_VERSION="13.0" +# Set this to True if you want to install the Odoo enterprise version! +IS_ENTERPRISE="False" +# Set this to True if you want to install Nginx! +INSTALL_NGINX="False" +# Set the superadmin password - if GENERATE_RANDOM_PASSWORD is set to "True" we will automatically generate a random password, otherwise we use this one +OE_SUPERADMIN="admin" +# Set to "True" to generate a random password, "False" to use the variable in OE_SUPERADMIN +GENERATE_RANDOM_PASSWORD="True" +OE_CONFIG="${OE_USER}-server" +# Set the website name +WEBSITE_NAME="_" +# Set the default Odoo longpolling port (you still have to use -c /etc/odoo-server.conf for example to use this.) +LONGPOLLING_PORT="8072" + +## +### WKHTMLTOPDF download links +## === Centos 7 x64 & x32 === (for other distributions please replace these two links, +## in order to have correct version of wkhtmltopdf installed, for a danger note refer to +## https://github.com/odoo/odoo/wiki/Wkhtmltopdf ): +## https://www.odoo.com/documentation/13.0/setup/install.html#debian-ubuntu + +WKHTMLTOX_X64=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos7.x86_64.rpm +WKHTMLTOX_X32=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos7.i686.rpm + +#-------------------------------------------------- +# Check run script as root +#-------------------------------------------------- +if [ $EUID != 0 ]; then + echo -ne "\nPlease re-run this script with sudo or as root\n\n" + exit 1 +fi + +#-------------------------------------------------- +# Update Server +#-------------------------------------------------- +echo -e "\n---- Update Server ----" +yum update -y +yum upgrade -y + +#-------------------------------------------------- +# Install Dependencies & Tools +#-------------------------------------------------- +echo -e "\n--- Dependencies & Tools --" +yum install -y centos-release-scl gcc epel-release +yum install -y wget git libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel nodejs + +# ODOO < 12 use less and ODOO >=12 use sass (libsass) +if [ ${OE_VERSION//./} -lt 120 ]; then + echo -e "\n--- Install other required packages" + npm install -g less + npm install -g less-plugin-clean-css +fi + +#-------------------------------------------------- +# Install PostgreSQL Server +#-------------------------------------------------- +# CentOS 7 includes PostgreSQL 9.2 in its default repositories +# Install PostgreSQL 10 from Software Collections (SCL) +# https://wiki.centos.org/AdditionalResources/Repositories/SCL +# https://www.softwarecollections.org/en/scls/rhscl/rh-postgresql10/ + +echo -e "\n---- Install PostgreSQL Server from SCL ----" +yum -y install rh-postgresql10-postgresql-server rh-postgresql10-postgresql-devel +scl enable rh-postgresql10 "postgresql-setup --initdb --unit rh-postgresql10-postgresql" +pgdata_path=/var/opt/rh/rh-postgresql10/lib/pgsql/data +grep -q '^local\s' $pgdata_path/pg_hba.conf | echo -e "local all all trust" | tee -a $pgdata_path/pg_hba.conf +sed -i.bak 's/\(^local\s*\w*\s*\w*\s*\)\(peer$\)/\1trust/' $pgdata_path/pg_hba.conf +systemctl enable rh-postgresql10-postgresql +systemctl start rh-postgresql10-postgresql + +echo -e "\n---- Creating the ODOO PostgreSQL User ----" +su - postgres -c "scl enable rh-postgresql10 -- psql -c 'create user $OE_USER createdb'" + +#-------------------------------------------------- +# Install Python +#-------------------------------------------------- +# https://wiki.centos.org/AdditionalResources/Repositories/SCL +# https://www.softwarecollections.org/en/scls/rhscl/rh-python36/ + +echo -e "\n--- Installing Python 3 from SCL --" +yum install -y rh-python36 + +echo -e "\n---- Install python packages/requirements ----" +scl enable rh-python36 -- pip3.6 install pip -U +scl enable rh-python36 -- pip3.6 install wheel +scl enable rh-python36 -- pip3.6 install -r https://github.com/odoo/odoo/raw/${OE_VERSION}/requirements.txt + +echo -e "\n---- Installing rtlcss for LTR support ----" +npm install -g rtlcss + +#-------------------------------------------------- +# Install Wkhtmltopdf if needed +#-------------------------------------------------- +if [ $INSTALL_WKHTMLTOPDF = "True" ]; then + echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 13 ----" + #pick up correct one from x64 & x32 versions: + if [ "$(getconf LONG_BIT)" == "64" ];then + _url=$WKHTMLTOX_X64 + else + _url=$WKHTMLTOX_X32 + fi + yum localinstall -y $_url + +else + echo "Wkhtmltopdf isn't installed due to the choice of the user!" +fi + +echo -e "\n---- Create ODOO system user ----" +adduser --system --shell=/bin/bash --home-dir=$OE_HOME --user-group $OE_USER + +#The user should also be added to the wheel group. +usermod -aG wheel $OE_USER + +echo -e "\n---- Create Log directory ----" +mkdir /var/log/$OE_USER +chown $OE_USER:$OE_USER /var/log/$OE_USER + +#-------------------------------------------------- +# Install ODOO +#-------------------------------------------------- +echo -e "\n==== Installing ODOO Server ====" +git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/odoo $OE_HOME_EXT/ + +if [ $IS_ENTERPRISE = "True" ]; then + # Odoo Enterprise install! + su $OE_USER -c "mkdir $OE_HOME/enterprise" + su $OE_USER -c "mkdir $OE_HOME/enterprise/addons" + + GITHUB_RESPONSE=$(git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1) + while [[ $GITHUB_RESPONSE == *"Authentication"* ]]; do + echo "------------------------WARNING------------------------------" + echo "Your authentication with Github has failed! Please try again." + printf "In order to clone and install the Odoo enterprise version you \nneed to be an offical Odoo partner and you need access to\nhttp://github.com/odoo/enterprise.\n" + echo "TIP: Press ctrl+c to stop this script." + echo "-------------------------------------------------------------" + echo " " + GITHUB_RESPONSE=$(git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1) + done + + echo -e "\n---- Added Enterprise code under $OE_HOME/enterprise/addons ----" + echo -e "\n---- Installing Enterprise specific libraries ----" + scl enable rh-python36 -- pip3.6 install num2words ofxparse dbfread ebaysdk firebase_admin pyOpenSSL +fi + +echo -e "\n---- Create custom module directory ----" +mkdir -p $OE_HOME/custom/addons + +echo -e "\n---- Setting permissions on home folder ----" +chown -R $OE_USER:$OE_USER $OE_HOME/ + +echo -e "* Create server config file" +touch /etc/${OE_CONFIG}.conf +echo -e "* Creating server config file" +su root -c "printf '[options] \n; This is the password that allows database operations:\n' >> /etc/${OE_CONFIG}.conf" +if [ $GENERATE_RANDOM_PASSWORD = "True" ]; then + echo -e "* Generating random admin password" + OE_SUPERADMIN=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) +fi +su root -c "printf 'admin_passwd = ${OE_SUPERADMIN}\n' >> /etc/${OE_CONFIG}.conf" +if [ ${OE_VERSION//./} -ge 120 ]; then + su root -c "printf 'http_port = ${OE_PORT}\n' >> /etc/${OE_CONFIG}.conf" +else + su root -c "printf 'xmlrpc_port = ${OE_PORT}\n' >> /etc/${OE_CONFIG}.conf" +fi +su root -c "printf 'logfile = /var/log/${OE_USER}/${OE_CONFIG}.log\n' >> /etc/${OE_CONFIG}.conf" + +if [ $IS_ENTERPRISE = "True" ]; then + su root -c "printf 'addons_path=${OE_HOME}/enterprise/addons,${OE_HOME_EXT}/addons\n' >> /etc/${OE_CONFIG}.conf" +else + su root -c "printf 'addons_path=${OE_HOME_EXT}/addons,${OE_HOME}/custom/addons\n' >> /etc/${OE_CONFIG}.conf" +fi +chown $OE_USER:$OE_USER /etc/${OE_CONFIG}.conf +chmod 640 /etc/${OE_CONFIG}.conf + +echo -e "* Create startup file" +su root -c "echo '#!/bin/sh' >> $OE_HOME_EXT/start.sh" +su root -c "echo 'su - $OE_USER -c \"scl enable rh-python36 -- python3 $OE_HOME_EXT/odoo-bin --config=/etc/${OE_CONFIG}.conf\"' >> $OE_HOME_EXT/start.sh" +chmod 755 $OE_HOME_EXT/start.sh + +#-------------------------------------------------- +# Adding ODOO as a deamon (initscript) +#-------------------------------------------------- +echo -e "* Create init file" +cat > /etc/systemd/system/$OE_CONFIG.service << EOF +[Unit] +Description=$OE_CONFIG +Requires=rh-postgresql10 +After=network.target rh-postgresql10 + +[Service] +Type=simple +SyslogIdentifier=$OE_CONFIG +PermissionsStartOnly=true +User=$OE_USER +Group=$OE_USER +ExecStart=/usr/bin/scl enable rh-python36 -- $OE_HOME_EXT/odoo-bin -c /etc/$OE_CONFIG.conf +StandardOutput=journal+console + +[Install] +WantedBy=multi-user.target +EOF + +systemctl daemon-reload +systemctl enable $OE_CONFIG + +#-------------------------------------------------- +# Install Nginx if needed +#-------------------------------------------------- +if [ $INSTALL_NGINX = "True" ]; then + echo -e "\n---- Installing and setting up Nginx ----" + yum install nginx -y + systemctl enable nginx + systemctl start nginx + + mkdir /etc/nginx/sites-available + + cat < ~/odoo.conf + server { + listen 80; + + # set proper server name after domain set + server_name $WEBSITE_NAME; + + # Add Headers for odoo proxy mode + proxy_set_header X-Forwarded-Host \$host; + proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto \$scheme; + proxy_set_header X-Real-IP \$remote_addr; + add_header X-Frame-Options "SAMEORIGIN"; + add_header X-XSS-Protection "1; mode=block"; + proxy_set_header X-Client-IP \$remote_addr; + proxy_set_header HTTP_X_FORWARDED_HOST \$remote_addr; + + # odoo log files + access_log /var/log/nginx/$OE_USER-access.log; + error_log /var/log/nginx/$OE_USER-error.log; + + # increase proxy buffer size + proxy_buffers 16 64k; + proxy_buffer_size 128k; + + proxy_read_timeout 900s; + proxy_connect_timeout 900s; + proxy_send_timeout 900s; + + # force timeouts if the backend dies + proxy_next_upstream error timeout invalid_header http_500 http_502 + http_503; + + types { + text/less less; + text/scss scss; + } + + # enable data compression + gzip on; + gzip_min_length 1100; + gzip_buffers 4 32k; + gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript application/pdf image/jpeg image/png; + gzip_vary on; + client_header_buffer_size 4k; + large_client_header_buffers 4 64k; + client_max_body_size 0; + + location / { + proxy_pass http://127.0.0.1:$OE_PORT; + # by default, do not forward anything + proxy_redirect off; + } + + location /longpolling { + proxy_pass http://127.0.0.1:$LONGPOLLING_PORT; + } + location ~* .(js|css|png|jpg|jpeg|gif|ico)$ { + expires 2d; + proxy_pass http://127.0.0.1:$OE_PORT; + add_header Cache-Control "public, no-transform"; + } + # cache some static data in memory for 60mins. + location ~ /[a-zA-Z0-9_-]*/static/ { + proxy_cache_valid 200 302 60m; + proxy_cache_valid 404 1m; + proxy_buffering on; + expires 864000; + proxy_pass http://127.0.0.1:$OE_PORT; + } + } +EOF + +mv ~/odoo.conf /etc/nginx/sites-available/ +ln -s /etc/nginx/sites-available/odoo.conf /etc/nginx/conf.d/odoo.conf +echo -e "* SELinux permission" +setsebool -P httpd_can_network_connect 1 +restorecon /etc/nginx/conf.d/* +systemctl reload nginx +su root -c "printf 'proxy_mode = True\n' >> /etc/${OE_CONFIG}.conf" + +# Firewalld by default and blocks access to ports 80 and 443 +echo -e "* enables ports 80 and 443" +firewall-cmd --zone=public --permanent --add-service=http +firewall-cmd --zone=public --permanent --add-service=https +firewall-cmd --reload +echo "Done! The Nginx server is up and running. Configuration can be found at /etc/nginx/sites-available/odoo.conf" +else + echo "Nginx isn't installed due to choice of the user!" +fi + +echo -e "* Starting Odoo Service" +systemctl start $OE_CONFIG +echo -e "* Opening Odoo Port in firewalld" +firewall-cmd --permanent --zone=public --add-port=${OE_PORT}/tcp +firewall-cmd --reload +echo "-----------------------------------------------------------" +echo "Done! The Odoo server is up and running. Specifications:" +echo "Port: $OE_PORT" +echo "User service: $OE_USER" +echo "Configuraton file location: /etc/${OE_CONFIG}.conf" +echo "Logfile location: /var/log/$OE_USER" +echo "User PostgreSQL: $OE_USER" +echo "Code location: $OE_USER" +echo "Addons folder: $OE_USER/$OE_CONFIG/addons/" +echo "Password superadmin (database): $OE_SUPERADMIN" +echo "Start Odoo service: sudo systemctl start $OE_CONFIG" +echo "Stop Odoo service: sudo systemctl stop $OE_CONFIG" +echo "Restart Odoo service: sudo systemctl restart $OE_CONFIG" +if [ $INSTALL_NGINX = "True" ]; then + echo "Nginx configuration file: /etc/nginx/sites-available/odoo" +fi +echo "-----------------------------------------------------------" From 0985ae6d57b4d99255f715d3d31293be45b6ec0f Mon Sep 17 00:00:00 2001 From: Swapnesh Shah Date: Wed, 16 Sep 2020 23:04:01 +0530 Subject: [PATCH 06/17] [FIX] Fixed typo --- odoo_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo_install.sh b/odoo_install.sh index 51c4f587..782ec8d9 100644 --- a/odoo_install.sh +++ b/odoo_install.sh @@ -369,7 +369,7 @@ echo "-----------------------------------------------------------" echo "Done! The Odoo server is up and running. Specifications:" echo "Port: $OE_PORT" echo "User service: $OE_USER" -echo "Configuraton file location: /etc/${OE_CONFIG}.conf" +echo "Configuration file location: /etc/${OE_CONFIG}.conf" echo "Logfile location: /var/log/$OE_USER" echo "User PostgreSQL: $OE_USER" echo "Code location: $OE_USER" From 8c4f52f41b434a83aa4191e5c503fcb2f621738a Mon Sep 17 00:00:00 2001 From: billal mesloub Date: Thu, 3 Oct 2024 21:33:21 +0200 Subject: [PATCH 07/17] Create codeql.yml Signed-off-by: billal mesloub --- .github/workflows/codeql.yml | 90 ++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..a5f6ebae --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,90 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL Advanced" + +on: + push: + branches: [ "16.0" ] + pull_request: + branches: [ "16.0" ] + schedule: + - cron: '16 0 * * 2' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' + # Use `c-cpp` to analyze code written in C, C++ or both + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + # If the analyze step fails for one of the languages you are analyzing with + # "We were unable to automatically build your code", modify the matrix above + # to set the build mode to "manual" for that language. Then modify this step + # to build your code. + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - if: matrix.build-mode == 'manual' + shell: bash + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" From 5921651208250ecf9a5ba7233aaa64c4c1df1795 Mon Sep 17 00:00:00 2001 From: billal mesloub Date: Fri, 4 Oct 2024 00:03:05 +0200 Subject: [PATCH 08/17] Update odoo_install_debian.sh Signed-off-by: billal mesloub --- odoo_install_debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo_install_debian.sh b/odoo_install_debian.sh index 425ad77e..a7bb3b0b 100644 --- a/odoo_install_debian.sh +++ b/odoo_install_debian.sh @@ -21,7 +21,7 @@ OE_HOME_EXT="/$OE_USER/${OE_USER}-server" # The default port where this Odoo instance will run under (provided you use the command -c in the terminal) # Set to true if you want to install it, false if you don't need it or have it already installed. INSTALL_WKHTMLTOPDF="True" -# Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this.) +# Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this) OE_PORT="8069" # Choose the Odoo version which you want to install. For example: 13.0, 12.0, 11.0 or saas-18. When using 'master' the master version will be installed. # IMPORTANT! This script contains extra libraries that are specifically needed for Odoo 13.0 From 4848f2b7808e544f62b30745dab78a3fdb9e1ca8 Mon Sep 17 00:00:00 2001 From: billal mesloub Date: Fri, 4 Oct 2024 00:03:41 +0200 Subject: [PATCH 09/17] Update odoo_install_centos7.sh Signed-off-by: billal mesloub --- odoo_install_centos7.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo_install_centos7.sh b/odoo_install_centos7.sh index fb49ce51..eb0640a1 100644 --- a/odoo_install_centos7.sh +++ b/odoo_install_centos7.sh @@ -21,7 +21,7 @@ OE_HOME_EXT="/$OE_USER/${OE_USER}-server" # The default port where this Odoo instance will run under (provided you use the command -c in the terminal) # Set to true if you want to install it, false if you don't need it or have it already installed. INSTALL_WKHTMLTOPDF="True" -# Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this.) +# Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this) OE_PORT="8069" # Choose the Odoo version which you want to install. For example: 13.0, 12.0, 11.0 or saas-18. When using 'master' the master version will be installed. # IMPORTANT! This script contains extra libraries that are specifically needed for Odoo 13.0 From 4be3e0228a925cfd91033a72d1003e13843277f6 Mon Sep 17 00:00:00 2001 From: billal mesloub Date: Fri, 4 Oct 2024 00:04:06 +0200 Subject: [PATCH 10/17] Update odoo_install.sh Signed-off-by: billal mesloub --- odoo_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo_install.sh b/odoo_install.sh index c50baee2..5b8e317a 100644 --- a/odoo_install.sh +++ b/odoo_install.sh @@ -20,7 +20,7 @@ OE_HOME_EXT="/$OE_USER/${OE_USER}-server" # The default port where this Odoo instance will run under (provided you use the command -c in the terminal) # Set to true if you want to install it, false if you don't need it or have it already installed. INSTALL_WKHTMLTOPDF="True" -# Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this.) +# Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this) OE_PORT="8069" # Choose the Odoo version which you want to install. For example: 16.0, 15.0, 14.0 or saas-22. When using 'master' the master version will be installed. # IMPORTANT! This script contains extra libraries that are specifically needed for Odoo 17.0 From 773aafbffc614b6108acc9cde8d6656234b84a47 Mon Sep 17 00:00:00 2001 From: billal mesloub Date: Fri, 4 Oct 2024 00:05:11 +0200 Subject: [PATCH 11/17] Update README.md Signed-off-by: billal mesloub --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1fbafc82..4620b6f5 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ sudo ./odoo_install.sh ## Where should I host Odoo? There are plenty of great services that offer good hosting. The script has been tested with a few major players such as [Google Cloud](https://cloud.google.com/), [Hetzner](https://www.hetzner.com/), [Amazon AWS](https://aws.amazon.com/) and [DigitalOcean](https://www.digitalocean.com/products/droplets/). -If you'd like you can use my [DigitalOcean referral link](https://m.do.co/c/d605cc420682) which gives you a 200$ voucher for free for the first 60 days. +If you'd like you can use my [DigitalOcean referral link](https://m.do.co/c/d605cc420682) which gives you a 200$ voucher for free for the first 60 days ## Minimal server requirements While technically you can run an Odoo instance on 1GB (1024MB) of RAM it is absolutely not advised. A Linux instance typically uses 300MB-500MB and the rest has to be split among Odoo, postgreSQL and others. If you install an Odoo you should make sure to use at least 2GB of RAM. This script might fail with less resources too. From 79e598ae51bd06e9124bd510d97c0f5bafdb3ba5 Mon Sep 17 00:00:00 2001 From: billal mesloub Date: Fri, 4 Oct 2024 00:06:24 +0200 Subject: [PATCH 12/17] Update and rename .gitignore to gitignore Signed-off-by: billal mesloub --- .gitignore | 4 ---- gitignore | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 .gitignore create mode 100644 gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index f56ec4b5..00000000 --- a/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -*~ -*.swp -*.tmp -*.bak diff --git a/gitignore b/gitignore new file mode 100644 index 00000000..93a9571c --- /dev/null +++ b/gitignore @@ -0,0 +1,4 @@ +*~ +* swp +* tmp +* bak From 536d4fe181f2265424c48f169f96d3b7bc38a5eb Mon Sep 17 00:00:00 2001 From: billal mesloub Date: Fri, 4 Oct 2024 00:07:12 +0200 Subject: [PATCH 13/17] Rename FUNDING.yml to FUNDING.yml. Signed-off-by: billal mesloub --- .github/{FUNDING.yml => FUNDING.yml.} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{FUNDING.yml => FUNDING.yml.} (100%) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml. similarity index 100% rename from .github/FUNDING.yml rename to .github/FUNDING.yml. From f3dfc086d421bf5a3340ea22cc149b2a4b9737ca Mon Sep 17 00:00:00 2001 From: billal mesloub Date: Fri, 4 Oct 2024 00:07:29 +0200 Subject: [PATCH 14/17] Rename FUNDING.yml. to FUNDING.yml Signed-off-by: billal mesloub --- .github/{FUNDING.yml. => FUNDING.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{FUNDING.yml. => FUNDING.yml} (100%) diff --git a/.github/FUNDING.yml. b/.github/FUNDING.yml similarity index 100% rename from .github/FUNDING.yml. rename to .github/FUNDING.yml From 69aef0bbb59c1a8069213328d16036756f46ff8b Mon Sep 17 00:00:00 2001 From: billal mesloub <145295387+meslubi2021@users.noreply.github.com> Date: Wed, 1 Jan 2025 22:08:16 +0100 Subject: [PATCH 15/17] Create SECURITY.md Signed-off-by: billal mesloub <145295387+meslubi2021@users.noreply.github.com> --- SECURITY.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..034e8480 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,21 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 5.1.x | :white_check_mark: | +| 5.0.x | :x: | +| 4.0.x | :white_check_mark: | +| < 4.0 | :x: | + +## Reporting a Vulnerability + +Use this section to tell people how to report a vulnerability. + +Tell them where to go, how often they can expect to get an update on a +reported vulnerability, what to expect if the vulnerability is accepted or +declined, etc. From a94a0771b1fab36088c09599af9cc0979c4b5838 Mon Sep 17 00:00:00 2001 From: billal mesloub <145295387+meslubi2021@users.noreply.github.com> Date: Wed, 1 Jan 2025 22:09:19 +0100 Subject: [PATCH 16/17] Update LICENSE Signed-off-by: billal mesloub <145295387+meslubi2021@users.noreply.github.com> --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 5116bb6b..0d7944d2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Yenthe V.G +Copyright (c) 2025-2004 Unity Odoo-Billal-Mesloub Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 756d83f2a949c4f9caed869729753748856d06cd Mon Sep 17 00:00:00 2001 From: Billal Mesloub <145295387+meslubi2021@users.noreply.github.com> Date: Sat, 1 Feb 2025 19:56:03 +0100 Subject: [PATCH 17/17] Update LICENSE Signed-off-by: Billal Mesloub <145295387+meslubi2021@users.noreply.github.com> --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 0d7944d2..92a258a6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025-2004 Unity Odoo-Billal-Mesloub +Copyright (c) 2025-2004 Unity Odoo-Billal Mesloub Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal