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

manifestv2

This commit is contained in:
Salamandar 2024-01-29 11:36:53 +01:00
parent 643295fc6e
commit fbafc33263
12 changed files with 131 additions and 230 deletions

View file

@ -1,19 +0,0 @@
;; Test complet
; Manifest
domain="domain.tld"
password="1Strong-Password"
nextcloud_domain="nextcloud.tld"
; 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=0
change_url=0
;;; Options
Email=
Notification=none

View file

@ -1,7 +1,7 @@
## Configuration
**Settings:**
The settings of Collabora are at `https://office.domain.tld/browser/dist/admin/admin.html`.
The settings of Collabora are at `https://__DOMAIN__/browser/dist/admin/admin.html`.
- User: admin
- Password: The password set during the installation. (If you forgot it, you can find it again in `/etc/coolwsd/coolwsd.xml`).

View file

@ -1,7 +1,7 @@
## Configuration
**Paramètres :**
Les paramètres de Collabora sont à `https://office.domain.tld/browser/dist/admin/admin.html`.
Les paramètres de Collabora sont à `https://__DOMAIN__/browser/dist/admin/admin.html`.
- Utilisateur : admin
- Mot de passe : Le mot de passe défini lors de l'installation. (Si vous l'avez oublié, vous pouvez le retrouver dans `/etc/coolwsd/coolwsd.xml`).

View file

@ -1,50 +0,0 @@
{
"name": "Collabora Online",
"id": "collabora",
"packaging_format": 1,
"description": {
"en": "LibreOffice-based online office suite with collaborative editing",
"fr": "Suite office en ligne et collaborative, basée sur LibreOffice"
},
"version": "22.05.14.3~ynh1",
"url": "https://collaboraoffice.com",
"upstream": {
"license": "MPL-2.0",
"website": "https://collaboraoffice.com",
"admindoc": "https://www.collaboraoffice.com/code/"
},
"license": "MPL-2.0",
"maintainer": {
"name": "rafi59",
"email": "rafi59_dev@srvmaison.fr.nf"
},
"requirements": {
"yunohost": ">= 11.2"
},
"multi_instance": false,
"services": [
"nginx"
],
"arguments": {
"install" : [
{
"name": "domain",
"type": "domain"
},
{
"name": "password",
"type": "password"
},
{
"name": "nextcloud_domain",
"type": "string",
"ask": {
"en": "The domain of your Nextcloud instance",
"fr": "Le domain de votre instance Nextcloud"
},
"example": "example.com/nextcloud",
"default": ""
}
]
}
}

75
manifest.toml Normal file
View file

@ -0,0 +1,75 @@
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json
packaging_format = 2
id = "collabora"
name = "Collabora Online"
description.en = "LibreOffice-based online office suite with collaborative editing"
description.fr = "Suite office en ligne et collaborative, basée sur LibreOffice"
version = "22.05.14.3~ynh1"
maintainers = ["rafi59"]
[upstream]
license = "MPL-2.0"
website = "https://collaboraoffice.com"
admindoc = "https://www.collaboraoffice.com/code/"
cpe = "cpe:2.3:a:collabora:online"
[integration]
yunohost = ">= 11.2"
architectures = ["amd64", "i386", "arm64"]
multi_instance = false
ldap = "not_relevant"
sso = "not_relevant"
disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ...
ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ...
ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ...
[install]
[install.domain]
type = "domain"
[install.init_main_permission]
help.en = "You will only be able to connect Collabora to Nextcloud if both apps are public!"
help.fr = "Nextcloud et Collabora doivent être des applications publiques si vous voulez les connecter !"
type = "group"
default = "visitors"
[install.password]
type = "password"
[install.nextcloud_domain]
ask.en = "The domain of your Nextcloud instance"
ask.fr = "Le domain de votre instance Nextcloud"
type = "string"
example = "example.com/nextcloud"
default = ""
[resources]
[resources.system_user]
[resources.install_dir]
[resources.permissions]
main.url = "/"
[resources.ports]
main.default = 9980
[resources.apt]
packages = [
"hunspell-de-de",
"hunspell-en-gb",
"hunspell-fr",
"hunspell",
]
[resources.apt.extras.collabora]
repo = "deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./ "
key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D"
packages = [
"coolwsd",
"code-brand"
]

View file

@ -4,9 +4,6 @@
# COMMON VARIABLES
#=================================================
# dependencies used by the app
pkg_dependencies="coolwsd code-brand hunspell-de-de hunspell-en-gb hunspell-fr hunspell"
#=================================================
# PERSONAL HELPERS
#=================================================

View file

@ -14,20 +14,20 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
#REMOVEME? ynh_clean_setup () {
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#REMOVEME? ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info --message="Loading installation settings..."
#REMOVEME? ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP

View file

