From 1dce7601cfd494ee5b328f4978265f87918d6826 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Sat, 17 Nov 2018 22:08:10 +0100 Subject: [PATCH] Introduce Odoo application package --- README.md | 1 + app-vmmgr | 2 +- odoo/install.sh | 41 ++++++++++++++++++++++++++++ odoo/install/adminpwd.sql | 3 ++ odoo/install/createdb.sql | 4 +++ odoo/install/etc/init.d/odoo | 23 ++++++++++++++++ odoo/install/srv/odoo/conf/odoo.conf | 12 ++++++++ odoo/install/srv/odoo/update-conf.sh | 3 ++ odoo/lxcfile | 39 ++++++++++++++++++++++++++ odoo/pkg | 7 +++++ odoo/uninstall.sh | 13 +++++++++ 11 files changed, 147 insertions(+), 1 deletion(-) create mode 100755 odoo/install.sh create mode 100644 odoo/install/adminpwd.sql create mode 100644 odoo/install/createdb.sql create mode 100755 odoo/install/etc/init.d/odoo create mode 100644 odoo/install/srv/odoo/conf/odoo.conf create mode 100755 odoo/install/srv/odoo/update-conf.sh create mode 100644 odoo/lxcfile create mode 100644 odoo/pkg create mode 100755 odoo/uninstall.sh diff --git a/README.md b/README.md index 2cce3a1..8d732be 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,7 @@ The full build process takes considerable amount of time, so it is advised to ha | Motech | motech | 8013 | 8080 (HTTP) | motech | | ODK Aggregate | opendatakit | 8015 | 8080 (HTTP) | odk | | ODK Build | opendatakit-build | 8017 | 8080 (HTTP) | odkbuild | +| Odoo | odoo | 8019 | 8080 (HTPP) | odoo | | OpenMapKit | openmapkit | 8007 | 8080 (HTTP) | omk | | Pan.do/ra | pandora | 8002 | 8080 (HTTP) | pandora | | Postgres | postgres | 5432 | 5432 (Postgres) | - | diff --git a/app-vmmgr b/app-vmmgr index 6a68be7..be5e95d 160000 --- a/app-vmmgr +++ b/app-vmmgr @@ -1 +1 @@ -Subproject commit 6a68be739ab7ba6c55d79c9abf7744b6eaa35cf7 +Subproject commit be5e95d5c0389ef024359cf4885a0a5792363c05 diff --git a/odoo/install.sh b/odoo/install.sh new file mode 100755 index 0000000..39ecc90 --- /dev/null +++ b/odoo/install.sh @@ -0,0 +1,41 @@ +#!/bin/sh +set -ev + +cd $(realpath $(dirname "${0}"))/install + +# Check prerequisites +[ ! -e /run/openrc/started/postgres ] && service postgres start && STOP_POSTGRES=1 + +# Create databases +export ODOO_PWD=$(head -c 18 /dev/urandom | base64) +envsubst /srv/odoo/conf/odoo.conf + +# Populate database +lxc-start odoo -- /srv/odoo/odoo-bin -c /srv/odoo/odoo.conf -i base --load-language=cs_CZ +until grep -q 'odoo.modules.loading: Modules loaded.' /var/log/lxc/odoo.log; do + sleep 1 +done +lxc-stop odoo + +# Update admin account +export ODOO_ADMIN_HASH=$(lxc-execute odoo -- python -c "from passlib.hash import pbkdf2_sha512;print(pbkdf2_sha512.encrypt('${ODOO_ADMIN_PWD}'))") +envsubst