1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jirafeau_ynh.git synced 2024-09-03 19:35:53 +02:00
* Update app.src
This commit is contained in:
Éric Gaspar 2021-04-12 23:01:19 +02:00 committed by GitHub
parent 4b237a154f
commit ea5a9bf4ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 49 additions and 52 deletions

View file

@ -27,14 +27,14 @@ Jirafeau is a web site permitting to upload a file in a simple way and give an u
## Documentation ## Documentation
* Official documentation: * Official documentation:
* YunoHost documentation: https://yunohost.org/#/app_jirafeau * YunoHost documentation: https://yunohost.org/en/app_jirafeau
## YunoHost specific features ## YunoHost specific features
#### Supported architectures #### 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/) * 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%20%28Apps%29.svg)](https://ci-apps-arm.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 ## Limitations

View file

@ -27,14 +27,14 @@ Jirafeau est un site web permettant d'héberger et de partager des fichiers de m
## Documentation ## Documentation
* Documentation officielle : * Documentation officielle :
* Documentation YunoHost : https://yunohost.org/#/app_jirafeau_fr * Documentation YunoHost : https://yunohost.org/fr/app_jirafeau
## Caractéristiques spécifiques YunoHost ## Caractéristiques spécifiques YunoHost
#### Architectures supportées #### 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/) * 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%20%28Apps%29.svg)](https://ci-apps-arm.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 ## Limitations

View file

@ -13,16 +13,14 @@
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
upgrade=1 from_commit=48ed2dc5b80ed7f1ddd39a46917f993a8c4207d5
backup_restore=1 backup_restore=1
multi_instance=0 multi_instance=0
port_already_use=0
change_url=1 change_url=1
;;; Options ;;; Options
Email= Email=
Notification=none Notification=none
;;; Upgrade options ;;; Upgrade options
; commit=48ed2dc5b80ed7f1ddd39a46917f993a8c4207d5 ; commit=
name=Refactoring and upgrade 3.3.0 name=
manifest_arg=domain=DOMAIN&path=PATH&admin_user=USER&upload_password=supersecretpassword&is_public=1& manifest_arg=domain=DOMAIN&path=PATH&admin_user=USER&upload_password=supersecretpassword&is_public=1&

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://gitlab.com/mojo42/Jirafeau/repository/4.3.0/archive.tar.gz SOURCE_URL=https://gitlab.com/mojo42/Jirafeau/-/archive/4.3.0/Jirafeau-4.3.0.tar.gz
SOURCE_SUM=435675a2b19d70155c5c3b1ee192582668f17696a040d8051bcdf9eea24dc1da SOURCE_SUM=77bd4b69cb822ac8cac9df6890f17a673c978b10d8dd6fce46b60c763b859f74
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -27,11 +27,11 @@
/* URL of installation, with traling slash (eg. »https://exmaple.com/jirafeau/«) /* 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« /* 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. /* 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 * 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'); // One password
* $cfg['upload_password'] = array('psw1', 'psw2'); // Two passwords * $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. /* List of IP allowed to upload a file.
* If the list is empty, then there is no upload restriction based on IP. * 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. * that the provided user is logged in.
* If »admin_password« parameter is set, then the »admin_password« is ignored. * 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. /* Allow user to select different options for file expiration time.
* Possible values in array: * Possible values in array:

View file

@ -6,7 +6,7 @@
"en": "Upload a file in a simple way and give a unique link to it", "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" "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", "url": "https://gitlab.com/mojo42/Jirafeau",
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
"maintainer": { "maintainer": {
@ -14,7 +14,7 @@
"email": "julien.malik@paraiso.me" "email": "julien.malik@paraiso.me"
}, },
"requirements": { "requirements": {
"yunohost": ">= 4.0.0" "yunohost": ">= 4.1.7"
}, },
"multi_instance": false, "multi_instance": false,
"services": [ "services": [
@ -26,19 +26,11 @@
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain",
"ask": {
"en": "Choose a domain for Jirafeau",
"fr": "Choisissez un domaine pour Jirafeau"
},
"example": "domain.org" "example": "domain.org"
}, },
{ {
"name": "path", "name": "path",
"type": "path", "type": "path",
"ask": {
"en": "Choose a path for Jirafeau",
"fr": "Choisissez un chemin pour Jirafeau"
},
"example": "/jirafeau", "example": "/jirafeau",
"default": "/jirafeau" "default": "/jirafeau"
}, },
@ -64,10 +56,6 @@
{ {
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
"ask": {
"en": "Is it a public Jirafeau site?",
"fr": "Est-ce un site public ?"
},
"default": true "default": true
} }
] ]

View file

@ -28,6 +28,23 @@ ynh_script_progression --message="Loading installation settings..."
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#================================================= #=================================================
# CHECK WHICH PARTS SHOULD BE CHANGED # CHECK WHICH PARTS SHOULD BE CHANGED
#================================================= #=================================================

View file

@ -100,10 +100,10 @@ cp "../conf/config.local.php" "$jirafeauconfigfile"
ynh_print_OFF ynh_print_OFF
if [ -z "$upload_password" ] if [ -z "$upload_password" ]
then 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="" ynh_app_setting_set --app=$app --key=upload_password --value=""
else 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" ynh_app_setting_set --app=$app --key=upload_password --value="$upload_password"
fi fi
ynh_print_ON ynh_print_ON
@ -115,15 +115,15 @@ ynh_script_progression --message="Configuring Jirafeau..." --weight=2
var_root=/home/yunohost.app/$app 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" = "/" ] if [ "$path_url" = "/" ]
then 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 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 fi
ynh_replace_string --match_string="__YNH_VAR_ROOT__" --replace_string="$var_root" --target_file="$jirafeauconfigfile" ynh_replace_string --match_string="__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="__ADMIN_USER__" --replace_string="$admin_user" --target_file="$jirafeauconfigfile"
# Calculate and store the config file checksum into the app settings # Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$jirafeauconfigfile" 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 ynh_script_progression --message="Configuring the cron file..." --weight=2
cp ../conf/cron /etc/cron.d/$app ynh_add_config --template="../conf/cron" --destination="/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
#================================================= #=================================================
# GENERIC FINALISATION # GENERIC FINALISATION

View file

@ -181,10 +181,10 @@ cp "../conf/config.local.php" "$final_path/lib/config.local.php"
ynh_print_OFF ynh_print_OFF
if [ -z "$upload_password" ] if [ -z "$upload_password" ]
then 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="" ynh_app_setting_set --app=$app --key=upload_password --value=""
else 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" ynh_app_setting_set --app=$app --key=upload_password --value="$upload_password"
fi fi
ynh_print_ON ynh_print_ON
@ -196,15 +196,15 @@ ynh_script_progression --message="Upgrading Jirafeau configuration..." --weight=
var_root=/home/yunohost.app/$app 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" = "/" ] if [ "$path_url" = "/" ]
then 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 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 fi
ynh_replace_string --match_string="__YNH_VAR_ROOT__" --replace_string="$var_root" --target_file="$jirafeauconfigfile" ynh_replace_string --match_string="__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="__ADMIN_USER__" --replace_string="$admin_user" --target_file="$jirafeauconfigfile"
# Recalculate and store the checksum of the file for the next upgrade. # Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$jirafeauconfigfile" 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 ynh_script_progression --message="Configuring the cron file..." --weight=1
cp ../conf/cron /etc/cron.d/$app ynh_add_config --template="../conf/cron" --destination="/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
#================================================= #=================================================
# GENERIC FINALISATION # GENERIC FINALISATION