@ -10,59 +10,10 @@ source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
# INITIALIZE AND STORE SETTINGS
#=================================================
ynh_clean_setup () {
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
domain=$YNH_APP_ARG_DOMAIN
path_url="/"
password=$YNH_APP_ARG_PASSWORD
nextcloud_domain=$YNH_APP_ARG_NEXTCLOUD_DOMAIN
app=$YNH_APP_INSTANCE_NAME
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
ynh_script_progression --message="Validating installation parameters..." --weight=1
if dpkg-architecture --is armhf
then
ynh_die --message="Sorry, this app can not be installed on an ARM architecture"
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=path --value=$path_url
ynh_app_setting_set --app=$app --key=password --value=$password
ynh_app_setting_set --app=$app --key=nextcloud_domain --value=$nextcloud_domain
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# FIND AND OPEN A PORT
#=================================================
ynh_script_progression --message="Finding an available port..." --weight=1
# Find a free port
port=$(ynh_find_port --port=9980)
ynh_app_setting_set --app=$app --key=port --value=$port
ynh_app_setting_set --app="$app" --key=password --value="$password"
#=================================================
# CONFIGURE ONLYOFFICE
@ -78,26 +29,13 @@ ynh_add_config --template="../conf/coolwsd.xml" --destination="/etc/coolwsd/cool
chmod 640 "/etc/coolwsd/coolwsd.xml"
#=================================================
# INSTALL DEPENDENCIES
# SYSTEM CONFIGURATION
#=================================================
ynh_script_progression --message="Installing 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
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=3
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add "coolwsd" --description="Collabora online office suite" --log="/var/log/$app/$app.log"
#=================================================
@ -111,20 +49,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=5
# 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 ...
ynh_systemd_action --service_name="coolwsd" --action="restart" --log_path="systemd" --line_match="Ready to accept connections"
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring permissions..." --weight=1
ynh_permission_update --permission="main" --add="visitors" --show_tile="false"
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -10,63 +10,30 @@ source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
port=$(ynh_app_setting_get --app=$app --key=port)
#=================================================
# 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 "coolwsd" >/dev/null
then
ynh_script_progression --message="Removing coolwsd service integration..." --weight=1
if ynh_exec_warn_less yunohost service status "coolwsd" >/dev/null; then
yunohost service remove "coolwsd"
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="coolwsd"
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=1
# Fix "rm: cannot remove '/etc/apt/apt.conf.d/25loolwsd': No such file or directory"
# on apt remove
touch /etc/apt/apt.conf.d/25loolwsd
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
# Remove the dedicated NGINX config
ynh_remove_nginx_config
#=================================================
# SPECIFIC REMOVE
#=================================================
# Remove a directory securely
ynh_secure_remove --file="/etc/coolwsd"
# FIXME: is it still required?
# Fix "rm: cannot remove '/etc/apt/apt.conf.d/25loolwsd': No such file or directory"
# on apt remove
touch /etc/apt/apt.conf.d/25loolwsd
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -14,21 +14,21 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
#REMOVEME? ynh_clean_setup () {
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#REMOVEME? ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path)
#=================================================
# STANDARD RESTORATION STEPS
@ -51,10 +51,10 @@ chmod 640 "/etc/coolwsd/coolwsd.xml"
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=10
#REMOVEME? ynh_script_progression --message="Reinstalling 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
#REMOVEME? 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

View file

@ -12,15 +12,15 @@ source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..." --weight=1
#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app="$app" --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
port=$(ynh_app_setting_get --app=$app --key=port)
password=$(ynh_app_setting_get --app="$app" --key=password)
nextcloud_domain=$(ynh_app_setting_get --app="$app" --key=nextcloud_domain)
#REMOVEME? domain=$(ynh_app_setting_get --app="$app" --key=domain)
#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path)
#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port)
#REMOVEME? password=$(ynh_app_setting_get --app="$app" --key=password)
#REMOVEME? nextcloud_domain=$(ynh_app_setting_get --app="$app" --key=nextcloud_domain)
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
@ -33,13 +33,13 @@ then
fi
# If db_name doesn't exist, create it
if [ -z "$path_url" ]; then
path_url="/"
ynh_app_setting_set --app=$app --key=path_url --value=$path_url
if [ -z "$path" ]; then
path="/"
#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path
fi
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
#REMOVEME? if ynh_legacy_permissions_exists; then
#REMOVEME? ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
@ -47,17 +47,17 @@ fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=5
#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=5
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
#REMOVEME? ynh_backup_before_upgrade
#REMOVEME? ynh_clean_setup () {
# restore it if the upgrade fails
ynh_clean_check_starting
ynh_restore_upgradebackup
#REMOVEME? ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#REMOVEME? ynh_abort_if_errors
#=================================================
# REMOVE OLD SERVICE INTEGRATION IN YUNOHOST
@ -108,10 +108,10 @@ chmod 640 "/etc/coolwsd/coolwsd.xml"
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=10
#REMOVEME? 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
#REMOVEME? 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
@ -130,9 +130,9 @@ ynh_systemd_action --service_name="coolwsd" --action="restart" --log_path="syste
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT

7
tests.toml Normal file
View file

@ -0,0 +1,7 @@
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json
test_format = 1.0
[default]
# test_upgrade_from.5725c85c09f1d3b76d12a4dc4d367ec911cd0019.name = "Last packaging v1 version"