From 12102afb9318513b699fae34be6713ce26d536c3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 14 Dec 2020 11:36:02 +0100 Subject: [PATCH] Fix linter warnings --- README.md | 2 +- README_fr.md | 3 +-- check_process | 3 --- manifest.json | 12 +++++++----- scripts/_common.sh | 2 +- scripts/backup | 12 ++++++------ scripts/change_url | 16 ++++++++-------- scripts/install | 19 ++++++++----------- scripts/remove | 4 ++-- scripts/restore | 8 ++++---- scripts/upgrade | 23 +++++++++++------------ 11 files changed, 49 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 512c461..e4919a4 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to Transmission is a fast, easy, and free BitTorrent client. -**Shipped version:** Debian repository version. +**Shipped version:** 2.94-2 (Debian repository version) ## Screenshots ![](transmission.jpg) diff --git a/README_fr.md b/README_fr.md index 3dea907..c7d2de5 100644 --- a/README_fr.md +++ b/README_fr.md @@ -12,7 +12,7 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install Transmission est un client BitTorrent libre, efficace et simple. -**Version incluse :** La version du dépôt de Debian. +**Version incluse :** 2.94-2 (La version du dépôt de Debian) ## Captures d'écran ![](transmission.jpg) @@ -65,7 +65,6 @@ Vous pouvez utiliser les informations suivantes pour vous connecter à votre ser ## Informations pour les développeurs - Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/transmission_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. diff --git a/check_process b/check_process index 43bd8d4..d989292 100644 --- a/check_process +++ b/check_process @@ -14,11 +14,8 @@ upgrade=1 from_commit=7d887f6bc1e29ce94de703517d5302580cbb8a7e backup_restore=1 multi_instance=0 - incorrect_path=1 port_already_use=1 (9091) change_url=1 -;;; Levels - Level 5=auto ;;; Options Email= Notification=down diff --git a/manifest.json b/manifest.json index 1686100..7dfae68 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "apps@yunohost.org" }, "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 3.8.1" }, "multi_instance": false, "services": [ @@ -27,7 +27,8 @@ "name": "domain", "type": "domain", "ask": { - "en": "Choose a domain for Transmission" + "en": "Choose a domain name for Transmission", + "fr": "Choisissez un nom de domaine pour Transmission" }, "example": "domain.org" }, @@ -35,10 +36,11 @@ "name": "path", "type": "path", "ask": { - "en": "Choose a path for Transmission" + "en": "Choose a path for Transmission", + "fr": "Choisissez un chemin pour Transmission" }, - "example": "/torrent", - "default": "/torrent" + "example": "/transmission", + "default": "/transmission" } ] } diff --git a/scripts/_common.sh b/scripts/_common.sh index 75b2cbf..e3b88df 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -27,7 +27,7 @@ ynh_multimedia_build_main_dir () { local checksum="806a827ba1902d6911095602a9221181" # Download yunohost.multimedia scripts - wget -nv https://github.com/YunoHost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz + wget -nv https://github.com/YunoHost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz 2>&1 # Check the control sum echo "${checksum} ${ynh_media_release}.tar.gz" | md5sum -c --status \ diff --git a/scripts/backup b/scripts/backup index 8a89d8b..775a812 100644 --- a/scripts/backup +++ b/scripts/backup @@ -19,18 +19,20 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) #================================================= -# STANDARD BACKUP STEPS +# DECLARE DATA AND CONF FILES TO BACKUP +#================================================= +ynh_print_info --message="Declaring files to be backed up..." + #================================================= # BACKUP OF THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Backing up nginx web server configuration..." ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -39,7 +41,6 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP TRANSMISSION CONFIGURATION #================================================= -ynh_script_progression --message="Backing up transmission configuration..." ynh_backup --src_path="/etc/transmission-daemon/settings.json" if [ -e /proc/sys/net/core/rmem_max ] @@ -50,7 +51,6 @@ fi #================================================= # BACKUP DATA #================================================= -ynh_script_progression --message="Backing up transmission data..." ynh_backup --src_path="/usr/share/transmission" ynh_backup --src_path="/var/lib/transmission-daemon" @@ -61,4 +61,4 @@ ynh_backup --src_path="/home/yunohost.transmission" --is_big # END OF SCRIPT #================================================= -ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index 7fbfbb2..4067ead 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -51,30 +51,30 @@ fi #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping transmission..." --weight=2 +ynh_script_progression --message="Stopping Transmission..." --weight=2 ynh_systemd_action --service_name=transmission-daemon --action=stop #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating nginx web server configuration..." --weight=2 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf -# Change the path in the nginx config file +# 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 + # Make a backup of the original NGINX config file if modified ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for nginx helper + # Set global variables for NGINX helper domain="$old_domain" path_url="$new_path" - # Create a dedicated nginx config + # Create a dedicated NGINX config ynh_add_nginx_config fi -# Change the domain for nginx +# Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location @@ -104,7 +104,7 @@ ynh_systemd_action --service_name=transmission-daemon --action=start #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/install b/scripts/install index 29b606e..27a184d 100644 --- a/scripts/install +++ b/scripts/install @@ -30,9 +30,6 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Validating installation parameters..." -# Normalize the url path syntax -path_url=$(ynh_normalize_url_path $path_url) - # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url @@ -66,7 +63,7 @@ ynh_app_setting_set --app=$app --key=peer_port --value=$peer_port #================================================= # INSTALL TRANSMISSION #================================================= -ynh_script_progression --message="Installing transmission..." --weight=16 +ynh_script_progression --message="Installing Transmission..." --weight=16 ynh_install_app_dependencies $pkg_dependencies @@ -78,15 +75,15 @@ ynh_install_app_dependencies $pkg_dependencies # Explicitly reinstalling the package fixes the issue :| if [ ! -d /usr/share/transmission/ ] then - ynh_package_install transmission-common --reinstall + ynh_install_app_dependencies transmission-common --reinstall fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --weight=2 +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -109,7 +106,7 @@ chmod -R 777 /home/yunohost.transmission/watched #================================================= # CONFIGURE TRANSMISSION #================================================= -ynh_script_progression --message="Configuring transmission..." --weight=2 +ynh_script_progression --message="Configuring Transmission..." --weight=2 # Transmission has to be stopped before modifying its config ynh_systemd_action --service_name=transmission-daemon --action=stop @@ -169,7 +166,7 @@ ynh_replace_string "
$" "
" /usr/share/transmission/web/index.html +#================================================= +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + +yunohost service add transmission-daemon --description="BitTorrent Client" --log="/var/log/syslog" + #================================================= # START TRANSMISSION #================================================= -ynh_script_progression --message="Starting transmission..." --weight=2 +ynh_script_progression --message="Starting Transmission..." --weight=2 ynh_systemd_action --service_name=transmission-daemon --action=start @@ -190,7 +189,7 @@ ynh_systemd_action --service_name=transmission-daemon --action=start #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload