diff --git a/check_process b/check_process deleted file mode 100644 index f0c8a51..0000000 --- a/check_process +++ /dev/null @@ -1,19 +0,0 @@ -;; Test complet - ; Manifest - domain="domain.tld" - password="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 diff --git a/doc/DISCLAIMER.md b/doc/ADMIN.md similarity index 92% rename from doc/DISCLAIMER.md rename to doc/ADMIN.md index 94c0f98..2b834ac 100644 --- a/doc/DISCLAIMER.md +++ b/doc/ADMIN.md @@ -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`). diff --git a/doc/DISCLAIMER_fr.md b/doc/ADMIN_fr.md similarity index 92% rename from doc/DISCLAIMER_fr.md rename to doc/ADMIN_fr.md index ea64e03..cffb337 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/ADMIN_fr.md @@ -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`). diff --git a/manifest.json b/manifest.json deleted file mode 100644 index f10d140..0000000 --- a/manifest.json +++ /dev/null @@ -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.8.2~ynh2", - "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.1.15" - }, - "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": "" - } - ] - } -} diff --git a/manifest.toml b/manifest.toml index 246a374..e98125f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -13,27 +13,22 @@ maintainers = ["rafi59"] license = "MPL-2.0" website = "https://collaboraoffice.com" admindoc = "https://www.collaboraoffice.com/code/" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] yunohost = ">= 11.1.15" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +architectures = ["amd64", "arm64"] multi_instance = false -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -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, ... +ldap = "not_relevant" +sso = "not_relevant" +disk = "50M" +ram.runtime = "50M" [install] [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "domain" full_domain = true [install.password] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "password" [install.nextcloud_domain] @@ -44,13 +39,17 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen default = "" [resources] + + [resources.ports] + [resources.system_user] [resources.install_dir] [resources.permissions] main.url = "/" + [[resources.apt.extras]] - repo = "deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./ " + repo = "deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian11 ./ " key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D 2>/dev/null" - packages = "#FIXME#$pkg_dependencies" + packages = "coolwsd code-brand hunspell-de-de hunspell-en-gb hunspell-fr hunspell" diff --git a/scripts/_common.sh b/scripts/_common.sh index c5de651..944a65e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#REMOVEME? pkg_dependencies="coolwsd code-brand hunspell-de-de hunspell-en-gb hunspell-fr hunspell" - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 32782c7..3eeb51c 100644 --- a/scripts/backup +++ b/scripts/backup @@ -10,25 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/install b/scripts/install index a6dabf9..c0c970b 100644 --- a/scripts/install +++ b/scripts/install @@ -9,61 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -#REMOVEME? domain=$YNH_APP_ARG_DOMAIN -path="/" -#REMOVEME? password=$YNH_APP_ARG_PASSWORD -#REMOVEME? nextcloud_domain=$YNH_APP_ARG_NEXTCLOUD_DOMAIN - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? 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 -#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 - -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path -#REMOVEME? ynh_app_setting_set --app=$app --key=password --value=$password -#REMOVEME? ynh_app_setting_set --app=$app --key=nextcloud_domain --value=$nextcloud_domain - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 - -# Find a free port -#REMOVEME? port=$(ynh_find_port --port=9980) -#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port - #================================================= # CONFIGURE ONLYOFFICE #================================================= @@ -77,14 +22,6 @@ mkdir -p /etc/coolwsd ynh_add_config --template="../conf/coolwsd.xml" --destination="/etc/coolwsd/coolwsd.xml" chmod 640 "/etc/coolwsd/coolwsd.xml" -#================================================= -# INSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=10 - -DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .) -#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 - #================================================= # NGINX CONFIGURATION #================================================= @@ -111,20 +48,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 -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 - -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" --show_tile="false" - -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index f80f135..e2cd386 100644 --- a/scripts/remove +++ b/scripts/remove @@ -9,16 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) - #================================================= # REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= @@ -43,15 +33,12 @@ ynh_remove_systemd_config --service="coolwsd" #================================================= # REMOVE DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=1 +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 -#REMOVEME? ynh_remove_app_dependencies - #================================================= # REMOVE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index a358701..29a4514 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,26 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) - #================================================= # STANDARD RESTORATION STEPS #================================================= @@ -46,16 +26,6 @@ ynh_script_progression --message="Restoring the configuration..." --weight=3 ynh_restore_file --origin_path="/etc/coolwsd/coolwsd.xml" chmod 640 "/etc/coolwsd/coolwsd.xml" -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=10 - -DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .) -#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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7762fb3..3f43fd6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,56 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#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 -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=2 - -if ynh_compare_current_package_version --comparison le --version 6.4.10~ynh2 -then - ynh_die --message="Upgrade from version 6.4.10 is not possible. You must uninstall and reinstall Collabora package manually" -fi - -# If db_name doesn't exist, create it -if [ -z "$path" ]; then - path="/" -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path -fi - -#REMOVEME? if ynh_legacy_permissions_exists; then -#REMOVEME? ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=5 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # restore it if the upgrade fails - ynh_clean_check_starting -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # REMOVE OLD SERVICE INTEGRATION IN YUNOHOST #================================================= @@ -105,14 +55,6 @@ ynh_add_config --template="../conf/coolwsd.xml" --destination="/etc/coolwsd/cool chown cool: "/etc/coolwsd/coolwsd.xml" chmod 640 "/etc/coolwsd/coolwsd.xml" -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=10 - -DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .) -#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 #================================================= @@ -127,13 +69,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_systemd_action --service_name="coolwsd" --action="restart" --log_path="systemd" --line_match="Ready to accept connections" -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..4891451 --- /dev/null +++ b/tests.toml @@ -0,0 +1,15 @@ +test_format = 1.0 + +[default] + + # ------------ + # Tests to run + # ------------ + + exclude = ["install.private", "install.nourl", "install.multi", "install.subdir", "change_url"] + + # ------------------------------- + # Default args to use for install + # ------------------------------- + + args.nextcloud_domain = "nextcloud.tld"