Initial commit

This commit is contained in:
scith 2015-09-14 17:12:17 +02:00
parent b82245b263
commit e90d68e933
10 changed files with 238 additions and 0 deletions

40
README.md Normal file
View file

@ -0,0 +1,40 @@
Odoo for YunoHost
----------------------------
Warning: This YunoHost app is still in development. Use it at your own risk! I am **not** responsible for any data loss that jeopardizes your organization
**WARNING**: Odoo is a complex app. **DO NOT USE IT** to run your business unless you know what you are doing!!! If you don't, use <a href="https://www.odoo.com/fr_FR/pricing-online#num_users=1&custom_apps=0">the hosted Odoo</a> that will give you peace and customer support!
**Important:** This app MUST be installed on a domain's root!
https://odoo.example.com/ will work
https://example.com/odoo/ will NOT work
What does not work
------------------
Backup and restore
Configuration
-------------
Create a database name "subdomain-domain-ltd" (for example "erp-test-com" if you access via erp.test.com)
Setup LDAP
- Create a user named "template" with email "template". This user will give its permissions by default to YunoHost users so you can also give it appropriate rights.
- In "Edit Company Data" (on the logo), go to "Configuration" and add a LDAP setting
- LDAP Address: localhost
- LDAP Port: 389
- LDAP Base: ou=users, dc=yunohost,dc=org
- LDAP filter: uid=%s
- Template user: template
- Save
Odoo
----
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an <a href="https://www.odoo.com/page/crm">Open Source CRM</a>, <a href="https://www.odoo.com/page/website-builder">Website Builder</a>, <a href="https://www.odoo.com/page/e-commerce">eCommerce</a>, <a href="https://www.odoo.com/page/project-management">Project Management</a>, <a href="https://www.odoo.com/page/accounting">Billing &amp; Accounting</a>, <a href="https://www.odoo.com/page/point-of-sale">Point of Sale</a>, <a href="https://www.odoo.com/page/employees">Human Resources</a>, Marketing, Manufacturing, Purchase Management, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get
a full-featured <a href="https://www.odoo.com">Open Source ERP</a> when you install several Apps.

13
conf/nginx.conf Normal file
View file

@ -0,0 +1,13 @@
location / {
proxy_pass http://127.0.0.1:8069/;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_buffers 16 64k;
proxy_buffer_size 128k;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_read_timeout 999999999;
}

14
conf/odoo-server.conf Normal file
View file

@ -0,0 +1,14 @@
[options]
; This is the password that allows database operations:
admin_passwd = ADMIN_PASSWORD
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/addons
;Log settings
logfile = /var/log/odoo/odoo-server.log
log_level = error
proxy_mode = true
dbfilter = %h
init = auth_ldap

19
conf/systemd.service Normal file
View file

@ -0,0 +1,19 @@
[Unit]
Description=Advanced OpenSource ERP and CRM server
Requires=postgresql.service
After=postgresql.service
[Install]
Alias=odoo.service
[Service]
Type=simple
PermissionsStartOnly=true
EnvironmentFile=-/etc/odoo-server.conf
User=odoo
Group=odoo
SyslogIdentifier=odoo-server
PIDFile=/run/odoo/odoo-server.pid
ExecStartPre=/usr/bin/install -d -m755 -o odoo -g odoo /run/odoo
ExecStart=/usr/local/bin/odoo-server -c /etc/odoo-server.conf --pid=/run/odoo/odoo-server.pid --syslog $OPENERP_ARGS
ExecStop=/bin/kill $MAINPID
[Install]
WantedBy=multi-user.target

50
manifest.json Normal file
View file

