From a31cdf071eb3ffe8a22e0ca900977343d50a9201 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 19 Jan 2022 15:30:33 +0100 Subject: [PATCH] fix --- conf/config.default.yml | 6 +++--- config_panel.toml | 22 ++++++++++++++++++++++ scripts/install | 4 ++++ scripts/upgrade | 12 ++++++++++++ 4 files changed, 41 insertions(+), 3 deletions(-) diff --git a/conf/config.default.yml b/conf/config.default.yml index c9949db..3ec8faf 100644 --- a/conf/config.default.yml +++ b/conf/config.default.yml @@ -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 diff --git a/config_panel.toml b/config_panel.toml index f321441..e4e061c 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -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" + + + + + + diff --git a/scripts/install b/scripts/install index e18ee0a..353124f 100644 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index 3e6dff7..c575d46 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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