diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..2729a6b --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,55 @@ +--- +name: Bug report +about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently. + +--- + +**How to post a meaningful bug report** +1. *Read this whole template first.* +2. *Determine if you are on the right place:* + - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* + - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* + - *When in doubt, post here and we will figure it out together.* +3. *Delete the italic comments as you write over them below, and remove this guide.* +--- + +### Describe the bug + +*A clear and concise description of what the bug is.* + +### Context + +- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* +- YunoHost version: x.x.x +- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* +- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* + - If yes, please explain: +- Using, or trying to install package version/branch: +- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* + +### Steps to reproduce + +- *If you performed a command from the CLI, the command itself is enough. For example:* + ```sh + sudo yunohost app install the_app + ``` +- *If you used the webadmin, please perform the equivalent command from the CLI first.* +- *If the error occurs in your browser, explain what you did:* + 1. *Go to '...'* + 2. *Click on '...'* + 3. *Scroll down to '...'* + 4. *See error* + +### Expected behavior + +*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.* + +### Logs + +*When an operation fails, YunoHost provides a simple way to share the logs.* +- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* +- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* + +*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)* + +*If applicable and useful, add screenshots to help explain your problem.* diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ef70e18 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Problem + +- *Description of why you made this PR* + +## Solution + +- *And how do you fix that problem* + +## PR Status + +- [ ] Code finished and ready to be reviewed/tested +- [ ] The fix/enhancement were manually tested (if applicable) + +## Automatic tests + +Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization) diff --git a/ALL_README.md b/ALL_README.md new file mode 100644 index 0000000..152f2e7 --- /dev/null +++ b/ALL_README.md @@ -0,0 +1,8 @@ +# All available README files by language + +- [Read the README in English](README.md) +- [Lea el README en español](README_es.md) +- [Irakurri README euskaraz](README_eu.md) +- [Lire le README en français](README_fr.md) +- [Le o README en galego](README_gl.md) +- [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index 9d4f9d3..55d4568 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,47 @@ -# xWiki for YunoHost +# XWiki for YunoHost [![Integration level](https://dash.yunohost.org/integration/xwiki.svg)](https://dash.yunohost.org/appci/app/xwiki) ![Working status](https://ci-apps.yunohost.org/ci/badges/xwiki.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/xwiki.maintain.svg) -[![Install xWiki with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=xwiki) +[![Install XWiki with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=xwiki) -*[Lire ce readme en français.](./README_fr.md)* +*[Read this README in other languages.](./ALL_README.md)* -> *This package allows you to install xWiki quickly and simply on a YunoHost server. -If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* +> *This package allows you to install XWiki quickly and simply on a YunoHost server.* +> *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.* ## Overview XWiki is an Open Source wiki engine (LGPLv2) suitable for use by workgroups (associations, companies, etc.). The software allows the rapid creation of small applications to meet different information management needs. -**Shipped version:** 15.10.1~ynh1 +**Shipped version:** 16.4.0~ynh1 -**Demo:** https://playground.xwiki.org/xwiki/bin/view/Main/WebHome +**Demo:** ## Screenshots -![Screenshot of xWiki](./doc/screenshots/XWiki-standard-help.jpg) +![Screenshot of XWiki](./doc/screenshots/XWiki-standard-help.jpg) ## Documentation and resources -* Official app website: -* Official user documentation: -* Official admin documentation: -* Upstream app code repository: -* YunoHost Store: -* Report a bug: +- Official app website: +- Official user documentation: +- Official admin documentation: +- Upstream app code repository: +- YunoHost Store: +- Report a bug: ## Developer info -Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing). +Please send your pull request to the [`testing` branch](https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing). -To try the testing branch, please proceed like that. +To try the `testing` branch, please proceed like that: -``` bash +```bash sudo yunohost app install https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing --debug or sudo yunohost app upgrade xwiki -u https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing --debug diff --git a/README_es.md b/README_es.md new file mode 100644 index 0000000..08706fe --- /dev/null +++ b/README_es.md @@ -0,0 +1,50 @@ + + +# XWiki para Yunohost + +[![Nivel de integración](https://dash.yunohost.org/integration/xwiki.svg)](https://dash.yunohost.org/appci/app/xwiki) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/xwiki.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/xwiki.maintain.svg) + +[![Instalar XWiki con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=xwiki) + +*[Leer este README en otros idiomas.](./ALL_README.md)* + +> *Este paquete le permite instalarXWiki rapidamente y simplement en un servidor YunoHost.* +> *Si no tiene YunoHost, visita [the guide](https://yunohost.org/install) para aprender como instalarla.* + +## Descripción general + +XWiki is an Open Source wiki engine (LGPLv2) suitable for use by workgroups (associations, companies, etc.). The software allows the rapid creation of small applications to meet different information management needs. + +**Versión actual:** 16.4.0~ynh1 + +**Demo:** + +## Capturas + +![Captura de XWiki](./doc/screenshots/XWiki-standard-help.jpg) + +## Documentaciones y recursos + +- Sitio web oficial: +- Documentación usuario oficial: +- Documentación administrador oficial: +- Repositorio del código fuente oficial de la aplicación : +- Catálogo YunoHost: +- Reportar un error: + +## Información para desarrolladores + +Por favor enviar sus correcciones a la [`branch testing`](https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing + +Para probar la rama `testing`, sigue asÍ: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing --debug +o +sudo yunohost app upgrade xwiki -u https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing --debug +``` + +**Mas informaciones sobre el empaquetado de aplicaciones:** diff --git a/README_eu.md b/README_eu.md new file mode 100644 index 0000000..5e43e97 --- /dev/null +++ b/README_eu.md @@ -0,0 +1,50 @@ + + +# XWiki YunoHost-erako + +[![Integrazio maila](https://dash.yunohost.org/integration/xwiki.svg)](https://dash.yunohost.org/appci/app/xwiki) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/xwiki.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/xwiki.maintain.svg) + +[![Instalatu XWiki YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=xwiki) + +*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)* + +> *Pakete honek XWiki YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.* +> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.* + +## Aurreikuspena + +XWiki is an Open Source wiki engine (LGPLv2) suitable for use by workgroups (associations, companies, etc.). The software allows the rapid creation of small applications to meet different information management needs. + +**Paketatutako bertsioa:** 16.4.0~ynh1 + +**Demoa:** + +## Pantaila-argazkiak + +![XWiki(r)en pantaila-argazkia](./doc/screenshots/XWiki-standard-help.jpg) + +## Dokumentazioa eta baliabideak + +- Aplikazioaren webgune ofiziala: +- Erabiltzaileen dokumentazio ofiziala: +- Administratzaileen dokumentazio ofiziala: +- Jatorrizko aplikazioaren kode-gordailua: +- YunoHost Denda: +- Eman errore baten berri: + +## Garatzaileentzako informazioa + +Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing). + +`testing` abarra probatzeko, ondorengoa egin: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing --debug +edo +sudo yunohost app upgrade xwiki -u https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing --debug +``` + +**Informazio gehiago aplikazioaren paketatzeari buruz:** diff --git a/README_fr.md b/README_fr.md index 6b4bcf2..5339058 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,50 +1,50 @@ -# xWiki pour YunoHost +# XWiki pour YunoHost [![Niveau d’intégration](https://dash.yunohost.org/integration/xwiki.svg)](https://dash.yunohost.org/appci/app/xwiki) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/xwiki.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/xwiki.maintain.svg) -[![Installer xWiki avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=xwiki) +[![Installer XWiki avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=xwiki) -*[Read this readme in english.](./README.md)* +*[Lire le README dans d'autres langues.](./ALL_README.md)* -> *Ce package vous permet d’installer xWiki rapidement et simplement sur un serveur YunoHost. -Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* +> *Ce package vous permet d’installer XWiki rapidement et simplement sur un serveur YunoHost.* +> *Si vous n’avez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment l’installer et en profiter.* ## Vue d’ensemble XWiki est un moteur de wiki Open Source (LGPLv2) adapté à un usage pour des groupes de travail (associations, entreprises…). Le logiciel permet la création rapide de petites applications pour répondre à différents besoins de gestion de l'information. -**Version incluse :** 15.10.1~ynh1 +**Version incluse :** 16.4.0~ynh1 -**Démo :** https://playground.xwiki.org/xwiki/bin/view/Main/WebHome +**Démo :** ## Captures d’écran -![Capture d’écran de xWiki](./doc/screenshots/XWiki-standard-help.jpg) +![Capture d’écran de XWiki](./doc/screenshots/XWiki-standard-help.jpg) ## Documentations et ressources -* Site officiel de l’app : -* Documentation officielle utilisateur : -* Documentation officielle de l’admin : -* Dépôt de code officiel de l’app : -* YunoHost Store: -* Signaler un bug : +- Site officiel de l’app : +- Documentation officielle utilisateur : +- Documentation officielle de l’admin : +- Dépôt de code officiel de l’app : +- YunoHost Store : +- Signaler un bug : ## Informations pour les développeurs -Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing). +Merci de faire vos pull request sur la [branche `testing`](https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing). -Pour essayer la branche testing, procédez comme suit. +Pour essayer la branche `testing`, procédez comme suit : -``` bash +```bash sudo yunohost app install https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing --debug ou sudo yunohost app upgrade xwiki -u https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing --debug ``` -**Plus d’infos sur le packaging d’applications :** \ No newline at end of file +**Plus d’infos sur le packaging d’applications :** diff --git a/README_gl.md b/README_gl.md new file mode 100644 index 0000000..9320196 --- /dev/null +++ b/README_gl.md @@ -0,0 +1,50 @@ + + +# XWiki para YunoHost + +[![Nivel de integración](https://dash.yunohost.org/integration/xwiki.svg)](https://dash.yunohost.org/appci/app/xwiki) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/xwiki.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/xwiki.maintain.svg) + +[![Instalar XWiki con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=xwiki) + +*[Le este README en outros idiomas.](./ALL_README.md)* + +> *Este paquete permíteche instalar XWiki de xeito rápido e doado nun servidor YunoHost.* +> *Se non usas YunoHost, le a [documentación](https://yunohost.org/install) para saber como instalalo.* + +## Vista xeral + +XWiki is an Open Source wiki engine (LGPLv2) suitable for use by workgroups (associations, companies, etc.). The software allows the rapid creation of small applications to meet different information management needs. + +**Versión proporcionada:** 16.4.0~ynh1 + +**Demo:** + +## Capturas de pantalla + +![Captura de pantalla de XWiki](./doc/screenshots/XWiki-standard-help.jpg) + +## Documentación e recursos + +- Web oficial da app: +- Documentación oficial para usuarias: +- Documentación oficial para admin: +- Repositorio de orixe do código: +- Tenda YunoHost: +- Informar dun problema: + +## Info de desenvolvemento + +Envía a túa colaboración á [rama `testing`](https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing). + +Para probar a rama `testing`, procede deste xeito: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing --debug +ou +sudo yunohost app upgrade xwiki -u https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing --debug +``` + +**Máis info sobre o empaquetado da app:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md new file mode 100644 index 0000000..d5ba5ed --- /dev/null +++ b/README_zh_Hans.md @@ -0,0 +1,50 @@ + + +# YunoHost 上的 XWiki + +[![集成程度](https://dash.yunohost.org/integration/xwiki.svg)](https://dash.yunohost.org/appci/app/xwiki) ![工作状态](https://ci-apps.yunohost.org/ci/badges/xwiki.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/xwiki.maintain.svg) + +[![使用 YunoHost 安装 XWiki](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=xwiki) + +*[阅读此 README 的其它语言版本。](./ALL_README.md)* + +> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 XWiki。* +> *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。* + +## 概况 + +XWiki is an Open Source wiki engine (LGPLv2) suitable for use by workgroups (associations, companies, etc.). The software allows the rapid creation of small applications to meet different information management needs. + +**分发版本:** 16.4.0~ynh1 + +**演示:** + +## 截图 + +![XWiki 的截图](./doc/screenshots/XWiki-standard-help.jpg) + +## 文档与资源 + +- 官方应用网站: +- 官方用户文档: +- 官方管理文档: +- 上游应用代码库: +- YunoHost 商店: +- 报告 bug: + +## 开发者信息 + +请向 [`testing` 分支](https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing) 发送拉取请求。 + +如要尝试 `testing` 分支,请这样操作: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing --debug +或 +sudo yunohost app upgrade xwiki -u https://github.com/YunoHost-Apps/xwiki_ynh/tree/testing --debug +``` + +**有关应用打包的更多信息:** diff --git a/auto_update/auto_update.sh b/auto_update/auto_update.sh new file mode 100644 index 0000000..e130c82 --- /dev/null +++ b/auto_update/auto_update.sh @@ -0,0 +1,91 @@ +#!/bin/bash + +set -eu + +readonly app_name=xwiki + +source auto_update_config.sh + +get_from_manifest() { + result=$(python3 <&1 | tee "${app_name}_build_temp.log" + return "${PIPESTATUS[0]}" +} + +app_prev_version="$(get_from_manifest ".version" | cut -d'~' -f1)" +app_version="$app_prev_version" + +if check_app_version +then + set +eu + upgrade_app + res=$? + set -eu + if [ $res -eq 0 ]; then + result="Success" + else + result="Failed" + fi + msg="Build: $app_name version $app_version\n" + msg+="$(cat ${app_name}_build_temp.log)" + echo -e "$msg" | mail.mailutils -a "Content-Type: text/plain; charset=UTF-8" -s "Autoupgrade $app_name : $result" "$notify_email" +fi diff --git a/auto_update/auto_update_config_example.sh b/auto_update/auto_update_config_example.sh new file mode 100644 index 0000000..daecfc8 --- /dev/null +++ b/auto_update/auto_update_config_example.sh @@ -0,0 +1 @@ +notify_email="hello@world.tld" diff --git a/conf/install_extensions.xml b/conf/install_extensions.xml index 16b077c..dda1a41 100644 --- a/conf/install_extensions.xml +++ b/conf/install_extensions.xml @@ -2,7 +2,7 @@ extension - provision + action __JOB_ID__ @@ -29,7 +29,7 @@ namespaces - xwiki:xwiki + wiki:xwiki diff --git a/conf/xwiki.properties b/conf/xwiki.properties index f185673..cabd93d 100644 --- a/conf/xwiki.properties +++ b/conf/xwiki.properties @@ -340,7 +340,7 @@ environment.permanentDirectory = __DATA_DIR__ #-# Type of the openoffice server instance used by officeimporter component. #-# 0 - Internally managed server instance. (Default) #-# 1 - Externally managed (local) server instance. -# openoffice.serverType = 0 +openoffice.serverType = 0 #-# [Since 12.1RC1] #-# Port numbers used for connecting to the openoffice server instance. @@ -351,7 +351,7 @@ environment.permanentDirectory = __DATA_DIR__ #-# [Since 1.9M2] #-# If the openoffice server should be started / connected upon XE start. #-# Default value is false -# openoffice.autoStart = false +openoffice.autoStart = true #-# [Since 1.8RC3] #-# Path to openoffice installation (serverType:0 only). diff --git a/manifest.toml b/manifest.toml index 4bf2a11..d663709 100644 --- a/manifest.toml +++ b/manifest.toml @@ -1,11 +1,11 @@ packaging_format = 2 id = "xwiki" -name = "xWiki" +name = "XWiki" description.en = "Collaboration tool based on the wiki principle" description.fr = "Outil de collaboration basé sur le principe du wiki" -version = "15.10.1~ynh1" +version = "16.4.0~ynh1" maintainers = ["Josué Tille"] @@ -61,31 +61,31 @@ ram.runtime = "1G" [resources.sources] [resources.sources.main] - url = "https://nexus.xwiki.org/nexus/content/groups/public/org/xwiki/platform/xwiki-platform-distribution-jetty-hsqldb/15.10.1/xwiki-platform-distribution-jetty-hsqldb-15.10.1.zip" - sha256 = "76efd6e1c58b8557034a3e25271963392b8b5e125af97d932210823510586e9f" + url = "https://nexus.xwiki.org/nexus/content/groups/public/org/xwiki/platform/xwiki-platform-distribution-jetty-hsqldb/16.4.0/xwiki-platform-distribution-jetty-hsqldb-16.4.0.zip" + sha256 = "5cfc373198bb7386a573dfcbfa8352af4ce0017b49911ec724900fb58cf7bace" format = "zip" [resources.sources.jdbc] - url = "https://jdbc.postgresql.org/download/postgresql-42.7.0.jar" - rename = "postgresql-42.7.0.jar" - sha256 = "90c39c97ac309b5767882f9beef913244da029204af2d2982c2b45bcfcb42624" + url = "https://jdbc.postgresql.org/download/postgresql-42.7.3.jar" + rename = "postgresql-42.7.3.jar" + sha256 = "a2644cbfba1baa145ff7e8c8ef582a6eed7a7ec4ca792f7f054122bdec756268" # Note that xq is available on debian package since debian 12 # So on bookworm should just remove this and use official package [resources.sources.xq_tool] in_subdir= false - i386.url = "https://github.com/sibprogrammer/xq/releases/download/v1.2.3/xq_1.2.3_linux_386.tar.gz" - i386.sha256 = "fc500e887d825f6cbedecdbfb3a272e1a88473b1f1a1b92075cab429d3d6fc64" + i386.url = "https://github.com/sibprogrammer/xq/releases/download/v1.2.4/xq_1.2.4_linux_386.tar.gz" + i386.sha256 = "f51e27493fb49dee53f3511ad6f4710f8fb7014e6ba0796d3c6d2eee6ceef914" - amd64.url = "https://github.com/sibprogrammer/xq/releases/download/v1.2.3/xq_1.2.3_linux_amd64.tar.gz" - amd64.sha256 = "d510d97a247ad9b5a4e92759ea9b1b6be07d9f18187209b359525744e1bb8947" + amd64.url = "https://github.com/sibprogrammer/xq/releases/download/v1.2.4/xq_1.2.4_linux_amd64.tar.gz" + amd64.sha256 = "96148dc3ce4fede9ab47b26fa07f1ada950dfd61ae54db7013c76a410945302f" - armhf.url = "https://github.com/sibprogrammer/xq/releases/download/v1.2.3/xq_1.2.3_linux_armv7.tar.gz" - armhf.sha256 = "f9b01ba7d77965f292f3c1b8c164267367507e16a8951b67733a539d7f73eecb" + armhf.url = "https://github.com/sibprogrammer/xq/releases/download/v1.2.4/xq_1.2.4_linux_armv7.tar.gz" + armhf.sha256 = "9b08c33f1a3dd1f7a6a82dd91ef7dfb5297d0c3ea2ccfc6ee616393667862d56" - arm64.url = "https://github.com/sibprogrammer/xq/releases/download/v1.2.3/xq_1.2.3_linux_arm64.tar.gz" - arm64.sha256 = "a8989b2b1a5254033aebacb72ffea77964d6903d809361001dbf1ed09a0c6550" + arm64.url = "https://github.com/sibprogrammer/xq/releases/download/v1.2.4/xq_1.2.4_linux_arm64.tar.gz" + arm64.sha256 = "414ea9fde3c6e669f034465c21aa095bc3c10a3e3dd8c2989ee8073605274bf9" # # INFO need also to update extensions version on _common.sh @@ -109,7 +109,7 @@ ram.runtime = "1G" admin.label = "Admins" [resources.apt] - packages = ["openjdk-17-jre", "postgresql"] + packages = ["openjdk-17-jre", "postgresql", "libreoffice"] [resources.database] type = "postgresql" diff --git a/scripts/_common.sh b/scripts/_common.sh index 4d4bdd7..3a91061 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,8 +6,8 @@ super_admin_config='#' systemd_match_start_line='oxtjl.NotifyListener:main: ----------------------------------' -flavor_version='15.10.1' -ldap_version='9.12.0' +flavor_version='16.3.1' +ldap_version='9.15.2' if [ $install_standard_flavor -eq 1 ]; then distribution_default_ui="distribution.defaultUI=org.xwiki.platform:xwiki-platform-distribution-flavor-mainwiki/$flavor_version" @@ -24,7 +24,7 @@ else install_on_root=false path2=${path/#\//}/ # path=/xwiki -> xwiki/ path3=${path/#\//} # path=/xwiki -> xwiki - web_inf_path="$install_dir"/webapps$path/WEB-INF + web_inf_path="$install_dir/webapps$path/WEB-INF" fi #================================================= @@ -34,18 +34,18 @@ fi enable_super_admin() { super_admin_pwd=$(ynh_string_random) super_admin_config="xwiki.superadminpassword=$super_admin_pwd" - ynh_add_config --template=xwiki.cfg --destination=/etc/$app/xwiki_conf.cfg - ln -f /etc/$app/xwiki_conf.cfg "$web_inf_path"/xwiki.cfg - chmod 400 /etc/$app/xwiki_conf.cfg - chown "$app:$app" /etc/$app/xwiki_conf.cfg + ynh_add_config --template=xwiki.cfg --destination=/etc/"$app"/xwiki_conf.cfg + ln -f /etc/"$app"/xwiki_conf.cfg "$web_inf_path"/xwiki.cfg + chmod 400 /etc/"$app"/xwiki_conf.cfg + chown "$app:$app" /etc/"$app"/xwiki_conf.cfg } disable_super_admin() { super_admin_config='#' - ynh_add_config --template=xwiki.cfg --destination=/etc/$app/xwiki_conf.cfg - ln -f /etc/$app/xwiki_conf.cfg "$web_inf_path"/xwiki.cfg - chmod 400 /etc/$app/xwiki_conf.cfg - chown "$app:$app" /etc/$app/xwiki_conf.cfg + ynh_add_config --template=xwiki.cfg --destination=/etc/"$app"/xwiki_conf.cfg + ln -f /etc/"$app"/xwiki_conf.cfg "$web_inf_path"/xwiki.cfg + chmod 400 /etc/"$app"/xwiki_conf.cfg + chown "$app:$app" /etc/"$app"/xwiki_conf.cfg } install_exension() { @@ -66,17 +66,17 @@ install_exension() { local status_raw local state_request - chmod 700 $temp_dir - chown root:root $temp_dir + chmod 700 "$temp_dir" + chown root:root "$temp_dir" - ynh_add_config --template=install_extensions.xml --destination=$temp_dir/install_extensions.xml + ynh_add_config --template=install_extensions.xml --destination="$temp_dir"/install_extensions.xml status_raw=$($curl -i --user "superadmin:$super_admin_pwd" -X PUT -H 'Content-Type: text/xml' "http://127.0.0.1:$port/${path2}rest/jobs?jobType=install&async=true" --upload-file $temp_dir/install_extensions.xml) - state_request=$(echo $status_raw | $xq -x '//jobStatus/ns2:state') + state_request=$(echo "$status_raw" | $xq -x '//jobStatus/ns2:state') while true; do sleep 5 - status_raw=$($curl --user "superadmin:$super_admin_pwd" -X GET -H 'Content-Type: text/xml' "http://127.0.0.1:$port/${path2}rest/jobstatus/extension/provision/$job_id") + status_raw=$($curl --user "superadmin:$super_admin_pwd" -X GET -H 'Content-Type: text/xml' "http://127.0.0.1:$port/${path2}rest/jobstatus/extension/action/$job_id") state_request=$(echo "$status_raw" | $xq -x '//jobStatus/state') if [ -z "$state_request" ]; then @@ -96,7 +96,7 @@ install_exension() { } wait_xwiki_started() { - local res='meta http-equiv="refresh" content="1"'$ + local res='meta http-equiv="refresh" content="1"' local curl='curl --silent --show-error' while echo "$res" | grep -q 'meta http-equiv="refresh" content="1"'; do @@ -106,31 +106,15 @@ wait_xwiki_started() { } wait_for_flavor_install() { - local flavor_job_id='org.xwiki.platform%3Axwiki-platform-distribution-flavor-mainwiki/wiki%3Axwiki' - local status_raw - local state_request - local xq=$install_dir/xq_tool/xq - local curl='curl --silent --show-error' + local status_header # Need to call main page to start xwiki service wait_xwiki_started while true; do - status_raw=$($curl --user "superadmin:$super_admin_pwd" -X GET -H 'Content-Type: text/xml' "http://127.0.0.1:$port/${path2}rest/jobstatus/extension/action/$flavor_job_id") - state_request=$(echo "$status_raw" | $xq -x '//jobStatus/state') - - if [ -z "$state_request" ]; then - ynh_die --message="Invalid answer: '$status_raw'" - elif [ "$state_request" == FINISHED ]; then - # Check if error happen - error_msg=$(echo "$status_raw" | $xq -x '//jobStatus/errorMessage') - if [ -z "$error_msg" ]; then - break - else - ynh_die --message="Error while installing extension 'org.xwiki.platform%3Axwiki-platform-distribution-flavor-mainwiki'. Error: $error_msg" - fi - elif [ "$state_request" != RUNNING ]; then - ynh_die --message="Invalid status '$state_request'" + status_header="$(curl --silent --show-error -I "http://127.0.0.1:$port/${path2}bin/view/Main/")" + if ! echo "$status_header" | grep -q -E 'Location:[[:space:]].*/Distribution\?xredirect='; then + break fi sleep 10 done @@ -152,14 +136,14 @@ install_source() { elif [ "$path" == /root ]; then ynh_die --message='Path "/root" not supported' elif [ "$path" != /xwiki ]; then - mv "$install_dir"/webapps/xwiki "$install_dir"/webapps$path + mv "$install_dir"/webapps/xwiki "$install_dir/webapps$path" fi } add_config() { - ynh_add_config --template=hibernate.cfg.xml --destination=/etc/$app/hibernate.cfg.xml - ynh_add_config --template=xwiki.cfg --destination=/etc/$app/xwiki_conf.cfg - ynh_add_config --template=xwiki.properties --destination=/etc/$app/xwiki_conf.properties + ynh_add_config --template=hibernate.cfg.xml --destination=/etc/"$app"/hibernate.cfg.xml + ynh_add_config --template=xwiki.cfg --destination=/etc/"$app"/xwiki_conf.cfg + ynh_add_config --template=xwiki.properties --destination=/etc/"$app"/xwiki_conf.properties # Note that using /etc/xwiki/xwiki.cfg or /etc/xwiki/xwiki.properties is hard coded on the application # And using this break multi instance feature so we must use an other path @@ -172,16 +156,16 @@ set_permissions() { chmod -R u+rwX,o-rwx "$install_dir" chown -R "$app:$app" "$install_dir" - chmod -R u=rwX,g=rX,o= /etc/$app - chown -R "$app:$app" /etc/$app + chmod -R u=rwX,g=rX,o= /etc/"$app" + chown -R "$app:$app" /etc/"$app" - chown "$app:$app" -R /var/log/$app - chmod u=rwX,g=rX,o= -R /var/log/$app + chown "$app:$app" -R /var/log/"$app" + chmod u=rwX,g=rX,o= -R /var/log/"$app" - find $data_dir \( \! -perm u=rwX,g=rX,-o= \ - -o \! -user $app \ - -o \! -group $app \) \ - -exec chown $app:$app {} \; \ + find "$data_dir" \( \! -perm -o= \ + -o \! -user "$app" \ + -o \! -group "$app" \) \ + -exec chown "$app:$app" {} \; \ -exec chmod u=rwX,g=rX,o= {} \; } diff --git a/scripts/backup b/scripts/backup index 6fef85d..7d7515d 100755 --- a/scripts/backup +++ b/scripts/backup @@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_print_info --message="Declaring files to be backed up..." -if [[ ! "$(systemctl status $app)" =~ "Active: inactive (dead)" ]]; then +if systemctl is-active "$app" --quiet; then ynh_print_warn --message="It's hightly recommended to make your backup when the service is stopped. Please stop $app service with this command before to run the backup 'systemctl stop $app.service'" fi diff --git a/scripts/change_url b/scripts/change_url index 77b52b4..1fd1da4 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action=stop +ynh_systemd_action --service_name="$app" --action=stop #================================================= # MODIFY URL IN NGINX CONF @@ -27,15 +27,15 @@ ynh_change_url_nginx_config ynh_script_progression --message="Updating xwiki configuration..." --weight=1 -if [ $new_path != $old_path ]; then - if $install_on_root; then - mv "$install_dir"/webapps$old_path "$install_dir"/webapps/root +if [ "$new_path" != "$old_path" ]; then + if "$install_on_root"; then + mv "$install_dir/webapps$old_path" "$install_dir"/webapps/root elif [ "$path" == /root ]; then ynh_die --message='Path "/root" not supported' elif [ $old_path == / ]; then - mv "$install_dir"/webapps/root "$install_dir"/webapps$new_path + mv "$install_dir"/webapps/root "$install_dir/webapps$new_path" else - mv "$install_dir"/webapps$old_path "$install_dir"/webapps$new_path + mv "$install_dir/webapps$old_path" "$install_dir/webapps$new_path" fi fi add_config @@ -48,7 +48,7 @@ set_permissions #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="$systemd_match_start_line" +ynh_systemd_action --service_name="$app" --action=start --log_path=systemd --line_match="$systemd_match_start_line" wait_xwiki_started #================================================= diff --git a/scripts/install b/scripts/install index 115aa71..287e813 100755 --- a/scripts/install +++ b/scripts/install @@ -13,15 +13,15 @@ source /usr/share/yunohost/helpers # APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC) #================================================= -if [ -n "$(ls -A $data_dir)" ]; then +if [ -n "$(ls -A "$data_dir")" ]; then old_data_dir_path="${data_dir}_$(date '+%Y%m%d.%H%M%S')" ynh_print_warn "Data directory was not empty. Data was moved to $old_data_dir_path" - mkdir -p $old_data_dir_path + mkdir -p "$old_data_dir_path" mv -t "$old_data_dir_path" "$data_dir"/* fi mkdir -p /var/log/"$app" -mkdir -p /etc/$app +mkdir -p /etc/"$app" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -52,7 +52,7 @@ ynh_add_systemd_config yunohost service add "$app" --description=XWiki --log="/var/log/$app/$app.log" -ynh_use_logrotate --logfile "/var/log/$app" +ynh_use_logrotate --logfile="/var/log/$app" #================================================= # INSTALL EXTENSIONS @@ -61,9 +61,9 @@ ynh_use_logrotate --logfile "/var/log/$app" enable_super_admin # Start a systemd service -ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="$systemd_match_start_line" +ynh_systemd_action --service_name="$app" --action=start --log_path=systemd --line_match="$systemd_match_start_line" -if [ $install_standard_flavor -eq 1 ]; then +if [ "$install_standard_flavor" -eq 1 ]; then ynh_script_progression --message='Installing flavor...' wait_for_flavor_install fi @@ -72,7 +72,7 @@ ynh_script_progression --message='Installing LDAP extension...' --weight=1 install_exension 'org.xwiki.contrib.ldap:ldap-authenticator' "$ldap_version" # Disable super admin -ynh_systemd_action --service_name=$app --action=stop +ynh_systemd_action --service_name="$app" --action=stop disable_super_admin #================================================= @@ -82,7 +82,7 @@ disable_super_admin #================================================= ynh_script_progression --message='Starting a systemd service...' --weight=1 -ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="$systemd_match_start_line" +ynh_systemd_action --service_name="$app" --action=start --log_path=systemd --line_match="$systemd_match_start_line" wait_xwiki_started #================================================= diff --git a/scripts/remove b/scripts/remove index 8b5abd6..d0fad6f 100755 --- a/scripts/remove +++ b/scripts/remove @@ -17,10 +17,10 @@ source /usr/share/yunohost/helpers 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 +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 + yunohost service remove "$app" fi ynh_secure_remove --file="/etc/$app" diff --git a/scripts/restore b/scripts/restore index b3b4aac..4737f23 100755 --- a/scripts/restore +++ b/scripts/restore @@ -22,7 +22,7 @@ ynh_restore #================================================= ynh_script_progression --message="Restoring the database..." --weight=1 -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 #================================================= # RESTORE SYSTEM CONFIGURATIONS @@ -32,10 +32,10 @@ ynh_script_progression --message="Restoring system configurations related to $ap mkdir -p /var/log/"$app" set_permissions -systemctl enable $app.service --quiet -yunohost service add $app --description=XWiki --log="/var/log/$app/$app.log" +systemctl enable "$app".service --quiet +yunohost service add "$app" --description=XWiki --log="/var/log/$app/$app.log" -ynh_use_logrotate --logfile "/var/log/$app" +ynh_use_logrotate --logfile="/var/log/$app" #================================================= # GENERIC FINALIZATION @@ -44,7 +44,7 @@ ynh_use_logrotate --logfile "/var/log/$app" #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="$systemd_match_start_line" +ynh_systemd_action --service_name="$app" --action=start --log_path=systemd --line_match="$systemd_match_start_line" wait_xwiki_started ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 371a951..92eb21d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,9 +9,9 @@ source _common.sh source /usr/share/yunohost/helpers -upgrade_type=$(ynh_check_app_version_changed) +upgrade_type="$(ynh_check_app_version_changed)" -if ynh_compare_current_package_version --comparison le --version '14.10.8~ynh1'; then +if ynh_compare_current_package_version --comparison=le --version='14.10.8~ynh1'; then ynh_die --mesage='Upgrade from this version is not supported. Please backup and restore manually the data after a clean new install' fi @@ -20,7 +20,7 @@ fi #================================================= ynh_script_progression --message='Stopping a systemd service..' --weight=1 -ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name="$app" --action=stop --log_path="/var/log/$app/$app.log" #================================================= # "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) @@ -47,7 +47,7 @@ ynh_add_systemd_config yunohost service add "$app" --description=XWiki --log="/var/log/$app/$app.log" -ynh_use_logrotate --logfile "/var/log/$app" +ynh_use_logrotate --logfile="/var/log/$app" #================================================= # ADD A CONFIGURATION @@ -63,9 +63,9 @@ set_permissions enable_super_admin # Start a systemd service -ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="$systemd_match_start_line" +ynh_systemd_action --service_name="$app" --action=start --log_path=systemd --line_match="$systemd_match_start_line" -if [ $install_standard_flavor -eq 1 ]; then +if [ "$install_standard_flavor" -eq 1 ]; then ynh_script_progression --message='Upgrading flavor...' wait_for_flavor_install fi @@ -74,7 +74,7 @@ ynh_script_progression --message='Upgrading LDAP extension...' --weight=1 install_exension 'org.xwiki.contrib.ldap:ldap-authenticator' "$ldap_version" # Disable super admin -ynh_systemd_action --service_name=$app --action=stop +ynh_systemd_action --service_name="$app" --action=stop disable_super_admin #================================================= @@ -84,7 +84,7 @@ disable_super_admin #================================================= ynh_script_progression --message='Starting a systemd service...' --weight=1 -ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="$systemd_match_start_line" +ynh_systemd_action --service_name="$app" --action=start --log_path=systemd --line_match="$systemd_match_start_line" wait_xwiki_started #=================================================