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