From 07e64fac10ee8d5dbb8c7571943fc33ac3eacf07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 25 Nov 2023 15:16:41 +0100 Subject: [PATCH] v2 --- check_process | 20 --------- doc/{DISCLAIMER.md => ADMIN.md} | 0 doc/{DISCLAIMER_fr.md => ADMIN_fr.md} | 0 manifest.json | 60 --------------------------- manifest.toml | 19 +++++---- scripts/_common.sh | 3 -- scripts/backup | 16 ------- scripts/install | 27 ------------ scripts/restore | 28 +------------ scripts/upgrade | 26 ------------ tests.toml | 3 ++ 11 files changed, 14 insertions(+), 188 deletions(-) delete mode 100644 check_process rename doc/{DISCLAIMER.md => ADMIN.md} (100%) rename doc/{DISCLAIMER_fr.md => ADMIN_fr.md} (100%) delete mode 100644 manifest.json create mode 100644 tests.toml diff --git a/check_process b/check_process deleted file mode 100644 index 95b4923..0000000 --- a/check_process +++ /dev/null @@ -1,20 +0,0 @@ -;; Test complet - ; pre-install - sudo yunohost app install my_webapp --force -a "domain=domain.tld&path=/path&with_sftp=1&password=myreallystrengthpassword&init_main_permission=visitors&phpversion=7.4&with_mysql=1" - ; Manifest - app_id="my_webapp" - sub_folder="/www" - domain="domain.tld" - path="/icecoder" - ; Checks - pkg_linter=1 - setup_sub_dir=1 - setup_root=0 - setup_nourl=0 - setup_private=0 - setup_public=0 - upgrade=1 - backup_restore=1 - multi_instance=0 - port_already_use=0 - change_url=1 diff --git a/doc/DISCLAIMER.md b/doc/ADMIN.md similarity index 100% rename from doc/DISCLAIMER.md rename to doc/ADMIN.md diff --git a/doc/DISCLAIMER_fr.md b/doc/ADMIN_fr.md similarity index 100% rename from doc/DISCLAIMER_fr.md rename to doc/ADMIN_fr.md diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 58ea49a..0000000 --- a/manifest.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "ICEcoder", - "id": "icecoder", - "packaging_format": 1, - "description": { - "en": "Code editor awesomeness... in your browser", - "fr": "Un éditeur de code impressionnant... dans votre navigateur" - }, - "version": "8.1~ynh1", - "url": "https://icecoder.net", - "upstream": { - "license": "AGPL-3.0-only", - "website": "https://icecoder.net", - "demo": "http://demo.icecoder.net/ICEcoder/", - "admindoc": "https://icecoder.net/manual", - "code": "https://github.com/icecoder/ICEcoder" - }, - "license": "AGPL-3.0-only", - "maintainer": { - "name": "Stylix58", - "email": "lateman-jpeg@outlook.fr" - }, - "requirements": { - "yunohost": ">= 4.3.0" - }, - "multi_instance": true, - "services": [ - "nginx", - "php7.3-fpm" - ], - "arguments": { - "install": [ - { - "name": "app_id", - "type": "string", - "ask": { - "en": "Indicate the ID of the Custom Webapp where you want to install this app", - "fr": "Indiquez l'ID de la Custom Webapp dans laquelle vous voulez installer cette app" - }, - "help": { - "en": "You can get the ID in Custom Webapp's settings.", - "fr": "Vous pouvez obtenir l'ID dans les paramètres de la Custom Webapp." - } - }, - { - "name": "sub_folder", - "type": "path", - "ask": { - "en": "Indicate the name of the final_path subfolder containing the files accessible from your browser", - "fr": "Indiquer le nom du sous-dossier du final_path contenant les fichiers accessibles depuis votre navigateur" - }, - "help": { - "en": "For example for Custom Webapp it is located in the /www subfolder.", - "fr": "Par exemple pour Custom Webapp il se situe dans le sous-dossier /www." - }, - "default": "/www" - } - ] - } -} diff --git a/manifest.toml b/manifest.toml index 422a064..143e0a7 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,18 +15,19 @@ website = "https://icecoder.net" demo = "http://demo.icecoder.net/ICEcoder/" admindoc = "https://icecoder.net/manual" code = "https://github.com/icecoder/ICEcoder" -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 = ">= 4.3.0" -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"] +yunohost = ">= 11.2" +architectures = "all" multi_instance = true -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 = false + +sso = false + +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install] [install.app_id] diff --git a/scripts/_common.sh b/scripts/_common.sh index 68d345b..944a65e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#REMOVEME? #pkg_dependencies="deb1 deb2 php$YNH_DEFAULT_PHP_VERSION-deb1 php$YNH_DEFAULT_PHP_VERSION-deb2" - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index a0bcd2a..c2ee80f 100755 --- a/scripts/backup +++ b/scripts/backup @@ -10,22 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# 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? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/install b/scripts/install index 100070e..964f586 100755 --- a/scripts/install +++ b/scripts/install @@ -9,31 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -#REMOVEME? app_id=$YNH_APP_ARG_APP_ID -#REMOVEME? sub_folder=$YNH_APP_ARG_SUB_FOLDER - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app_id --key=install_dir)$sub_folder/icecoder -#REMOVEME? #REMOVEME? test -e "$(ynh_app_setting_get --app=$app_id --key=install_dir)" || ynh_die --message="You don't have installed $app_id before installing this app" -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - #================================================= # STORE SETTINGS FROM MANIFEST #================================================= @@ -47,11 +22,9 @@ ynh_app_setting_set --app=$app --key=sub_folder --value=$sub_folder #================================================= ynh_script_progression --message="Setting up source files..." -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app_id:www-data "$install_dir" diff --git a/scripts/restore b/scripts/restore index 99ca96c..8c4cbbc 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,32 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? app_id=$(ynh_app_setting_get --app=$app --key=app_id) -#REMOVEME? sub_folder=$(ynh_app_setting_get --app=$app --key=sub_folder) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." - -#REMOVEME? #REMOVEME? test -e "$(ynh_app_setting_get --app=$app_id --key=install_dir)" || ynh_die --message="You don't have installed $app_id before installing this app" -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - #================================================= # STANDARD RESTORATION STEPS #================================================= @@ -45,9 +19,9 @@ ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app_id:www-data "$install_dir" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 25e75da..b0fe0d4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,37 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? app_id=$(ynh_app_setting_get --app=$app --key=app_id) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -57,7 +32,6 @@ then ynh_setup_source --dest_dir="$install_dir" --keep="/data" fi -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app_id:www-data "$install_dir" diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..eb73b8d --- /dev/null +++ b/tests.toml @@ -0,0 +1,3 @@ +test_format = 1.0 + +[default] \ No newline at end of file