今天逛逗比的博客,发现他更新了一个新东西 Cloud Torrent。
简单的看了看Github上的介绍,挺简单方便的。
开源地址
https://github.com/jpillora/cloud-torrent
特点说明
- 支持 BT下载
- 支持 磁力链接下载
- 支持 搜索磁力链接
- 支持 离线下载
- 可视化界面 Web UI(自带)
- 支持Linux 和 Windows (Windows用这个干啥)
- MP4 Webm Ogg 格式文件可以在浏览器(HTML5)直接播放。
安装步骤
官方提供2种安装方式。
二进制安装(推荐)
使用官方的推荐命令,然后将执行文件放到 /etc/cloudtorrent
curl i.jpillora.com/cloud-torrent | bash
cp cloud-torrent /usr/bin/cloud-torrent
源码安装
由于Cloud Torrent是由Go语言编写,依赖Golang环境。
Golang安装
安装golang 和 git
rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
cd /etc/yum.repos.d
wget http://www.hop5.in/yum/el6/hop5.repo
yum install -y golang git
以上安装完成,需要设置GOPath
mkdir /usr/local/golang
export GOPATH=/usr/local/golang
export PATH=$PATH:$GOPATH/bin
这样就安装完成了golang 和 git!
CT安装
1
|
go get –v github.com/jpillora/cloud–torrent
|
一行代码即可安装完成。
一键安装脚本
谢谢逗比博主提供脚本。
CentOS / Debian / Ubuntu 都可以,因为是 Go语言写的。
不过,本人(逗比哥)测试系统为 Debian 7 x64 建议使用这个。
1
|
wget –N —no–check–certificate https://soft.dou-bi.co/Bash/cloudt.sh && chmod +x cloudt.sh && bash cloudt.sh
|
下载运行完毕脚本,就会直接开始安装 Cloud Torrent ,安装过程中如果出现让你选择Y和N的,都选Y。
安装完成之后,就会提醒你,输入要开放的端口(推荐:默认 8000)
可选:用户名(默认 user)和密码(默认 dou-bi.co)。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
请输入要开放的端口 [1–65535]
(默认端口: 8000):
========================
端口 : 8000
========================
是否设置 用户名和密码 ? [Y/n] :
请输入用户名
(默认用户名: user):
========================
用户名 : user
========================
请输入用户名的密码
(默认密码: dou–bi.co):
========================
密码 : dou–bi.co
========================
Cloud torrent 已启动 !
浏览器访问,地址: http://VPS_IP:8000
|
启动后,访问 http://VPS_IP:8000
即可看到Web UI界面了。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
bash cloudt.sh install
# 安装 Cloud Torrent
bash cloudt.sh start
# 启动 Cloud Torrent
bash cloudt.sh stop
# 停止 Cloud Torrent
bash cloudt.sh tail
# 查看 Cloud Torrent 日志
bash cloudt.sh uninstall
# 卸载 Cloud Torrent
|
Docker安装
2016年12月2日10:41:45 更新。
镜像:jpillora/cloud-torrent
端口:3000 TCP
CMD: cloud-torrent -p 3000 -a ruyo:RUYO.net
PS: CMD命令中参数含义,请参考命令行启动中的描述。
以上是 arukas.io 配置。
PS : 由于樱花端口IP总变,用的比较不爽。
使用方法
命令介绍
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
$ cloud–torrent —help
Usage: cloud–torrent [options]
Options:
—title, –t Title of this instance (default Cloud Torrent, env TITLE)
—port, –p Listening port (default 3000, env PORT)(监听的端口,默认3000)
—host, –h Listening interface (default all)(这里可以使用自己的域名,多IP的监听某一个IP)
—auth, –a Optional basic auth in form ‘user:password’ (env AUTH)(认证信息注意格式 用户名:密码)
—config–path, –c Configuration file path (default cloud–torrent.json) (配置文件启动)
—key–path, –k TLS Key file path (SSL KEY 目录)
—cert–path, –r TLS Certicate file path (SSL Crt 目录)
—log, –l Enable request logging (输出日志)
—open, –o Open now with your default browser
—help
—version, –v
Version:
0.X.Y
Read more:
https://github.com/jpillora/cloud-torrent
|
命令行启动
1
|
cloud-torrent -p 80 -l -a ruyo:RUYO.net -c /etc/cloudtorrent/cloud-torrent.json >> /var/log/cloud-torrent.log 2>&1 &
|
说明 (不懂的话,只做了解即可):
-p 后面是监听端口;
-a 后面是用户:密码 ;
-c后面cloud-torrent的配置文件(后面会单独介绍该文件);
-l 是日志输出
>> 日志输出到目录文件 /var/log/cloud-torrent.log
后台启动运行
一般我们启动程序都会放到后台运行。
我们可以使用 nohup 来后台守护进程。
1
|
nohup cloud–torrent –p 80 –l –a ruyo:RUYO.net –c /etc/cloudtorrent/cloud–torrent.json >> /var/log/cloud–torrent.log 2>&1 &
|
PS : 有兴趣可以搜索 screen 也可以后台运行。这里不介绍了。
防火墙设置
当然你可以关闭防火墙。也可以执行下面的命令。
1
|
iptables –A INPUT –p tcp —dport 80 –j ACCEPT
|
开放 80 端口。
PS:如果你使用其他端口请自行替换。
开机启动
一行代码,里面的参数请参考上文
1
|
echo “nohup cloud-torrent -p 80 -l -a ruyo:RUYO.net -c /etc/cloudtorrent/cloud-torrent.json >> /var/log/cloud-torrent.log 2>&1 &”>> /etc/rc.local
|
停止命令
我们利用kill命令,杀掉进程即可。
1
|
eval $(ps –ef | grep cloud–torrent | grep –v grep | awk ‘{print “kill “$2}’)
|
检查是否运行
以下命令,查询有结果说明正在运行。
1
|
ps –ef | grep ‘cloud-torrent’ | grep –v ‘grep’ | awk ‘{print $2}’
|
配置文件说明
上面提供启动服务的时候有一个配置。
配置内容如下,这个配置会自动生成。
1
2
3
4
5
6
7
8
|
{
“AutoStart”: true, #自动启动下载
“DisableEncryption”: false, #禁用加密
“DownloadDirectory”: “/root/downloads”,#文件下载到的目录
“EnableUpload”: true, #是否上传
“EnableSeeding”: false,#是否启用种子
“IncomingPort”: 50007 #输入端口
}
|
后续说明
稍后更新Docker部署。
参考文献:
https://www.dou-bi.co/wlzy-12/
https://github.com/jpillora/cloud-torrent/wiki
转载请注明:落伍老站长 » Cloud Torrent配置使用教程