使用 transmission 在 linux 上搭建 pt 下载环境

现在在 linux 服务器上部署的 pt 下载器主要是 aria2, transmission 和 rtorrent,然而 aria2 要下载 pt 的话还需要伪装客户端,rtorrent 的 webui 太丑加载速度还很慢,于是最后选择了 transmission。博客中提到的服务器的配置为 Intel Atom N2800 2c/4 t 1.86GHz,4Gb DDR3 1066,2T HDD, 位于欧洲,不抗投诉。

安装 transmission 与 deamon

服务器的系统环境是 debian9,所以可以很方便用包管理器安装需要的软件

1
2
apt -y install transmission transmission-deamon
systemctl enable transmission-deamon

好像没有什么特别的配置要配置的,反正 webui 里都可以改

安装修改版的 transmission webui

项目地址,安装过程也是全自动的

1
2
wget https://github.com/ronggang/transmission-web-control/raw/master/release/install-tr-control.sh
bash install-tr-control.sh

接下来输入 1 然后按回车就可以了
然后重启下 transmission

1
systemctl restart transmission-deamon

安装 transmission-rss

使用 nginx 反代 webui

transmission 的 webui 没有 ssl 也没法加密码,所以用 nginx 反代下,性能更高。我安装的 nginx 是来自 烧饼博客上的教程,下面是配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com;

location /.well-known/acme-challenge {
root /var/www/letsencrypt;
}

location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;

server_name example.com;
client_max_body_size 10m;
server_tokens off;

root /var/www/rutorrent;
index index.html index.htm index.php;

ssl_dhparam /etc/nginx/ssl/dhparam.pem;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
ssl_prefer_server_ciphers on;

ssl_session_cache shared:SSL:50m;
ssl_session_timeout 1d;


ssl_certificate /etc/nginx/ssl/fullchain.cer;
ssl_certificate_key /etc/nginx/ssl/dl.key;


add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";

location / {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/passwd;
proxy_pass http://127.0.0.1:9091;
}

location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
include snippets/fastcgi-php.conf;
}

access_log /var/log/nginx/rutorrent.access.log;
error_log /var/log/nginx/rutorrent.error.log;
}

其中,/etc/nginx/passwd 的生成方法是 printf "user:$(openssl passwd -crypt password)\n" >> /etc/nginx/passwd

最后的效果

1540133454051

真香