From 1d0a98a754bcde5bae871a958959419694fb136f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 20 Mar 2024 19:36:05 +0100 Subject: [PATCH 01/21] Manifestv2: install --- check_process | 73 --------------- conf/10.src | 5 - conf/11.src | 5 - conf/12.src | 5 - conf/14.src | 5 - conf/15.src | 5 - conf/16.src | 5 - conf/8.src | 5 - conf/9.src | 5 - conf/app.src | 5 - conf/oca-12.src | 5 - conf/oca-14.src | 5 - conf/oca-15.src | 5 - conf/oca-16.src | 5 - conf/openupgrade.src | 5 - manifest.json | 92 ------------------ manifest.toml | 172 ++++++++++++++++++++++++++++++++++ scripts/_common.sh | 51 +++++----- scripts/install | 216 +++++++++---------------------------------- tests.toml | 23 +++++ 20 files changed, 264 insertions(+), 433 deletions(-) delete mode 100644 check_process delete mode 100644 conf/10.src delete mode 100644 conf/11.src delete mode 100644 conf/12.src delete mode 100644 conf/14.src delete mode 100644 conf/15.src delete mode 100644 conf/16.src delete mode 100644 conf/8.src delete mode 100644 conf/9.src delete mode 100644 conf/app.src delete mode 100644 conf/oca-12.src delete mode 100644 conf/oca-14.src delete mode 100644 conf/oca-15.src delete mode 100644 conf/oca-16.src delete mode 100644 conf/openupgrade.src delete mode 100644 manifest.json create mode 100644 manifest.toml create mode 100644 tests.toml diff --git a/check_process b/check_process deleted file mode 100644 index 25e6085..0000000 --- a/check_process +++ /dev/null @@ -1,73 +0,0 @@ -;; Test complet sans multisite v14 - auto_remove=1 - ; Manifest - domain="domain.tld" - version="14" - oca=0 - lang="en_US" - tz="Etc/GMT" - admin="john" - admin_password="1Strong-Password" - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=1 - setup_nourl=0 - setup_private=0 - setup_public=1 - upgrade=1 - # 12.0~ynh6 - upgrade=1 from_commit=54f28204591c902ebe4a3a6b662e88e8fa598fde - # 15.0~ynh1 - upgrade=1 from_commit=c82770776ccf5ea14a1b47f0ee6a113858e749e6 - backup_restore=1 - multi_instance=1 - port_already_use=0 - change_url=0 -;; Test complet sans multisite v15 - auto_remove=1 - ; Manifest - domain="domain.tld" - version="15" - oca=0 - lang="en_US" - tz="Etc/GMT" - admin="john" - admin_password="1Strong-Password" - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=1 - setup_nourl=0 - setup_private=0 - setup_public=1 - upgrade=1 - backup_restore=1 - multi_instance=1 - port_already_use=0 - change_url=0 -;; Test complet sans multisite v16 - auto_remove=1 - ; Manifest - domain="domain.tld" - version="16" - oca=0 - lang="en_US" - tz="Etc/GMT" - admin="john" - admin_password="1Strong-Password" - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=1 - setup_nourl=0 - setup_private=0 - setup_public=1 - upgrade=1 - backup_restore=1 - multi_instance=1 - port_already_use=0 - change_url=0 -;;; Options -Email=ljf+libreerp_ynh@reflexlibre.net -Notification=down diff --git a/conf/10.src b/conf/10.src deleted file mode 100644 index 512c90b..0000000 --- a/conf/10.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/odoo/odoo/archive/28c3f51c4878fbcd79b2e819948465fcf2160ebc.tar.gz -SOURCE_SUM=880be8b9e5a57e67d6645a527efd83224319d8fc645cbd72f24e7e50a75ff31d -SOURCE_FILENAME=odoo-10.tar.gz -SOURCE_FORMAT=tar.gz -SOURCE_SUM_PRG=sha256sum diff --git a/conf/11.src b/conf/11.src deleted file mode 100644 index 1653db3..0000000 --- a/conf/11.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/odoo/odoo/archive/43200e9dcc1d91cfd5c1e5e939b27e713d20cc7c.tar.gz -SOURCE_SUM=71418fc5536242de72baa2d17b38a439252956fbbb1ebc3e2294c858674c4659 -SOURCE_FILENAME=odoo-11.tar.gz -SOURCE_FORMAT=tar.gz -SOURCE_SUM_PRG=sha256sum diff --git a/conf/12.src b/conf/12.src deleted file mode 100644 index ffc58a5..0000000 --- a/conf/12.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/odoo/odoo/archive/c53081f10befd4f1c98e46a450ed3bc71a6246ed.tar.gz -SOURCE_SUM=e2569f947d83ee549304a3112cf5dda3ff4ef7affca8e5e6119b1305ccac1bae -SOURCE_FILENAME=odoo-12.tar.gz -SOURCE_FORMAT=tar.gz -SOURCE_SUM_PRG=sha256sum diff --git a/conf/14.src b/conf/14.src deleted file mode 100644 index aee6de0..0000000 --- a/conf/14.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/odoo/odoo/archive/8ede8a758a92c4b61fe48d820464783e21ee7847.tar.gz -SOURCE_SUM=9bd03884cdfe644652a09f86cec652d69c11538d0e0ed620740c25f49099a734 -SOURCE_FILENAME=odoo-14.tar.gz -SOURCE_FORMAT=tar.gz -SOURCE_SUM_PRG=sha256sum diff --git a/conf/15.src b/conf/15.src deleted file mode 100644 index 92c51c6..0000000 --- a/conf/15.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/odoo/odoo/archive/1ab48bd4c89f21691b34f349338405fcbb85dea4.tar.gz -SOURCE_SUM=93e12c7574e73403d4da456cf612fd5542d961e302fdf9c3a87cdeca9146184d -SOURCE_FILENAME=odoo-15.tar.gz -SOURCE_FORMAT=tar.gz -SOURCE_SUM_PRG=sha256sum diff --git a/conf/16.src b/conf/16.src deleted file mode 100644 index ecb7dae..0000000 --- a/conf/16.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/odoo/odoo/archive/2a88076c1d1df4920bfd139c94862a894d8ef3bc.tar.gz -SOURCE_SUM=39d23f01d9a095d75460829acfd53b74bcfc273a074d6eae163eedcaeeeb58c7 -SOURCE_FILENAME=odoo-16.tar.gz -SOURCE_FORMAT=tar.gz -SOURCE_SUM_PRG=sha256sum diff --git a/conf/8.src b/conf/8.src deleted file mode 100644 index 134e002..0000000 --- a/conf/8.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/odoo/odoo/archive/9e8f70e4849b0eeaca8b5cf51372ecfa23dc561b.tar.gz -SOURCE_SUM=51d5db432364d272efe8c7b8f93757a63d762393a9163307f52a2f4f950ec4e6 -SOURCE_FILENAME=odoo-8.tar.gz -SOURCE_FORMAT=tar.gz -SOURCE_SUM_PRG=sha256sum diff --git a/conf/9.src b/conf/9.src deleted file mode 100644 index 5983b00..0000000 --- a/conf/9.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/odoo/odoo/archive/7132a15c38a3b5e5ec232404d21aacfa2ac5874e.tar.gz -SOURCE_SUM=f4c522da29201835435b01c651032d07c2d0c0e8a14b30f9a784cb531c5ba250 -SOURCE_FILENAME=odoo-9.tar.gz -SOURCE_FORMAT=tar.gz -SOURCE_SUM_PRG=sha256sum diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index 7b93ab8..0000000 --- a/conf/app.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -SOURCE_SUM=049b2cdec9a8254f0ef8ac273afaf54f7e25459a273e27189591edc7d7cf29db -SOURCE_FILE=wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -SOURCE_FORMAT=tar.xz -SOURCE_SUM_PRG=sha256sum diff --git a/conf/oca-12.src b/conf/oca-12.src deleted file mode 100644 index 78095ae..0000000 --- a/conf/oca-12.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/OCA/OCB/archive/daa274eb48324d563e1096e334a5a73034be71dc.tar.gz -SOURCE_SUM=73bd925d3bdc402248548f92908a07e8475b6703d063609ba7f0729060c59aac -SOURCE_FILENAME=oca-12.tar.gz -SOURCE_FORMAT=tar.gz -SOURCE_SUM_PRG=sha256sum diff --git a/conf/oca-14.src b/conf/oca-14.src deleted file mode 100644 index 4fd2f35..0000000 --- a/conf/oca-14.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/OCA/OCB/archive/890a6aa943aafff149924b1aca2517a95a1b352f.tar.gz -SOURCE_SUM=41decd11b20d8f99329c413faec9abd1e5ee75076e5f47a33ab806483f51926c -SOURCE_FILENAME=oca-14.tar.gz -SOURCE_FORMAT=tar.gz -SOURCE_SUM_PRG=sha256sum diff --git a/conf/oca-15.src b/conf/oca-15.src deleted file mode 100644 index 0f265b2..0000000 --- a/conf/oca-15.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/OCA/OCB/archive/1ab48bd4c89f21691b34f349338405fcbb85dea4.tar.gz -SOURCE_SUM=23b8902b6fc22e4ce36f6dcc7178257235663e9911b61b70b70aeca0fdb36331 -SOURCE_FILENAME=oca-15.tar.gz -SOURCE_FORMAT=tar.gz -SOURCE_SUM_PRG=sha256sum diff --git a/conf/oca-16.src b/conf/oca-16.src deleted file mode 100644 index f327da3..0000000 --- a/conf/oca-16.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/OCA/OCB/archive/9d5ff52da5ec65a21a00a46e21783a2c6188dd80.tar.gz -SOURCE_SUM=3c3a95ec627e3807c85b0b2fd13a484b0b990426efb4905681aaee8768386e39 -SOURCE_FILENAME=oca-16.tar.gz -SOURCE_FORMAT=tar.gz -SOURCE_SUM_PRG=sha256sum diff --git a/conf/openupgrade.src b/conf/openupgrade.src deleted file mode 100644 index 7bba77f..0000000 --- a/conf/openupgrade.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://raw.githubusercontent.com/OCA/OpenUpgrade/11.0/scripts/migrate.py -SOURCE_SUM=362c8cf9b43a3aaddb440e642205e9596da78e28d1e47b582612ced671d95e0b -SOURCE_FILE=odoo-migrate-11.py -SOURCE_SUM_PRG=sha256sum -SOURCE_EXTRACT=False diff --git a/manifest.json b/manifest.json deleted file mode 100644 index c9e43f7..0000000 --- a/manifest.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "name": "LibreERP", - "id": "libreerp", - "packaging_format": 1, - "description": { - "en": "Suite of business apps (ERP: CRM, Accounting, Point of Sale, HR, Purchases...)", - "fr": "Une collection d'apps de gestion d'entreprise (ERP : CRM, Comptabilité, Point de Vente, RH, Achats...)" - }, - "version": "16.0~ynh2", - "url": "https://odoo.com", - "upstream": { - "license": "LGPL-3.0-only", - "website": "https://odoo.com", - "demo": "https://www.odoo.com/trial", - "admindoc": "https://www.odoo.com/documentation/16.0/administration.html", - "userdoc": "https://www.odoo.com/documentation/16.0/applications.html", - "code": "https://github.com/odoo/odoo" - }, - "license": "LGPL-3.0-only", - "maintainer": { - "name": "ljf", - "email": "ljf+libreerp_ynh@reflexlibre.net" - }, - "previous_maintainers": { - "name": "scith" - }, - "requirements": { - "yunohost": ">= 4.3.0" - }, - "multi_instance": true, - "services": [ - "nginx" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "version", - "type": "string", - "ask": { - "en": "Choose the version you want", - "fr": "Choisissez la version désirée" - }, - "choices": ["11", "12", "14", "15", "16"], - "default": "16" - }, - { - "name": "oca", - "type": "boolean", - "default": false, - "ask": { - "en": "Do you want to setup OCA instead of LibreERP?", - "fr": "Désirez vous installer OCA à la place des sources de LibreERP" - } - }, - { - "name": "lang", - "type": "string", - "ask": { - "en": "Choose the application language", - "fr": "Choisissez la langue de l'application" - }, - "choices": ["sq_AL", "am_ET", "ar_SY", "eu_ES", "bs_BA", "bg_BG", "my_MM", "ca_ES", "zh_CN", "zh_HK", "zh_TW", "hr_HR", "cs_CZ", "da_DK", "nl_BE", "nl_NL", "en_AU", "en_GB", "en_US", "et_EE", "fi_FI", "fr_BE", "fr_CA", "fr_CH", "fr_FR", "gl_ES", "ka_GE", "de_CH", "de_DE", "el_GR", "gu_IN", "he_IL", "hi_IN", "hu_HU", "id_ID", "it_IT", "ja_JP", "kab_DZ", "ko_KP", "ko_KR", "lo_LA", "lv_LV", "lt_LT", "mk_MK", "mn_MN", "nb_NO", "fa_IR", "pl_PL", "pt_BR", "pt_PT", "ro_RO", "ru_RU", "sr_RS", "sr@latin", "sk_SK", "sl_SI", "es_AR", "es_BO", "es_CL", "es_CO", "es_CR", "es_DO", "es_EC", "es_GT", "es_MX", "es_PA", "es_PE", "es_PY", "es_UY", "es_VE", "es_ES", "sv_SE", "te_IN", "th_TH", "tr_TR", "uk_UA", "vi_VN"], - "default": "en_US" - }, - { - "name": "tz", - "type": "string", - "ask": { - "en": "Choose a timezone", - "fr": "Choisissez un fuseau horaire" - }, - "default": "Etc/UTC" - }, - { - "name": "admin", - "type": "user" - }, - { - "name": "admin_password", - "type": "password", - "ask": { - "en": "Choose a strong master admin password", - "fr": "Choisissez un mot de passe maître fort pour l'administration" - } - } - ] - } -} diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..86d69ec --- /dev/null +++ b/manifest.toml @@ -0,0 +1,172 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json + +packaging_format = 2 + +id = "libreerp" +name = "LibreERP" +description.en = "Suite of business apps (ERP: CRM, Accounting, Point of Sale, HR, Purchases...)" +description.fr = "Une collection d'apps de gestion d'entreprise (ERP : CRM, Comptabilité, Point de Vente, RH, Achats...)" + +version = "16.0~ynh3" + +maintainers = ["ljf"] + +[upstream] +license = "LGPL-3.0-only" +website = "https://odoo.com" +demo = "https://www.odoo.com/trial" +admindoc = "https://www.odoo.com/documentation/16.0/administration.html" +userdoc = "https://www.odoo.com/documentation/16.0/applications.html" +code = "https://github.com/odoo/odoo" +cpe = "cpe:2.3:a:odoo:odoo" + +[integration] +yunohost = ">= 11.2" +architectures = "all" +multi_instance = true +ldap = true +sso = true +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + [install.domain] + type = "domain" + + [install.version] + ask.en = "Choose the version you want" + ask.fr = "Choisissez la version désirée" + type = "string" + choices = ["11", "12", "14", "15", "16"] + default = "16" + + [install.oca] + ask.en = "Do you want to setup OCA instead of LibreERP?" + ask.fr = "Désirez vous installer OCA à la place des sources de LibreERP" + type = "boolean" + default = false + + [install.lang] + ask.en = "Choose the application language" + ask.fr = "Choisissez la langue de l'application" + type = "string" + choices = ["sq_AL", "am_ET", "ar_SY", "eu_ES", "bs_BA", "bg_BG", "my_MM", "ca_ES", "zh_CN", "zh_HK", "zh_TW", "hr_HR", "cs_CZ", "da_DK", "nl_BE", "nl_NL", "en_AU", "en_GB", "en_US", "et_EE", "fi_FI", "fr_BE", "fr_CA", "fr_CH", "fr_FR", "gl_ES", "ka_GE", "de_CH", "de_DE", "el_GR", "gu_IN", "he_IL", "hi_IN", "hu_HU", "id_ID", "it_IT", "ja_JP", "kab_DZ", "ko_KP", "ko_KR", "lo_LA", "lv_LV", "lt_LT", "mk_MK", "mn_MN", "nb_NO", "fa_IR", "pl_PL", "pt_BR", "pt_PT", "ro_RO", "ru_RU", "sr_RS", "sr@latin", "sk_SK", "sl_SI", "es_AR", "es_BO", "es_CL", "es_CO", "es_CR", "es_DO", "es_EC", "es_GT", "es_MX", "es_PA", "es_PE", "es_PY", "es_UY", "es_VE", "es_ES", "sv_SE", "te_IN", "th_TH", "tr_TR", "uk_UA", "vi_VN"] + default = "en_US" + + [install.tz] + ask.en = "Choose a timezone" + ask.fr = "Choisissez un fuseau horaire" + type = "string" + default = "Etc/UTC" + + [install.admin] + type = "user" + + [install.admin_password] + ask.en = "Choose a strong master admin password" + ask.fr = "Choisissez un mot de passe maître fort pour l'administration" + type = "password" + +[resources] + [resources.sources] + [resources.sources.main_16_oca] + url = "https://github.com/OCA/OCB/archive/9d5ff52da5ec65a21a00a46e21783a2c6188dd80.tar.gz" + sha256 = "3c3a95ec627e3807c85b0b2fd13a484b0b990426efb4905681aaee8768386e39" + prefetch = false + + [resources.sources.main_16] + url = "https://github.com/odoo/odoo/archive/2a88076c1d1df4920bfd139c94862a894d8ef3bc.tar.gz" + sha256 = "39d23f01d9a095d75460829acfd53b74bcfc273a074d6eae163eedcaeeeb58c7" + prefetch = false + + [resources.sources.main_15_oca] + url = "https://github.com/OCA/OCB/archive/1ab48bd4c89f21691b34f349338405fcbb85dea4.tar.gz" + sha256 = "23b8902b6fc22e4ce36f6dcc7178257235663e9911b61b70b70aeca0fdb36331" + prefetch = false + + [resources.sources.main_15] + url = "https://github.com/odoo/odoo/archive/1ab48bd4c89f21691b34f349338405fcbb85dea4.tar.gz" + sha256 = "93e12c7574e73403d4da456cf612fd5542d961e302fdf9c3a87cdeca9146184d" + prefetch = false + + [resources.sources.main_14_oca] + url = "https://github.com/OCA/OCB/archive/890a6aa943aafff149924b1aca2517a95a1b352f.tar.gz" + sha256 = "41decd11b20d8f99329c413faec9abd1e5ee75076e5f47a33ab806483f51926c" + prefetch = false + + [resources.sources.main_14] + url = "https://github.com/odoo/odoo/archive/8ede8a758a92c4b61fe48d820464783e21ee7847.tar.gz" + sha256 = "9bd03884cdfe644652a09f86cec652d69c11538d0e0ed620740c25f49099a734" + prefetch = false + + [resources.sources.main_12_oca] + url = "https://github.com/OCA/OCB/archive/daa274eb48324d563e1096e334a5a73034be71dc.tar.gz" + sha256 = "73bd925d3bdc402248548f92908a07e8475b6703d063609ba7f0729060c59aac" + prefetch = false + + [resources.sources.main_12] + url = "https://github.com/odoo/odoo/archive/c53081f10befd4f1c98e46a450ed3bc71a6246ed.tar.gz" + sha256 = "e2569f947d83ee549304a3112cf5dda3ff4ef7affca8e5e6119b1305ccac1bae" + prefetch = false + + [resources.sources.main_11] + url = "https://github.com/odoo/odoo/archive/43200e9dcc1d91cfd5c1e5e939b27e713d20cc7c.tar.gz" + sha256 = "71418fc5536242de72baa2d17b38a439252956fbbb1ebc3e2294c858674c4659" + prefetch = false + + [resources.sources.main_10] + url = "https://github.com/odoo/odoo/archive/28c3f51c4878fbcd79b2e819948465fcf2160ebc.tar.gz" + sha256 = "880be8b9e5a57e67d6645a527efd83224319d8fc645cbd72f24e7e50a75ff31d" + prefetch = false + + [resources.sources.main_9] + url = "https://github.com/odoo/odoo/archive/7132a15c38a3b5e5ec232404d21aacfa2ac5874e.tar.gz" + sha256 = "f4c522da29201835435b01c651032d07c2d0c0e8a14b30f9a784cb531c5ba250" + prefetch = false + + [resources.sources.main_8] + url = "https://github.com/odoo/odoo/archive/9e8f70e4849b0eeaca8b5cf51372ecfa23dc561b.tar.gz" + sha256 = "51d5db432364d272efe8c7b8f93757a63d762393a9163307f52a2f4f950ec4e6" + prefetch = false + + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] + main.url = "/" + + [resources.ports] + main.default = 8069 + chat.default = 8072 + + [resources.apt] + packages = [ + "curl", + "postgresql", + "xfonts-75dpi", + "xfonts-base", + "wkhtmltopdf", + "node-less", + "python3-dev", + "gcc", + "libldap2-dev", + "libssl-dev", + "libsasl2-dev", + "python3-pip", + "python3-dev", + "python3-venv", + "python3-wheel", + "libxslt-dev", + "libzip-dev", + "python3-setuptools", + "libjpeg-dev", + "zlib1g-dev", + "libfreetype6-dev", + "libffi-dev", + "libpq-dev", + ] + + [resources.database] + type = "postgresql" diff --git a/scripts/_common.sh b/scripts/_common.sh index ededc6c..44c585a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,8 +9,7 @@ export FORKNAME="odoo" swap_needed=1024 -# dependencies used by the app -pkg_dependencies="curl postgresql xfonts-75dpi xfonts-base wkhtmltopdf node-less python3-dev gcc libldap2-dev libssl-dev libsasl2-dev python3-pip python3-dev python3-venv python3-wheel libxslt-dev libzip-dev python3-setuptools libjpeg-dev zlib1g-dev libfreetype6-dev libffi-dev libpq-dev" +conf_file="/etc/$app/main.conf" #================================================= # PERSONAL HELPERS @@ -18,50 +17,50 @@ pkg_dependencies="curl postgresql xfonts-75dpi xfonts-base wkhtmltopdf node-less function debranding() { # Remove Odoo references to avoid trademark issue - if [ -d $final_path/$appname/$FORKNAME ]; then - python_app=$final_path/$appname/$FORKNAME + if [ -d $install_dir/$appname/$FORKNAME ]; then + python_app=$install_dir/$appname/$FORKNAME else - python_app=$final_path/$appname/openerp + python_app=$install_dir/$appname/openerp fi - find $final_path/$appname -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/Powered by ]*>Odoo<\/a>//g' {} \; - find $final_path/$appname -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/]*>Powered by <[^>]*>Odoo<\/[^>]*><\/a>//g' {} \; - find $final_path/$appname -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/Powered by <[^>]*>Odoo<\/[^>]*>//g' {} \; - find $final_path/$appname -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/Powered by <[^>]*>]*Odoo[^>]*><\/a>//g' {} \; - if test -f "$final_path/$appname/addons/web/static/src/xml/base.xml"; then - sed -i 's/]*>My Odoo.com account<\/a>//g' $final_path/$appname/addons/web/static/src/xml/base.xml - sed -i 's/]*>Documentation<\/a>//g' $final_path/$appname/addons/web/static/src/xml/base.xml - sed -i 's/]*>Support<\/a>//g' $final_path/$appname/addons/web/static/src/xml/base.xml + find $install_dir/$appname -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/Powered by ]*>Odoo<\/a>//g' {} \; + find $install_dir/$appname -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/]*>Powered by <[^>]*>Odoo<\/[^>]*><\/a>//g' {} \; + find $install_dir/$appname -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/Powered by <[^>]*>Odoo<\/[^>]*>//g' {} \; + find $install_dir/$appname -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/Powered by <[^>]*>]*Odoo[^>]*><\/a>//g' {} \; + if test -f "$install_dir/$appname/addons/web/static/src/xml/base.xml"; then + sed -i 's/]*>My Odoo.com account<\/a>//g' $install_dir/$appname/addons/web/static/src/xml/base.xml + sed -i 's/]*>Documentation<\/a>//g' $install_dir/$appname/addons/web/static/src/xml/base.xml + sed -i 's/]*>Support<\/a>//g' $install_dir/$appname/addons/web/static/src/xml/base.xml fi cp ../conf/logo_type.png $python_app/addons/base/static/img/logo_white.png } function setup_files() { - + if [[ $oca -eq 0 ]]; then - ynh_setup_source $final_path/$appname $app_version + ynh_setup_source $install_dir/$appname $app_version else - ynh_setup_source $final_path/$appname "oca-$app_version" + ynh_setup_source $install_dir/$appname "oca-$app_version" fi debranding - mkdir -p $final_path/custom-addons - chmod 750 "$final_path" - chmod -R o-rwx "$final_path" - chown -R $app:$app "$final_path" + mkdir -p $install_dir/custom-addons + chmod 750 "$install_dir" + chmod -R o-rwx "$install_dir" + chown -R $app:$app "$install_dir" touch /var/log/$app.log chown $app:$app /var/log/$app.log - + if [ ! -f $conf_file ]; then ynh_configure server.conf $conf_file chmod 400 "$conf_file" chown $app:$app "$conf_file" # Autoinstall the LDAP auth module - if ls $final_path/$appname/$FORKNAME-bin > /dev/null ; then - ynh_replace_string "^{$" "{'auto_install': True," $final_path/$appname/addons/auth_ldap/__manifest__.py + if ls $install_dir/$appname/$FORKNAME-bin > /dev/null ; then + ynh_replace_string "^{$" "{'auto_install': True," $install_dir/$appname/addons/auth_ldap/__manifest__.py else - ynh_replace_string "'auto_install': False" "'auto_install': True" $final_path/$appname/addons/auth_ldap/__openerp__.py + ynh_replace_string "'auto_install': False" "'auto_install': True" $install_dir/$appname/addons/auth_ldap/__openerp__.py fi - fi + fi } @@ -70,7 +69,7 @@ function setup_database() { ynh_configure server.conf $conf_file chown $app:$app $conf_file # Load translation - #param=" --without-demo True --addons-path $final_path/$appname/addons --db_user $app --db_password $db_pwd --db_host 127.0.0.1 --db_port 5432 --db-filter '^$app\$' -d $app " + #param=" --without-demo True --addons-path $install_dir/$appname/addons --db_user $app --db_password $db_pwd --db_host 127.0.0.1 --db_port 5432 --db-filter '^$app\$' -d $app " param=" -c $conf_file -d $app " ynh_exec_as $app $bin_file -c $conf_file --stop-after-init -i base -d $app ynh_exec_as $app $bin_file -c $conf_file --stop-after-init -i auth_ldap -d $app diff --git a/scripts/install b/scripts/install index 704d1f0..97b4577 100644 --- a/scripts/install +++ b/scripts/install @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -10,109 +8,33 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# MANAGE SCRIPT FAILURE +# INITIALIZE AND STORE SETTINGS #================================================= -ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -domain=$YNH_APP_ARG_DOMAIN -path_url="/" -export app_version=$YNH_APP_ARG_VERSION -oca=$YNH_APP_ARG_OCA -lang=$YNH_APP_ARG_LANG -tz=$YNH_APP_ARG_TZ -admin=$YNH_APP_ARG_ADMIN -admin_password=$YNH_APP_ARG_ADMIN_PASSWORD - -export app=$YNH_APP_INSTANCE_NAME - export conf_file=/etc/$app/main.conf +ynh_app_setting_set --app="$app" --key="conf_file" --value="$conf_file" + export preinstall=0 -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 - -export final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" - -export bin_file="$final_path/venv/bin/python3 $final_path/$appname/$FORKNAME-bin" -if [ "$app_version" = "9" ]; then - bin_file="$final_path/venv/bin/python3 $final_path/$appname/$FORKNAME.py" -fi -if [ "$app_version" = "8" ]; then - bin_file="$final_path/venv/bin/python3 $final_path/$appname/$FORKNAME.py" +if [ "$app_version" = "9" ] || [ "$app_version" = "8" ]; then + bin_file="$install_dir/venv/bin/python3 $install_dir/$appname/$FORKNAME.py" +else + bin_file="$install_dir/venv/bin/python3 $install_dir/$appname/$FORKNAME-bin" fi -# Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url - #================================================= -# STORE SETTINGS FROM MANIFEST +# ADD SWAP #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=1 -ynh_app_setting_set --app=$app --key=domain --value=$domain -ynh_app_setting_set --app=$app --key=app_version --value=$app_version -ynh_app_setting_set --app=$app --key=oca --value=$oca -ynh_app_setting_set --app=$app --key=lang --value=$lang -ynh_app_setting_set --app=$app --key=tz --value=$tz -ynh_app_setting_set --app=$app --key=conf_file --value=$conf_file - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -ynh_script_progression --message="Finding an available port..." --weight=1 - -# Find an available port -port=$(ynh_find_port --port=8069) -ynh_app_setting_set --app=$app --key=port --value=$port - -# Find an available port -port_chat=$(ynh_find_port --port=8072) -ynh_app_setting_set --app=$app --key=port_chat --value=$port_chat - -#================================================= -# INSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Installing dependencies..." --weight=1 - -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +if [ "${PACKAGE_CHECK_EXEC:-0}" -ne 1 ]; then + ynh_script_progression --message="Adding swap..." --weight=1 + ynh_add_swap --size=$swap_needed +fi #================================================= # CREATE A POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Creating a PostgreSQL database..." --weight=1 - -export db_name=$(ynh_sanitize_dbid --db_name=$app) -db_user=$db_name -ynh_app_setting_set --app=$app --key=db_name --value=$db_name - -# Make sure that postgresql is installed and running -ynh_psql_test_if_first_run - -# Create the database -ynh_psql_setup_db --db_user=$db_user --db_name=$db_name -export db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) +ynh_script_progression --message="Configuring $app's PostgreSQL database..." --weight=1 # Make sure that its encoding is UTF-8 ynh_psql_execute_as_root --sql="update pg_database set encoding = pg_char_to_encoding('UTF8') where datname = '$db_name'" @@ -122,73 +44,37 @@ ynh_psql_execute_as_root --sql="update pg_database set encoding = pg_char_to_enc #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src setup_files -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=1 - -# Create a dedicated NGINX config -ynh_add_nginx_config - -#================================================= -# SPECIFIC SETUP -#================================================= -# ADD SWAP -#================================================= - -if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then - : -else - ynh_script_progression --message="Adding swap..." --weight=1 - ynh_add_swap --size=$swap_needed -fi - #================================================= # BUILD APP #================================================= ynh_script_progression --message="Building app..." --weight=1 -if ! wkhtmltopdf --version | grep "wkhtmltopdf 0.12.4 (with patched qt)"; then - # The debian package has a bug so we deploy a more recent version - if [ -f '../manifest.json' ] ; then - ynh_setup_source /usr/ - else - OLD_YNH_CWD=$YNH_CWD - YNH_CWD=$YNH_CWD/../settings/conf - ynh_setup_source /usr/ - YNH_CWD=$OLD_YNH_CWD - fi -fi -pushd $final_path - ynh_exec_warn_less ynh_exec_as $app RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y' - export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" - if grep "python3" $final_path/$appname/$FORKNAME-bin ; then - python3 -m venv venv - venv/bin/pip3 install --upgrade pip - venv/bin/pip3 install wheel - venv/bin/pip3 install -r $appname/requirements.txt - else - virtualenv venv - venv/bin/pip3 install --upgrade pip - venv/bin/pip install wheel - venv/bin/pip install -r $appname/requirements.txt - fi - ynh_secure_remove --file="$final_path/.cargo" - ynh_secure_remove --file="$final_path/.rustup" +pushd "$install_dir" + ynh_exec_warn_less ynh_exec_as "$app" \ + RUSTUP_HOME="$install_dir/.rustup" \ + CARGO_HOME="$install_dir/.cargo" \ + bash -c 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y' + + export PATH="$PATH:$install_dir/.cargo/bin:$install_dir/.local/bin:/usr/local/sbin" + + if grep "python3" "$install_dir/$appname/$FORKNAME-bin" ; then + python3 -m venv venv + venv/bin/pip3 install --upgrade pip + venv/bin/pip3 install wheel + venv/bin/pip3 install -r $appname/requirements.txt + else + virtualenv venv + venv/bin/pip3 install --upgrade pip + venv/bin/pip install wheel + venv/bin/pip install -r $appname/requirements.txt + fi + ynh_secure_remove --file="$install_dir/.cargo" + ynh_secure_remove --file="$install_dir/.rustup" popd -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - -# Create a dedicated systemd config -ynh_add_systemd_config - #================================================= # SETUP DATABASE #================================================= @@ -197,38 +83,24 @@ ynh_script_progression --message="Setuping the database..." --weight=1 setup_database #================================================= -# GENERIC FINALIZATION +# SYSTEM CONFIGURATION #================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 -yunohost service add $app --log="/var/log/$app.log" +# Create a dedicated NGINX config +ynh_add_nginx_config + +# Create a dedicated systemd config +ynh_add_systemd_config +yunohost service add "$app" --log="/var/log/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression --message="Starting $app's systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app.log" - -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 - -ynh_permission_update --permission="main" --add="visitors" - -# Only the admin can access the admin panel of the app (if the app has an admin panel) -ynh_permission_create --permission="admin" --url="/web/database/manager" --allowed="all_users" - -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload +ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app.log" #================================================= # END OF SCRIPT diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..a5bd120 --- /dev/null +++ b/tests.toml @@ -0,0 +1,23 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json + +test_format = 1.0 + +[default] + + args.version = "14" + args.tz = "Etc/GMT" + + # ------------ + # Tests to run + # ------------ + + test_upgrade_from.54f28204591c902ebe4a3a6b662e88e8fa598fde.name = "12.0~ynh6" + test_upgrade_from.c82770776ccf5ea14a1b47f0ee6a113858e749e6.name = "15.0~ynh1" + +[no_multisite_v15] + args.version = "15" + args.tz = "Etc/GMT" + +[no_multisite_v16] + args.version = "16" + args.tz = "Etc/GMT" From 5aa88fcc342ba24f15643efb61caf053e62d7da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 20 Mar 2024 20:49:39 +0100 Subject: [PATCH 02/21] update packagingv2 --- scripts/_common.sh | 129 +++++++++++++++------------- scripts/backup | 42 ++-------- scripts/install | 15 +--- scripts/remove | 80 ++---------------- scripts/restore | 204 ++++++++++++--------------------------------- scripts/upgrade | 182 ++++++++++------------------------------ 6 files changed, 183 insertions(+), 469 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 44c585a..c724e0f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,88 +4,98 @@ # COMMON VARIABLES #================================================= -export appname="libreerp" -export FORKNAME="odoo" +appname="libreerp" +FORKNAME="odoo" swap_needed=1024 conf_file="/etc/$app/main.conf" +if [ "$app_version" = "9" ] || [ "$app_version" = "8" ]; then + bin_file="$install_dir/venv/bin/python3 $install_dir/$appname/$FORKNAME.py" +else + bin_file="$install_dir/venv/bin/python3 $install_dir/$appname/$FORKNAME-bin" +fi + #================================================= # PERSONAL HELPERS #================================================= function debranding() { - # Remove Odoo references to avoid trademark issue - if [ -d $install_dir/$appname/$FORKNAME ]; then - python_app=$install_dir/$appname/$FORKNAME - else - python_app=$install_dir/$appname/openerp - fi - find $install_dir/$appname -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/Powered by ]*>Odoo<\/a>//g' {} \; - find $install_dir/$appname -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/]*>Powered by <[^>]*>Odoo<\/[^>]*><\/a>//g' {} \; - find $install_dir/$appname -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/Powered by <[^>]*>Odoo<\/[^>]*>//g' {} \; - find $install_dir/$appname -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/Powered by <[^>]*>]*Odoo[^>]*><\/a>//g' {} \; - if test -f "$install_dir/$appname/addons/web/static/src/xml/base.xml"; then - sed -i 's/]*>My Odoo.com account<\/a>//g' $install_dir/$appname/addons/web/static/src/xml/base.xml - sed -i 's/]*>Documentation<\/a>//g' $install_dir/$appname/addons/web/static/src/xml/base.xml - sed -i 's/]*>Support<\/a>//g' $install_dir/$appname/addons/web/static/src/xml/base.xml - fi - cp ../conf/logo_type.png $python_app/addons/base/static/img/logo_white.png + # Remove Odoo references to avoid trademark issue + if [ -d "$install_dir/$appname/$FORKNAME" ]; then + python_app="$install_dir/$appname/$FORKNAME" + else + python_app="$install_dir/$appname/openerp" + fi + find "$install_dir/$appname" -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/Powered by ]*>Odoo<\/a>//g' {} \; + find "$install_dir/$appname" -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/]*>Powered by <[^>]*>Odoo<\/[^>]*><\/a>//g' {} \; + find "$install_dir/$appname" -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/Powered by <[^>]*>Odoo<\/[^>]*>//g' {} \; + find "$install_dir/$appname" -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/Powered by <[^>]*>]*Odoo[^>]*><\/a>//g' {} \; + if test -f "$install_dir/$appname/addons/web/static/src/xml/base.xml"; then + sed -i 's/]*>My Odoo.com account<\/a>//g' "$install_dir/$appname/addons/web/static/src/xml/base.xml" + sed -i 's/]*>Documentation<\/a>//g' "$install_dir/$appname/addons/web/static/src/xml/base.xml" + sed -i 's/]*>Support<\/a>//g' "$install_dir/$appname/addons/web/static/src/xml/base.xml" + fi + cp ../conf/logo_type.png "$python_app/addons/base/static/img/logo_white.png" } function setup_files() { + if [[ "$oca" -eq 0 ]]; then + source_id="main_${app_version}" + else + source_id="main_${app_version}-oca" + fi + ynh_setup_source --source_id="$source_id" --dest_dir="$install_dir/$appname" - if [[ $oca -eq 0 ]]; then - ynh_setup_source $install_dir/$appname $app_version - else - ynh_setup_source $install_dir/$appname "oca-$app_version" - fi - debranding - mkdir -p $install_dir/custom-addons - chmod 750 "$install_dir" - chmod -R o-rwx "$install_dir" - chown -R $app:$app "$install_dir" - touch /var/log/$app.log - chown $app:$app /var/log/$app.log + debranding + mkdir -p "$install_dir/custom-addons" - if [ ! -f $conf_file ]; then - ynh_configure server.conf $conf_file - chmod 400 "$conf_file" - chown $app:$app "$conf_file" + chmod 750 "$install_dir" + chmod -R o-rwx "$install_dir" + chown -R "$app:$app" "$install_dir" - # Autoinstall the LDAP auth module - if ls $install_dir/$appname/$FORKNAME-bin > /dev/null ; then - ynh_replace_string "^{$" "{'auto_install': True," $install_dir/$appname/addons/auth_ldap/__manifest__.py - else - ynh_replace_string "'auto_install': False" "'auto_install': True" $install_dir/$appname/addons/auth_ldap/__openerp__.py - fi - fi + touch "/var/log/$app.log" + chown "$app:$app" "/var/log/$app.log" + if [ ! -f "$conf_file" ]; then + ynh_configure server.conf "$conf_file" + chmod 400 "$conf_file" + chown "$app:$app" "$conf_file" + + # Autoinstall the LDAP auth module + if [ -f "$install_dir/$appname/$FORKNAME-bin" ]; then + ynh_replace_string --target_file="$install_dir/$appname/addons/auth_ldap/__manifest__.py" \ + --match_string="^{$" --replace_string="{'auto_install': True," + else + ynh_replace_string --target_file="$install_dir/$appname/addons/auth_ldap/__openerp__.py" \ + --match_string="'auto_install': False" --replace_string="'auto_install': True" + fi + fi } function setup_database() { - export preinstall=1 - ynh_configure server.conf $conf_file - chown $app:$app $conf_file - # Load translation - #param=" --without-demo True --addons-path $install_dir/$appname/addons --db_user $app --db_password $db_pwd --db_host 127.0.0.1 --db_port 5432 --db-filter '^$app\$' -d $app " - param=" -c $conf_file -d $app " - ynh_exec_as $app $bin_file -c $conf_file --stop-after-init -i base -d $app - ynh_exec_as $app $bin_file -c $conf_file --stop-after-init -i auth_ldap -d $app - ynh_exec_as $app $bin_file -c $conf_file --stop-after-init --load-language $lang -d $app - # Configure language, timezone and ldap - ynh_exec_as $app $bin_file shell -c $conf_file -d $app <<< \ + export preinstall=1 + ynh_configure server.conf "$conf_file" + chown "$app:$app" "$conf_file" + # Load translation + #param=" --without-demo True --addons-path $install_dir/$appname/addons --db_user $app --db_password $db_pwd --db_host 127.0.0.1 --db_port 5432 --db-filter '^$app\$' -d $app " + param=" -c $conf_file -d $app " + ynh_exec_as "$app" "$bin_file" -c "$conf_file" --stop-after-init -i base -d "$app" + ynh_exec_as "$app" "$bin_file" -c "$conf_file" --stop-after-init -i auth_ldap -d "$app" + ynh_exec_as "$app" "$bin_file" -c "$conf_file" --stop-after-init --load-language $lang -d "$app" + # Configure language, timezone and ldap + ynh_exec_as "$app" "$bin_file" shell -c "$conf_file" -d "$app" <<< \ " self.env['res.users'].search([['login', '=', 'admin']])[0].write({'password': '$admin_password'}) self.env.cr.commit() " - ynh_exec_as $app $bin_file shell -c $conf_file -d $app <<< \ + ynh_exec_as "$app" "$bin_file" shell -c "$conf_file" -d "$app" <<< \ " self.write({'tz':'$tz','lang':'$lang'}) self.env.cr.commit() " - ynh_exec_as $app $bin_file shell -c $conf_file -d $app <<< \ + ynh_exec_as "$app" "$bin_file" shell -c "$conf_file" -d "$app" <<< \ " template=env['res.users'].create({ 'login':'template', @@ -107,9 +117,9 @@ self.company_id.ldaps.create({ }) self.env.cr.commit() " - export preinstall=0 - ynh_configure server.conf $conf_file - chown $app:$app $conf_file + export preinstall=0 + ynh_configure server.conf "$conf_file" + chown "$app:$app" "$conf_file" } ynh_configure () { @@ -118,12 +128,11 @@ ynh_configure () { content="" content2="" content3="" - if [[ $preinstall == '1' ]] - then + if [[ $preinstall == '1' ]]; then content="dbfilter = $db_name" else content="db_name = $db_name" - if [[ $app_version > 9 ]] + if [[ $app_version -gt 9 ]] then content2="dbfilter = False" fi diff --git a/scripts/backup b/scripts/backup index 47ac1ea..eb9a5b1 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -10,28 +8,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_print_info --message="Loading settings..." - -app=$YNH_APP_INSTANCE_NAME - -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -domain=$(ynh_app_setting_get --app=$app --key=domain) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -conf_file=$(ynh_app_setting_get --app=$app --key=conf_file) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= @@ -41,29 +17,25 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path/$appname" -ynh_backup --src_path="$final_path/custom-addons" -ynh_backup --src_path="$final_path/.local" +ynh_backup --src_path="$install_dir/$appname" +ynh_backup --src_path="$install_dir/custom-addons" +ynh_backup --src_path="$install_dir/.local" + +ynh_backup --src_path="$conf_file" #================================================= -# BACKUP THE NGINX CONFIGURATION +# BACKUP THE SYSTEM CONFIGURATION #================================================= ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP SYSTEMD -#================================================= - ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= # BACKUP VARIOUS FILES #================================================= -ynh_backup --src_path="$conf_file" +ynh_backup --src_path="/var/log/$app.log" #================================================= # BACKUP THE POSTGRESQL DATABASE diff --git a/scripts/install b/scripts/install index 97b4577..43a2343 100644 --- a/scripts/install +++ b/scripts/install @@ -11,16 +11,7 @@ source /usr/share/yunohost/helpers # INITIALIZE AND STORE SETTINGS #================================================= -export conf_file=/etc/$app/main.conf -ynh_app_setting_set --app="$app" --key="conf_file" --value="$conf_file" - -export preinstall=0 - -if [ "$app_version" = "9" ] || [ "$app_version" = "8" ]; then - bin_file="$install_dir/venv/bin/python3 $install_dir/$appname/$FORKNAME.py" -else - bin_file="$install_dir/venv/bin/python3 $install_dir/$appname/$FORKNAME-bin" -fi +preinstall=0 #================================================= # ADD SWAP @@ -64,12 +55,12 @@ pushd "$install_dir" python3 -m venv venv venv/bin/pip3 install --upgrade pip venv/bin/pip3 install wheel - venv/bin/pip3 install -r $appname/requirements.txt + venv/bin/pip3 install -r "$appname/requirements.txt" else virtualenv venv venv/bin/pip3 install --upgrade pip venv/bin/pip install wheel - venv/bin/pip install -r $appname/requirements.txt + venv/bin/pip install -r "$appname/requirements.txt" fi ynh_secure_remove --file="$install_dir/.cargo" ynh_secure_remove --file="$install_dir/.rustup" diff --git a/scripts/remove b/scripts/remove index 5fb9341..f6d3408 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -10,73 +8,21 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading settings..." --weight=1 - -app=$YNH_APP_INSTANCE_NAME - -domain=$(ynh_app_setting_get --app=$app --key=domain) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -conf_file=$(ynh_app_setting_get --app=$app --key=conf_file) - -#================================================= -# STANDARD REMOVE -#================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST +# REMOVE SYSTEM CONFIGURATIONS #================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app >/dev/null -then - ynh_script_progression --message="Removing $app service integration..." --weight=1 - yunohost service remove $app +if ynh_exec_warn_less yunohost service status "$app" >/dev/null; then + yunohost service remove "$app" fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE THE POSTGRESQL DATABASE -#================================================= -ynh_script_progression --message="Removing the PostgreSQL database..." --weight=1 - -# Remove a database if it exists, along with the associated user -ynh_psql_remove_db --db_user=$db_user --db_name=$db_name - -#================================================= -# REMOVE APP MAIN DIR -#================================================= -ynh_script_progression --message="Removing app main directory..." --weight=1 - -# Remove the app directory securely -ynh_secure_remove --file="$final_path" - -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - -#================================================= -# SPECIFIC REMOVE #================================================= # REMOVE VARIOUS FILES #================================================= @@ -92,23 +38,11 @@ ynh_secure_remove --file="/var/log/$app.log" # REMOVE SWAP #================================================= -if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then - : -else - ynh_script_progression --message="Removing swap..." --weight=1 - ynh_del_swap +if [ "${PACKAGE_CHECK_EXEC:-0}" -ne 1 ]; then + ynh_script_progression --message="Removing swap..." --weight=1 + ynh_del_swap fi -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 - -# Delete a system user -ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 7b9f65e..31f4a95 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -11,192 +9,94 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= -# MANAGE SCRIPT FAILURE +# ADD SWAP #================================================= -ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -export app=$YNH_APP_INSTANCE_NAME - -export domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -export app_version=$(ynh_app_setting_get --app=$app --key=app_version) -export oca=$(ynh_app_setting_get --app=$app --key=oca) -export port=$(ynh_app_setting_get --app=$app --key=port) -export port_chat=$(ynh_app_setting_get --app=$app --key=port_chat) -export db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -export db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) -export final_path=$(ynh_app_setting_get --app=$app --key=final_path) -export conf_file=$(ynh_app_setting_get --app=$app --key=conf_file) -export bin_file="$final_path/venv/bin/python $final_path/$appname/$FORKNAME-bin" -if [ "$app_version" = "9" ]; then - bin_file="$final_path/venv/bin/python $final_path/$appname/$FORKNAME.py" +if [ "${PACKAGE_CHECK_EXEC:-0}" -ne 1 ]; then + ynh_script_progression --message="Adding swap..." --weight=1 + ynh_add_swap --size=$swap_needed fi -if [ "$app_version" = "8" ]; then - bin_file="$final_path/venv/bin/python $final_path/$appname/$FORKNAME.py" -fi -export preinstall=0 - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=1 - -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " - -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # RESTORE THE APP MAIN DIR #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=1 -ynh_restore_file --origin_path="$final_path/$appname" -ynh_restore_file --origin_path="$final_path/custom-addons" -ynh_restore_file --origin_path="$final_path/.local" +ynh_restore_file --origin_path="$install_dir/$appname" +ynh_restore_file --origin_path="$install_dir/custom-addons" +ynh_restore_file --origin_path="$install_dir/.local" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chmod -R o-rwx "$install_dir" +chown -R "$app:$app" "$install_dir" -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=1 - -# Define and install dependencies -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - -#================================================= -# ADD SWAP -#================================================= - -if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then - : -else - ynh_script_progression --message="Adding swap..." --weight=1 - ynh_add_swap --size=$swap_needed -fi - -#================================================= -# BUILD APP -#================================================= -ynh_script_progression --message="Building app..." --weight=1 - -if ! wkhtmltopdf --version | grep "wkhtmltopdf 0.12.4 (with patched qt)"; then - # The debian package has a bug so we deploy a more recent version - if [ -f '../manifest.json' ] ; then - ynh_setup_source /usr/ - else - OLD_YNH_CWD=$YNH_CWD - YNH_CWD=$YNH_CWD/../settings/conf - ynh_setup_source /usr/ - YNH_CWD=$OLD_YNH_CWD - fi -fi -pushd $final_path - ynh_exec_warn_less ynh_exec_as $app RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y' - export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" - if grep "python3" $final_path/$appname/$FORKNAME-bin ; then - python3 -m venv venv - venv/bin/pip3 install --upgrade pip - venv/bin/pip3 install wheel - venv/bin/pip3 install -r $appname/requirements.txt - else - virtualenv venv - venv/bin/pip3 install --upgrade pip - venv/bin/pip install wheel - venv/bin/pip install -r $appname/requirements.txt - fi - ynh_secure_remove --file="$final_path/.cargo" - ynh_secure_remove --file="$final_path/.rustup" -popd +ynh_restore_file --origin_path="$conf_file" +chmod 400 "$conf_file" +chown "$app:$app" "$conf_file" #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1 -# Make sure that postgresql is installed and running -ynh_psql_test_if_first_run - -# Create the database -ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd - # Make sure that its encoding is UTF-8 ynh_psql_execute_as_root --sql="update pg_database set encoding = pg_char_to_encoding('UTF8') where datname = '$db_name'" # Restore the database contents -ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql +ynh_psql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql + +#================================================= +# BUILD APP +#================================================= +ynh_script_progression --message="Building app..." --weight=1 + +pushd "$install_dir" + ynh_exec_warn_less ynh_exec_as "$app" \ + RUSTUP_HOME="$install_dir/.rustup" \ + CARGO_HOME="$install_dir/.cargo" \ + bash -c 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y' + + export PATH="$PATH:$install_dir/.cargo/bin:$install_dir/.local/bin:/usr/local/sbin" + + if grep "python3" "$install_dir/$appname/$FORKNAME-bin" ; then + python3 -m venv venv + venv/bin/pip3 install --upgrade pip + venv/bin/pip3 install wheel + venv/bin/pip3 install -r "$appname/requirements.txt" + else + virtualenv venv + venv/bin/pip3 install --upgrade pip + venv/bin/pip install wheel + venv/bin/pip install -r "$appname/requirements.txt" + fi + ynh_secure_remove --file="$install_dir/.cargo" + ynh_secure_remove --file="$install_dir/.rustup" +popd #================================================= # RESTORE VARIOUS FILES #================================================= ynh_script_progression --message="Restoring various files..." --weight=1 -ynh_restore_file --origin_path="$conf_file" -chmod 400 "$conf_file" -chown $app:$app "$conf_file" - -touch /var/log/$app.log -chown $app:$app /var/log/$app.log +ynh_restore_file --origin_path="/var/log/$app.log" +chown "$app:$app" "/var/log/$app.log" #================================================= -# RESTORE SYSTEMD +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service --quiet +systemctl enable "$app.service" --quiet +yunohost service add "$app" --log="/var/log/$app.log" #================================================= -# INTEGRATE SERVICE IN YUNOHOST +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -yunohost service add $app --log="/var/log/$app.log" - -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 - -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app.log" - -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app.log" ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 7c94ba7..9ed854e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -9,173 +7,83 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading settings..." --weight=1 - -export app=$YNH_APP_INSTANCE_NAME - -export domain=$(ynh_app_setting_get --app=$app --key=domain) -export app_version=$(ynh_app_setting_get --app=$app --key=app_version) -export oca=$(ynh_app_setting_get --app=$app --key=oca) -export port=$(ynh_app_setting_get --app=$app --key=port) -export port_chat=$(ynh_app_setting_get --app=$app --key=port_chat) -export final_path=$(ynh_app_setting_get --app=$app --key=final_path) -export conf_file=$(ynh_app_setting_get --app=$app --key=conf_file) export preinstall=0 -#================================================= -# CHECK VERSION -#================================================= -ynh_script_progression --message="Checking version..." --weight=1 - -upgrade_type=$(ynh_check_app_version_changed) - -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # Restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# STANDARD UPGRADE STEPS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=1 +ynh_script_progression --message="Stopping $app's systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app.log" +ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app.log" #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +# ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - -if ! ynh_permission_exists --permission="admin"; then - # Create the required permissions - ynh_permission_create --permission="admin" --url="/web/database/manager" --allowed="all_users" -fi - -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" - -#================================================= -# DOWNLOAD, CHECK AND UNPACK SOURCE -#================================================= - -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=1 - - # Download, check integrity, uncompress and patch the source from app.src - setup_files -fi - -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=1 - -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 - -# Create a dedicated NGINX config -ynh_add_nginx_config - -#================================================= -# SPECIFIC UPGRADE #================================================= # ADD SWAP #================================================= -if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then - : -else - ynh_script_progression --message="Adding swap..." --weight=1 - ynh_add_swap --size=$swap_needed +if [ "${PACKAGE_CHECK_EXEC:-0}" -ne 1 ]; then + ynh_script_progression --message="Adding swap..." --weight=1 + ynh_add_swap --size=$swap_needed fi +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= +ynh_script_progression --message="Upgrading source files..." --weight=1 + +# Download, check integrity, uncompress and patch the source from app.src +setup_files + #================================================= # BUILD APP #================================================= ynh_script_progression --message="Building app..." --weight=1 -if ! wkhtmltopdf --version | grep "wkhtmltopdf 0.12.4 (with patched qt)"; then - # The debian package has a bug so we deploy a more recent version - if [ -f '../manifest.json' ] ; then - ynh_setup_source /usr/ - else - OLD_YNH_CWD=$YNH_CWD - YNH_CWD=$YNH_CWD/../settings/conf - ynh_setup_source /usr/ - YNH_CWD=$OLD_YNH_CWD - fi -fi -pushd $final_path - ynh_exec_warn_less ynh_exec_as $app RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y' - export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" - if grep "python3" $final_path/$appname/$FORKNAME-bin ; then - python3 -m venv venv - venv/bin/pip3 install --upgrade pip - venv/bin/pip3 install wheel - venv/bin/pip3 install -r $appname/requirements.txt - else - virtualenv venv - venv/bin/pip3 install --upgrade pip - venv/bin/pip install wheel - venv/bin/pip install -r $appname/requirements.txt - fi - ynh_secure_remove --file="$final_path/.cargo" - ynh_secure_remove --file="$final_path/.rustup" +pushd "$install_dir" + ynh_exec_warn_less ynh_exec_as "$app" \ + RUSTUP_HOME="$install_dir/.rustup" \ + CARGO_HOME="$install_dir/.cargo" \ + bash -c 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y' + + export PATH="$PATH:$install_dir/.cargo/bin:$install_dir/.local/bin:/usr/local/sbin" + + if grep "python3" "$install_dir/$appname/$FORKNAME-bin" ; then + python3 -m venv venv + venv/bin/pip3 install --upgrade pip + venv/bin/pip3 install wheel + venv/bin/pip3 install -r "$appname/requirements.txt" + else + virtualenv venv + venv/bin/pip3 install --upgrade pip + venv/bin/pip install wheel + venv/bin/pip install -r "$appname/requirements.txt" + fi + ynh_secure_remove --file="$install_dir/.cargo" + ynh_secure_remove --file="$install_dir/.rustup" popd #================================================= -# GENERIC FINALIZATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 -yunohost service add $app --log="/var/log/$app.log" +# Create a dedicated NGINX config +ynh_add_nginx_config + +# Create a dedicated systemd config +ynh_add_systemd_config +yunohost service add "$app" --log="/var/log/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression --message="Starting $app's systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app.log" - -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload +ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app.log" #================================================= # END OF SCRIPT From 635275a5273a8d62c55817df3d0ec28971ab5bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 20 Mar 2024 20:57:13 +0100 Subject: [PATCH 03/21] Fix variable name in manifest --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 86d69ec..e4037f7 100644 --- a/manifest.toml +++ b/manifest.toml @@ -34,7 +34,7 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [install.domain] type = "domain" - [install.version] + [install.app_version] ask.en = "Choose the version you want" ask.fr = "Choisissez la version désirée" type = "string" From 7df51b4c02949bcd5698a1c9fb6641702beabd1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 20 Mar 2024 21:13:51 +0100 Subject: [PATCH 04/21] Fix asset names --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index c724e0f..7a51f7b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -44,7 +44,7 @@ function setup_files() { if [[ "$oca" -eq 0 ]]; then source_id="main_${app_version}" else - source_id="main_${app_version}-oca" + source_id="main_${app_version}_oca" fi ynh_setup_source --source_id="$source_id" --dest_dir="$install_dir/$appname" From 49c5bc1d2a60d6f80a094451292cd2532486634e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 20 Mar 2024 21:25:52 +0100 Subject: [PATCH 05/21] Update doc for packaging v2 --- doc/ADMIN.md | 5 +++++ doc/DESCRIPTION.md | 5 +++++ doc/DISCLAIMER.md | 16 ---------------- doc/PRE_INSTALL.md | 5 +++++ 4 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 doc/ADMIN.md delete mode 100644 doc/DISCLAIMER.md create mode 100644 doc/PRE_INSTALL.md diff --git a/doc/ADMIN.md b/doc/ADMIN.md new file mode 100644 index 0000000..367412a --- /dev/null +++ b/doc/ADMIN.md @@ -0,0 +1,5 @@ + +### To connect on your LibreERP + +- Go on +- Login as "admin" with the master password you provided during installation diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 2444842..5a56f62 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -3,3 +3,8 @@ LibreERP is a suite of web based open source business apps. LibreERP is a fork o The main LibreERP Apps include an Open Source CRM, Website Builder, eCommerce, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ... LibreERP 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. + +### About licences +LibreERP 8.0 is under AGPL-3.0 +Next version are under LGPL-3.0 +LibreERP is forked from Odoo Community Edition. The name is change due to Odoo trademark policy. diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md deleted file mode 100644 index 1d44340..0000000 --- a/doc/DISCLAIMER.md +++ /dev/null @@ -1,16 +0,0 @@ -**WARNING**: LibreERP is a complex app. **DO NOT USE THIS PACKAGE** to run your business unless you know what you are doing!!! If you don't, you should consider to ask for help from a professionnal! - -**IMPORTANT:** This app MUST be installed on a domain's root! -https://erp.example.com/ will work -https://example.com/erp/ will NOT work - -To connect on your LibreERP ------------ -- Go on https://YOURDOMAIN/web -- Login as "admin" with the master password you provided during installation - -About licences ------------ -LibreERP 8.0 is under AGPL-3.0 -Next version are under LGPL-3.0 -LibreERP is forked from Odoo Community Edition. The name is change due to Odoo trademark policy. diff --git a/doc/PRE_INSTALL.md b/doc/PRE_INSTALL.md new file mode 100644 index 0000000..8b4ef05 --- /dev/null +++ b/doc/PRE_INSTALL.md @@ -0,0 +1,5 @@ +**WARNING**: LibreERP is a complex app. **DO NOT USE THIS PACKAGE** to run your business unless you know what you are doing!!! If you don't, you should consider to ask for help from a professionnal! + +**IMPORTANT:** This app MUST be installed on a domain's root! +https://erp.example.com/ will work +https://example.com/erp/ will NOT work From dedaab9b4d917b75832adfb0f8a8748758e502d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 20 Mar 2024 21:25:58 +0100 Subject: [PATCH 06/21] Add init_main_permission --- manifest.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifest.toml b/manifest.toml index e4037f7..9d04f4a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -34,6 +34,10 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [install.domain] type = "domain" + [install.init_main_permission] + type = "group" + default = "visitors" + [install.app_version] ask.en = "Choose the version you want" ask.fr = "Choisissez la version désirée" From 8504814f4b1fe77b9c68828bf48a55cff83e35ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 20 Mar 2024 21:26:40 +0100 Subject: [PATCH 07/21] =?UTF-8?q?fix=20json=E2=88=92>toml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 7a51f7b..56c9713 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -140,7 +140,7 @@ ynh_configure () { fi mkdir -p "$(dirname $DEST)" - if [ -f '../manifest.json' ] ; then + if [ -f '../manifest.toml' ] ; then ynh_add_config "${YNH_CWD}/../conf/$TEMPLATE" "$DEST" else ynh_add_config "${YNH_CWD}/../settings/conf/$TEMPLATE" "$DEST" From db7ed356ff87492aefc6e404bd05a59ae4a8f32d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 20 Mar 2024 21:29:29 +0100 Subject: [PATCH 08/21] Remove ugly old trick --- scripts/_common.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 56c9713..414f121 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -132,19 +132,13 @@ ynh_configure () { content="dbfilter = $db_name" else content="db_name = $db_name" - if [[ $app_version -gt 9 ]] - then + if [[ $app_version -gt 9 ]]; then content2="dbfilter = False" fi content3="list_db = False" fi - mkdir -p "$(dirname $DEST)" - if [ -f '../manifest.toml' ] ; then - ynh_add_config "${YNH_CWD}/../conf/$TEMPLATE" "$DEST" - else - ynh_add_config "${YNH_CWD}/../settings/conf/$TEMPLATE" "$DEST" - fi + ynh_add_config --template="$TEMPLATE" --destination="$DEST" } #================================================= From a18616b9cfdafdceea4831bde0760fc84ad31a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 20 Mar 2024 21:48:59 +0100 Subject: [PATCH 09/21] final_path -> install_dir --- conf/server.conf | 2 +- scripts/config | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/server.conf b/conf/server.conf index 29e201e..69a90d4 100644 --- a/conf/server.conf +++ b/conf/server.conf @@ -9,7 +9,7 @@ db_password = __DB_PWD__ __CONTENT__ __CONTENT2__ __CONTENT3__ -addons_path = __FINAL_PATH__/__APPNAME__/addons,__FINAL_PATH__/custom-addons +addons_path = __INSTALL_DIR__/__APPNAME__/addons,__INSTALL_DIR__/custom-addons proxy_mode = true logfile = /var/log/__APP__.log xmlrpc_interface = 127.0.0.1 diff --git a/scripts/config b/scripts/config index 92659f2..5ede183 100755 --- a/scripts/config +++ b/scripts/config @@ -2,8 +2,8 @@ source /usr/share/yunohost/helpers ynh_abort_if_errors -CUSTOM_ADDONS=$final_path/custom-addons -VENV=$final_path/venv +CUSTOM_ADDONS=$install_dir/custom-addons +VENV=$install_dir/venv CUSTOM_REPO=$CUSTOM_ADDONS/custom-repo REPOS_YML=$CUSTOM_REPO/repos.yml REQUIREMENTS_TXT=$CUSTOM_REPO/requirements.txt @@ -83,7 +83,7 @@ run__update_code() { ynh_exec_as $app $VENV/bin/pip3 install -Ur $CUSTOM_REPO/requirements.txt fi ynh_script_progression --message="Updating odoo addons and restarting the service" - sudo -u $app $VENV/bin/python $final_path/libreerp/odoo-bin shell -d $app -c /etc/$app/main.conf --logfile /proc/self/fd/1 < Date: Wed, 20 Mar 2024 21:53:10 +0100 Subject: [PATCH 10/21] Remove unused favicon.ico --- conf/favicon.ico | Bin 1030 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 conf/favicon.ico diff --git a/conf/favicon.ico b/conf/favicon.ico deleted file mode 100644 index 3f226c7011dab85687bedad81d7e114a60f6879b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1030 zcmZQzU<5)gF$N&1!0>^YfdR;5&;VjCAl3n5koZUdzuOpW{&z9_$A$lOF?;}p1F7o% qbu#qe3qP27qv}vYX`sRd)fIz__x}I`13GR1IuV5X4-k*h%>V#=1d@sX From f4a5d9d5dc66e3f8d944e28deaae9019c96ca35d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 20 Mar 2024 22:10:03 +0100 Subject: [PATCH 11/21] fix: mkdir --- scripts/_common.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 414f121..875ef50 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -59,9 +59,10 @@ function setup_files() { chown "$app:$app" "/var/log/$app.log" if [ ! -f "$conf_file" ]; then + mkdir -p "$(dirname "$conf_file")" ynh_configure server.conf "$conf_file" chmod 400 "$conf_file" - chown "$app:$app" "$conf_file" + chown -R "$app:$app" "$(dirname "$conf_file")" # Autoinstall the LDAP auth module if [ -f "$install_dir/$appname/$FORKNAME-bin" ]; then From dea3a04faee34b0d757fc9f4a518a0b7d310aff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 20 Mar 2024 22:25:30 +0100 Subject: [PATCH 12/21] string -> select --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 9d04f4a..42753bd 100644 --- a/manifest.toml +++ b/manifest.toml @@ -54,7 +54,7 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [install.lang] ask.en = "Choose the application language" ask.fr = "Choisissez la langue de l'application" - type = "string" + type = "select" choices = ["sq_AL", "am_ET", "ar_SY", "eu_ES", "bs_BA", "bg_BG", "my_MM", "ca_ES", "zh_CN", "zh_HK", "zh_TW", "hr_HR", "cs_CZ", "da_DK", "nl_BE", "nl_NL", "en_AU", "en_GB", "en_US", "et_EE", "fi_FI", "fr_BE", "fr_CA", "fr_CH", "fr_FR", "gl_ES", "ka_GE", "de_CH", "de_DE", "el_GR", "gu_IN", "he_IL", "hi_IN", "hu_HU", "id_ID", "it_IT", "ja_JP", "kab_DZ", "ko_KP", "ko_KR", "lo_LA", "lv_LV", "lt_LT", "mk_MK", "mn_MN", "nb_NO", "fa_IR", "pl_PL", "pt_BR", "pt_PT", "ro_RO", "ru_RU", "sr_RS", "sr@latin", "sk_SK", "sl_SI", "es_AR", "es_BO", "es_CL", "es_CO", "es_CR", "es_DO", "es_EC", "es_GT", "es_MX", "es_PA", "es_PE", "es_PY", "es_UY", "es_VE", "es_ES", "sv_SE", "te_IN", "th_TH", "tr_TR", "uk_UA", "vi_VN"] default = "en_US" From 28180eb972156d1cc7e31d9d1934e4f15b45b41a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 20 Mar 2024 22:52:21 +0100 Subject: [PATCH 13/21] Disable swap for now --- scripts/install | 10 +++++----- scripts/remove | 8 ++++---- scripts/restore | 8 ++++---- scripts/upgrade | 8 ++++---- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/scripts/install b/scripts/install index 43a2343..5d80586 100644 --- a/scripts/install +++ b/scripts/install @@ -17,10 +17,10 @@ preinstall=0 # ADD SWAP #================================================= -if [ "${PACKAGE_CHECK_EXEC:-0}" -ne 1 ]; then - ynh_script_progression --message="Adding swap..." --weight=1 - ynh_add_swap --size=$swap_needed -fi +# if [ "${PACKAGE_CHECK_EXEC:-0}" -ne 1 ]; then +# ynh_script_progression --message="Adding swap..." --weight=1 +# ynh_add_swap --size=$swap_needed +# fi #================================================= # CREATE A POSTGRESQL DATABASE @@ -69,7 +69,7 @@ popd #================================================= # SETUP DATABASE #================================================= -ynh_script_progression --message="Setuping the database..." --weight=1 +ynh_script_progression --message="Setting up the database..." --weight=1 setup_database diff --git a/scripts/remove b/scripts/remove index f6d3408..2f1994a 100644 --- a/scripts/remove +++ b/scripts/remove @@ -38,10 +38,10 @@ ynh_secure_remove --file="/var/log/$app.log" # REMOVE SWAP #================================================= -if [ "${PACKAGE_CHECK_EXEC:-0}" -ne 1 ]; then - ynh_script_progression --message="Removing swap..." --weight=1 - ynh_del_swap -fi +# if [ "${PACKAGE_CHECK_EXEC:-0}" -ne 1 ]; then +# ynh_script_progression --message="Removing swap..." --weight=1 +# ynh_del_swap +# fi #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 31f4a95..798f23d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -12,10 +12,10 @@ source /usr/share/yunohost/helpers # ADD SWAP #================================================= -if [ "${PACKAGE_CHECK_EXEC:-0}" -ne 1 ]; then - ynh_script_progression --message="Adding swap..." --weight=1 - ynh_add_swap --size=$swap_needed -fi +# if [ "${PACKAGE_CHECK_EXEC:-0}" -ne 1 ]; then +# ynh_script_progression --message="Adding swap..." --weight=1 +# ynh_add_swap --size=$swap_needed +# fi #================================================= # RESTORE THE APP MAIN DIR diff --git a/scripts/upgrade b/scripts/upgrade index 9ed854e..22862f6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,10 +25,10 @@ ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$a # ADD SWAP #================================================= -if [ "${PACKAGE_CHECK_EXEC:-0}" -ne 1 ]; then - ynh_script_progression --message="Adding swap..." --weight=1 - ynh_add_swap --size=$swap_needed -fi +# if [ "${PACKAGE_CHECK_EXEC:-0}" -ne 1 ]; then +# ynh_script_progression --message="Adding swap..." --weight=1 +# ynh_add_swap --size=$swap_needed +# fi #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE From f6bb6860b4d88f4e6c50cfbc692e0d34a3a0b18c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 20 Mar 2024 23:04:28 +0100 Subject: [PATCH 14/21] =?UTF-8?q?bin=5Ffile=20is=20actually=20a=20multiple?= =?UTF-8?q?=20files=20command=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/_common.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 875ef50..48ab392 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -82,21 +82,21 @@ function setup_database() { # Load translation #param=" --without-demo True --addons-path $install_dir/$appname/addons --db_user $app --db_password $db_pwd --db_host 127.0.0.1 --db_port 5432 --db-filter '^$app\$' -d $app " param=" -c $conf_file -d $app " - ynh_exec_as "$app" "$bin_file" -c "$conf_file" --stop-after-init -i base -d "$app" - ynh_exec_as "$app" "$bin_file" -c "$conf_file" --stop-after-init -i auth_ldap -d "$app" - ynh_exec_as "$app" "$bin_file" -c "$conf_file" --stop-after-init --load-language $lang -d "$app" + ynh_exec_as "$app" $bin_file -c "$conf_file" --stop-after-init -i base -d "$app" + ynh_exec_as "$app" $bin_file -c "$conf_file" --stop-after-init -i auth_ldap -d "$app" + ynh_exec_as "$app" $bin_file -c "$conf_file" --stop-after-init --load-language $lang -d "$app" # Configure language, timezone and ldap - ynh_exec_as "$app" "$bin_file" shell -c "$conf_file" -d "$app" <<< \ + ynh_exec_as "$app" $bin_file shell -c "$conf_file" -d "$app" <<< \ " self.env['res.users'].search([['login', '=', 'admin']])[0].write({'password': '$admin_password'}) self.env.cr.commit() " - ynh_exec_as "$app" "$bin_file" shell -c "$conf_file" -d "$app" <<< \ + ynh_exec_as "$app" $bin_file shell -c "$conf_file" -d "$app" <<< \ " self.write({'tz':'$tz','lang':'$lang'}) self.env.cr.commit() " - ynh_exec_as "$app" "$bin_file" shell -c "$conf_file" -d "$app" <<< \ + ynh_exec_as "$app" $bin_file shell -c "$conf_file" -d "$app" <<< \ " template=env['res.users'].create({ 'login':'template', From 58fcbdfd7378c6998640b9caf42c76ed7be40ff4 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 22 May 2024 09:59:35 +0000 Subject: [PATCH 15/21] Auto-update READMEs --- README.md | 24 +++++------------------- README_es.md | 24 +++++------------------- README_eu.md | 24 +++++------------------- README_fr.md | 24 +++++------------------- README_gl.md | 24 +++++------------------- README_zh_Hans.md | 24 +++++------------------- 6 files changed, 30 insertions(+), 114 deletions(-) diff --git a/README.md b/README.md index 38e0aee..654ccc7 100644 --- a/README.md +++ b/README.md @@ -22,29 +22,15 @@ The main LibreERP Apps include an Open Source CRM, Website Builder, eCommerce, P LibreERP 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. - -**Shipped version:** 16.0~ynh2 - -**Demo:** -## Disclaimers / important information - -**WARNING**: LibreERP is a complex app. **DO NOT USE THIS PACKAGE** to run your business unless you know what you are doing!!! If you don't, you should consider to ask for help from a professionnal! - -**IMPORTANT:** This app MUST be installed on a domain's root! -https://erp.example.com/ will work -https://example.com/erp/ will NOT work - -To connect on your LibreERP ------------ -- Go on https://YOURDOMAIN/web -- Login as "admin" with the master password you provided during installation - -About licences ------------ +### About licences LibreERP 8.0 is under AGPL-3.0 Next version are under LGPL-3.0 LibreERP is forked from Odoo Community Edition. The name is change due to Odoo trademark policy. + +**Shipped version:** 16.0~ynh3 + +**Demo:** ## :red_circle: Antifeatures - **Paid content**: Promotes or depends, entirely or partially, on a paid service. diff --git a/README_es.md b/README_es.md index 538fd94..72f10da 100644 --- a/README_es.md +++ b/README_es.md @@ -22,29 +22,15 @@ The main LibreERP Apps include an Open Source CRM, Website Builder, eCommerce, P LibreERP 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. - -**Versión actual:** 16.0~ynh2 - -**Demo:** -## informaciones importantes - -**WARNING**: LibreERP is a complex app. **DO NOT USE THIS PACKAGE** to run your business unless you know what you are doing!!! If you don't, you should consider to ask for help from a professionnal! - -**IMPORTANT:** This app MUST be installed on a domain's root! -https://erp.example.com/ will work -https://example.com/erp/ will NOT work - -To connect on your LibreERP ------------ -- Go on https://YOURDOMAIN/web -- Login as "admin" with the master password you provided during installation - -About licences ------------ +### About licences LibreERP 8.0 is under AGPL-3.0 Next version are under LGPL-3.0 LibreERP is forked from Odoo Community Edition. The name is change due to Odoo trademark policy. + +**Versión actual:** 16.0~ynh3 + +**Demo:** ## :red_circle: funcionalidades no deseadas - **Paid content**: Promotes or depends, entirely or partially, on a paid service. diff --git a/README_eu.md b/README_eu.md index e5dd760..7f1668f 100644 --- a/README_eu.md +++ b/README_eu.md @@ -22,29 +22,15 @@ The main LibreERP Apps include an Open Source CRM, Website Builder, eCommerce, P LibreERP 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. - -**Paketatutako bertsioa:** 16.0~ynh2 - -**Demoa:** -## Ezespena / informazio garrantzitsua - -**WARNING**: LibreERP is a complex app. **DO NOT USE THIS PACKAGE** to run your business unless you know what you are doing!!! If you don't, you should consider to ask for help from a professionnal! - -**IMPORTANT:** This app MUST be installed on a domain's root! -https://erp.example.com/ will work -https://example.com/erp/ will NOT work - -To connect on your LibreERP ------------ -- Go on https://YOURDOMAIN/web -- Login as "admin" with the master password you provided during installation - -About licences ------------ +### About licences LibreERP 8.0 is under AGPL-3.0 Next version are under LGPL-3.0 LibreERP is forked from Odoo Community Edition. The name is change due to Odoo trademark policy. + +**Paketatutako bertsioa:** 16.0~ynh3 + +**Demoa:** ## :red_circle: Ezaugarri zalantzagarriak - **Ordainpeko edukia**: Ordainpeko zerbitzu bat sustatzen du edo bere mende dago, osorik edo neurri batean. diff --git a/README_fr.md b/README_fr.md index 9c1e17e..0242cbc 100644 --- a/README_fr.md +++ b/README_fr.md @@ -22,29 +22,15 @@ The main LibreERP Apps include an Open Source CRM, Website Builder, eCommerce, P LibreERP 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. - -**Version incluse :** 16.0~ynh2 - -**Démo :** -## Avertissements / informations importantes - -**WARNING**: LibreERP is a complex app. **DO NOT USE THIS PACKAGE** to run your business unless you know what you are doing!!! If you don't, you should consider to ask for help from a professionnal! - -**IMPORTANT:** This app MUST be installed on a domain's root! -https://erp.example.com/ will work -https://example.com/erp/ will NOT work - -To connect on your LibreERP ------------ -- Go on https://YOURDOMAIN/web -- Login as "admin" with the master password you provided during installation - -About licences ------------ +### About licences LibreERP 8.0 is under AGPL-3.0 Next version are under LGPL-3.0 LibreERP is forked from Odoo Community Edition. The name is change due to Odoo trademark policy. + +**Version incluse :** 16.0~ynh3 + +**Démo :** ## :red_circle: Anti-fonctionnalités - **Contenu payant **: Promeut ou dépend, entièrement ou partiellement, d'un service payant. diff --git a/README_gl.md b/README_gl.md index 947b490..0f0ff1f 100644 --- a/README_gl.md +++ b/README_gl.md @@ -22,29 +22,15 @@ The main LibreERP Apps include an Open Source CRM, Website Builder, eCommerce, P LibreERP 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. - -**Versión proporcionada:** 16.0~ynh2 - -**Demo:** -## Avisos / información importante - -**WARNING**: LibreERP is a complex app. **DO NOT USE THIS PACKAGE** to run your business unless you know what you are doing!!! If you don't, you should consider to ask for help from a professionnal! - -**IMPORTANT:** This app MUST be installed on a domain's root! -https://erp.example.com/ will work -https://example.com/erp/ will NOT work - -To connect on your LibreERP ------------ -- Go on https://YOURDOMAIN/web -- Login as "admin" with the master password you provided during installation - -About licences ------------ +### About licences LibreERP 8.0 is under AGPL-3.0 Next version are under LGPL-3.0 LibreERP is forked from Odoo Community Edition. The name is change due to Odoo trademark policy. + +**Versión proporcionada:** 16.0~ynh3 + +**Demo:** ## :red_circle: Debes considerar - **Paid content**: Promotes or depends, entirely or partially, on a paid service. diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 15d7ee7..be458fd 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -22,29 +22,15 @@ The main LibreERP Apps include an Open Source CRM, Website Builder, eCommerce, P LibreERP 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. - -**分发版本:** 16.0~ynh2 - -**演示:** -## 免责声明 / 重要信息 - -**WARNING**: LibreERP is a complex app. **DO NOT USE THIS PACKAGE** to run your business unless you know what you are doing!!! If you don't, you should consider to ask for help from a professionnal! - -**IMPORTANT:** This app MUST be installed on a domain's root! -https://erp.example.com/ will work -https://example.com/erp/ will NOT work - -To connect on your LibreERP ------------ -- Go on https://YOURDOMAIN/web -- Login as "admin" with the master password you provided during installation - -About licences ------------ +### About licences LibreERP 8.0 is under AGPL-3.0 Next version are under LGPL-3.0 LibreERP is forked from Odoo Community Edition. The name is change due to Odoo trademark policy. + +**分发版本:** 16.0~ynh3 + +**演示:** ## :red_circle: 负面特征 - **Paid content**: Promotes or depends, entirely or partially, on a paid service. From f6c25df2b0c1c76f663c1a37f8c347031d4e0287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 22 May 2024 12:00:23 +0200 Subject: [PATCH 16/21] Disable change_url tests --- tests.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests.toml b/tests.toml index a5bd120..aae2c2c 100644 --- a/tests.toml +++ b/tests.toml @@ -3,6 +3,7 @@ test_format = 1.0 [default] + exclude = ["change_url"] args.version = "14" args.tz = "Etc/GMT" @@ -15,9 +16,13 @@ test_format = 1.0 test_upgrade_from.c82770776ccf5ea14a1b47f0ee6a113858e749e6.name = "15.0~ynh1" [no_multisite_v15] + exclude = ["change_url"] + args.version = "15" args.tz = "Etc/GMT" [no_multisite_v16] + exclude = ["change_url"] + args.version = "16" args.tz = "Etc/GMT" From bb7c020e1a27544f56afa1cdaddcc5f4ccf337b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 22 May 2024 16:41:45 +0200 Subject: [PATCH 17/21] Only allow OCA versions of odoo --- manifest.toml | 46 ---------------------------------------------- scripts/_common.sh | 6 +----- 2 files changed, 1 insertion(+), 51 deletions(-) diff --git a/manifest.toml b/manifest.toml index 42753bd..7706d0e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -45,12 +45,6 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen choices = ["11", "12", "14", "15", "16"] default = "16" - [install.oca] - ask.en = "Do you want to setup OCA instead of LibreERP?" - ask.fr = "Désirez vous installer OCA à la place des sources de LibreERP" - type = "boolean" - default = false - [install.lang] ask.en = "Choose the application language" ask.fr = "Choisissez la langue de l'application" @@ -79,61 +73,21 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen sha256 = "3c3a95ec627e3807c85b0b2fd13a484b0b990426efb4905681aaee8768386e39" prefetch = false - [resources.sources.main_16] - url = "https://github.com/odoo/odoo/archive/2a88076c1d1df4920bfd139c94862a894d8ef3bc.tar.gz" - sha256 = "39d23f01d9a095d75460829acfd53b74bcfc273a074d6eae163eedcaeeeb58c7" - prefetch = false - [resources.sources.main_15_oca] url = "https://github.com/OCA/OCB/archive/1ab48bd4c89f21691b34f349338405fcbb85dea4.tar.gz" sha256 = "23b8902b6fc22e4ce36f6dcc7178257235663e9911b61b70b70aeca0fdb36331" prefetch = false - [resources.sources.main_15] - url = "https://github.com/odoo/odoo/archive/1ab48bd4c89f21691b34f349338405fcbb85dea4.tar.gz" - sha256 = "93e12c7574e73403d4da456cf612fd5542d961e302fdf9c3a87cdeca9146184d" - prefetch = false - [resources.sources.main_14_oca] url = "https://github.com/OCA/OCB/archive/890a6aa943aafff149924b1aca2517a95a1b352f.tar.gz" sha256 = "41decd11b20d8f99329c413faec9abd1e5ee75076e5f47a33ab806483f51926c" prefetch = false - [resources.sources.main_14] - url = "https://github.com/odoo/odoo/archive/8ede8a758a92c4b61fe48d820464783e21ee7847.tar.gz" - sha256 = "9bd03884cdfe644652a09f86cec652d69c11538d0e0ed620740c25f49099a734" - prefetch = false - [resources.sources.main_12_oca] url = "https://github.com/OCA/OCB/archive/daa274eb48324d563e1096e334a5a73034be71dc.tar.gz" sha256 = "73bd925d3bdc402248548f92908a07e8475b6703d063609ba7f0729060c59aac" prefetch = false - [resources.sources.main_12] - url = "https://github.com/odoo/odoo/archive/c53081f10befd4f1c98e46a450ed3bc71a6246ed.tar.gz" - sha256 = "e2569f947d83ee549304a3112cf5dda3ff4ef7affca8e5e6119b1305ccac1bae" - prefetch = false - - [resources.sources.main_11] - url = "https://github.com/odoo/odoo/archive/43200e9dcc1d91cfd5c1e5e939b27e713d20cc7c.tar.gz" - sha256 = "71418fc5536242de72baa2d17b38a439252956fbbb1ebc3e2294c858674c4659" - prefetch = false - - [resources.sources.main_10] - url = "https://github.com/odoo/odoo/archive/28c3f51c4878fbcd79b2e819948465fcf2160ebc.tar.gz" - sha256 = "880be8b9e5a57e67d6645a527efd83224319d8fc645cbd72f24e7e50a75ff31d" - prefetch = false - - [resources.sources.main_9] - url = "https://github.com/odoo/odoo/archive/7132a15c38a3b5e5ec232404d21aacfa2ac5874e.tar.gz" - sha256 = "f4c522da29201835435b01c651032d07c2d0c0e8a14b30f9a784cb531c5ba250" - prefetch = false - - [resources.sources.main_8] - url = "https://github.com/odoo/odoo/archive/9e8f70e4849b0eeaca8b5cf51372ecfa23dc561b.tar.gz" - sha256 = "51d5db432364d272efe8c7b8f93757a63d762393a9163307f52a2f4f950ec4e6" - prefetch = false - [resources.system_user] [resources.install_dir] diff --git a/scripts/_common.sh b/scripts/_common.sh index 48ab392..eb7f02c 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -41,11 +41,7 @@ function debranding() { } function setup_files() { - if [[ "$oca" -eq 0 ]]; then - source_id="main_${app_version}" - else - source_id="main_${app_version}_oca" - fi + source_id="main_${app_version}_oca" ynh_setup_source --source_id="$source_id" --dest_dir="$install_dir/$appname" debranding From 968b1454d2936ade6ca1be99c95bf9740ebf9990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 22 May 2024 16:42:36 +0200 Subject: [PATCH 18/21] Remove version 15 for add-ons --- manifest.toml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/manifest.toml b/manifest.toml index 7706d0e..d543af4 100644 --- a/manifest.toml +++ b/manifest.toml @@ -42,7 +42,7 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen ask.en = "Choose the version you want" ask.fr = "Choisissez la version désirée" type = "string" - choices = ["11", "12", "14", "15", "16"] + choices = ["12", "14", "16"] default = "16" [install.lang] @@ -73,11 +73,6 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen sha256 = "3c3a95ec627e3807c85b0b2fd13a484b0b990426efb4905681aaee8768386e39" prefetch = false - [resources.sources.main_15_oca] - url = "https://github.com/OCA/OCB/archive/1ab48bd4c89f21691b34f349338405fcbb85dea4.tar.gz" - sha256 = "23b8902b6fc22e4ce36f6dcc7178257235663e9911b61b70b70aeca0fdb36331" - prefetch = false - [resources.sources.main_14_oca] url = "https://github.com/OCA/OCB/archive/890a6aa943aafff149924b1aca2517a95a1b352f.tar.gz" sha256 = "41decd11b20d8f99329c413faec9abd1e5ee75076e5f47a33ab806483f51926c" From 9aab68f2a6836ff09b4ba26e221d87e50aa518d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 22 May 2024 17:00:42 +0200 Subject: [PATCH 19/21] Remove manifes.ttoml fixmes --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index d543af4..5252c08 100644 --- a/manifest.toml +++ b/manifest.toml @@ -26,9 +26,9 @@ architectures = "all" multi_instance = true ldap = true sso = true -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +disk = "500M" +ram.build = "500M" +ram.runtime = "200M" [install] [install.domain] From c2814ae14f8d543f7052a95e2f3a39742fc633a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 22 May 2024 23:53:45 +0200 Subject: [PATCH 20/21] Fix manifest warning --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 5252c08..57850b8 100644 --- a/manifest.toml +++ b/manifest.toml @@ -41,7 +41,7 @@ ram.runtime = "200M" [install.app_version] ask.en = "Choose the version you want" ask.fr = "Choisissez la version désirée" - type = "string" + type = "select" choices = ["12", "14", "16"] default = "16" From 8ee24c67abfa803e817c929e46f6e7f6ffb1c10c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Fri, 24 May 2024 13:38:32 +0200 Subject: [PATCH 21/21] Add pre-upgrade doc --- doc/PRE_UPGRADE.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/PRE_UPGRADE.md diff --git a/doc/PRE_UPGRADE.md b/doc/PRE_UPGRADE.md new file mode 100644 index 0000000..b2bd8ac --- /dev/null +++ b/doc/PRE_UPGRADE.md @@ -0,0 +1,3 @@ +**WARNING**: LibreERP is a complex app. Upgrades will **PROBABLY** break your installation and plugins. + +**PLEASE ENSURE** backups are done and you have time to fix the upgrade aftewrards !