Browse Source

updating files

master
Samir S 2 years ago
parent
commit
15632330f7
  1. 2
      CloudronManifest.json
  2. 6
      Dockerfile
  3. 129
      odoo12CE_install.sh
  4. 2
      sql_db.py

2
CloudronManifest.json

@ -1,5 +1,5 @@
{
"id": "com.odoo-ce.community.cloudronapp",
"id": "com.odoo12ce.community.cloudronapp",
"title": "Odoo Community",
"author": "Odoo",
"description": "file://DESCRIPTION.md",

6
Dockerfile

@ -4,11 +4,11 @@ MAINTAINER Samir Saidani <saidani@babel.coop>
RUN mkdir -p /app/code /app/data
WORKDIR /app/code
COPY ./odoo10CE_install.sh /app/code/
COPY ./odoo12CE_install.sh /app/code/
RUN /app/code/odoo10CE_install.sh
RUN /app/code/odoo12CE_install.sh
RUN wget -O - https://nightly.odoo.com/odoo.key | apt-key add -
RUN echo "deb http://nightly.odoo.com/10.0/nightly/deb/ ./" >> /etc/apt/sources.list.d/odoo.list
RUN echo "deb http://nightly.odoo.com/12.0/nightly/deb/ ./" >> /etc/apt/sources.list.d/odoo.list
RUN apt-get update && apt-get -y install wkhtmltopdf && rm -r /var/cache/apt /var/lib/apt/lists
# patch to accept a db name

129
odoo10CE_install.sh → odoo12CE_install.sh

@ -1,10 +1,10 @@
#!/bin/bash
# modified for cloudron - Samir Saidani
################################################################################
# Script for installing Odoo V10 on Ubuntu 16.04, 15.04, 14.04 (could be used for other version too)
# 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 14.04 server. It can install multiple Odoo instances
# 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:
@ -14,40 +14,43 @@
# Execute the script to install Odoo:
# ./odoo-install
################################################################################
##fixed parameters
#odoo
OE_USER="odoo"
#OE_HOME="/app/code/$OE_USER"
OE_HOME="/app/code"
OE_HOME_EXT="$OE_HOME/${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.
# 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="False"
#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: 10.0, 9.0, 8.0, 7.0 or saas-6. When using 'trunk' the master version will be installed.
#IMPORTANT! This script contains extra libraries that are specifically needed for Odoo 10.0
OE_VERSION="10.0"
# Set this to True if you want to install Odoo 10 Enterprise!
# 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
# set the superadmin password
OE_SUPERADMIN="admin"
OE_CONFIG="${OE_USER}"
##
### 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
## https://www.odoo.com/documentation/8.0/setup/install.html#deb ):
#WKHTMLTOX_X64=http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-jessie-amd64.deb
#WKHTMLTOX_X32=http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-jessie-i386.deb
WKHTMLTOX_X64=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.2.1/wkhtmltox-0.12.2.1_linux-jessie-amd64.deb
WKHTMLTOX_X32=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.2.1/wkhtmltox-0.12.2.1_linux-jessie-i386.deb
## in order to have correct version of wkhtmltopdf installed, for a danger note refer to
## https://github.com/odoo/odoo/wiki/Wkhtmltopdf ):
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
#--------------------------------------------------
# Update Server
#--------------------------------------------------
echo -e "\n---- Update Server ----"
# add-apt-repository can install add-apt-repository Ubuntu 18.x
sudo apt-get install software-properties-common -y
# universe package is for Ubuntu 18.x
sudo add-apt-repository universe
# libpng12-0 dependency for wkhtmltopdf
sudo add-apt-repository "deb http://mirrors.kernel.org/ubuntu/ xenial main"
sudo apt-get update
sudo apt-mark hold postfix phpmyadmin
sudo apt-get upgrade -y
@ -64,28 +67,28 @@ sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true
#--------------------------------------------------
# Install Dependencies
#--------------------------------------------------
echo -e "\n---- Install tool packages ----"
sudo apt-get install wget git python-pip gdebi-core libjpeg62-turbo -y
echo -e "\n---- Install python packages ----"
sudo apt-get install python-dateutil python-feedparser python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-decorator python-requests python-passlib python-pil -y python-suds
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
sudo apt-get install python3-pypdf2 -y
echo -e "\n---- Upgrade pip ----"
pip install --upgrade pip
echo -e "\n---- Install python libraries ----"
sudo pip install gdata psycogreen ofxparse XlsxWriter
echo -e "\n---- Install python packages/requirements ----"
sudo pip3 install -r https://github.com/odoo/odoo/raw/${OE_VERSION}/requirements.txt
echo -e "\n--- Install other required packages"
sudo apt-get install node-clean-css -y
sudo apt-get install node-less -y
sudo apt-get install python-gevent -y
echo -e "\n---- Installing nodeJS NPM and rtlcss for LTR support ----"
sudo apt-get install nodejs npm -y
#sudo npm install -g rtlcss
echo -e "\n---- Installing modules necessary for mysqldb ----"
sudo pip3 install pyserial
#--------------------------------------------------
# Install Wkhtmltopdf if needed
#--------------------------------------------------
if [ $INSTALL_WKHTMLTOPDF = "True" ]; then
echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 10 ----"
echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 12 ----"
#pick up correct one from x64 & x32 versions:
if [ "`getconf LONG_BIT`" == "64" ];then
_url=$WKHTMLTOX_X64
@ -100,7 +103,7 @@ if [ $INSTALL_WKHTMLTOPDF = "True" ]; then
else
echo "Wkhtmltopdf isn't installed due to the choice of the user!"
fi
echo -e "\n---- Create ODOO system 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.
@ -108,6 +111,7 @@ sudo adduser $OE_USER sudo
sudo chown -R $OE_USER:$OE_USER /app/code
sudo chown -R $OE_USER:$OE_USER /app/data
echo -e "\n---- Create Log directory ----"
sudo mkdir /var/log/$OE_USER
sudo chown $OE_USER:$OE_USER /var/log/$OE_USER
@ -125,39 +129,47 @@ if [ $IS_ENTERPRISE = "True" ]; then
sudo su $OE_USER -c "mkdir $OE_HOME/enterprise"
sudo su $OE_USER -c "mkdir $OE_HOME/enterprise/addons"
echo -e "\n---- Adding Enterprise code under $OE_HOME/enterprise/addons ----"
sudo git clone --depth 1 --branch 10.0 https://www.github.com/odoo/enterprise "$OE_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)
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 $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 ----"
sudo apt-get install nodejs npm
sudo pip3 install num2words ofxparse
sudo npm install -g less
sudo npm install -g less-plugin-clean-css
else
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 $OE_USER -c "mkdir $OE_HOME/extra-addons"
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 $OE_USER -c "mkdir $OE_HOME/extra-addons"
echo -e "\n---- Setting permissions on home folder ----"
sudo chown -R $OE_USER:$OE_USER $OE_HOME/*
echo -e "* Create server config file"
#sudo cp $OE_HOME_EXT/debian/odoo.conf /app/data/${OE_CONFIG}.conf
sudo su $OE_USER -c "echo '[options]' >> /app/data/${OE_CONFIG}.conf"
sudo touch /app/data/${OE_CONFIG}.conf
sudo chown $OE_USER:$OE_USER /app/data/${OE_CONFIG}.conf
sudo chmod 640 /app/data/${OE_CONFIG}.conf
echo -e "* Change server config file"
sudo sed -i s/"db_user = .*"/"db_user = $OE_USER"/g /app/data/${OE_CONFIG}.conf
sudo sed -i s/"; admin_passwd.*"/"admin_passwd = $OE_SUPERADMIN"/g /app/data/${OE_CONFIG}.conf
sudo su root -c "echo '[options]' > /app/data/${OE_CONFIG}.conf"
sudo su root -c "echo 'logfile = /var/log/$OE_USER/$OE_CONFIG$1.log' >> /app/data/${OE_CONFIG}.conf"
if [ $IS_ENTERPRISE = "True" ]; then
sudo su root -c "echo 'addons_path=$OE_HOME/enterprise/addons,$OE_HOME_EXT/addons' >> /app/data/${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' >> /app/data/${OE_CONFIG}.conf"
sudo su root -c "printf 'admin_passwd = ${OE_SUPERADMIN}\n' >> /app/data/${OE_CONFIG}.conf"
sudo su root -c "printf 'xmlrpc_port = ${OE_PORT}\n' >> /app/data/${OE_CONFIG}.conf"
sudo su root -c "printf 'logfile =/var/log/${OE_USER}/${OE_CONFIG}.log\n' >> /app/data/${OE_CONFIG}.conf"
if [ $IS_ENTERPRISE = "True" ]; then
sudo su root -c "printf 'addons_path=${OE_HOME}/enterprise/addons,${OE_HOME_EXT}/addons\n' >> /app/data/${OE_CONFIG}.conf"
else
# sudo su root -c "echo 'addons_path=$OE_HOME_EXT/addons,$OE_HOME/custom/addons' >> /etc/${OE_CONFIG}.conf"
sudo su root -c "echo 'addons_path=$OE_HOME_EXT/addons,$OE_HOME/extra-addons' >> /app/data/${OE_CONFIG}.conf"
sudo su root -c "printf 'addons_path=${OE_HOME_EXT}/addons,${OE_HOME}/extra-addons\n' >> /app/data/${OE_CONFIG}.conf"
fi
echo -e "* Create startup file"
@ -187,16 +199,12 @@ PATH=/bin:/sbin:/usr/bin
DAEMON=$OE_HOME_EXT/odoo-bin
NAME=$OE_CONFIG
DESC=$OE_CONFIG
# Specify the user name (Default: odoo).
USER=$OE_USER
# Specify an alternate config file (Default: /etc/openerp-server.conf).
CONFIGFILE="/app/data/${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
@ -207,7 +215,6 @@ pid=\`cat \$PIDFILE\`
[ -d /proc/\$pid ] && return 0
return 1
}
case "\${1}" in
start)
echo -n "Starting \${DESC}: "
@ -222,7 +229,6 @@ start-stop-daemon --stop --quiet --pidfile \$PIDFILE \
--oknodo
echo "\${NAME}."
;;
restart|force-reload)
echo -n "Restarting \${DESC}: "
start-stop-daemon --stop --quiet --pidfile \$PIDFILE \
@ -238,7 +244,6 @@ N=/etc/init.d/\$NAME
echo "Usage: \$NAME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
EOF
@ -248,9 +253,6 @@ 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 "* Change default xmlrpc port"
sudo su root -c "echo 'xmlrpc_port = $OE_PORT' >> /app/data/${OE_CONFIG}.conf"
echo -e "* Start ODOO on Startup"
sudo update-rc.d $OE_CONFIG defaults
@ -267,6 +269,3 @@ 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 "-----------------------------------------------------------"
# ajout de librairies python pour projet MAIE (module sale_order_import_csv)
sudo pip install PyPDF2 unicodecsv

2
sql_db.py

@ -12,7 +12,7 @@ from contextlib import contextmanager
from functools import wraps
import logging
import time
import urlparse
import urllib.parse
import uuid
import psycopg2

Loading…
Cancel
Save