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. 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/favicon.ico b/conf/favicon.ico deleted file mode 100644 index 3f226c7..0000000 Binary files a/conf/favicon.ico and /dev/null differ 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/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/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 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 ! 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..57850b8 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,125 @@ +#: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 = "500M" +ram.build = "500M" +ram.runtime = "200M" + +[install] + [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" + type = "select" + choices = ["12", "14", "16"] + default = "16" + + [install.lang] + ask.en = "Choose the application language" + ask.fr = "Choisissez la langue de l'application" + 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" + + [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_14_oca] + url = "https://github.com/OCA/OCB/archive/890a6aa943aafff149924b1aca2517a95a1b352f.tar.gz" + sha256 = "41decd11b20d8f99329c413faec9abd1e5ee75076e5f47a33ab806483f51926c" + prefetch = false + + [resources.sources.main_12_oca] + url = "https://github.com/OCA/OCB/archive/daa274eb48324d563e1096e334a5a73034be71dc.tar.gz" + sha256 = "73bd925d3bdc402248548f92908a07e8475b6703d063609ba7f0729060c59aac" + 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..eb7f02c 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,89 +4,95 @@ # COMMON VARIABLES #================================================= -export appname="libreerp" -export FORKNAME="odoo" +appname="libreerp" +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" + +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 $final_path/$appname/$FORKNAME ]; then - python_app=$final_path/$appname/$FORKNAME - else - python_app=$final_path/$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 - 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 - ynh_setup_source $final_path/$appname $app_version - else - ynh_setup_source $final_path/$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" - 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" + source_id="main_${app_version}_oca" + ynh_setup_source --source_id="$source_id" --dest_dir="$install_dir/$appname" - # 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 - else - ynh_replace_string "'auto_install': False" "'auto_install': True" $final_path/$appname/addons/auth_ldap/__openerp__.py - fi - 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" + + if [ ! -f "$conf_file" ]; then + mkdir -p "$(dirname "$conf_file")" + ynh_configure server.conf "$conf_file" + chmod 400 "$conf_file" + chown -R "$app:$app" "$(dirname "$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 $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=" -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', @@ -108,9 +114,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 () { @@ -119,24 +125,17 @@ 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 ]] - then + if [[ $app_version -gt 9 ]]; then content2="dbfilter = False" fi content3="list_db = False" fi - mkdir -p "$(dirname $DEST)" - if [ -f '../manifest.json' ] ; 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" } #================================================= 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/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 </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,22 +38,10 @@ 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 -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 +# 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 7b9f65e..798f23d 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" -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" +# 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 #================================================= 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..22862f6 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 -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 +#================================================= +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 diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..aae2c2c --- /dev/null +++ b/tests.toml @@ -0,0 +1,28 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json + +test_format = 1.0 + +[default] + exclude = ["change_url"] + + 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] + exclude = ["change_url"] + + args.version = "15" + args.tz = "Etc/GMT" + +[no_multisite_v16] + exclude = ["change_url"] + + args.version = "16" + args.tz = "Etc/GMT"