Merge pull request #9940 from neheb/tr2
transmission: Fix tracker issue with some firewalls
This commit is contained in:
commit
acc646dafb
5 changed files with 34 additions and 83 deletions
|
@ -9,19 +9,17 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=transmission
|
PKG_NAME:=transmission
|
||||||
PKG_VERSION:=2.94
|
PKG_VERSION:=2.94
|
||||||
PKG_RELEASE:=5
|
PKG_RELEASE:=6
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||||
PKG_SOURCE_URL:=@GITHUB/transmission/transmission-releases/master
|
PKG_SOURCE_URL:=@GITHUB/transmission/transmission-releases/master
|
||||||
PKG_HASH:=35442cc849f91f8df982c3d0d479d650c6ca19310a994eccdaa79a4af3916b7d
|
PKG_HASH:=35442cc849f91f8df982c3d0d479d650c6ca19310a994eccdaa79a4af3916b7d
|
||||||
PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
|
||||||
|
|
||||||
|
PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
|
||||||
PKG_LICENSE:=GPL-2.0-or-later
|
PKG_LICENSE:=GPL-2.0-or-later
|
||||||
PKG_LICENSE_FILES:=COPYING
|
PKG_LICENSE_FILES:=COPYING
|
||||||
PKG_CPE_ID:=cpe:/a:transmissionbt:transmission
|
PKG_CPE_ID:=cpe:/a:transmissionbt:transmission
|
||||||
|
|
||||||
PKG_FIXUP:=autoreconf
|
|
||||||
PKG_INSTALL:=1
|
PKG_INSTALL:=1
|
||||||
PKG_BUILD_PARALLEL:=1
|
PKG_BUILD_PARALLEL:=1
|
||||||
|
|
||||||
|
@ -32,7 +30,7 @@ define Package/transmission/template
|
||||||
SECTION:=net
|
SECTION:=net
|
||||||
CATEGORY:=Network
|
CATEGORY:=Network
|
||||||
TITLE:=BitTorrent client
|
TITLE:=BitTorrent client
|
||||||
URL:=http://www.transmissionbt.com
|
URL:=https://www.transmissionbt.com
|
||||||
DEPENDS:=+libcurl +libevent2 +libminiupnpc +libnatpmp +libpthread +librt +zlib
|
DEPENDS:=+libcurl +libevent2 +libminiupnpc +libnatpmp +libpthread +librt +zlib
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
@ -121,7 +119,7 @@ define Package/transmission-daemon-openssl/conffiles
|
||||||
endef
|
endef
|
||||||
Package/transmission-daemon-mbedtls/conffiles = $(Package/transmission-daemon-openssl/conffiles)
|
Package/transmission-daemon-mbedtls/conffiles = $(Package/transmission-daemon-openssl/conffiles)
|
||||||
|
|
||||||
TARGET_CFLAGS += -flto
|
TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
|
||||||
TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--as-needed
|
TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--as-needed
|
||||||
|
|
||||||
CONFIGURE_ARGS += \
|
CONFIGURE_ARGS += \
|
||||||
|
|
|
@ -14,8 +14,8 @@ append_params() {
|
||||||
IFS="$LIST_SEP"
|
IFS="$LIST_SEP"
|
||||||
for v in $v; do
|
for v in $v; do
|
||||||
[ -n "$v" ] && (
|
[ -n "$v" ] && (
|
||||||
echo "\"$p\": $v," | sed -e 's|_|-|g' >> $config_file
|
echo "\"$p\": $v," | sed -e 's|_|-|g'
|
||||||
)
|
) >> "$config_file"
|
||||||
done
|
done
|
||||||
unset IFS
|
unset IFS
|
||||||
done
|
done
|
||||||
|
@ -28,9 +28,9 @@ append_params_quotes() {
|
||||||
IFS="$LIST_SEP"
|
IFS="$LIST_SEP"
|
||||||
for v in $v; do
|
for v in $v; do
|
||||||
[ -n "$v" ] && (
|
[ -n "$v" ] && (
|
||||||
echo -n "\"$p" | sed -e 's|/|\\/|g;s|_|-|g' >> $config_file; \
|
printf "\"%s" "$p" | sed -e 's|/|\\/|g;s|_|-|g'; \
|
||||||
echo "\": \"$v\"," >> $config_file
|
echo "\": \"$v\","
|
||||||
)
|
) >> "$config_file"
|
||||||
done
|
done
|
||||||
unset IFS
|
unset IFS
|
||||||
done
|
done
|
||||||
|
@ -51,7 +51,6 @@ transmission() {
|
||||||
local download_dir config_dir
|
local download_dir config_dir
|
||||||
local mem_percentage
|
local mem_percentage
|
||||||
local nice
|
local nice
|
||||||
local cmdline
|
|
||||||
local web_home
|
local web_home
|
||||||
|
|
||||||
section_enabled "$section" || return 1
|
section_enabled "$section" || return 1
|
||||||
|
@ -73,16 +72,16 @@ transmission() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
config_file="$config_dir/settings.json"
|
config_file="$config_dir/settings.json"
|
||||||
[ -d $config_dir ] || {
|
[ -d "$config_dir" ] || {
|
||||||
mkdir -p $config_dir
|
mkdir -p "$config_dir"
|
||||||
chmod 0755 $config_dir
|
chmod 0755 "$config_dir"
|
||||||
touch $config_file
|
touch "$config_file"
|
||||||
[ -z "$user" ] || chown -R "$user:$group" $config_dir
|
[ -z "$user" ] || chown -R "$user:$group" "$config_dir"
|
||||||
}
|
}
|
||||||
|
|
||||||
[ "$config_overwrite" = 0 ] || {
|
[ "$config_overwrite" = 0 ] || {
|
||||||
|
|
||||||
echo "{" > $config_file
|
echo "{" > "$config_file"
|
||||||
|
|
||||||
append_params "$cfg" \
|
append_params "$cfg" \
|
||||||
alt_speed_down alt_speed_enabled alt_speed_time_begin alt_speed_time_day \
|
alt_speed_down alt_speed_enabled alt_speed_time_begin alt_speed_time_day \
|
||||||
|
@ -107,20 +106,24 @@ transmission() {
|
||||||
peer_congestion_algorithm peer_socket_tos rpc_bind_address rpc_password rpc_url \
|
peer_congestion_algorithm peer_socket_tos rpc_bind_address rpc_password rpc_url \
|
||||||
rpc_username rpc_host_whitelist rpc_whitelist script_torrent_done_filename watch_dir
|
rpc_username rpc_host_whitelist rpc_whitelist script_torrent_done_filename watch_dir
|
||||||
|
|
||||||
echo "\"invalid-key\": false" >> $config_file
|
{
|
||||||
echo "}" >> $config_file
|
echo "\"invalid-key\": false"
|
||||||
|
echo "}"
|
||||||
|
} >> "$config_file"
|
||||||
}
|
}
|
||||||
|
|
||||||
cmdline="transmission-daemon -g $config_dir -f"
|
|
||||||
procd_open_instance
|
procd_open_instance
|
||||||
procd_set_param command $cmdline
|
procd_set_param command "/usr/bin/transmission-daemon"
|
||||||
procd_set_param user $user
|
procd_append_param "-f"
|
||||||
procd_set_param group $group
|
procd_append_param "--log-error"
|
||||||
procd_set_param nice $nice
|
procd_append_param "-g $config_dir"
|
||||||
|
procd_set_param user "$user"
|
||||||
|
procd_set_param group "$group"
|
||||||
|
procd_set_param nice "$nice"
|
||||||
|
procd_set_param stderr 1
|
||||||
procd_set_param respawn retry=60
|
procd_set_param respawn retry=60
|
||||||
|
|
||||||
if test -z $USE; then
|
if [ -z "$USE" ]; then
|
||||||
procd_set_param limits core="0 0"
|
procd_set_param limits core="0 0"
|
||||||
else
|
else
|
||||||
procd_set_param limits core="0 0" as="$USE $USE"
|
procd_set_param limits core="0 0" as="$USE $USE"
|
||||||
|
@ -132,8 +135,8 @@ transmission() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
procd_add_jail transmission log
|
procd_add_jail transmission log
|
||||||
procd_add_jail_mount $config_file
|
procd_add_jail_mount "$config_file"
|
||||||
procd_add_jail_mount_rw $download_dir
|
procd_add_jail_mount_rw "$download_dir"
|
||||||
procd_close_instance
|
procd_close_instance
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,6 @@
|
||||||
|
# Transmission requests large buffers by default
|
||||||
net.core.rmem_max = 4194304
|
net.core.rmem_max = 4194304
|
||||||
net.core.wmem_max = 1048576
|
net.core.wmem_max = 1048576
|
||||||
|
|
||||||
|
# Some firewalls block SYN packets that are too small
|
||||||
|
net.ipv4.tcp_adv_win_scale = 4
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
From a2991e22434352a3114bf437674070a135b723fd Mon Sep 17 00:00:00 2001
|
|
||||||
From: Rosen Penev <rosenp@gmail.com>
|
|
||||||
Date: Sun, 27 May 2018 13:38:27 -0700
|
|
||||||
Subject: [PATCH] portcheck: Switch to HTTPS
|
|
||||||
|
|
||||||
Useful for testing TLS verification.
|
|
||||||
---
|
|
||||||
libtransmission/rpcimpl.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/libtransmission/rpcimpl.c b/libtransmission/rpcimpl.c
|
|
||||||
index 46fd3192c..dcd96df59 100644
|
|
||||||
--- a/libtransmission/rpcimpl.c
|
|
||||||
+++ b/libtransmission/rpcimpl.c
|
|
||||||
@@ -1455,7 +1455,7 @@ portTest (tr_session * session,
|
|
||||||
struct tr_rpc_idle_data * idle_data)
|
|
||||||
{
|
|
||||||
const int port = tr_sessionGetPeerPort (session);
|
|
||||||
- char * url = tr_strdup_printf ("http://portcheck.transmissionbt.com/%d", port);
|
|
||||||
+ char * url = tr_strdup_printf ("https://portcheck.transmissionbt.com/%d", port);
|
|
||||||
tr_webRun (session, url, portTested, idle_data);
|
|
||||||
tr_free (url);
|
|
||||||
return NULL;
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
From 81d584b9027b2b2ddd3209c1582c9ec73c26cc3e Mon Sep 17 00:00:00 2001
|
|
||||||
From: Simon Wells <simonrwells@gmail.com>
|
|
||||||
Date: Sun, 27 May 2018 13:44:41 -0700
|
|
||||||
Subject: [PATCH] Change TR_CURL_SSL_VERIFY to TR_CURL_SSL_NO_VERIFY
|
|
||||||
|
|
||||||
use secure by default and change the env var to match curl -k behaviour
|
|
||||||
|
|
||||||
Closes: #179
|
|
||||||
---
|
|
||||||
libtransmission/web.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/libtransmission/web.c b/libtransmission/web.c
|
|
||||||
index 997a151b5..ce41e342a 100644
|
|
||||||
--- a/libtransmission/web.c
|
|
||||||
+++ b/libtransmission/web.c
|
|
||||||
@@ -392,7 +392,7 @@ tr_webThreadFunc (void * vsession)
|
|
||||||
web->taskLock = tr_lockNew ();
|
|
||||||
web->tasks = NULL;
|
|
||||||
web->curl_verbose = tr_env_key_exists ("TR_CURL_VERBOSE");
|
|
||||||
- web->curl_ssl_verify = tr_env_key_exists ("TR_CURL_SSL_VERIFY");
|
|
||||||
+ web->curl_ssl_verify = !tr_env_key_exists ("TR_CURL_SSL_NO_VERIFY");
|
|
||||||
web->curl_ca_bundle = tr_env_get_string ("CURL_CA_BUNDLE", NULL);
|
|
||||||
if (web->curl_ssl_verify)
|
|
||||||
{
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
Loading…
Reference in a new issue