mirror of
https://github.com/YunoHost-Apps/transmission_ynh.git
synced 2024-09-04 01:46:12 +02:00
Fix linter warnings
This commit is contained in:
parent
723a2840de
commit
12102afb93
11 changed files with 49 additions and 55 deletions
|
@ -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.
|
Transmission is a fast, easy, and free BitTorrent client.
|
||||||
|
|
||||||
**Shipped version:** Debian repository version.
|
**Shipped version:** 2.94-2 (Debian repository version)
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
![](transmission.jpg)
|
![](transmission.jpg)
|
||||||
|
|
|
@ -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.
|
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
|
## Captures d'écran
|
||||||
![](transmission.jpg)
|
![](transmission.jpg)
|
||||||
|
@ -65,7 +65,6 @@ Vous pouvez utiliser les informations suivantes pour vous connecter à votre ser
|
||||||
|
|
||||||
## Informations pour les développeurs
|
## Informations pour les développeurs
|
||||||
|
|
||||||
|
|
||||||
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/transmission_ynh/tree/testing).
|
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.
|
Pour essayer la branche testing, procédez comme suit.
|
||||||
|
|
|
@ -14,11 +14,8 @@
|
||||||
upgrade=1 from_commit=7d887f6bc1e29ce94de703517d5302580cbb8a7e
|
upgrade=1 from_commit=7d887f6bc1e29ce94de703517d5302580cbb8a7e
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=0
|
multi_instance=0
|
||||||
incorrect_path=1
|
|
||||||
port_already_use=1 (9091)
|
port_already_use=1 (9091)
|
||||||
change_url=1
|
change_url=1
|
||||||
;;; Levels
|
|
||||||
Level 5=auto
|
|
||||||
;;; Options
|
;;; Options
|
||||||
Email=
|
Email=
|
||||||
Notification=down
|
Notification=down
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"email": "apps@yunohost.org"
|
"email": "apps@yunohost.org"
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 3.5"
|
"yunohost": ">= 3.8.1"
|
||||||
},
|
},
|
||||||
"multi_instance": false,
|
"multi_instance": false,
|
||||||
"services": [
|
"services": [
|
||||||
|
@ -27,7 +27,8 @@
|
||||||
"name": "domain",
|
"name": "domain",
|
||||||
"type": "domain",
|
"type": "domain",
|
||||||
"ask": {
|
"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"
|
"example": "domain.org"
|
||||||
},
|
},
|
||||||
|
@ -35,10 +36,11 @@
|
||||||
"name": "path",
|
"name": "path",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"ask": {
|
"ask": {
|
||||||
"en": "Choose a path for Transmission"
|
"en": "Choose a path for Transmission",
|
||||||
|
"fr": "Choisissez un chemin pour Transmission"
|
||||||
},
|
},
|
||||||
"example": "/torrent",
|
"example": "/transmission",
|
||||||
"default": "/torrent"
|
"default": "/transmission"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ ynh_multimedia_build_main_dir () {
|
||||||
local checksum="806a827ba1902d6911095602a9221181"
|
local checksum="806a827ba1902d6911095602a9221181"
|
||||||
|
|
||||||
# Download yunohost.multimedia scripts
|
# 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
|
# Check the control sum
|
||||||
echo "${checksum} ${ynh_media_release}.tar.gz" | md5sum -c --status \
|
echo "${checksum} ${ynh_media_release}.tar.gz" | md5sum -c --status \
|
||||||
|
|
|
@ -19,18 +19,20 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Loading installation settings..."
|
ynh_print_info --message="Loading installation settings..."
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
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
|
# 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"
|
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
|
# BACKUP TRANSMISSION CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up transmission configuration..."
|
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/transmission-daemon/settings.json"
|
ynh_backup --src_path="/etc/transmission-daemon/settings.json"
|
||||||
if [ -e /proc/sys/net/core/rmem_max ]
|
if [ -e /proc/sys/net/core/rmem_max ]
|
||||||
|
@ -50,7 +51,6 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP DATA
|
# BACKUP DATA
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up transmission data..."
|
|
||||||
|
|
||||||
ynh_backup --src_path="/usr/share/transmission"
|
ynh_backup --src_path="/usr/share/transmission"
|
||||||
ynh_backup --src_path="/var/lib/transmission-daemon"
|
ynh_backup --src_path="/var/lib/transmission-daemon"
|
||||||
|
@ -61,4 +61,4 @@ ynh_backup --src_path="/home/yunohost.transmission" --is_big
|
||||||
# END OF SCRIPT
|
# 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)."
|
||||||
|
|
|
@ -51,30 +51,30 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# STOP SYSTEMD SERVICE
|
# 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
|
ynh_systemd_action --service_name=transmission-daemon --action=stop
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY URL IN NGINX CONF
|
# 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
|
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 ]
|
if [ $change_path -eq 1 ]
|
||||||
then
|
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"
|
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"
|
domain="$old_domain"
|
||||||
path_url="$new_path"
|
path_url="$new_path"
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Change the domain for nginx
|
# Change the domain for NGINX
|
||||||
if [ $change_domain -eq 1 ]
|
if [ $change_domain -eq 1 ]
|
||||||
then
|
then
|
||||||
# Delete file checksum for the old conf file location
|
# Delete file checksum for the old conf file location
|
||||||
|
@ -104,7 +104,7 @@ ynh_systemd_action --service_name=transmission-daemon --action=start
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# 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
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
|
|
@ -30,9 +30,6 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Validating installation parameters..."
|
ynh_script_progression --message="Validating installation parameters..."
|
||||||
|
|
||||||
# Normalize the url path syntax
|
|
||||||
path_url=$(ynh_normalize_url_path $path_url)
|
|
||||||
|
|
||||||
# Register (book) web path
|
# Register (book) web path
|
||||||
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
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
|
# INSTALL TRANSMISSION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing transmission..." --weight=16
|
ynh_script_progression --message="Installing Transmission..." --weight=16
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
|
@ -78,15 +75,15 @@ ynh_install_app_dependencies $pkg_dependencies
|
||||||
# Explicitly reinstalling the package fixes the issue :|
|
# Explicitly reinstalling the package fixes the issue :|
|
||||||
if [ ! -d /usr/share/transmission/ ]
|
if [ ! -d /usr/share/transmission/ ]
|
||||||
then
|
then
|
||||||
ynh_package_install transmission-common --reinstall
|
ynh_install_app_dependencies transmission-common --reinstall
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# 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
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -109,7 +106,7 @@ chmod -R 777 /home/yunohost.transmission/watched
|
||||||
#=================================================
|
#=================================================
|
||||||
# CONFIGURE TRANSMISSION
|
# 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
|
# Transmission has to be stopped before modifying its config
|
||||||
ynh_systemd_action --service_name=transmission-daemon --action=stop
|
ynh_systemd_action --service_name=transmission-daemon --action=stop
|
||||||
|
@ -169,7 +166,7 @@ ynh_replace_string "<div id=\"toolbar-inspector\" title=\"Toggle Inspector\"></d
|
||||||
#=================================================
|
#=================================================
|
||||||
# START TRANSMISSION
|
# START TRANSMISSION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting transmission..."
|
ynh_script_progression --message="Starting Transmission..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=transmission-daemon --action=start
|
ynh_systemd_action --service_name=transmission-daemon --action=start
|
||||||
|
|
||||||
|
@ -179,12 +176,12 @@ ynh_systemd_action --service_name=transmission-daemon --action=start
|
||||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
yunohost service add transmission-daemon --log "/var/log/syslog"
|
yunohost service add transmission-daemon --description="BitTorrent Client" --log="/var/log/syslog"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# 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
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
|
|
@ -59,9 +59,9 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE THE NGINX CONFIGURATION
|
# REMOVE THE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing nginx web server configuration..."
|
ynh_script_progression --message="Removing NGINX web server configuration..."
|
||||||
|
|
||||||
# Remove the dedicated nginx config
|
# Remove the dedicated NGINX config
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -57,7 +57,7 @@ ynh_exec_warn_less yunohost firewall allow Both $peer_port
|
||||||
#=================================================
|
#=================================================
|
||||||
# REINSTALL TRANSMISSION
|
# REINSTALL TRANSMISSION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reinstalling transmission..." --weight=16
|
ynh_script_progression --message="Reinstalling Transmission..." --weight=16
|
||||||
|
|
||||||
# Define and install dependencies
|
# Define and install dependencies
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
@ -65,7 +65,7 @@ ynh_install_app_dependencies $pkg_dependencies
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE TRANSMISSION CONFIGURATION
|
# RESTORE TRANSMISSION CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring transmission configuration..." --weight=2
|
ynh_script_progression --message="Restoring Transmission configuration..." --weight=2
|
||||||
|
|
||||||
# Transmission has to be stopped before modifying its config
|
# Transmission has to be stopped before modifying its config
|
||||||
ynh_systemd_action --service_name=transmission-daemon --action=stop
|
ynh_systemd_action --service_name=transmission-daemon --action=stop
|
||||||
|
@ -127,14 +127,14 @@ ynh_systemd_action --service_name=transmission-daemon --action=start
|
||||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
yunohost service add transmission-daemon --log "/var/log/syslog"
|
yunohost service add transmission-daemon --description="BitTorrent Client" --log="/var/log/syslog"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX AND PHP-FPM
|
# RELOAD NGINX AND PHP-FPM
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reloading nginx web server..." --weight=2
|
ynh_script_progression --message="Reloading NGINX web server..." --weight=2
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
|
|
@ -67,21 +67,14 @@ ynh_clean_setup () {
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
ynh_abort_if_errors
|
ynh_abort_if_errors
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CHECK THE PATH
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Normalize the URL path syntax
|
|
||||||
path_url=$(ynh_normalize_url_path --path_url=$path_url)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD UPGRADE STEPS
|
# STANDARD UPGRADE STEPS
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2
|
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
|
||||||
|
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -111,7 +104,7 @@ chmod -R 777 /home/yunohost.transmission/watched
|
||||||
#=================================================
|
#=================================================
|
||||||
# CONFIGURE TRANSMISSION
|
# CONFIGURE TRANSMISSION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reconfiguring transmission..." --weight=2
|
ynh_script_progression --message="Reconfiguring Transmission..." --weight=2
|
||||||
|
|
||||||
# Transmission has to be stopped before modifying its config
|
# Transmission has to be stopped before modifying its config
|
||||||
ynh_systemd_action --service_name=transmission-daemon --action=stop
|
ynh_systemd_action --service_name=transmission-daemon --action=stop
|
||||||
|
@ -178,10 +171,16 @@ then
|
||||||
fi
|
fi
|
||||||
ynh_replace_string "<div id=\"toolbar-inspector\" title=\"Toggle Inspector\"></div>$" "<div id=\"toolbar-inspector\" title=\"Toggle Inspector\"></div><div id=\"toolbar-separator\"></div><a href=\"../../downloads/\" id=\"toolbar-downloads\" title=\"Downloads\" target=\"_blank\"></a>" /usr/share/transmission/web/index.html
|
ynh_replace_string "<div id=\"toolbar-inspector\" title=\"Toggle Inspector\"></div>$" "<div id=\"toolbar-inspector\" title=\"Toggle Inspector\"></div><div id=\"toolbar-separator\"></div><a href=\"../../downloads/\" id=\"toolbar-downloads\" title=\"Downloads\" target=\"_blank\"></a>" /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
|
# 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
|
ynh_systemd_action --service_name=transmission-daemon --action=start
|
||||||
|
|
||||||
|
@ -190,7 +189,7 @@ ynh_systemd_action --service_name=transmission-daemon --action=start
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# 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
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue