From 1639951ac7ab7d452f0b2fd1263142596ba54c51 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:13:16 +0100 Subject: [PATCH 01/13] v2 --- conf/app.src | 6 ----- manifest.toml | 57 ++++++++++++++++++++++++++++++++++++++++++++++ scripts/_common.sh | 2 +- scripts/backup | 10 ++++---- scripts/install | 28 +++++++++++------------ scripts/remove | 10 ++++---- scripts/restore | 26 ++++++++++----------- scripts/upgrade | 26 ++++++++++----------- 8 files changed, 108 insertions(+), 57 deletions(-) delete mode 100644 conf/app.src create mode 100644 manifest.toml diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index a7af146..0000000 --- a/conf/app.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/icecoder/ICEcoder/archive/refs/tags/8.1.zip -SOURCE_SUM=669aa799cab161334ec108fbaafea97061859622433ad98188ddb19e86285f31 -SOURCE_SUM_PRG=/usr/bin/sha256sum -SOURCE_FORMAT=zip -SOURCE_IN_SUBDIR=true -SOURCE_EXTRACT=true diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..422a064 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,57 @@ +packaging_format = 2 + +id = "icecoder" +name = "ICEcoder" +description.en = "Code editor awesomeness... in your browser" +description.fr = "Un éditeur de code impressionnant... dans votre navigateur" + +version = "8.1~ynh1" + +maintainers = ["Stylix58"] + +[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" +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"] +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, ... + +[install] + [install.app_id] + ask.en = "Indicate the ID of the Custom Webapp where you want to install this app" + ask.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." + help.fr = "Vous pouvez obtenir l'ID dans les paramètres de la Custom Webapp." + type = "string" + + [install.sub_folder] + ask.en = "Indicate the name of the final_path subfolder containing the files accessible from your browser" + ask.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." + help.fr = "Par exemple pour Custom Webapp il se situe dans le sous-dossier /www." + type = "path" + default = "/www" + +[resources] + [resources.sources.main] + url = "https://github.com/icecoder/ICEcoder/archive/refs/tags/8.1.zip" + sha256 = "669aa799cab161334ec108fbaafea97061859622433ad98188ddb19e86285f31" + + + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] diff --git a/scripts/_common.sh b/scripts/_common.sh index 572cd27..68d345b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -#pkg_dependencies="deb1 deb2 php$YNH_DEFAULT_PHP_VERSION-deb1 php$YNH_DEFAULT_PHP_VERSION-deb2" +#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 6d11483..a0bcd2a 100755 --- a/scripts/backup +++ b/scripts/backup @@ -15,16 +15,16 @@ source /usr/share/yunohost/helpers #================================================= # 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 -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -35,7 +35,7 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index d3110c5..100070e 100755 --- a/scripts/install +++ b/scripts/install @@ -14,30 +14,30 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -app_id=$YNH_APP_ARG_APP_ID -sub_folder=$YNH_APP_ARG_SUB_FOLDER +#REMOVEME? app_id=$YNH_APP_ARG_APP_ID +#REMOVEME? sub_folder=$YNH_APP_ARG_SUB_FOLDER -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." -final_path=$(ynh_app_setting_get --app=$app_id --key=final_path)$sub_folder/icecoder -test -e "$(ynh_app_setting_get --app=$app_id --key=final_path)" || ynh_die --message="You don't have installed $app_id before installing this app" -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#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 #================================================= -ynh_script_progression --message="Storing installation settings..." +#REMOVEME? ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app=$app --key=app_id --value=$app_id ynh_app_setting_set --app=$app --key=sub_folder --value=$sub_folder @@ -47,13 +47,13 @@ ynh_app_setting_set --app=$app --key=sub_folder --value=$sub_folder #================================================= ynh_script_progression --message="Setting up source files..." -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +#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="$final_path" +ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app_id:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app_id:www-data "$install_dir" #================================================= # GENERIC FINALIZATION diff --git a/scripts/remove b/scripts/remove index d293873..0e21928 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,21 +12,21 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +#REMOVEME? ynh_script_progression --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # STANDARD REMOVE #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." +#REMOVEME? ynh_script_progression --message="Removing app main directory..." # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 9a60143..99ca96c 100755 --- a/scripts/restore +++ b/scripts/restore @@ -15,26 +15,26 @@ source /usr/share/yunohost/helpers #================================================= # 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 installation settings..." +#REMOVEME? ynh_script_progression --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -app_id=$(ynh_app_setting_get --app=$app --key=app_id) -sub_folder=$(ynh_app_setting_get --app=$app --key=sub_folder) +#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 #================================================= -ynh_script_progression --message="Validating restoration parameters..." +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." -test -e "$(ynh_app_setting_get --app=$app_id --key=final_path)" || ynh_die --message="You don't have installed $app_id before installing this app" -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#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 @@ -43,11 +43,11 @@ test ! -e "$final_path" || ynh_die --message="This path already contains a folde #================================================= ynh_script_progression --message="Restoring the app main directory..." -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app_id:www-data "$final_path" +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 29618e6..25e75da 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,12 +12,12 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +#REMOVEME? ynh_script_progression --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -app_id=$(ynh_app_setting_get --app=$app --key=app_id) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#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 @@ -29,16 +29,16 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." +#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." # 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_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 #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -54,12 +54,12 @@ then ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --keep="/data" + ynh_setup_source --dest_dir="$install_dir" --keep="/data" fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app_id:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app_id:www-data "$install_dir" #================================================= # GENERIC FINALIZATION 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 02/13] 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 From 242082d68ce71e396c02e38e03c9f3cd4000baf8 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 25 Nov 2023 14:16:46 +0000 Subject: [PATCH 03/13] Auto-update README --- README.md | 11 ----------- README_fr.md | 11 ----------- 2 files changed, 22 deletions(-) diff --git a/README.md b/README.md index fbedf8f..51a3eeb 100644 --- a/README.md +++ b/README.md @@ -23,17 +23,6 @@ A code editor in your browser. **Shipped version:** 8.1~ynh1 **Demo:** http://demo.icecoder.net/ICEcoder/ -## Disclaimers / important information - -## Limitations - -* If the editor's current folder is where the editor is, the editor's folder is visible in the file tree. - -## Additional information - -* You will need to configure things like password **directly** in the app. -* If you change the URL of this app, you don't change the real URL but the internal path (the process is the same as installation). - ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index 6a397b4..1a756b5 100644 --- a/README_fr.md +++ b/README_fr.md @@ -22,17 +22,6 @@ Un éditeur de code dans votre navigateur. **Version incluse :** 8.1~ynh1 **Démo :** http://demo.icecoder.net/ICEcoder/ -## Avertissements / informations importantes - -## Limitations - -* Si le dossier actuel de l'éditeur se trouve là où se trouve l'éditeur, le dossier de l'éditeur est visible dans l'arbre des fichiers. - -## Informations additionnelles - -* Vous devrez configurer des éléments comme le mot de passe **directement** dans l'application. -* Si vous changez l'URL de cette application, vous ne changez pas l'URL réelle mais le chemin interne (le processus est le même que pour l'installation). - ## Documentations et ressources * Site officiel de l’app : From c8a974998ff5374563c964a0c58839e76fa98097 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 22 Jan 2024 17:32:44 +0100 Subject: [PATCH 04/13] Cleanup + rename confusing 'app_id' question --- manifest.toml | 2 +- scripts/backup | 11 ----------- scripts/install | 16 +--------------- scripts/remove | 29 ----------------------------- scripts/restore | 9 +-------- scripts/upgrade | 28 ++++------------------------ 6 files changed, 7 insertions(+), 88 deletions(-) diff --git a/manifest.toml b/manifest.toml index 143e0a7..dbe5773 100644 --- a/manifest.toml +++ b/manifest.toml @@ -30,7 +30,7 @@ ram.build = "50M" ram.runtime = "50M" [install] - [install.app_id] + [install.custom_webapp_id] ask.en = "Indicate the ID of the Custom Webapp where you want to install this app" ask.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." diff --git a/scripts/backup b/scripts/backup index c2ee80f..13c4781 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,12 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -15,10 +8,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_print_info --message="Declaring files to be backed up..." -#================================================= -# BACKUP THE APP MAIN DIR -#================================================= - ynh_backup --src_path="$install_dir" #================================================= diff --git a/scripts/install b/scripts/install index 964f586..04829f8 100755 --- a/scripts/install +++ b/scripts/install @@ -1,22 +1,8 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." - -ynh_app_setting_set --app=$app --key=app_id --value=$app_id -ynh_app_setting_set --app=$app --key=sub_folder --value=$sub_folder - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -26,7 +12,7 @@ ynh_script_progression --message="Setting up source files..." ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app_id:www-data "$install_dir" +chown -R $custom_webapp_id:www-data "$install_dir" #================================================= # GENERIC FINALIZATION diff --git a/scripts/remove b/scripts/remove index 0e21928..e957053 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,35 +1,6 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - 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? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - -#================================================= -# STANDARD REMOVE -#================================================= -# REMOVE APP MAIN DIR -#================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." - -# Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" - -#================================================= -# END OF SCRIPT -#================================================= - ynh_script_progression --message="Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index 8c4cbbc..0f64cf9 100755 --- a/scripts/restore +++ b/scripts/restore @@ -1,12 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -20,7 +13,7 @@ ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app_id:www-data "$install_dir" +chown -R $custom_webapp_id:www-data "$install_dir" #================================================= # END OF SCRIPT diff --git a/scripts/upgrade b/scripts/upgrade index b0fe0d4..57a1add 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,39 +1,19 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." +ynh_script_progression --message="Upgrading source files..." - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="/data" -fi +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$install_dir" --keep="/data" chmod -R o-rwx "$install_dir" -chown -R $app_id:www-data "$install_dir" +chown -R $custom_webapp_id:www-data "$install_dir" #================================================= # GENERIC FINALIZATION From 28c5cc22c6a5834fab5a571218821c0a039a164e Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 22 Jan 2024 17:35:04 +0100 Subject: [PATCH 05/13] Add my_webapp during tests --- tests.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index eb73b8d..d5d7b73 100644 --- a/tests.toml +++ b/tests.toml @@ -1,3 +1,7 @@ test_format = 1.0 -[default] \ No newline at end of file +[default] + + preinstall = """ + sudo yunohost app install my_webapp --force -a "domain=domain.tld&path=/path&with_sftp=1&password=myreallystrengthpassword&init_main_permission=visitors&phpversion=8.2&database=none" + """ From 870f3d34339edcf386567f85543b7eb7eea60827 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Mon, 22 Jan 2024 18:11:28 +0100 Subject: [PATCH 06/13] Update tests.toml --- tests.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests.toml b/tests.toml index d5d7b73..be4e9d3 100644 --- a/tests.toml +++ b/tests.toml @@ -5,3 +5,5 @@ test_format = 1.0 preinstall = """ sudo yunohost app install my_webapp --force -a "domain=domain.tld&path=/path&with_sftp=1&password=myreallystrengthpassword&init_main_permission=visitors&phpversion=8.2&database=none" """ + + args.custom_webapp_id = "my_webapp" From ac23afd9053c53392b698a95a2fe88f2c911391a Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Mon, 22 Jan 2024 18:41:47 +0100 Subject: [PATCH 07/13] Update DESCRIPTION.md --- doc/DESCRIPTION.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 2d489ca..89e8ec8 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,2 +1,3 @@ -A code editor in your browser. +Code editor awesomeness... in your browser +Note that this app is designed to be coupled to my_webapp / Custom webapp From 6fe57e69c2751a042f931eeb0af50b4957da0d23 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 22 Jan 2024 17:41:51 +0000 Subject: [PATCH 08/13] Auto-update README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 51a3eeb..f240e51 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,9 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -A code editor in your browser. +Code editor awesomeness... in your browser +Note that this app is designed to be coupled to my_webapp / Custom webapp **Shipped version:** 8.1~ynh1 From 9c84a564ffd07b166c391d0dfd96d9555b23356f Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Mon, 22 Jan 2024 18:42:43 +0100 Subject: [PATCH 09/13] Update DESCRIPTION_fr.md --- doc/DESCRIPTION_fr.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index fe83a1f..5bdb7f8 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1 +1,3 @@ -Un éditeur de code dans votre navigateur. +Un éditeur de code impressionnant... dans votre navigateur + +Notez que cette app est conçue pour s'intégrer à my_webapp / custom webapp dans le but de pouvoir éditer le code depuis votre navigateur. From 3db8811c8a784a0fcced86fa66703122e15970bc Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 22 Jan 2024 17:42:47 +0000 Subject: [PATCH 10/13] Auto-update README --- README_fr.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index 1a756b5..b81713d 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,7 +16,9 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -Un éditeur de code dans votre navigateur. +Un éditeur de code impressionnant... dans votre navigateur + +Notez que cette app est conçue pour s'intégrer à my_webapp / custom webapp dans le but de pouvoir éditer le code depuis votre navigateur. **Version incluse :** 8.1~ynh1 From dc9ec1e52d1b703e10437b697c7f162b055eb46f Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Mon, 22 Jan 2024 18:42:58 +0100 Subject: [PATCH 11/13] Update DESCRIPTION.md --- doc/DESCRIPTION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 89e8ec8..f7243d4 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,3 +1,3 @@ Code editor awesomeness... in your browser -Note that this app is designed to be coupled to my_webapp / Custom webapp +Note that this app is designed to be coupled to my_webapp / Custom webapp to be able to edit its code directly from a web browser. From dac55930015f3de5a50317ab1cf40dd9854ad930 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 22 Jan 2024 17:43:03 +0000 Subject: [PATCH 12/13] Auto-update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f240e51..7dae13b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Code editor awesomeness... in your browser -Note that this app is designed to be coupled to my_webapp / Custom webapp +Note that this app is designed to be coupled to my_webapp / Custom webapp to be able to edit its code directly from a web browser. **Shipped version:** 8.1~ynh1 From aeee3d6f6c8ec3e8d95a8ae0ee683e6e82fb4528 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Mon, 22 Jan 2024 18:43:17 +0100 Subject: [PATCH 13/13] Update manifest.toml --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index dbe5773..4344bf8 100644 --- a/manifest.toml +++ b/manifest.toml @@ -33,8 +33,8 @@ ram.runtime = "50M" [install.custom_webapp_id] ask.en = "Indicate the ID of the Custom Webapp where you want to install this app" ask.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." - help.fr = "Vous pouvez obtenir l'ID dans les paramètres de la Custom Webapp." + help.en = "This should be my_webapp, or my_webapp__2, __3, __4 etc if you have several installs of my_webapp." + help.fr = "Il s'agit de my_webapp ou my_webapp__2, __3, __4 etc si vous avez plusieurs installations de my_webapp." type = "string" [install.sub_folder]