From cc57922903cf5d6910d2dce3e62be116e28fe99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 28 Oct 2023 18:12:27 +0200 Subject: [PATCH 1/8] v2 --- conf/app.src | 6 ----- conf/nginx.conf | 2 +- manifest.toml | 55 ++++++++++++++++++++++++++++++++++++++++++++++ scripts/backup | 12 +++++----- scripts/change_url | 52 ++++++++++++++++++++++--------------------- scripts/install | 50 ++++++++++++++++++++--------------------- scripts/remove | 16 +++++++------- scripts/restore | 28 +++++++++++------------ scripts/upgrade | 50 ++++++++++++++++++++--------------------- 9 files changed, 161 insertions(+), 110 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 e74c1cc..0000000 --- a/conf/app.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/MohannadNaj/Strut/archive/467fcb8a6436c84f2acb8ffb31b954d5eb3655b8.tar.gz -SOURCE_SUM=d138ec3116b507d1fc3608f0c8bbb7601a68824403cb20617a80af1906bff3ab -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=strut-20160915-3.tar.gz diff --git a/conf/nginx.conf b/conf/nginx.conf index ded657f..d30b198 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __FINALPATH__/ ; + alias __INSTALL_DIR__/ ; index index.html; try_files $uri $uri/ /index.html; diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..621a228 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,55 @@ +packaging_format = 2 + +id = "strut" +name = "Strut" +description.en = "Slide editor for creating impress.js presentations" +description.fr = "Éditeur de diapositives permettant de créer des présentations impress.js" + +version = "20220404~ynh1" + +maintainers = ["ljf"] + +[upstream] +license = "AGPL-3.0" +website = "http://strut.io" +demo = "http://strut.io/dist/" +code = "https://github.com/MohannadNaj/Strut" +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 = ">= 11.0.9" +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.domain] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "domain" + + [install.path] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "path" + default = "/strut" + + [install.init_main_permission] + type = "group" + default = "visitors" + +[resources] + [resources.sources.main] + url = "https://github.com/MohannadNaj/Strut/archive/467fcb8a6436c84f2acb8ffb31b954d5eb3655b8.tar.gz" + sha256 = "d138ec3116b507d1fc3608f0c8bbb7601a68824403cb20617a80af1906bff3ab" + + + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] + main.url = "/" diff --git a/scripts/backup b/scripts/backup index d40b17f..cc81098 100644 --- a/scripts/backup +++ b/scripts/backup @@ -14,17 +14,17 @@ 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 -domain=$(ynh_app_setting_get --app=$app --key=domain) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#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" #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/change_url b/scripts/change_url index 9f0cb6d..7b1c50d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -8,42 +8,42 @@ # source _common.sh source /usr/share/yunohost/helpers -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS #================================================= -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH +#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN +#REMOVEME? old_path=$YNH_APP_OLD_PATH -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH +#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN +#REMOVEME? new_path=$YNH_APP_NEW_PATH -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +#REMOVEME? ynh_script_progression --message="Loading installation settings..." -# Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? # Needed for helper "ynh_add_nginx_config" +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED #================================================= -change_domain=0 -if [ "$old_domain" != "$new_domain" ] +#REMOVEME? change_domain=0 +#REMOVEME? if [ "$old_domain" != "$new_domain" ] then - change_domain=1 + #REMOVEME? change_domain=1 fi -change_path=0 -if [ "$old_path" != "$new_path" ] +#REMOVEME? change_path=0 +#REMOVEME? if [ "$old_path" != "$new_path" ] then - change_path=1 + #REMOVEME? change_path=1 fi #================================================= @@ -53,28 +53,30 @@ fi #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2 -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf +ynh_change_url_nginx_config + +#REMOVEME? nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf # Change the path in the NGINX config file if [ $change_path -eq 1 ] then # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" +#REMOVEME? ynh_backup_if_checksum_is_different --file="$nginx_conf_path" # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" +#REMOVEME? domain="$old_domain" +#REMOVEME? path="$new_path" # Create a dedicated NGINX config - ynh_add_nginx_config +#REMOVEME? ynh_add_nginx_config fi # Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location - ynh_delete_file_checksum --file="$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf +#REMOVEME? ynh_delete_file_checksum --file="$nginx_conf_path" +#REMOVEME? mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" +#REMOVEME? ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi #================================================= @@ -82,9 +84,9 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? #REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index c2fd5c1..8f0ee40 100644 --- a/scripts/install +++ b/scripts/install @@ -14,44 +14,44 @@ 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 #================================================= -domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH -is_public=$YNH_APP_ARG_IS_PUBLIC +#REMOVEME? domain=$YNH_APP_ARG_DOMAIN +#REMOVEME? path=$YNH_APP_ARG_PATH +#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC -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..." --weight=2 +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=2 -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" # Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=2 +#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=2 -ynh_app_setting_set --app=$app --key=domain --value=$domain -ynh_app_setting_set --app=$app --key=path --value=$path_url +#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain +#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # STANDARD MODIFICATIONS @@ -60,13 +60,13 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= ynh_script_progression --message="Setting up source files..." --weight=4 -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 # For this app sources are in app subdirectory tmp_dir=$(mktemp -d) ynh_setup_source --dest_dir="$tmp_dir" -mv "$tmp_dir/dist" "$final_path" +mv "$tmp_dir/dist" "$install_dir" ynh_secure_remove --file="$tmp_dir" #================================================= @@ -85,7 +85,7 @@ ynh_add_nginx_config # Imgur is deactivated on the specific upstream selected, but this text is still here # Don't use a patch because it's minified js -ynh_replace_string --match_string="are currently uploaded to imgur.*re working on changing this" --replace_string="size is limited" --target_file="$final_path/scripts/amd-app.js" +ynh_replace_string --match_string="are currently uploaded to imgur.*re working on changing this" --replace_string="size is limited" --target_file="$install_dir/scripts/amd-app.js" #================================================= # GENERIC FINALIZATION @@ -94,27 +94,27 @@ ynh_replace_string --match_string="are currently uploaded to imgur.*re working o #================================================= # Set permissions to app files -chown -R $app:www-data "$final_path" -chmod -R 640 "$final_path" -find "$final_path" -type d -print0 | xargs -0 chmod 750 +chown -R $app:www-data "$install_dir" +chmod -R 640 "$install_dir" +find "$install_dir" -type d -print0 | xargs -0 chmod 750 #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary -if [ $is_public -eq 1 ] +#REMOVEME? if [ $is_public -eq 1 ] then - ynh_permission_update --permission="main" --add="visitors" +#REMOVEME? ynh_permission_update --permission="main" --add="visitors" fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 12d0321..a450987 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,22 +12,22 @@ 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 -domain=$(ynh_app_setting_get --app=$app --key=domain) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#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..." --weight=2 +#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=2 # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" #================================================= # REMOVE NGINX CONFIGURATION @@ -40,10 +40,10 @@ ynh_remove_nginx_config #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 # Delete a system user -ynh_system_user_delete --username=$app +#REMOVEME? ynh_system_user_delete --username=$app #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 9865364..a37ce8b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,26 +14,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 settings..." --weight=2 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=3 +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=3 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +#REMOVEME? test ! -d $install_dir \ + || ynh_die --message="There is already a directory: $install_dir " #================================================= # STANDARD RESTORATION STEPS @@ -47,26 +47,26 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # RESTORE THE APP MAIN DIR #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=1 -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" #================================================= # RESTORE USER RIGHTS #================================================= # Restore permissions on app files -chown -R $app:www-data "$final_path" -chmod -R 640 "$final_path" -find "$final_path" -type d -print0 | xargs -0 chmod 750 +chown -R $app:www-data "$install_dir" +chmod -R 640 "$install_dir" +find "$install_dir" -type d -print0 | xargs -0 chmod 750 #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 2710124..9aad835 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,13 +12,13 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=3 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=3 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # CHECK VERSION @@ -29,31 +29,31 @@ 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)..." --weight=6 +#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=6 # 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 #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# If final_path doesn't exist, create it -if [ -z "$final_path" ]; then - final_path=/var/www/$app - ynh_app_setting_set --app=$app --key=final_path --value=$final_path +# If install_dir doesn't exist, create it +if [ -z "$install_dir" ]; then +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir fi # Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all +#REMOVEME? if ynh_legacy_permissions_exists; then +#REMOVEME? ynh_legacy_permissions_delete_all ynh_app_setting_delete --app=$app --key=is_public fi @@ -61,10 +61,10 @@ fi #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 +#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # STANDARD UPGRADE STEPS @@ -82,7 +82,7 @@ then ynh_setup_source --dest_dir="$tmp_dir" # Dist is the compiled version. Other directories are source code and tools to build the program - cp -a "$tmp_dir/dist/." "$final_path/" + cp -a "$tmp_dir/dist/." "$install_dir/" ynh_secure_remove --file="$tmp_dir" fi @@ -104,7 +104,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then # Imgur is deactivated on the specific upstream selected, but this text is still here # Don't use a patch because it's minified js - ynh_replace_string --match_string="are currently uploaded to imgur.*re working on changing this" --replace_string="size is limited" --target_file="$final_path/scripts/amd-app.js" + ynh_replace_string --match_string="are currently uploaded to imgur.*re working on changing this" --replace_string="size is limited" --target_file="$install_dir/scripts/amd-app.js" fi #================================================= @@ -114,16 +114,16 @@ fi #================================================= # Set permissions on app files -chown -R $app:www-data "$final_path" -chmod -R 640 "$final_path" -find "$final_path" -type d -print0 | xargs -0 chmod 750 +chown -R $app:www-data "$install_dir" +chmod -R 640 "$install_dir" +find "$install_dir" -type d -print0 | xargs -0 chmod 750 #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT From 951ba43415ded2c2b132ef8102792558ee2709e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 28 Oct 2023 18:16:34 +0200 Subject: [PATCH 2/8] v2 --- check_process | 24 --------- doc/{DISCLAIMER.md => ADMIN.md} | 0 doc/{DISCLAIMER_fr.md => ADMIN_fr.md} | 0 doc/DESCRIPTION_fr.md | 2 +- manifest.json | 48 ------------------ manifest.toml | 18 +++---- scripts/_common.sh | 16 ++++++ scripts/backup | 17 ------- scripts/change_url | 70 --------------------------- scripts/install | 63 ------------------------ scripts/remove | 28 ----------- scripts/restore | 34 ------------- scripts/upgrade | 58 ---------------------- tests.toml | 3 ++ 14 files changed, 27 insertions(+), 354 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 ab3a929..0000000 --- a/check_process +++ /dev/null @@ -1,24 +0,0 @@ -;; Test complet - ; Manifest - domain="domain.tld" - path="/path" - is_public=1 - ; Checks - pkg_linter=1 - setup_sub_dir=1 - setup_root=1 - setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 - upgrade=1 from_commit=f6565f66d82fa077d752226f8b8267018f7b91d8 - backup_restore=1 - multi_instance=1 - change_url=1 -;;; Options -Email=ljf+ynh-strut@grimaud.me -Notification=down -;;; Upgrade options - ; commit=f6565f66d82fa077d752226f8b8267018f7b91d8 - name=May 27, 2018 - manifest_arg=domain=DOMAIN&path=PATH&is_public=Yes& 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_fr.md b/doc/DESCRIPTION_fr.md index 5a66639..595943f 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1 +1 @@ -Strut est un éditeur WEB de présentations fonctionnant en HTML/JS. Tout se passe en local. Il fonctinne grâce à [impress.js](http://bartaz.github.com/impress.js/#/bored). +Strut est un éditeur WEB de présentations fonctionnant en HTML/JS. Tout se passe en local. \ No newline at end of file diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 6c771d0..0000000 --- a/manifest.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "Strut", - "id": "strut", - "packaging_format": 1, - "description": { - "en": "Slide editor for creating impress.js presentations", - "fr": "Éditeur de diapositives permettant de créer des présentations impress.js" - }, - "version": "20220404~ynh1", - "url": "http://strut.io", - "upstream": { - "license": "AGPL-3.0", - "website": "http://strut.io", - "demo": "http://strut.io/dist/", - "code": "https://github.com/MohannadNaj/Strut" - }, - "license": "AGPL-3.0", - "maintainer": { - "name": "ljf", - "email": "ljf+yunohost@grimaud.me" - }, - "requirements": { - "yunohost": ">= 11.0.9" - }, - "multi_instance": true, - "services": [ - "nginx" - ], - "arguments": { - "install" : [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "example": "/strut", - "default": "/strut" - }, - { - "name": "is_public", - "type": "boolean", - "default": true - } - ] - } -} diff --git a/manifest.toml b/manifest.toml index 621a228..a6a321f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -14,26 +14,22 @@ license = "AGPL-3.0" website = "http://strut.io" demo = "http://strut.io/dist/" code = "https://github.com/MohannadNaj/Strut" -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 = ">= 11.0.9" -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.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "domain" [install.path] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "path" default = "/strut" diff --git a/scripts/_common.sh b/scripts/_common.sh index a9bf588..69c72c9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1 +1,17 @@ #!/bin/bash + +#================================================= +# COMMON VARIABLES +#================================================= + +#================================================= +# PERSONAL HELPERS +#================================================= + +#================================================= +# EXPERIMENTAL HELPERS +#================================================= + +#================================================= +# FUTURE OFFICIAL HELPERS +#================================================= \ No newline at end of file diff --git a/scripts/backup b/scripts/backup index cc81098..55ccde2 100644 --- a/scripts/backup +++ b/scripts/backup @@ -9,23 +9,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? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/change_url b/scripts/change_url index 7b1c50d..8a06216 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -8,43 +8,6 @@ # source _common.sh source /usr/share/yunohost/helpers -#REMOVEME? ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN -#REMOVEME? old_path=$YNH_APP_OLD_PATH - -#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN -#REMOVEME? new_path=$YNH_APP_NEW_PATH - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." - -#REMOVEME? # Needed for helper "ynh_add_nginx_config" -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -#REMOVEME? change_domain=0 -#REMOVEME? if [ "$old_domain" != "$new_domain" ] -then - #REMOVEME? change_domain=1 -fi - -#REMOVEME? change_path=0 -#REMOVEME? if [ "$old_path" != "$new_path" ] -then - #REMOVEME? change_path=1 -fi #================================================= # STANDARD MODIFICATIONS @@ -55,39 +18,6 @@ ynh_script_progression --message="Updating NGINX web server configuration..." -- ynh_change_url_nginx_config -#REMOVEME? nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf - -# Change the path in the NGINX config file -if [ $change_path -eq 1 ] -then - # Make a backup of the original NGINX config file if modified -#REMOVEME? ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper -#REMOVEME? domain="$old_domain" -#REMOVEME? path="$new_path" - # Create a dedicated NGINX config -#REMOVEME? ynh_add_nginx_config -fi - -# Change the domain for NGINX -if [ $change_domain -eq 1 ] -then - # Delete file checksum for the old conf file location -#REMOVEME? ynh_delete_file_checksum --file="$nginx_conf_path" -#REMOVEME? mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location -#REMOVEME? ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi - -#================================================= -# GENERIC FINALISATION -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? #REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index 8f0ee40..ccf9b72 100644 --- a/scripts/install +++ b/scripts/install @@ -9,50 +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? domain=$YNH_APP_ARG_DOMAIN -#REMOVEME? path=$YNH_APP_ARG_PATH -#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=2 - -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - -# Register (book) web path -#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=2 - -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -60,7 +16,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Setting up source files..." --weight=4 -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src # For this app sources are in app subdirectory tmp_dir=$(mktemp -d) @@ -98,24 +53,6 @@ chown -R $app:www-data "$install_dir" chmod -R 640 "$install_dir" find "$install_dir" -type d -print0 | xargs -0 chmod 750 -#================================================= -# SETUP SSOWAT -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 - -# Make app public if necessary -#REMOVEME? if [ $is_public -eq 1 ] -then -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" -fi - -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index a450987..318dae4 100644 --- a/scripts/remove +++ b/scripts/remove @@ -9,26 +9,6 @@ # 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? domain=$(ynh_app_setting_get --app=$app --key=domain) -#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..." --weight=2 - -# Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" - #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -37,14 +17,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 - -# Delete a system user -#REMOVEME? ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index a37ce8b..d7ea54b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -9,32 +9,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 -#================================================= -ynh_script_progression --message="Loading settings..." --weight=2 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=3 - -#REMOVEME? test ! -d $install_dir \ - || ynh_die --message="There is already a directory: $install_dir " - #================================================= # STANDARD RESTORATION STEPS #================================================= @@ -44,14 +18,6 @@ ynh_script_progression --message="Restoring the NGINX web server configuration.. ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # RESTORE THE APP MAIN DIR #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 9aad835..ccb2987 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,63 +9,12 @@ # source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=3 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - #================================================= # CHECK 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)..." --weight=6 - -# 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 -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - -# If install_dir doesn't exist, create it -if [ -z "$install_dir" ]; then -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir -fi - -# Cleaning legacy permissions -#REMOVEME? if ynh_legacy_permissions_exists; then -#REMOVEME? ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -118,13 +67,6 @@ chown -R $app:www-data "$install_dir" chmod -R 640 "$install_dir" find "$install_dir" -type d -print0 | xargs -0 chmod 750 -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= 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 13c0aad12a3ed3245ae9cf4bf1d3990ecc86c5ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 28 Oct 2023 18:54:42 +0200 Subject: [PATCH 3/8] Update install --- scripts/install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index ccf9b72..9542533 100644 --- a/scripts/install +++ b/scripts/install @@ -21,7 +21,8 @@ ynh_script_progression --message="Setting up source files..." --weight=4 tmp_dir=$(mktemp -d) ynh_setup_source --dest_dir="$tmp_dir" -mv "$tmp_dir/dist" "$install_dir" +mv "$tmp_dir/dist" "$install_dir" + ynh_secure_remove --file="$tmp_dir" #================================================= From b63ac5b12d84c4117fac1df44dddc9acef4d08b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 28 Oct 2023 18:59:29 +0200 Subject: [PATCH 4/8] fix --- conf/nginx.conf | 2 +- scripts/install | 20 ++------------------ 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index d30b198..378e10f 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __INSTALL_DIR__/ ; + alias __INSTALL_DIR__/dist/ ; index index.html; try_files $uri $uri/ /index.html; diff --git a/scripts/install b/scripts/install index 9542533..7414ba7 100644 --- a/scripts/install +++ b/scripts/install @@ -16,14 +16,9 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Setting up source files..." --weight=4 -# Download, check integrity, uncompress and patch the source from app.src -# For this app sources are in app subdirectory -tmp_dir=$(mktemp -d) +ynh_setup_source --dest_dir="$install_dir" -ynh_setup_source --dest_dir="$tmp_dir" -mv "$tmp_dir/dist" "$install_dir" - -ynh_secure_remove --file="$tmp_dir" +chown -R $app:www-data "$install_dir" #================================================= # NGINX CONFIGURATION @@ -43,17 +38,6 @@ ynh_add_nginx_config # Don't use a patch because it's minified js ynh_replace_string --match_string="are currently uploaded to imgur.*re working on changing this" --replace_string="size is limited" --target_file="$install_dir/scripts/amd-app.js" -#================================================= -# GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions to app files -chown -R $app:www-data "$install_dir" -chmod -R 640 "$install_dir" -find "$install_dir" -type d -print0 | xargs -0 chmod 750 - #================================================= # END OF SCRIPT #================================================= From cd68259c31cbb4433825692e6f8cb55f714ef38a Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 4 Dec 2023 21:02:28 +0100 Subject: [PATCH 5/8] the actual source is actually in a dist/ subdir x_x --- scripts/install | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 7414ba7..29ef770 100644 --- a/scripts/install +++ b/scripts/install @@ -16,7 +16,11 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Setting up source files..." --weight=4 -ynh_setup_source --dest_dir="$install_dir" +tmp_dir=$(mktemp -d) +ynh_setup_source --dest_dir="$tmp_dir" +# Dist is the compiled version. Other directories are source code and tools to build the program +cp -a "$tmp_dir/dist/." "$install_dir/" +ynh_secure_remove --file="$tmp_dir" chown -R $app:www-data "$install_dir" From d2b51506c788a57490a9f8cd140b9a449b2c2c85 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 4 Dec 2023 20:02:41 +0000 Subject: [PATCH 6/8] Auto-update README --- README.md | 18 +++--------------- README_fr.md | 41 ++++++++++++----------------------------- 2 files changed, 15 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index d8ef291..85c6bbf 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # Strut for YunoHost -[![Integration level](https://dash.yunohost.org/integration/strut.svg)](https://dash.yunohost.org/appci/app/strut) ![Working status](https://ci-apps.yunohost.org/ci/badges/strut.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/strut.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/strut.svg)](https://dash.yunohost.org/appci/app/strut) ![Working status](https://ci-apps.yunohost.org/ci/badges/strut.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/strut.maintain.svg) + [![Install Strut with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=strut) *[Lire ce readme en français.](./README_fr.md)* @@ -25,24 +26,11 @@ Strut is a simple, online editor that doesn't even require registration to opera ![Screenshot of Strut](./doc/screenshots/screenshot.gif) -## Disclaimers / important information - -## Limitations -No import/export from/to OpenDocument or pptx. - -## Additional information - -* This package doesn't contained the exact sources of the upstream https://github.com/tantaman/Strut. - -Initial Strut software includes Google Analytics and is bind to Imgur to upload images. This kind of trackers or external services are not accepted by the package team of YunoHost. So this trackers are removed from sources, a pull request has been done and merged but has finally be removed from the strut upstream with no explanation. In more, Strut developers don't deliver builded versions. To build a version it needs grunt, that can't be removed easily. - -To avoid to take time to build this html/js app, this package setups a builded version of Strut with the patch that remove Google Analytics and Imgur dependencies. It is a build of this version https://github.com/tantaman/Strut/commits/6761b141ee7aa622916e2d23cced84ee95618cce . So it's not the more recent version. - ## Documentation and resources * Official app website: * Upstream app code repository: -* YunoHost documentation for this app: +* YunoHost Store: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index 3da9ae8..5a0e336 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,49 +5,32 @@ It shall NOT be edited by hand. # Strut pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/strut.svg)](https://dash.yunohost.org/appci/app/strut) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/strut.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/strut.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/strut.svg)](https://dash.yunohost.org/appci/app/strut) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/strut.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/strut.maintain.svg) + [![Installer Strut avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=strut) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Strut rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +> *Ce package vous permet d’installer Strut rapidement et simplement sur un serveur YunoHost. +Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Vue d'ensemble - -Strut est un éditeur WEB de présentations fonctionnant en HTML/JS. Tout se passe en local. Il fonctinne grâce à [impress.js](http://bartaz.github.com/impress.js/#/bored). +## Vue d’ensemble +Strut est un éditeur WEB de présentations fonctionnant en HTML/JS. Tout se passe en local. **Version incluse :** 20220404~ynh1 **Démo :** http://strut.io/dist/ -## Captures d'écran +## Captures d’écran -![Capture d'écran de Strut](./doc/screenshots/screenshot.gif) - -## Avertissements / informations importantes - -## Limitations - -Pas d'import/export possible depuis ou vers des fichiers OpenDocument ou pptx. - -## Information supplémentaires - -* Ce package ne contient pas les sources exactes de [la version originale de Strut](https://github.com/tantaman/Strut) - -Strut, à l'origine, inclut Google Analytics et est lié à Imgur pour téléverser des images. Ces pisteurs ou services externes ne sont pas acceptés par l'équipe de YunoHost. -Ils sont donc supprimés par rapport aux sources. -Une pull request pour les supprimer de leur côté a été validée et mergée mais finalement supprimée sans explication. De plus, les développeurs de Strut ne fournissent pas le logiciel compilé. -Pour compiler le logiciel, cela nécessite grunt, ce qui ne peut pas être supprimé facilement. -Pour éviter de devoir générer cette application HTML/JS, ce package créé une version compilée de Strut avec le patch qui supprime les dépendances à Google Analytics et Imgur. -Voici la version compilée https://github.com/tantaman/Strut/commits/6761b141ee7aa622916e2d23cced84ee95618cce. Ce n'est pas la version la plus récente. +![Capture d’écran de Strut](./doc/screenshots/screenshot.gif) ## Documentations et ressources -* Site officiel de l'app : -* Dépôt de code officiel de l'app : -* Documentation YunoHost pour cette app : +* Site officiel de l’app : +* Dépôt de code officiel de l’app : +* YunoHost Store: * Signaler un bug : ## Informations pour les développeurs @@ -62,4 +45,4 @@ ou sudo yunohost app upgrade strut -u https://github.com/YunoHost-Apps/strut_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file From 4b4937e6d62ea02d24ebe321b8380e0d28835cf5 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 4 Dec 2023 21:37:53 +0100 Subject: [PATCH 7/8] Remove nginx conf tweaking, we serve the proper folder directly --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 378e10f..6bba814 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __INSTALL_DIR__/dist/ ; + alias __INSTALL_DIR__/; index index.html; try_files $uri $uri/ /index.html; From 9f41dd743146e17fbaf4c381fd515f1cf81d8929 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 4 Dec 2023 22:27:23 +0100 Subject: [PATCH 8/8] Fix permissions --- scripts/install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/install b/scripts/install index 29ef770..c5c2aed 100644 --- a/scripts/install +++ b/scripts/install @@ -22,7 +22,10 @@ ynh_setup_source --dest_dir="$tmp_dir" cp -a "$tmp_dir/dist/." "$install_dir/" ynh_secure_remove --file="$tmp_dir" +# Set permissions on app files chown -R $app:www-data "$install_dir" +chmod -R 640 "$install_dir" +find "$install_dir" -type d -print0 | xargs -0 chmod 750 #================================================= # NGINX CONFIGURATION