1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/collabora_ynh.git synced 2024-09-03 18:16:25 +02:00

Merge pull request #46 from YunoHost-Apps/patch

Fix
This commit is contained in:
Éric Gaspar 2021-07-07 19:59:27 +02:00 committed by GitHub
commit c64bf72969
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 300 additions and 148 deletions

55
.github/ISSUE_TEMPLATE.md vendored Normal file
View file

@ -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.*

16
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -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)

View file

@ -1,22 +1,34 @@
# Collabora for YunoHost <!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# Collabora Online for YunoHost
[![Integration level](https://dash.yunohost.org/integration/collabora.svg)](https://dash.yunohost.org/appci/app/collabora) ![](https://ci-apps.yunohost.org/ci/badges/collabora.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/collabora.maintain.svg) [![Integration level](https://dash.yunohost.org/integration/collabora.svg)](https://dash.yunohost.org/appci/app/collabora) ![](https://ci-apps.yunohost.org/ci/badges/collabora.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/collabora.maintain.svg)
[![Install Collabora with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=collabora) [![Install Collabora Online with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=collabora)
> *This package allow you to install Collabora quickly and simply on a YunoHost server. *[Lire ce readme en français.](./README_fr.md)*
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
> *This package allows you to install Collabora Online 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 ## Overview
[Collabora](https://www.collaboraoffice.com/code/) is an online office suite usable with Nextcloud. LibreOffice-based online office suite with collaborative editing
**Shipped version:** 6.4.4~ynh1
**Shipped version:** 6.4.4
## Screenshots ## Screenshots
![](https://www.collaboraoffice.com/wp-content/uploads/2019/07/Collabora_Online_-_versions_integration.png) ![](./doc/screenshots/Collabora_Online_-_versions_integration.png)
## Disclaimers / important information
## Configuration ## Configuration
**Settings:** **Settings:**
The settings of Collabora are at `https://office.domain.tld/loleaflet/dist/admin/admin.html`. The settings of Collabora are at `https://office.domain.tld/loleaflet/dist/admin/admin.html`.
@ -24,22 +36,11 @@ The settings of Collabora are at `https://office.domain.tld/loleaflet/dist/admin
- Password: The password set during the installation. (If you forgot it, you can find it again in `/etc/loolwsd/loolwsd.xml`). - Password: The password set during the installation. (If you forgot it, you can find it again in `/etc/loolwsd/loolwsd.xml`).
## Connexion to Nextcloud ## Connexion to Nextcloud
If you want to connect with Nextcloud, you have to install the [Collabora Online](https://apps.nextcloud.com/apps/richdocuments) app in Nextcloud, and configure it with the domain of your Collabora installation. If you want to connect with Nextcloud, you have to install the [Collabora Online](https://apps.nextcloud.com/apps/richdocuments) app in Nextcloud, and configure it with the domain of your Collabora installation.
*:warning: There are several Collabora Online apps. Be sure **not** to install the `Collabora Online - Built-in CODE server` apps, which are a lightwheigt version of this Collabora package. :warning:* *:warning: There are several Collabora Online apps. Be sure **not** to install the `Collabora Online - Built-in CODE server` apps, which are a lightwheigt version of this Collabora package. :warning:*
## Documentation
* Official documentation: https://www.collaboraoffice.com/code/
* YunoHost documentation: https://yunohost.org/#/app_collabora
#### Multi-users support
#### Supported architectures
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/collabora%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/collabora/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/collabora%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/collabora/)
## Limitations ## Limitations
**ARM platform not supported.** If you want to run Collabora on Nextcloud, there is a lightweight version of the Collabora server for ARM, called [Collabora Online - Built-in CODE Server (ARM64)](https://apps.nextcloud.com/apps/richdocumentscode_arm64) which can easily connect with the [Collabora Online](https://apps.nextcloud.com/apps/richdocuments) app. **ARM platform not supported.** If you want to run Collabora on Nextcloud, there is a lightweight version of the Collabora server for ARM, called [Collabora Online - Built-in CODE Server (ARM64)](https://apps.nextcloud.com/apps/richdocumentscode_arm64) which can easily connect with the [Collabora Online](https://apps.nextcloud.com/apps/richdocuments) app.
@ -48,22 +49,17 @@ If you want to connect with Nextcloud, you have to install the [Collabora Online
![](https://www.libreoffice.org/assets/Uploads/LibreOffice-Online-limit.png) ![](https://www.libreoffice.org/assets/Uploads/LibreOffice-Online-limit.png)
## Additionnal informations ## Documentation and resources
**Upgrade this package:** * Official app website: https://collaboraoffice.com
You can use your YunoHost admin interface, or the command line: `sudo yunohost app upgrade collabora -u https://github.com/YunoHost-Apps/collabora_ynh --debug` * Official user documentation: https://yunohost.org/#/app_collabora
* Official admin documentation: https://www.collaboraoffice.com/code/
* YunoHost documentation for this app: https://yunohost.org/app_collabora
* Report a bug: https://github.com/YunoHost-Apps/collabora_ynh/issues
## Links ## Developer info
* Report a bug: https://github.com/YunoHost-Apps/collabora_ynh/issues Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/collabora_ynh/tree/testing).
* Collabora website: https://www.collaboraoffice.com/
* YunoHost website: https://yunohost.org/
---
## Developers infos
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/collabora_ynh/tree/testing).
To try the testing branch, please proceed like that. To try the testing branch, please proceed like that.
``` ```
@ -71,3 +67,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/collabora_ynh/tree/te
or or
sudo yunohost app upgrade collabora -u https://github.com/YunoHost-Apps/collabora_ynh/tree/testing --debug sudo yunohost app upgrade collabora -u https://github.com/YunoHost-Apps/collabora_ynh/tree/testing --debug
``` ```
**More info regarding app packaging:** https://yunohost.org/packaging_apps

67
README_fr.md Normal file
View file

@ -0,0 +1,67 @@
# Collabora Online pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/collabora.svg)](https://dash.yunohost.org/appci/app/collabora) ![](https://ci-apps.yunohost.org/ci/badges/collabora.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/collabora.maintain.svg)
[![Installer Collabora Online avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=collabora)
*[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer Collabora Online 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.*
## Vue d'ensemble
Suite office en ligne et collaborative, basée sur LibreOffice
**Version incluse :** 6.4.4~ynh1
## Captures d'écran
![](./doc/screenshots/Collabora_Online_-_versions_integration.png)
## Avertissements / informations importantes
## Configuration
**Paramètres :**
Les paramètres de Collabora sont à `https://office.domain.tld/loleaflet/dist/admin/admin.html`.
- Utilisateur : administrateur
- Mot de passe : Le mot de passe défini lors de l'installation. (Si vous l'avez oublié, vous pouvez le retrouver dans `/etc/loolwsd/loolwsd.xml`).
## Connexion à Nextcloud
Si vous souhaitez vous connecter à Nextcloud, vous devez installer l'application [Collabora Online](https://apps.nextcloud.com/apps/richdocuments) dans Nextcloud, et la configurer avec le domaine de votre installation Collabora.
* : avertissement : il existe plusieurs applications Collabora Online. Assurez-vous **de ne pas** installer les applications `Collabora Online - Built-in CODE server`, qui sont une version allégée de ce package Collabora. :Attention:*
## Limites
**Plateforme ARM non prise en charge.** Si vous souhaitez exécuter Collabora sur Nextcloud, il existe une version allégée du serveur Collabora pour ARM, appelée [Collabora Online - Built-in CODE Server (ARM64)](https://apps.nextcloud.com/apps/richdocumentscode_arm64) qui peut facilement se connecter à l'application [Collabora Online](https://apps.nextcloud.com/apps/richdocuments).
**CODE a une limitation d'avertissement**
![](https://www.libreoffice.org/assets/Uploads/LibreOffice-Online-limit.png)
## Documentations et ressources
* Site officiel de l'app : https://collaboraoffice.com
* Documentation officielle utilisateur : https://yunohost.org/#/app_collabora
* Documentation officielle de l'admin : https://www.collaboraoffice.com/code/
* Documentation YunoHost pour cette app : https://yunohost.org/app_collabora
* Signaler un bug : https://github.com/YunoHost-Apps/collabora_ynh/issues
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/collabora_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
```
sudo yunohost app install https://github.com/YunoHost-Apps/collabora_ynh/tree/testing --debug
ou
sudo yunohost app upgrade collabora -u https://github.com/YunoHost-Apps/collabora_ynh/tree/testing --debug
```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps

View file

@ -1,11 +1,6 @@
# See here for more informations
# https://github.com/YunoHost/package_check#syntax-check_process-file
# Move this file from check_process.default to check_process when you have filled it.
;; Test complet ;; Test complet
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld"
password="pass" password="pass"
nextcloud_domain="nextcloud.tld" nextcloud_domain="nextcloud.tld"
; Checks ; Checks
@ -18,7 +13,6 @@
upgrade=1 upgrade=1
backup_restore=1 backup_restore=1
multi_instance=0 multi_instance=0
port_already_use=0
change_url=0 change_url=0
;;; Options ;;; Options
Email= Email=

BIN
doc/.DS_Store vendored Normal file

Binary file not shown.

21
doc/DISCLAIMER.md Normal file
View file

@ -0,0 +1,21 @@
## Configuration
**Settings:**
The settings of Collabora are at `https://office.domain.tld/loleaflet/dist/admin/admin.html`.
- User: admin
- Password: The password set during the installation. (If you forgot it, you can find it again in `/etc/loolwsd/loolwsd.xml`).
## Connexion to Nextcloud
If you want to connect with Nextcloud, you have to install the [Collabora Online](https://apps.nextcloud.com/apps/richdocuments) app in Nextcloud, and configure it with the domain of your Collabora installation.
*:warning: There are several Collabora Online apps. Be sure **not** to install the `Collabora Online - Built-in CODE server` apps, which are a lightwheigt version of this Collabora package. :warning:*
## Limitations
**ARM platform not supported.** If you want to run Collabora on Nextcloud, there is a lightweight version of the Collabora server for ARM, called [Collabora Online - Built-in CODE Server (ARM64)](https://apps.nextcloud.com/apps/richdocumentscode_arm64) which can easily connect with the [Collabora Online](https://apps.nextcloud.com/apps/richdocuments) app.
**CODE has a warning limitation**
![](https://www.libreoffice.org/assets/Uploads/LibreOffice-Online-limit.png)

21
doc/DISCLAIMER_fr.md Normal file
View file

@ -0,0 +1,21 @@
## Configuration
**Paramètres :**
Les paramètres de Collabora sont à `https://office.domain.tld/loleaflet/dist/admin/admin.html`.
- Utilisateur : administrateur
- Mot de passe : Le mot de passe défini lors de l'installation. (Si vous l'avez oublié, vous pouvez le retrouver dans `/etc/loolwsd/loolwsd.xml`).
## Connexion à Nextcloud
Si vous souhaitez vous connecter à Nextcloud, vous devez installer l'application [Collabora Online](https://apps.nextcloud.com/apps/richdocuments) dans Nextcloud, et la configurer avec le domaine de votre installation Collabora.
* : avertissement : il existe plusieurs applications Collabora Online. Assurez-vous **de ne pas** installer les applications `Collabora Online - Built-in CODE server`, qui sont une version allégée de ce package Collabora. :Attention:*
## Limites
**Plateforme ARM non prise en charge.** Si vous souhaitez exécuter Collabora sur Nextcloud, il existe une version allégée du serveur Collabora pour ARM, appelée [Collabora Online - Built-in CODE Server (ARM64)](https://apps.nextcloud.com/apps/richdocumentscode_arm64) qui peut facilement se connecter à l'application [Collabora Online](https://apps.nextcloud.com/apps/richdocuments).
**CODE a une limitation d'avertissement**
![](https://www.libreoffice.org/assets/Uploads/LibreOffice-Online-limit.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View file

@ -8,13 +8,19 @@
}, },
"version": "6.4.4~ynh1", "version": "6.4.4~ynh1",
"url": "https://collaboraoffice.com", "url": "https://collaboraoffice.com",
"upstream": {
"license": "MPL-2.0",
"website": "https://collaboraoffice.com",
"admindoc": "https://www.collaboraoffice.com/code/",
"userdoc": "https://yunohost.org/#/app_collabora"
},
"license": "MPL-2.0", "license": "MPL-2.0",
"maintainer": { "maintainer": {
"name": "rafi59", "name": "rafi59",
"email": "rafi59_dev@srvmaison.fr.nf" "email": "rafi59_dev@srvmaison.fr.nf"
}, },
"requirements": { "requirements": {
"yunohost": ">= 4.1.4.3" "yunohost": ">= 4.2.4"
}, },
"multi_instance": false, "multi_instance": false,
"services": [ "services": [
@ -25,19 +31,11 @@
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain",
"ask": {
"en": "Choose a domain name for collabora",
"fr": "Choisissez un nom de domaine pour collabora"
},
"example": "example.com" "example": "example.com"
}, },
{ {
"name": "password", "name": "password",
"type": "password", "type": "password",
"ask": {
"en": "Choose a password for Collabora admin",
"fr": "Choisissez un mot de passe pour l'administration de Collabora"
},
"example": "password" "example": "password"
}, },
{ {

View file

@ -1,16 +0,0 @@
## Problem
- *Description of why you made this PR*
## Solution
- *And how do you fix that problem*
## PR Status
- [ ] Code finished.
- [ ] Tested with Package_check.
- [ ] Fix or enhancement tested.
- [ ] Upgrade from last version tested.
- [ ] Can be reviewed and tested.
## Package_check results
---
* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"*

View file

@ -33,7 +33,7 @@ app=$YNH_APP_INSTANCE_NAME
#================================================= #=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#================================================= #=================================================
ynh_script_progression --message="Validating installation parameters..." ynh_script_progression --message="Validating installation parameters..." --weight=1
if dpkg-architecture --is armhf if dpkg-architecture --is armhf
then then
@ -46,7 +46,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
#================================================= #=================================================
# STORE SETTINGS FROM MANIFEST # STORE SETTINGS FROM MANIFEST
#================================================= #=================================================
ynh_script_progression --message="Storing installation settings..." 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=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=path --value=$path_url
@ -58,11 +58,10 @@ ynh_app_setting_set --app=$app --key=nextcloud_domain --value=$nextcloud_domain
#================================================= #=================================================
# FIND AND OPEN A PORT # FIND AND OPEN A PORT
#================================================= #=================================================
ynh_script_progression --message="Finding an available port..." ynh_script_progression --message="Finding an available port..." --weight=1
# Find a free port # Find a free port
port=$(ynh_find_port --port=9980) port=$(ynh_find_port --port=9980)
ynh_app_setting_set --app=$app --key=port --value=$port ynh_app_setting_set --app=$app --key=port --value=$port
#================================================= #=================================================
@ -74,30 +73,37 @@ ynh_app_setting_set --app=$app --key=port --value=$port
# config directory which of course doesn't exists and we want to disable SSL # config directory which of course doesn't exists and we want to disable SSL
# because we're in a reverse proxy context... # because we're in a reverse proxy context...
mkdir -p /etc/loolwsd mkdir -p /etc/loolwsd
ynh_add_config ../conf/loolwsd.xml /etc/loolwsd/loolwsd.xml ynh_add_config --template="../conf/loolwsd.xml" --destination="/etc/loolwsd/loolwsd.xml"
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." ynh_script_progression --message="Installing dependencies..." --weight=10
DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .) DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .)
ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./ " --package="$pkg_dependencies" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D" ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./ " --package="$pkg_dependencies" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D" 2>/dev/null
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring NGINX web server..." ynh_script_progression --message="Configuring NGINX web server..." --weight=3
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add "loolwsd" --description="Collabora online office suite" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." ynh_script_progression --message="Starting a systemd service..." --weight=5
# Start a systemd service # Start a systemd service
# NB. : we need a stupid *re*start because the service is in fact already started during the damn package install ... so it won't find a recent "Ready to accept connection" match ... # NB. : we need a stupid *re*start because the service is in fact already started during the damn package install ... so it won't find a recent "Ready to accept connection" match ...
@ -106,16 +112,14 @@ ynh_systemd_action --service_name="loolwsd" --action="restart" --log_path="syste
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Configuring permissions..." ynh_script_progression --message="Configuring permissions..." --weight=1
# Make app public
# unprotected_uris allows SSO credentials to be passed anyway.
ynh_permission_update --permission="main" --add="visitors" --show_tile="false" ynh_permission_update --permission="main" --add="visitors" --show_tile="false"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server..." ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -123,4 +127,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Installation of $app completed" ynh_script_progression --message="Installation of $app completed" --last

View file

@ -12,19 +12,38 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
#=================================================
# REMOVE SERVICE INTEGRATION IN YUNOHOST
#=================================================
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status "loolwsd" >/dev/null
then
ynh_script_progression --message="Removing loolwsd service integration..." --weight=1
yunohost service remove "loolwsd"
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 --service="loolwsd"
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE
#================================================= #=================================================
# REMOVE DEPENDENCIES # REMOVE DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Removing dependencies..." ynh_script_progression --message="Removing dependencies..." --weight=1
# Fix "rm: cannot remove '/etc/apt/apt.conf.d/25loolwsd': No such file or directory" # Fix "rm: cannot remove '/etc/apt/apt.conf.d/25loolwsd': No such file or directory"
# on apt remove # on apt remove
@ -36,43 +55,20 @@ ynh_remove_app_dependencies
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
# Remove the dedicated NGINX config # Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_remove_nginx_config
#=================================================
# CLOSE A PORT
#=================================================
if yunohost firewall list | grep -q "\- $port$"
then
echo "Close port $port" >&2
yunohost firewall disallow TCP $port 2>&1
fi
#================================================= #=================================================
# SPECIFIC REMOVE # SPECIFIC REMOVE
#================================================= #=================================================
# REMOVE THE CRON FILE
#=================================================
# Remove a cron file
ynh_secure_remove --file="/etc/cron.d/$app"
# Remove a directory securely
ynh_secure_remove --file="/etc/apt/sources.list.d/collabora.list"
# Remove a directory securely # Remove a directory securely
ynh_secure_remove --file="/etc/loolwsd" ynh_secure_remove --file="/etc/loolwsd"
# Remove the log files
ynh_secure_remove --file="/var/log/$app"
#=================================================
# GENERIC FINALIZATION
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Removal of $app completed" ynh_script_progression --message="Removal of $app completed" --last

View file

@ -23,7 +23,7 @@ ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading settings..." ynh_script_progression --message="Loading settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -33,7 +33,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
#================================================= #=================================================
# CHECK IF THE APP CAN BE RESTORED # CHECK IF THE APP CAN BE RESTORED
#================================================= #=================================================
ynh_script_progression --message="Validating restoration parameters..." ynh_script_progression --message="Validating restoration parameters..." --weight=1
ynh_webpath_available --domain=$domain --path_url=$path_url \ ynh_webpath_available --domain=$domain --path_url=$path_url \
|| ynh_die --message="Path not available: ${domain}${path_url}" || ynh_die --message="Path not available: ${domain}${path_url}"
@ -46,22 +46,29 @@ ynh_webpath_available --domain=$domain --path_url=$path_url \
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the configuration..." --weight=3
ynh_restore_file --origin_path="/etc/loolwsd/loolwsd.xml"
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Reinstalling dependencies..." ynh_script_progression --message="Reinstalling dependencies..." --weight=10
DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .) DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .)
ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./ " --package="$pkg_dependencies" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D" ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./ " --package="$pkg_dependencies" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D" 2>/dev/null
#================================================= #=================================================
# RESTORE CONFIGURATION # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
ynh_script_progression --message="Restoring the configuration..." ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
ynh_restore_file --origin_path="/etc/loolwsd/loolwsd.xml" yunohost service add "loolwsd" --description="Collabora online office suite" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
@ -70,12 +77,10 @@ ynh_script_progression --message="Starting a systemd service..."
ynh_systemd_action --service_name="loolwsd" --action="restart" --log_path="systemd" --line_match="Ready to accept connections" ynh_systemd_action --service_name="loolwsd" --action="restart" --log_path="systemd" --line_match="Ready to accept connections"
#=================================================
# GENERIC FINALIZATION
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server..." ynh_script_progression --message="Reloading NGINX web server..." --weight=2
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -83,4 +88,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Restoration completed for $app" ynh_script_progression --message="Restoration completed for $app" --last

View file

@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -25,16 +25,7 @@ nextcloud_domain=$(ynh_app_setting_get --app="$app" --key=nextcloud_domain)
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." ynh_script_progression --message="Ensuring downward compatibility..." --weight=2
# Fix is_public as a boolean value
if [ "$is_public" = "Yes" ]; then
ynh_app_setting_set --app=$app --key=is_public --value=1
is_public=1
elif [ "$is_public" = "No" ]; then
ynh_app_setting_set --app=$app --key=is_public --value=0
is_public=0
fi
# If db_name doesn't exist, create it # If db_name doesn't exist, create it
if [ -z "$path_url" ]; then if [ -z "$path_url" ]; then
@ -51,7 +42,7 @@ fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=5
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
@ -68,48 +59,50 @@ ynh_abort_if_errors
#================================================= #=================================================
# STOP SYSTEMD SERVICE # STOP SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." ynh_script_progression --message="Stopping a systemd service..." --weight=5
ynh_systemd_action --service_name="loolwsd" --action="stop" --log_path="systemd" --line_match="Stopped LibreOffice Online WebSocket Daemon." ynh_systemd_action --service_name="loolwsd" --action="stop" --log_path="systemd" --line_match="Stopped Collabora Online WebSocket Daemon"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Upgrading nginx web server configuration..." ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
# Create a dedicated nginx config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..."
DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .)
ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./ " --package="$pkg_dependencies" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D"
#=================================================
# SPECIFIC UPGRADE
#================================================= #=================================================
# UPGRADE CONFIG # UPGRADE CONFIG
#================================================= #=================================================
ynh_add_config "../conf/loolwsd.xml" "/etc/loolwsd/loolwsd.xml" ynh_add_config --template="../conf/loolwsd.xml" --destination="/etc/loolwsd/loolwsd.xml"
#================================================= #=================================================
# GENERIC FINALIZATION # UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=10
DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .)
ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./ " --package="$pkg_dependencies" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D" 2>/dev/null
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add "loolwsd" --description="Collabora online office suite" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." ynh_script_progression --message="Starting a systemd service..." --weight=3
ynh_systemd_action --service_name="loolwsd" --action="restart" --log_path="systemd" --line_match="Ready to accept connections" ynh_systemd_action --service_name="loolwsd" --action="restart" --log_path="systemd" --line_match="Ready to accept connections"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server..." ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -117,4 +110,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Upgrade of $app completed" ynh_script_progression --message="Upgrade of $app completed" --last