1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/simple-torrent_ynh.git synced 2024-09-03 20:26:18 +02:00
This commit is contained in:
ericgaspar 2022-01-19 15:30:33 +01:00
parent 98128ad54d
commit a31cdf071e
4 changed files with 41 additions and 3 deletions

View file

@ -19,7 +19,7 @@ ObfsRequirePreferred: false
DisableTrackers: false
# DisableTrackers Don't announce to trackers. This only leaves DHT to discover peers.
DisableIPv6: false
DisableIPv6: __DISABLE_IP_V6__
# DisableIPv6 Don't connect to IPv6 peers.
DisableUTP: false
@ -29,10 +29,10 @@ DisableUTP: false
NoDefaultPortForwarding: true
# Don't broadcast the UPNP request for gateway port forwarding, which is unnecessary in machines that has public IP (of which this program is mean for?)
DownloadDirectory: /home/yunohost.app/__APP__/downloads
DownloadDirectory: __DOWNLOAD_DIRECTORY__
# DisableEncryption A switch disables [BitTorrent protocol encryption](https://en.wikipedia.org/wiki/BitTorrent_protocol_encryption)
WatchDirectory: /home/yunohost.app/__APP__/torrents
WatchDirectory: __WATCH_DIRECTORY__
# DownloadDirectory The directory where downloaded file saves.
EnableUpload: true

View file

@ -20,3 +20,25 @@ services = ["__APP__"]
default = "/home/yunohost.app/__APP__/torrents"
help = "The directory where downloaded file saves."
bind = "WatchDirectory:__FINALPATH__/config.yml"
[main.config.disable_ip_v6]
ask = "Disable IPv6"
type = "boolean"
yes = "true"
no = "false"
help = "Don't connect to IPv6 peers."
bind = "DisableIPv6:__FINALPATH__/config.yml"
[main.config.disable_utp]
ask = "Disable UTP"
type = "boolean"
yes = "true"
no = "false"
help = "Disable UTP in the torrent protocol. In recent versions, the UTP process cause quite high CPU usage. Set to true can ease the situation."
bind = "DisableUTP:__FINALPATH__/config.yml"

View file

@ -29,6 +29,8 @@ app=$YNH_APP_INSTANCE_NAME
download_directory="/home/yunohost.app/$app/downloads"
watch_directory="/home/yunohost.app/$app/torrents"
disable_ip_v6="false"
disable_utp="false"
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
@ -56,6 +58,8 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=download_directory --value=$download_directory
ynh_app_setting_set --app=$app --key=watch_directory --value=$watch_directory
ynh_app_setting_set --app=$app --key=disable_ip_v6 --value=$disable_ip_v6
ynh_app_setting_set --app=$app --key=disable_utp --value=$disable_utp
#=================================================
# STANDARD MODIFICATIONS

View file

@ -25,6 +25,8 @@ architecture=$YNH_ARCH
download_directory=$(ynh_app_setting_get --app=$app --key=download_directory)
watch_directory=$(ynh_app_setting_get --app=$app --key=watch_directory)
disable_ip_v6=$(ynh_app_setting_get --app=$app --key=disable_ip_v6)
disable_utp=$(ynh_app_setting_get --app=$app --key=disable_utp)
#=================================================
# CHECK VERSION
@ -67,6 +69,16 @@ if [ -z "$watch_directory" ]; then
ynh_app_setting_set --app=$app --key=watch_directory --value=$watch_directory
fi
if [ -z "$disable_ip_v6" ]; then
disable_ip_v6="false"
ynh_app_setting_set --app=$app --key=disable_ip_v6 --value=$disable_ip_v6
fi
if [ -z "$disable_utp" ]; then
disable_utp="false"
ynh_app_setting_set --app=$app --key=disable_utp --value=$disable_utp
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all