mirror of
https://github.com/YunoHost-Apps/libreerp_ynh.git
synced 2024-09-03 19:36:13 +02:00
Merge pull request #47 from YunoHost-Apps/manifestv2
Manifestv2: install
This commit is contained in:
commit
1f932d7aff
37 changed files with 426 additions and 1017 deletions
24
README.md
24
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:** <https://www.odoo.com/trial>
|
||||
## 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:** <https://www.odoo.com/trial>
|
||||
## :red_circle: Antifeatures
|
||||
|
||||
- **Paid content**: Promotes or depends, entirely or partially, on a paid service.
|
||||
|
|
24
README_es.md
24
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:** <https://www.odoo.com/trial>
|
||||
## 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:** <https://www.odoo.com/trial>
|
||||
## :red_circle: funcionalidades no deseadas
|
||||
|
||||
- **Paid content**: Promotes or depends, entirely or partially, on a paid service.
|
||||
|
|
24
README_eu.md
24
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:** <https://www.odoo.com/trial>
|
||||
## 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:** <https://www.odoo.com/trial>
|
||||
## :red_circle: Ezaugarri zalantzagarriak
|
||||
|
||||
- **Ordainpeko edukia**: Ordainpeko zerbitzu bat sustatzen du edo bere mende dago, osorik edo neurri batean.
|
||||
|
|
24
README_fr.md
24
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 :** <https://www.odoo.com/trial>
|
||||
## 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 :** <https://www.odoo.com/trial>
|
||||
## :red_circle: Anti-fonctionnalités
|
||||
|
||||
- **Contenu payant **: Promeut ou dépend, entièrement ou partiellement, d'un service payant.
|
||||
|
|
24
README_gl.md
24
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:** <https://www.odoo.com/trial>
|
||||
## 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:** <https://www.odoo.com/trial>
|
||||
## :red_circle: Debes considerar
|
||||
|
||||
- **Paid content**: Promotes or depends, entirely or partially, on a paid service.
|
||||
|
|
|
@ -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
|
||||
|
||||
**演示:** <https://www.odoo.com/trial>
|
||||
## 免责声明 / 重要信息
|
||||
|
||||
**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
|
||||
|
||||
**演示:** <https://www.odoo.com/trial>
|
||||
## :red_circle: 负面特征
|
||||
|
||||
- **Paid content**: Promotes or depends, entirely or partially, on a paid service.
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
BIN
conf/favicon.ico
BIN
conf/favicon.ico
Binary file not shown.
Before Width: | Height: | Size: 1 KiB |
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
||||
|
|
5
doc/ADMIN.md
Normal file
5
doc/ADMIN.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
|
||||
### To connect on your LibreERP
|
||||
|
||||
- Go on <https://__DOMAIN__/web>
|
||||
- Login as "admin" with the master password you provided during installation
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
5
doc/PRE_INSTALL.md
Normal file
5
doc/PRE_INSTALL.md
Normal file
|
@ -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
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
125
manifest.toml
Normal file
125
manifest.toml
Normal file
|
@ -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 = "string"
|
||||
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"
|
|
@ -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 <a[^>]*>Odoo<\/a>//g' {} \;
|
||||
find $final_path/$appname -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/<a[^>]*>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 <[^>]*><img[^>]*Odoo[^>]*><\/a>//g' {} \;
|
||||
if test -f "$final_path/$appname/addons/web/static/src/xml/base.xml"; then
|
||||
sed -i 's/<a[^>]*>My Odoo.com account<\/a>//g' $final_path/$appname/addons/web/static/src/xml/base.xml
|
||||
sed -i 's/<a[^>]*>Documentation<\/a>//g' $final_path/$appname/addons/web/static/src/xml/base.xml
|
||||
sed -i 's/<a[^>]*>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 <a[^>]*>Odoo<\/a>//g' {} \;
|
||||
find "$install_dir/$appname" -type f \( -iname '*.xml' -o -iname '*.po' \) -exec sed -i 's/<a[^>]*>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 <[^>]*><img[^>]*Odoo[^>]*><\/a>//g' {} \;
|
||||
if test -f "$install_dir/$appname/addons/web/static/src/xml/base.xml"; then
|
||||
sed -i 's/<a[^>]*>My Odoo.com account<\/a>//g' "$install_dir/$appname/addons/web/static/src/xml/base.xml"
|
||||
sed -i 's/<a[^>]*>Documentation<\/a>//g' "$install_dir/$appname/addons/web/static/src/xml/base.xml"
|
||||
sed -i 's/<a[^>]*>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() {
|
||||
source_id="main_${app_version}_oca"
|
||||
ynh_setup_source --source_id="$source_id" --dest_dir="$install_dir/$appname"
|
||||
|
||||
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
|
||||
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 $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
|
||||
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"
|
||||
}
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 <<ODOODOC
|
||||
sudo -u $app $VENV/bin/python $install_dir/libreerp/odoo-bin shell -d $app -c /etc/$app/main.conf --logfile /proc/self/fd/1 <<ODOODOC
|
||||
if hasattr(self.env['ir.module.module'], 'upgrade_changed_checksum_shell'):
|
||||
self.env['ir.module.module'].upgrade_changed_checksum_shell()
|
||||
else:
|
||||
|
|
217
scripts/install
217
scripts/install
|
@ -1,7 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC START
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
@ -10,109 +8,24 @@ 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
|
||||
preinstall=0
|
||||
|
||||
#=================================================
|
||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||
# ADD SWAP
|
||||
#=================================================
|
||||
|
||||
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
|
||||
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"
|
||||
fi
|
||||
|
||||
# Register (book) web path
|
||||
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
||||
|
||||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
#=================================================
|
||||
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,113 +35,63 @@ 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
|
||||
#=================================================
|
||||
ynh_script_progression --message="Setuping the database..." --weight=1
|
||||
ynh_script_progression --message="Setting up 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
|
||||
|
|
|
@ -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,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
|
||||
|
|
206
scripts/restore
206
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
|
||||
|
||||
|
|
184
scripts/upgrade
184
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
|
||||
|
|
28
tests.toml
Normal file
28
tests.toml
Normal file
|
@ -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"
|
Loading…
Reference in a new issue