pull/428/merge
Afriza Gilleon Ginting 1 year ago committed by GitHub
commit d86a18e6a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -11,7 +11,7 @@ If you set the parameter ```INSTALL_NGINX``` to ```True``` you should also confi
##### 1. Download the script: ##### 1. Download the script:
``` ```
sudo wget https://raw.githubusercontent.com/Yenthe666/InstallScript/17.0/odoo_install.sh sudo wget https://raw.githubusercontent.com/Yenthe666/InstallScript/16.0/odoo_install.sh
``` ```
##### 2. Modify the parameters as you wish. ##### 2. Modify the parameters as you wish.
There are a few things you can configure, this is the most used list:<br/> There are a few things you can configure, this is the most used list:<br/>

@ -100,9 +100,6 @@ echo -e "\n--- Installing Python 3 + pip3 --"
sudo apt-get install python3 python3-pip sudo apt-get install python3 python3-pip
sudo apt-get install git python3-cffi build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libpng-dev libjpeg-dev gdebi -y sudo apt-get install git python3-cffi build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libpng-dev libjpeg-dev gdebi -y
echo -e "\n---- Install python packages/requirements ----"
sudo -H pip3 install -r https://github.com/odoo/odoo/raw/${OE_VERSION}/requirements.txt
echo -e "\n---- Installing nodeJS NPM and rtlcss for LTR support ----" echo -e "\n---- Installing nodeJS NPM and rtlcss for LTR support ----"
sudo apt-get install nodejs npm -y sudo apt-get install nodejs npm -y
sudo npm install -g rtlcss sudo npm install -g rtlcss
@ -140,6 +137,8 @@ sudo adduser --system --quiet --shell=/bin/bash --home=$OE_HOME --gecos 'ODOO' -
#The user should also be added to the sudo'ers group. #The user should also be added to the sudo'ers group.
sudo adduser $OE_USER sudo sudo adduser $OE_USER sudo
echo -e "\n---- Create Log directory ----" echo -e "\n---- Create Log directory ----"
sudo mkdir /var/log/$OE_USER sudo mkdir /var/log/$OE_USER
sudo chown $OE_USER:$OE_USER /var/log/$OE_USER sudo chown $OE_USER:$OE_USER /var/log/$OE_USER
@ -180,6 +179,18 @@ 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"
sudo su $OE_USER -c "mkdir $OE_HOME/custom/addons" sudo su $OE_USER -c "mkdir $OE_HOME/custom/addons"
#--------------------------------------------------
# Install Dependencies of ODOO
#--------------------------------------------------
echo -e "\n--- Installing Python 3 + pip3 --"
# Path to the virtual environment
venv_path="/$OE_HOME/$OE_USER-venv"
#Create a new Python virtual environment for Odoo
sudo su $OE_USER -c "python3 -m venv $venv_path"
# Activate the virtual environment using sudo
echo -e "\n---- Install python packages/requirements ----"
sudo -H -u "$OE_USER" bash -c "source $venv_path/bin/activate && pip3 install wheel && pip3 install -r $OE_HOME_EXT/requirements.txt && deactivate"
echo -e "\n---- Setting permissions on home folder ----" echo -e "\n---- Setting permissions on home folder ----"
sudo chown -R $OE_USER:$OE_USER $OE_HOME/* sudo chown -R $OE_USER:$OE_USER $OE_HOME/*
@ -219,79 +230,34 @@ sudo chmod 755 $OE_HOME_EXT/start.sh
#-------------------------------------------------- #--------------------------------------------------
echo -e "* Create init file" echo -e "* Create init file"
cat <<EOF > ~/$OE_CONFIG cat <<EOF > ~/$OE_USER.service
#!/bin/sh [Unit]
### BEGIN INIT INFO Description=$OE_USER
# Provides: $OE_CONFIG Requires=postgresql.service
# Required-Start: \$remote_fs \$syslog After=network.target postgresql.service
# Required-Stop: \$remote_fs \$syslog
# Should-Start: \$network [Service]
# Should-Stop: \$network Type=simple
# Default-Start: 2 3 4 5 SyslogIdentifier=$OE_USER
# Default-Stop: 0 1 6 PermissionsStartOnly=true
# Short-Description: Enterprise Business Applications User=$OE_USER
# Description: ODOO Business Applications Group=$OE_USER
### END INIT INFO ExecStart=$OE_HOME/$OE_USER-venv/bin/python3 $OE_HOME/$OE_CONFIG/odoo-bin -c /etc/$OE_CONFIG.conf
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin StandardOutput=journal+console
DAEMON=$OE_HOME_EXT/odoo-bin Restart=always
NAME=$OE_CONFIG RestartSec=5
DESC=$OE_CONFIG
# Specify the user name (Default: odoo).
USER=$OE_USER [Install]
# Specify an alternate config file (Default: /etc/openerp-server.conf). WantedBy=multi-user.target
CONFIGFILE="/etc/${OE_CONFIG}.conf"
# pidfile
PIDFILE=/var/run/\${NAME}.pid
# Additional options that are passed to the Daemon.
DAEMON_OPTS="-c \$CONFIGFILE"
[ -x \$DAEMON ] || exit 0
[ -f \$CONFIGFILE ] || exit 0
checkpid() {
[ -f \$PIDFILE ] || return 1
pid=\`cat \$PIDFILE\`
[ -d /proc/\$pid ] && return 0
return 1
}
case "\${1}" in
start)
echo -n "Starting \${DESC}: "
start-stop-daemon --start --quiet --pidfile \$PIDFILE \
--chuid \$USER --background --make-pidfile \
--exec \$DAEMON -- \$DAEMON_OPTS
echo "\${NAME}."
;;
stop)
echo -n "Stopping \${DESC}: "
start-stop-daemon --stop --quiet --pidfile \$PIDFILE \
--oknodo
echo "\${NAME}."
;;
restart|force-reload)
echo -n "Restarting \${DESC}: "
start-stop-daemon --stop --quiet --pidfile \$PIDFILE \
--oknodo
sleep 1
start-stop-daemon --start --quiet --pidfile \$PIDFILE \
--chuid \$USER --background --make-pidfile \
--exec \$DAEMON -- \$DAEMON_OPTS
echo "\${NAME}."
;;
*)
N=/etc/init.d/\$NAME
echo "Usage: \$NAME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
EOF EOF
echo -e "* Security Init File" sudo mv ~/$OE_USER.service /etc/systemd/system/$OE_USER.service
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" echo -e "* Start ODOO on Startup"
sudo update-rc.d $OE_CONFIG defaults sudo systemctl daemon-reload
# enable odoo
sudo systemctl enable --now $OE_USER
#-------------------------------------------------- #--------------------------------------------------
# Install Nginx if needed # Install Nginx if needed

Loading…
Cancel
Save