diff --git a/README.md b/README.md index fbedf8f..7dae13b 100644 --- a/README.md +++ b/README.md @@ -16,24 +16,14 @@ 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 to be able to edit its code directly from a web 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..b81713d 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,23 +16,14 @@ 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 **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 : 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/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/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/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 2d489ca..f7243d4 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 to be able to edit its code directly from a web browser. 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. 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 new file mode 100644 index 0000000..4344bf8 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,58 @@ +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" + +[integration] +yunohost = ">= 11.2" +architectures = "all" +multi_instance = true + +ldap = false + +sso = false + +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" + +[install] + [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 = "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] + 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..944a65e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#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..13c4781 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,41 +1,14 @@ #!/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 -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_print_info --message="Loading installation settings..." - -app=$YNH_APP_INSTANCE_NAME - -final_path=$(ynh_app_setting_get --app=$app --key=final_path) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= 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..04829f8 100755 --- a/scripts/install +++ b/scripts/install @@ -1,59 +1,18 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -app_id=$YNH_APP_ARG_APP_ID -sub_folder=$YNH_APP_ARG_SUB_FOLDER - -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -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" - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -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 #================================================= ynh_script_progression --message="Setting up source files..." -ynh_app_setting_set --app=$app --key=final_path --value=$final_path # 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 -R o-rwx "$install_dir" +chown -R $custom_webapp_id:www-data "$install_dir" #================================================= # GENERIC FINALIZATION diff --git a/scripts/remove b/scripts/remove index d293873..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 -#================================================= -ynh_script_progression --message="Loading installation settings..." - -app=$YNH_APP_INSTANCE_NAME - -final_path=$(ynh_app_setting_get --app=$app --key=final_path) - -#================================================= -# STANDARD REMOVE -#================================================= -# REMOVE APP MAIN DIR -#================================================= -ynh_script_progression --message="Removing app main directory..." - -# Remove the app directory securely -ynh_secure_remove --file="$final_path" - -#================================================= -# END OF SCRIPT -#================================================= - ynh_script_progression --message="Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index 9a60143..0f64cf9 100755 --- a/scripts/restore +++ b/scripts/restore @@ -1,41 +1,8 @@ #!/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 -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." - -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) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -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" - #================================================= # STANDARD RESTORATION STEPS #================================================= @@ -43,11 +10,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 -R o-rwx "$install_dir" +chown -R $custom_webapp_id:www-data "$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app_id:www-data "$final_path" #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 29618e6..57a1add 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,65 +1,19 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." - -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) - -#================================================= -# CHECK VERSION -#================================================= -ynh_script_progression --message="Checking version..." - -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)..." - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # Restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# 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="$final_path" --keep="/data" -fi +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$install_dir" --keep="/data" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app_id:www-data "$final_path" +chmod -R o-rwx "$install_dir" +chown -R $custom_webapp_id:www-data "$install_dir" #================================================= # GENERIC FINALIZATION diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..be4e9d3 --- /dev/null +++ b/tests.toml @@ -0,0 +1,9 @@ +test_format = 1.0 + +[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" + """ + + args.custom_webapp_id = "my_webapp"