From 2632a202063f0a5e62ba9ed7617aa715411d23fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 11 Apr 2021 18:58:39 +0200 Subject: [PATCH] Patch (#86) * Update app.src --- README.md | 6 +++--- README_fr.md | 6 +++--- check_process | 6 ++---- conf/app.src | 4 ++-- conf/config.local.php | 8 ++++---- manifest.json | 16 ++-------------- scripts/install | 19 ++++++++----------- scripts/upgrade | 19 ++++++++----------- 8 files changed, 32 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index c42f7a1..d4e22b3 100644 --- a/README.md +++ b/README.md @@ -27,14 +27,14 @@ Jirafeau is a web site permitting to upload a file in a simple way and give an u ## Documentation * Official documentation: - * YunoHost documentation: https://yunohost.org/#/app_jirafeau + * YunoHost documentation: https://yunohost.org/en/app_jirafeau ## YunoHost specific features #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/jirafeau%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/jirafeau/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/jirafeau%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/jirafeau/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/jirafeau.svg)](https://ci-apps.yunohost.org/ci/apps/jirafeau/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/jirafeau.svg)](https://ci-apps-arm.yunohost.org/ci/apps/jirafeau/) ## Limitations diff --git a/README_fr.md b/README_fr.md index 4c8919d..5c7d08b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -27,14 +27,14 @@ Jirafeau est un site web permettant d'héberger et de partager des fichiers de m ## Documentation * Documentation officielle : - * Documentation YunoHost : https://yunohost.org/#/app_jirafeau_fr + * Documentation YunoHost : https://yunohost.org/fr/app_jirafeau ## Caractéristiques spécifiques YunoHost #### Architectures supportées -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/jirafeau%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/jirafeau/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/jirafeau%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/jirafeau/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/jirafeau.svg)](https://ci-apps.yunohost.org/ci/apps/jirafeau/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/jirafeau.svg)](https://ci-apps-arm.yunohost.org/ci/apps/jirafeau/) ## Limitations diff --git a/check_process b/check_process index 29e0b0d..f518524 100644 --- a/check_process +++ b/check_process @@ -13,16 +13,14 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=48ed2dc5b80ed7f1ddd39a46917f993a8c4207d5 backup_restore=1 multi_instance=0 - port_already_use=0 change_url=1 ;;; Options Email= Notification=none ;;; Upgrade options - ; commit=48ed2dc5b80ed7f1ddd39a46917f993a8c4207d5 - name=Refactoring and upgrade 3.3.0 + ; commit= + name= manifest_arg=domain=DOMAIN&path=PATH&admin_user=USER&upload_password=supersecretpassword&is_public=1& diff --git a/conf/app.src b/conf/app.src index e5786d4..5a7af15 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://gitlab.com/mojo42/Jirafeau/repository/4.3.0/archive.tar.gz -SOURCE_SUM=435675a2b19d70155c5c3b1ee192582668f17696a040d8051bcdf9eea24dc1da +SOURCE_URL=https://gitlab.com/mojo42/Jirafeau/-/archive/4.3.0/Jirafeau-4.3.0.tar.gz +SOURCE_SUM=77bd4b69cb822ac8cac9df6890f17a673c978b10d8dd6fce46b60c763b859f74 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/config.local.php b/conf/config.local.php index 44d4f11..fd209dd 100644 --- a/conf/config.local.php +++ b/conf/config.local.php @@ -27,11 +27,11 @@ /* URL of installation, with traling slash (eg. »https://exmaple.com/jirafeau/«) */ -$cfg['web_root'] = 'https://' . '__YNH_DOMAIN__' . '__YNH_WWW_PATH__' . '/'; +$cfg['web_root'] = 'https://' . '__DOMAIN__' . '__PATH__' . '/'; /* Path to data directory, with trailing slash (eg. »/var/www/data/var_314159265358979323846264« */ -$cfg['var_root'] = '__YNH_VAR_ROOT__' . '/'; +$cfg['var_root'] = '__VAR_ROOT__' . '/'; /* Language - choice between 'auto' or any language located in the /lib/locales/ folder. * The mode »auto« will cause the script to detect the user's browser information @@ -74,7 +74,7 @@ $cfg['link_name_length'] = 8; * $cfg['upload_password'] = array('psw1'); // One password * $cfg['upload_password'] = array('psw1', 'psw2'); // Two passwords */ -$cfg['upload_password'] = array(__YNH_UPLOAD_PASSWORD__); +$cfg['upload_password'] = array(__UPLOAD_PASSWORD__); /* List of IP allowed to upload a file. * If the list is empty, then there is no upload restriction based on IP. @@ -96,7 +96,7 @@ $cfg['admin_password'] = ''; * that the provided user is logged in. * If »admin_password« parameter is set, then the »admin_password« is ignored. */ -$cfg['admin_http_auth_user'] = '__YNH_ADMIN_USER__'; +$cfg['admin_http_auth_user'] = '__ADMIN_USER__'; /* Allow user to select different options for file expiration time. * Possible values in array: diff --git a/manifest.json b/manifest.json index 3581bff..b736cd7 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Upload a file in a simple way and give a unique link to it", "fr": "Hébergez simplement un fichier et partagez-le avec un lien unique" }, - "version": "4.3.0~ynh1", + "version": "4.3.0~ynh2", "url": "https://gitlab.com/mojo42/Jirafeau", "license": "AGPL-3.0-only", "maintainer": { @@ -14,7 +14,7 @@ "email": "julien.malik@paraiso.me" }, "requirements": { - "yunohost": ">= 4.0.0" + "yunohost": ">= 4.1.7" }, "multi_instance": false, "services": [ @@ -26,19 +26,11 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain for Jirafeau", - "fr": "Choisissez un domaine pour Jirafeau" - }, "example": "domain.org" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Jirafeau", - "fr": "Choisissez un chemin pour Jirafeau" - }, "example": "/jirafeau", "default": "/jirafeau" }, @@ -64,10 +56,6 @@ { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public Jirafeau site?", - "fr": "Est-ce un site public ?" - }, "default": true } ] diff --git a/scripts/install b/scripts/install index aa9a32f..cec41ff 100755 --- a/scripts/install +++ b/scripts/install @@ -100,10 +100,10 @@ cp "../conf/config.local.php" "$jirafeauconfigfile" ynh_print_OFF if [ -z "$upload_password" ] then - ynh_replace_string --match_string="__YNH_UPLOAD_PASSWORD__" --replace_string="" --target_file="$jirafeauconfigfile" + ynh_replace_string --match_string="__UPLOAD_PASSWORD__" --replace_string="" --target_file="$jirafeauconfigfile" ynh_app_setting_set --app=$app --key=upload_password --value="" else - ynh_replace_special_string --match_string="__YNH_UPLOAD_PASSWORD__" --replace_string="'$upload_password'" --target_file="$jirafeauconfigfile" + ynh_replace_special_string --match_string="__UPLOAD_PASSWORD__" --replace_string="'$upload_password'" --target_file="$jirafeauconfigfile" ynh_app_setting_set --app=$app --key=upload_password --value="$upload_password" fi ynh_print_ON @@ -115,15 +115,15 @@ ynh_script_progression --message="Configuring Jirafeau..." --weight=2 var_root=/home/yunohost.app/$app -ynh_replace_string --match_string="__YNH_DOMAIN__" --replace_string="$domain" --target_file="$jirafeauconfigfile" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$jirafeauconfigfile" if [ "$path_url" = "/" ] then - ynh_replace_string --match_string="__YNH_WWW_PATH__" --replace_string="" --target_file="$jirafeauconfigfile" + ynh_replace_string --match_string="__PATH__" --replace_string="" --target_file="$jirafeauconfigfile" else - ynh_replace_string --match_string="__YNH_WWW_PATH__" --replace_string="$path_url" --target_file="$jirafeauconfigfile" + ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$jirafeauconfigfile" fi -ynh_replace_string --match_string="__YNH_VAR_ROOT__" --replace_string="$var_root" --target_file="$jirafeauconfigfile" -ynh_replace_string --match_string="__YNH_ADMIN_USER__" --replace_string="$admin_user" --target_file="$jirafeauconfigfile" +ynh_replace_string --match_string="__VAR_ROOT__" --replace_string="$var_root" --target_file="$jirafeauconfigfile" +ynh_replace_string --match_string="__ADMIN_USER__" --replace_string="$admin_user" --target_file="$jirafeauconfigfile" # Calculate and store the config file checksum into the app settings ynh_store_file_checksum --file="$jirafeauconfigfile" @@ -136,10 +136,7 @@ ynh_secure_remove --file=$final_path/install.php #================================================= ynh_script_progression --message="Configuring the cron file..." --weight=2 -cp ../conf/cron /etc/cron.d/$app -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file=/etc/cron.d/$app -ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file=/etc/cron.d/$app -ynh_replace_string --match_string="__PHPVERSION__" --replace_string=$phpversion --target_file=/etc/cron.d/$app +ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" #================================================= # GENERIC FINALISATION diff --git a/scripts/upgrade b/scripts/upgrade index 2709197..b80e9be 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -181,10 +181,10 @@ cp "../conf/config.local.php" "$final_path/lib/config.local.php" ynh_print_OFF if [ -z "$upload_password" ] then - ynh_replace_string --match_string="__YNH_UPLOAD_PASSWORD__" --replace_string="" --target_file="$jirafeauconfigfile" + ynh_replace_string --match_string="__UPLOAD_PASSWORD__" --replace_string="" --target_file="$jirafeauconfigfile" ynh_app_setting_set --app=$app --key=upload_password --value="" else - ynh_replace_special_string --match_string="__YNH_UPLOAD_PASSWORD__" --replace_string="'$upload_password'" --target_file="$jirafeauconfigfile" + ynh_replace_special_string --match_string="__UPLOAD_PASSWORD__" --replace_string="'$upload_password'" --target_file="$jirafeauconfigfile" ynh_app_setting_set --app=$app --key=upload_password --value="$upload_password" fi ynh_print_ON @@ -196,15 +196,15 @@ ynh_script_progression --message="Upgrading Jirafeau configuration..." --weight= var_root=/home/yunohost.app/$app -ynh_replace_string --match_string="__YNH_DOMAIN__" --replace_string="$domain" --target_file="$jirafeauconfigfile" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$jirafeauconfigfile" if [ "$path_url" = "/" ] then - ynh_replace_string --match_string="__YNH_WWW_PATH__" --replace_string="" --target_file="$jirafeauconfigfile" + ynh_replace_string --match_string="__PATH__" --replace_string="" --target_file="$jirafeauconfigfile" else - ynh_replace_string --match_string="__YNH_WWW_PATH__" --replace_string="$path_url" --target_file="$jirafeauconfigfile" + ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$jirafeauconfigfile" fi -ynh_replace_string --match_string="__YNH_VAR_ROOT__" --replace_string="$var_root" --target_file="$jirafeauconfigfile" -ynh_replace_string --match_string="__YNH_ADMIN_USER__" --replace_string="$admin_user" --target_file="$jirafeauconfigfile" +ynh_replace_string --match_string="__VAR_ROOT__" --replace_string="$var_root" --target_file="$jirafeauconfigfile" +ynh_replace_string --match_string="__ADMIN_USER__" --replace_string="$admin_user" --target_file="$jirafeauconfigfile" # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum --file="$jirafeauconfigfile" @@ -217,10 +217,7 @@ ynh_secure_remove --file=$final_path/install.php #================================================= ynh_script_progression --message="Configuring the cron file..." --weight=1 -cp ../conf/cron /etc/cron.d/$app -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file=/etc/cron.d/$app -ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file=/etc/cron.d/$app -ynh_replace_string --match_string="__PHPVERSION__" --replace_string=$phpversion --target_file=/etc/cron.d/$app +ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" #================================================= # GENERIC FINALISATION