@ -0,0 +1,50 @@
{
"name": "Odoo",
"id": "odoo",
"description": {
"en": "Odoo is a suite of business apps (ERP: CRM, Accounting, Point of Sale, HR, Purchases...).",
"fr": "Odoo est une collection d'apps de gestion d'entreprise (ERP : CRM, Comptabilité, Point de Vente, RH, Achats, ...)."
},
"developer": {
"name": "scith"
},
"multi_instance": "false",
"arguments": {
"install" : [
{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain for Odoo (Odoo will be installed on its root!)",
"fr": "Choisissez un domaine pour Odoo (Odoo sera installé dans sa racine !)"
},
"example": "odoo.domain.org"
},
{
"name": "is_public",
"ask": {
"en": "Is it a public instance of Odoo? (Note: you can NOT run a public e-commerce website with Odoo in a private instance)",
"fr": "Est-ce une instance publique d'Odoo ? (Note : vous ne pouvez PAS utiliser Odoo comme site e-commerce dans une instance privée)"
},
"choices": ["Yes", "No"],
"default": "Yes"
},
{
"name": "odoo_version",
"ask": {
"en": "Which version of Odoo do you want to install?",
"fr": "Quelle version d'Odoo souhaitez-vous installer ?"
},
"choices": ["8.0", "9.0"],
"default": "8.0"
},
{
"name": "admin_password",
"ask": {
"en": "Choose a strong master admin password",
"fr": "Choisissez un mot de passe maître fort pour l'administration"
}
}
]
}
}

5
scripts/backup Normal file
View file

@ -0,0 +1,5 @@
#! /bin/bash
app=docker
set -e
# TO BE DONE

76
scripts/install Normal file
View file

@ -0,0 +1,76 @@
#!/bin/bash
app=docker
set -e
# Retrieve arguments
domain=$1
is_public=$2
odoo_version=$3
admin_password=$4
sudo yunohost app checkport 8069
if [[ ! $? -eq 0 ]]; then
exit 1
fi
# Check domain/path availability
domain=${domain}"/"
sudo yunohost app checkurl $domain -a $app \
|| (echo "Path not available: $domain" && exit 1)
# Remove trailing "/" for next commands
domain=${domain%/}
sudo yunohost app setting $app domain -v $domain
# Install Odoo
# Install postgresql and create user
sudo apt-get install postgresql -y
sudo sed -i s/"#listen_addresses = 'localhost'"/"listen_addresses = '*'"/g /etc/postgresql/9.3/main/postgresql.conf
sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true
# Install Odoo dependencies
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 git-core python-passlib -y
sudo pip install gdata
# Install wkhtopdf to print PDF reports
wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-jessie-amd64.deb
sudo dpkg -i http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-jessie-amd64.deb
sudo apt-get install -y xfonts-75dpi
sudo cp /usr/local/bin/wkhtmltopdf /usr/bin
sudo cp /usr/local/bin/wkhtmltoimage /usr/bin
# Create odoo user
sudo adduser --system --quiet --shell=/bin/bash --home=/home/odoo --gecos 'ODOO' --group odoo
# Install Odoo
sudo git clone --branch $odoo_version https://www.github.com/odoo/odoo /opt/odoo/
sudo chown -R odoo:odoo /opt/odoo
# Create log file
sudo mkdir /var/log/odoo
sudo chown -R odoo:odoo /var/log/odoo
# Create conf file
sudo sed -i "s@ADMIN_PASSWORD@$admin_password@g" ../conf/odoo-server.conf
sudo cp ../conf/odoo-server.conf /etc/odoo-server.conf
sudo chown odoo:odoo /etc/odoo-server.conf
# Systemd and services
# if [ -d /run/systemd/system ]; then
# sudo systemctl enable postgresql.service
# sudo cp ../conf/systemd.service /etc/systemd/system/odoo.service
# sudo systemctl enable odoo.service
# fi
# sudo yunohost service add postgresql
# sudo yunohost service add odoo
# Configure Nginx and reload
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
if [ "$is_public" = "Yes" ];
then
sudo yunohost app setting $app skipped_uris -v "/"
fi
sudo service nginx reload
echo $?

13
scripts/remove Normal file
View file

@ -0,0 +1,13 @@
#!/bin/bash
app=docker
# TO BE DONE
# Remove NGINX conf
domain=$(sudo yunohost app setting $app domain)
sudo rm /etc/nginx/conf.d/$domain.d/$app.conf
# Reload
sudo service nginx reload
sudo yunohost app ssowatconf

5
scripts/restore Normal file
View file

@ -0,0 +1,5 @@
#!/bin/bash
app=docker
set -e
# TO BE DONE

3
scripts/upgrade Normal file
View file

@ -0,0 +1,3 @@
#!/bin/bash
# TBD