From bd4cb64336061747fc4c46fcace0f9e4d58367b5 Mon Sep 17 00:00:00 2001 From: Jeff Date: Thu, 17 Sep 2015 22:42:52 +0200 Subject: [PATCH 01/10] News --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a0bc048..477a01a 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,18 @@ https://example.com/odoo/ will NOT work What does not work ------------------ +- Backup and restore via Odoo (works with a trick shared on the Github) - Backup and restore via YunoHost -- Automatic database creation - Automatic LDAP configuration +Still to do +----------- +- Automatic LDAP setup + emails +- Backup/restore via Odoo fix +- Backup/restore via YunoHost +- SMTP settings + + Configuration ------------- **Setup LDAP** @@ -49,4 +57,4 @@ Odoo is a suite of web based open source business apps. The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ... Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get -a full-featured Open Source ERP when you install several Apps. \ No newline at end of file +a full-featured Open Source ERP when you install several Apps. From 9cff687e08103991571d911dc7530094f14e5ad5 Mon Sep 17 00:00:00 2001 From: Jeff Date: Thu, 17 Sep 2015 22:43:17 +0200 Subject: [PATCH 02/10] News --- README.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 477a01a..e25bf5a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ +Odoo +---- + +Odoo is a suite of web based open source business apps. + +The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ... + +Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get +a full-featured Open Source ERP when you install several Apps. + 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 @@ -47,14 +57,3 @@ Configuration - Go to manage databases and delete the old database - Restore - **Important!** The database must be named "*subdomain-domain-tld*" (for example *erp-test-com* if you access the database via *erp.test.com* - - -Odoo ----- - -Odoo is a suite of web based open source business apps. - -The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ... - -Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get -a full-featured Open Source ERP when you install several Apps. From 885dba428406d177b055559fbf1038a3c5412453 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 19 Sep 2015 11:48:14 +0200 Subject: [PATCH 03/10] Remove xfonts --- scripts/install | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index a80cbc5..7031daa 100644 --- a/scripts/install +++ b/scripts/install @@ -53,7 +53,6 @@ else # Install wkhtmltopdf to print PDF reports sudo wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-jessie-amd64.deb sudo dpkg -i wkhtmltox-0.12.2.1_linux-jessie-amd64.deb - sudo apt-get -y -qq install xfonts-75dpi sudo cp /usr/local/bin/wkhtmltopdf /usr/bin sudo cp /usr/local/bin/wkhtmltoimage /usr/bin @@ -91,4 +90,4 @@ fi sudo yunohost app setting $app skipped_uris -v "/" sudo service nginx reload -echo $? \ No newline at end of file +echo $? From 2c0f9b43e46eb9ec9f4fb83049a850044db54c2d Mon Sep 17 00:00:00 2001 From: Jeff Date: Sun, 20 Sep 2015 20:36:25 +0200 Subject: [PATCH 04/10] Auto db creation --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e25bf5a..66846ce 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ https://example.com/odoo/ will NOT work What does not work ------------------ +- Automatic database creation (experimental) - Backup and restore via Odoo (works with a trick shared on the Github) - Backup and restore via YunoHost - Automatic LDAP configuration From 929b47cbb8f60273d12869939f6c0a4bd87f9afc Mon Sep 17 00:00:00 2001 From: Jeff Date: Sun, 20 Sep 2015 20:36:58 +0200 Subject: [PATCH 05/10] Auto db not working --- scripts/install | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index 7031daa..53becc3 100644 --- a/scripts/install +++ b/scripts/install @@ -65,7 +65,7 @@ else sudo sed -i "s@'auto_install': False@'auto_install': True@g" /usr/lib/python2.7/dist-packages/openerp/addons/auth_ldap/__openerp__.py # Install oerplib to manage databases - sudo pip install oerplib + # sudo pip install oerplib # Add services sudo yunohost service add postgresql @@ -74,12 +74,12 @@ else sudo yunohost service start odoo fi -# Setup database - sudo sed -i "s@ADMIN_PASSWORD@$admin_password@g" ../conf/install_database.py - sudo sed -i "s@DOMAIN_DATABASE@${domain//./-}@g" ../conf/install_database.py - sudo sed -i "s@DATABASE_LANG@$database_lang@g" ../conf/install_database.py - sudo sed -i "s@DATABASE_PASSWORD@$database_password@g" ../conf/install_database.py - sudo python ../conf/install_database.py +# Setup database: not working +# sudo sed -i "s@ADMIN_PASSWORD@$admin_password@g" ../conf/install_database.py +# sudo sed -i "s@DOMAIN_DATABASE@${domain//./-}@g" ../conf/install_database.py +# sudo sed -i "s@DATABASE_LANG@$database_lang@g" ../conf/install_database.py +# sudo sed -i "s@DATABASE_PASSWORD@$database_password@g" ../conf/install_database.py +# sudo python ../conf/install_database.py # Setup LDAP: TO BE DONE From 2b1c7a7c2ee555b36c97b0c48efc48a085c8cef8 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sun, 20 Sep 2015 20:37:49 +0200 Subject: [PATCH 06/10] Auto db creation --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 66846ce..8deb0e7 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,9 @@ Still to do Configuration ------------- +**Create the database manually** +- The database must be named "*subdomain-domain-tld*" (for example *erp-test-com* if you access the database 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 permissions. - In "Edit Company Data" (on the logo), go to "Configuration" and add a LDAP setting From a34cd3abffbd1829574132db4e0beccdabb508d6 Mon Sep 17 00:00:00 2001 From: zamentur Date: Fri, 30 Oct 2015 18:02:03 +0100 Subject: [PATCH 07/10] [enh] Trap error [fix] Wkhtmltopdf from official repo [fix] Missing sudo to create postgres user --- scripts/install | 18 +++++++++++++----- scripts/remove | 4 +--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index 53becc3..46b7065 100644 --- a/scripts/install +++ b/scripts/install @@ -9,6 +9,8 @@ admin_password=$3 database_password=$4 database_lang=$5 + + # Check domain/path availability domain=${domain}"/" sudo yunohost app checkurl $domain -a $app \ @@ -46,15 +48,12 @@ else # Initialize installation sudo apt-get -y -qq install postgresql - su - postgres -c "createuser -s odoo" 2> /dev/null || true + sudo su - postgres -c "createuser -s odoo" 2> /dev/null || true sudo apt-get -y -qq install odoo # Install wkhtmltopdf to print PDF reports - sudo wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-jessie-amd64.deb - sudo dpkg -i wkhtmltox-0.12.2.1_linux-jessie-amd64.deb - sudo cp /usr/local/bin/wkhtmltopdf /usr/bin - sudo cp /usr/local/bin/wkhtmltoimage /usr/bin + sudo apt-get -yf -qq install wkhtmltopdf # Set admin password sudo sed -i "s@ADMIN_PASSWORD@$admin_password@g" ../conf/openerp-server.conf @@ -74,6 +73,15 @@ else sudo yunohost service start odoo fi +function exit_properly +{ + set +e + # TODO: uninstall db + sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf + sudo service nginx reload + exit 1 +} +trap exit_properly ERR # Setup database: not working # sudo sed -i "s@ADMIN_PASSWORD@$admin_password@g" ../conf/install_database.py # sudo sed -i "s@DOMAIN_DATABASE@${domain//./-}@g" ../conf/install_database.py diff --git a/scripts/remove b/scripts/remove index 971f0b4..980cf35 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,11 +10,9 @@ instance=$(sudo yunohost app setting $app instance) if [ "$instance" = "master" ]; then # Remove Odoo sudo yunohost service stop odoo - sudo yunohost service stop postgresql sudo apt-get remove odoo -y sudo apt-get remove wkhtmltopdf -y sudo yunohost service remove odoo - sudo yunohost service remove postgresql fi # Remove NGINX conf @@ -22,4 +20,4 @@ instance=$(sudo yunohost app setting $app instance) # Reload sudo service nginx reload - sudo yunohost app ssowatconf \ No newline at end of file + sudo yunohost app ssowatconf From e92e23a1ab3a6bd64cab5e2f1e6782d50104f8e4 Mon Sep 17 00:00:00 2001 From: Zamentur aka ljf Date: Thu, 26 Nov 2015 19:37:44 +0100 Subject: [PATCH 08/10] [enh] Give right to create db to odoo psql user --- scripts/install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 46b7065..d738796 100644 --- a/scripts/install +++ b/scripts/install @@ -48,7 +48,8 @@ else # Initialize installation sudo apt-get -y -qq install postgresql - sudo su - postgres -c "createuser -s odoo" 2> /dev/null || true + sudo su - postgres -c "echo \"CREATE USER odoo WITH PASSWORD '$admin_password';\" | psql" 2> /dev/null || true + sudo su - postgres -c "echo \"ALTER ROLE odoo WITH CREATEDB;\" | psql" 2> /dev/null || true sudo apt-get -y -qq install odoo From bd9744e80118d2b09d30875217eaafcbd55408f3 Mon Sep 17 00:00:00 2001 From: Zamentur aka ljf Date: Thu, 26 Nov 2015 19:45:23 +0100 Subject: [PATCH 09/10] [enh] Uncomment database setup --- scripts/install | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index d738796..5f04b7a 100644 --- a/scripts/install +++ b/scripts/install @@ -48,8 +48,7 @@ else # Initialize installation sudo apt-get -y -qq install postgresql - sudo su - postgres -c "echo \"CREATE USER odoo WITH PASSWORD '$admin_password';\" | psql" 2> /dev/null || true - sudo su - postgres -c "echo \"ALTER ROLE odoo WITH CREATEDB;\" | psql" 2> /dev/null || true + sudo su - postgres -c "echo \"CREATE USER odoo WITH PASSWORD '$admin_password' CREATEDB;\" | psql" 2> /dev/null || true sudo apt-get -y -qq install odoo @@ -65,7 +64,7 @@ else sudo sed -i "s@'auto_install': False@'auto_install': True@g" /usr/lib/python2.7/dist-packages/openerp/addons/auth_ldap/__openerp__.py # Install oerplib to manage databases - # sudo pip install oerplib + sudo pip install oerplib # Add services sudo yunohost service add postgresql @@ -84,11 +83,11 @@ function exit_properly } trap exit_properly ERR # Setup database: not working -# sudo sed -i "s@ADMIN_PASSWORD@$admin_password@g" ../conf/install_database.py -# sudo sed -i "s@DOMAIN_DATABASE@${domain//./-}@g" ../conf/install_database.py -# sudo sed -i "s@DATABASE_LANG@$database_lang@g" ../conf/install_database.py -# sudo sed -i "s@DATABASE_PASSWORD@$database_password@g" ../conf/install_database.py -# sudo python ../conf/install_database.py +sudo sed -i "s@ADMIN_PASSWORD@$admin_password@g" ../conf/install_database.py +sudo sed -i "s@DOMAIN_DATABASE@${domain//./-}@g" ../conf/install_database.py +sudo sed -i "s@DATABASE_LANG@$database_lang@g" ../conf/install_database.py +sudo sed -i "s@DATABASE_PASSWORD@$database_password@g" ../conf/install_database.py +sudo python ../conf/install_database.py # Setup LDAP: TO BE DONE From 720a0d8d23d012ad1b0b8bac00100e56cd82deb1 Mon Sep 17 00:00:00 2001 From: Zamentur aka ljf Date: Fri, 27 Nov 2015 09:41:18 +0100 Subject: [PATCH 10/10] [fix] Disable database creation --- scripts/install | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 5f04b7a..49183ed 100644 --- a/scripts/install +++ b/scripts/install @@ -64,7 +64,7 @@ else sudo sed -i "s@'auto_install': False@'auto_install': True@g" /usr/lib/python2.7/dist-packages/openerp/addons/auth_ldap/__openerp__.py # Install oerplib to manage databases - sudo pip install oerplib + #sudo pip install oerplib # Add services sudo yunohost service add postgresql @@ -83,11 +83,11 @@ function exit_properly } trap exit_properly ERR # Setup database: not working -sudo sed -i "s@ADMIN_PASSWORD@$admin_password@g" ../conf/install_database.py -sudo sed -i "s@DOMAIN_DATABASE@${domain//./-}@g" ../conf/install_database.py -sudo sed -i "s@DATABASE_LANG@$database_lang@g" ../conf/install_database.py -sudo sed -i "s@DATABASE_PASSWORD@$database_password@g" ../conf/install_database.py -sudo python ../conf/install_database.py +#sudo sed -i "s@ADMIN_PASSWORD@$admin_password@g" ../conf/install_database.py +#sudo sed -i "s@DOMAIN_DATABASE@${domain//./-}@g" ../conf/install_database.py +#sudo sed -i "s@DATABASE_LANG@$database_lang@g" ../conf/install_database.py +#sudo sed -i "s@DATABASE_PASSWORD@$database_password@g" ../conf/install_database.py +#sudo python ../conf/install_database.py # Setup LDAP: TO BE DONE