1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/icecoder_ynh.git synced 2024-09-03 19:26:10 +02:00
This commit is contained in:
Éric Gaspar 2023-11-25 15:13:16 +01:00
parent 9107b58c00
commit 1639951ac7
8 changed files with 108 additions and 57 deletions

View file

@ -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

57
manifest.toml Normal file
View file

@ -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]

View file

@ -5,7 +5,7 @@
#================================================= #=================================================
# dependencies used by the app # 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 # PERSONAL HELPERS

View file

@ -15,16 +15,16 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors #REMOVEME? ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # 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 # 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 # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_backup --src_path="$final_path" ynh_backup --src_path="$install_dir"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -14,30 +14,30 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# Exit if an error occurs during the execution of the script # 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 # RETRIEVE ARGUMENTS FROM THE MANIFEST
#================================================= #=================================================
app_id=$YNH_APP_ARG_APP_ID #REMOVEME? app_id=$YNH_APP_ARG_APP_ID
sub_folder=$YNH_APP_ARG_SUB_FOLDER #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 # 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 #REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app_id --key=install_dir)$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" #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"
test ! -e "$final_path" || ynh_die --message="This path already contains a folder" #REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder"
#================================================= #=================================================
# STORE SETTINGS FROM MANIFEST # 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=app_id --value=$app_id
ynh_app_setting_set --app=$app --key=sub_folder --value=$sub_folder 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_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 # 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 750 "$install_dir"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$install_dir"
chown -R $app_id:www-data "$final_path" chown -R $app_id:www-data "$install_dir"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION

View file

@ -12,21 +12,21 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # 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 # STANDARD REMOVE
#================================================= #=================================================
# REMOVE APP MAIN DIR # 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 # Remove the app directory securely
ynh_secure_remove --file="$final_path" #REMOVEME? ynh_secure_remove --file="$install_dir"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -15,26 +15,26 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors #REMOVEME? ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # 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)
app_id=$(ynh_app_setting_get --app=$app --key=app_id) #REMOVEME? app_id=$(ynh_app_setting_get --app=$app --key=app_id)
sub_folder=$(ynh_app_setting_get --app=$app --key=sub_folder) #REMOVEME? sub_folder=$(ynh_app_setting_get --app=$app --key=sub_folder)
#================================================= #=================================================
# CHECK IF THE APP CAN BE RESTORED # 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" #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"
test ! -e "$final_path" || ynh_die --message="This path already contains a folder" #REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder"
#================================================= #=================================================
# STANDARD RESTORATION STEPS # 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_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 750 "$install_dir"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$install_dir"
chown -R $app_id:www-data "$final_path" chown -R $app_id:www-data "$install_dir"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -12,12 +12,12 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # 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) #REMOVEME? app_id=$(ynh_app_setting_get --app=$app --key=app_id)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) #REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
@ -29,16 +29,16 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # 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 # Backup the current version of the app
ynh_backup_before_upgrade #REMOVEME? ynh_backup_before_upgrade
ynh_clean_setup () { #REMOVEME? ynh_clean_setup () {
# Restore it if the upgrade fails # Restore it if the upgrade fails
ynh_restore_upgradebackup #REMOVEME? ynh_restore_upgradebackup
} }
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors #REMOVEME? ynh_abort_if_errors
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
@ -54,12 +54,12 @@ 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 # 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 fi
chmod 750 "$final_path" chmod 750 "$install_dir"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$install_dir"
chown -R $app_id:www-data "$final_path" chown -R $app_id:www-data "$install_dir"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION