Raspberry Pi를 Always-On BitTorrent 상자로 바꾸는 방법

BitTorrent 클라이언트 전용 머신을 보유하는 것이 이상적이므로 연중 무휴 24 시간 시드 할 수 있습니다. 그러나 전체 장비의 전원을 켜고 온라인 상태로 유지하는 것은 에너지 집약적입니다. Raspberry Pi를 입력하십시오.

관련 : 에너지 사용을 측정하는 방법 괴짜 가이드

대부분의 데스크탑 PC는 상당한 양의 에너지를 소비합니다. 예를 들어, 우리의 겸손한 홈 오피스 서버는 연간 거의 200 달러 상당의 전기를 소비합니다. 반면에 Raspberry Pi는 모바일 프로세서를 중심으로 구축되어 벌새처럼 에너지를 빨아들입니다. 핵심 라즈베리 파이 보드의 사용은 적은 에너지의 $ 3에 비해 연간 심지어 몇 개의 외부 하드 드라이브에 추가, 당신은 여전히 적은 햄버거와 감자 튀김보다 당신의 연간 운영 비용을하겠습니다.

또한 토렌트를 다운로드 할 때 항상 켜져있는 시스템이 왕입니다. 급류를 사용하면 클라우드를 더 많이 모니터링하고 여기에 시드할수록 트래커의 비율이 높아집니다 (공개 추적기에서 거두어가는 경우에도 항상 켜져있는 머신을 통해 희귀 한 파일이 나타날 때 그 자리에있을 수 있음). .

그게 좋을 것 같으면 Pi를 완전히 원격 제어되는 다운로드 시스템으로 바꾸는 방법을 보여 주면서 계속 읽으십시오.

필요한 것

이 자습서에서는 Raspbian이 설치된 Raspberry Pi 장치가 있고 연결된 모니터와 키보드를 통해 직접 또는 SSH 및 VNC를 통해 원격으로 장치에 액세스 할 수 있으며 외부 USB 드라이브 (또는 드라이브)가 있다고 가정합니다. 그것에 붙어 있습니다. 이러한 영역에 대한 속도를 높이려면 여기에 나열된 순서대로 다음 가이드를 읽는 것이 좋습니다.

  1. Raspberry Pi 시작에 대해 알아야 할 모든 것
  2. 원격 셸, 데스크톱 및 파일 전송을 위해 Raspberry Pi를 구성하는 방법
  3. Raspberry Pi를 저전력 네트워크 저장 장치로 바꾸는 방법

첫 번째 튜토리얼의 모든 것이 필요합니다. 두 번째 자습서는 선택 사항입니다 (하지만 다운로드 상자는 헤드리스 빌드를위한 완벽한 후보이므로 원격 액세스는이 프로젝트에 매우 편리합니다). 세 번째 자습서의 가장 중요한 부분은 단순히 하드 드라이브를 설정하고 구성하는 것입니다. 부팅시 자동 마운트됩니다 (세 번째 안내서에 설명 됨).

관련 : BitTorrent 트래픽을 익명화하고 암호화하는 방법

또한 익명 다운로드를 위해 BitTorrent 클라이언트를 설정하는 방법에 대해 지나치게 익숙하지 않은 경우 이에 대해 읽어야합니다. 당신은 절대적으로 안전하게 비트 토 런트를 사용하기 위해 장소에서 프록시 나 VPN 시스템을 익명화의 일종이 필요합니다. 이 가이드에 언급 된 프록시는 저렴하고 쉽지만 좋은 VPN은 일반적으로 더 빠르고 다재다능하므로 대신 VPN을 원하면이 가이드를 확인하세요.

모든 자료를 검토하고 Pi를 구성했으면 Pi를 조용하고 초 저전력 다운로드 괴물로 바꾸는 사업에 착수해야합니다.

1 단계 : Raspbian에 Deluge 설치

고려할 가치가있는 Linux 용 BitTorrent 클라이언트가 여러 개 있지만 Deluge를 권장합니다. 기능과 풋 프린트의 적절한 균형이므로 지금부터 한 달 후 더 강력한 것을 설치했으면하는 바람을 찾지 못할 것입니다.

Deluge를 여러 가지 방법으로 구성 할 수 있지만 모든 구성이이 헤드리스 Pi 다운로드 상자에 적합한 것은 아닙니다. 대부분의 사람들은 다른 앱과 마찬가지로 데스크톱에서 토렌트 클라이언트를 사용하지만 이는 우리의 목적에 적합하지 않습니다. 왜냐하면 토렌트와 상호 작용하고 싶을 때마다 원격으로 박스에 로그인해야하기 때문입니다. 데스크톱 클라이언트와 엉망이됩니다. 그것은 당신의 시간을 낭비하고 Pi에서 자원을 낭비합니다.

Deluge WebUI를 실행하여 다른 컴퓨터의 브라우저에서 Deluge 클라이언트에 액세스 할 수 있습니다. 이것은 여전히 ​​우리가 선호하는 옵션이 아니지만, 스마트 폰 앱을 사용하여 Deluge를보고 제어 할 수있는 가능성을 열어줍니다 (이 내용은 나중에 자세히 설명합니다).

ThinClient 연결을 허용하도록 원격 시스템에서 Deluge를 구성하는 것이 좋습니다. 이러한 방식으로 다른 컴퓨터 (Windows, Linux 또는 OS X 상자)에서 실제 Deluge 데스크톱 클라이언트를 사용하여 Raspberry Pi Deluge 설치를 제어 할 수 있습니다. 실제 데스크톱에서 데스크톱 클라이언트의 모든 이점을 얻을 수 있으며 모든 작업은 원격 상자에서 수행됩니다.

이 두 가지 옵션 중에서 결정할 수 없다면 실제로 두 가지를 동시에 사용할 수 있지만 설정하는 데 시간이 조금 더 걸립니다. 그렇게하려면 아래 두 섹션의 지침을 따르십시오.

옵션 1 : ThinClient 액세스를위한 Deluge 설정

작업을 수행하기 전에 잠시 시간을내어 리포지토리를 업데이트하고 업그레이드하십시오. 터미널을 열고 다음 두 명령을 차례로 실행하십시오.

sudo apt-get updatesudo apt-get upgrade

완료되면 ThinClient 설정에 필요한 구성 요소 설치를 시작할 때입니다. 다음 명령을 입력하십시오.

sudo apt-get install delugedsudo apt-get install deluge-console

Deluge 데몬 및 콘솔 설치 패키지를 다운로드하고 실행합니다. 계속할지 묻는 메시지가 표시되면 Y를 입력합니다. Deluge가 설치를 마치면 Deluge 데몬을 실행해야합니다. 다음 명령을 입력하십시오.

delugedsudo pkill deluged

이렇게하면 구성 파일을 생성하는 Deluge 데몬이 시작되고 데몬이 종료됩니다. 해당 구성 파일을 편집 한 다음 다시 시작합니다. 다음 명령을 입력하여 먼저 원본 구성 파일의 백업을 만든 다음 편집을 위해 엽니 다.

cp ~/.config/deluge/auth ~/.config/deluge/auth.oldnano ~/.config/deluge/auth

nano 텍스트 편집기에 들어가면 다음 규칙에 따라 구성 파일의 맨 아래에 줄을 추가해야합니다.

user:password:level

userDeluge에 대해 원하는 사용자 이름은 어디에 있고 원하는 password암호 level는 10 (데몬에 대한 전체 액세스 / 관리 수준)입니다. 그래서 우리의 목적을 위해 pi:raspberry:10. 편집이 완료되면 키보드에서 Ctrl + X를 누르고 메시지가 표시되면 변경 사항을 저장합니다. 그런 다음 데몬을 시작하고 콘솔을 다시 시작합니다.

delugeddeluge-console

콘솔을 시작하면 깔끔한 형식의 콘솔 인터페이스 대신 오류 코드가 표시되면 "exit"를 입력 한 다음 데몬을 시작했는지 확인하십시오.

콘솔 내부에서 빠른 구성 변경을 수행해야합니다. 다음을 입력:

config -s allow_remote Trueconfig allow_remoteexit

명령 및 해당 출력은 아래 스크린 샷과 같습니다.

This enables remote connections to your Deluge daemon and double checks that the config variable has been set. Now it’s time to kill the daemon and restart it one more time so that the config changes take effect:

sudo pkill delugeddeluged

At this point, your Deluge daemon is ready for remote access. Head to your normal PC (not the Raspberry Pi) and install the Deluge desktop program. You’ll find the installer for your operating system on the Deluge Downloads page. Once you’ve installed Deluge on your PC, run it for the first time; we need to make some quick changes.

Once launched, navigate to Preferences > Interface. Within the interface submenu, you’ll see a checkbox for “Classic Mode”. By default it is checked. Uncheck it.

Click OK and then restart the Deluge desktop client. This time, when Deluge starts, it will present you with the Connection Manager. Click the “Add” button and then input the IP address of the Raspberry Pi on your network, as well as the username and password you set during the earlier configuration. Leave the port at the default 58846. Click Add.

Back in the Connection Manager, you’ll see the entry for the Raspberry Pi; if all goes well, the indicator light will turn green like so:

Click Connect, and you’ll be kicked into the interface, connected to the remote machine:

It’s a fresh install, nary a .torrent in site, but our connection between the remote machine and the desktop client is a success!

Go ahead and configure the WebUI now (if you wish to do so), or skip down to the next step of this tutorial.

Option Two: Set Up Deluge for WebUI Access

Configuring the WebUI is significantly faster, and allows for using some mobile apps to access Deluge. But as we mentioned before, you’ll have access to fewer features than with the full ThinClient experience. For example, ThinClient can associate .torrent files with the Deluge ThinClient for automatic transfer to the Pi, but you can’t do this with the WebUI.

First, take a moment to update and upgrade your repositories. Open a Terminal and run the following two commands, one after the other:

sudo apt-get updatesudo apt-get upgrade

Then, to install the WebUI, run the following commands. Note: If you already installed the Deluge daemon in the ThinClient section of the tutorial, skip the first command here.

sudo apt-get install delugedsudo apt-get install python-makosudo apt-get install deluge-webdeluge-web

This sequence installs the Deluge daemon (if you didn’t already install it in the last section), Mako (a template gallery for Python that the WebUI needs), the WebUI itself, and then starts the WebUI program.

The default port for the WebUI is 8112. If you wish to change it, run the following commands:

sudo pkill deluge-webnano ~/.config/deluge/web.conf

This stops the WebUI and opens up the configuration file for it. Use nano to edit the line: “port”: 8112, and replace the 8112 with any port number above 1000 (as 1-1000 are reserved by the system).

Once you have the WebUI up and running, it’s time to connect to it using a web browser. You can use a browser on the Pi if you ever need to, but it’s not the most pleasant user experience and best left for emergencies. Open up a browser on your regular desktop machine and point it at the IP address of your Pi with the port you just chose (e.g. //192.168.1.13:8112 ).

You’ll be greeted with a password prompt (the default password is “deluge”) and be immediately encouraged to change it after you enter it for the first time. After that, you’ll be able to interact with Deluge via the lightweight interface.

It’s not quite the same as the ThinClient, but it’s robust enough for light use and has the added benefit of serving as the point of connection for lots of torrent-control mobile apps.

Step Two: Configure Your Proxy or VPN

You might be tempted to start downloading torrents now,but wait! Don’t do that yet. It’s absolutely reckless to use a BitTorrent Client without first shuttling your connection through a proxy server or VPN.

RELATED:How to Choose the Best VPN Service for Your Needs

If you didn’t read over How To Anonymize and Encrypt Your BitTorrent Traffic yet, now is the time to do so. Read over the first section (for a better understanding of why it is important to protect your BitTorrent connection), and then sign up for a proxy service or, better yet, a good VPN before continuing on.

If you’re using a VPN, it’s pretty simple: Just choose a VPN that offers a Linux client. Then, download and install the Linux client on your Pi, start it up, and connect to your desired server. (You may even want to set it to launch when the Raspberry Pi boots, so it’s always connected to the VPN.)

If you’re using a proxy, you can plug its information into Deluge under Preferences > Proxy. You need to fill out the Peer, Web Seed, Tracker, and DHT sections like so, placing your proxy username and password in the appropriate slots. Your proxy service’s Type, Host, and Port may differ, so be sure to check its documentation.

In order for the proxy settings to take effect, you need to restart the Deluge daemon. From the terminal enter the following commands:

sudo pkill delugeddeluged

After that, you should be all set.

The best way to test that you’re actively using the proxy or VPN is to download a torrent file designed expressly to report back its IP address. You can find many of these torrents online, including this one from BTGuard and this one from TorGuard. Load either or both torrents into Deluge and wait a moment.

After the torrents have had a chance to connect to their respective trackers, select the torrents in the Deluge client and check the “Tracker Status” entry as seen above. Both will report the IP address they detect from your client. If that IP address matches your public IP address, then the proxy or VPN is not configured properly and you should return to the previous section to check your configuration. If it is configured properly, you’ll see the proxy or VPN’s IP address and not your own.

Step Three: Configure Your Download Location

Next, you’ll need to configure Deluge to use your external hard drive. If you followed along with the hard drive mounting instructions in this previously mentioned guide, you’re ready with a hard drive set to auto-mount on boot.

From there, all you need to do is change the default locations in Deluge. Navigate to Deluge’s Preferences  and head to the Downloads tab. By default, Deluge directs everything to /home/pi. That little SD card is going to fill up real fast, however, so we need to change it.

First, we’re going to create some new folders in /media/USBHDD1/shares, which is the share folder we already set up in the Low-Power Network Storage tutorial. That way, we can easily access our downloaded torrents over the network and have a network accessible watch folder for auto-loading torrent files. Use the following commands to create the folder set (adjusting the pathnames accordingly for your location if you’re not using the same Pi setup from the previous tutorial like we are):

sudo mkdir /media/USBHDD1/shares/torrents/downloading sudo mkdir /media/USBHDD1/shares/torrents/completed sudo mkdir /media/USBHDD1/shares/torrents/watch sudo mkdir /media/USBHDD1/shares/torrents/torrent-backups

Then, turn right around and plug those four new directories into Deluge.

Click OK to set the directories. There’s no need to restart as you did with the proxy setup.

Step Four: Test Your Connection

Now it’s time to download a large enough torrent that we can really see if the system is running smoothly. For our test we grabbed the .torrent file for the current Linux Mint distribution–it weighs in at solid 1.7GB, perfect for monitoring the connection speeds.

Once you’ve confirmed that your connection is stable and the Linux torrent is humming along nicely, it’s time to move onto the next step: automating the client startup.

Step Five: Configure Deluge to Run on Startup

Before we leave the Deluge setup, there is one final detail to attend to. We need to set up the Deluge daemon and WebUI to run automatically when our Raspberry Pi boots up. To do so simply and without the fuss of editing more complicated init files and settings, we’ll simple annotate the rc.local file. Run the following command in a Terminal to do so.

sudo nano /etc/rc.local

With the rc.local file loaded, add the following lines to the end of the file. Note: you do not need to add the the second command ending in “deluge-web” if you are not using the WebGUI. This may also be a good place to add your VPN program, if you’re using one.

# Start Deluge on boot: sudo -u pi /usr/bin/python /usr/bin/deluged  sudo -u pi /usr/bin/python /usr/bin/deluge-web

Your rc.local file should look something like this when you’re done (possibly with the addition of that VPN):

Press Ctrl+X to exit and save your work.

At this point, we would recommend restarting your Raspberry Pi, so fire off a “sudo reboot” at the command line. Once the Pi has finished rebooting, head to your other PC and try to connect to the Deluge ThinClient and/or WebUI to make sure they both work.

There are two major errors you may encounter here. First, a failure to connect at all means that the initialization scripts didn’t work. Open up the terminal on your Pi and manually start the daemon and WebUI using the commands we learned earlier in the tutorial.  Check to see that it works now. If it does, go back up and fix your rc.local script.

Second, if you can open up the client, but it shows permission errors for your existing torrents (like the Linux torrent we used to test things earlier), that indicates that your external hard drive was not mounted, or mounted incorrectly. Review the sections on installing an external drive and setting it to auto-mount on boot in our Low-Power Network Storage tutorial.

Enhancing Your Torrenting Experience

Now that you have your torrent box configured and ready to rock, there are a few additional tools and modifications you can look into to really enhance your user experience. None of these tips and tricks are necessary, but they do make your Raspberry Pi turned Torrent Box easier to use.

Add Mobile Access: Consider downloading a mobile control app like Transdroid and Transdrone for Android. Unfortunately we don’t have any solid suggestions for iOS users, as Apple has taken a really aggressive stance towards torrent-related apps in the App Store (and has banned any apps that slipped through the submission process).

Deluge doesn’t currently have a mobile-optimized template for the WebUI, but it’s more than functional on tablets like the iPad and Kindle Fire.

Set Up a Shared Drop Folder: Although we mentioned it briefly earlier in the tutorial, ensure that the /torrents/watch/ folder you created is accessible on your network. It’s really convenient to be able to dump a pile of .torrent files into the folder and have Deluge load them up automatically.

Install Browser Plugins: There are several Deluge-centered plugins for Chrome and Firefox that improve the user experience, including:

  • Chrome:
    • DelugeSiphon: Enables .torrent adding from the WebUI
    • Deluge Remote: Simple view of current torrents and their progress
  • Firefox:
    • BitTorrent WebUI+: Enables .torrent adding from the WebUI
    • WebUI Quick Add Torrent: Greasemonkey Script that adds clickable icon on webpages for easy torrent adding

Activate Deluge Plugins: There are a host of great plugins already included in Deluge, and even more third-party plugins. Some of the included plugins you may want to take advantage of include:

  • Notification: You receive email alerts from Deluge on torrent completion and other events
  • Scheduler: Limit bandwidth based on time of day

You can find these in Preferences > Plugins. Check the ones you want and a new entry will appear in the preferences menu (e.g. Preferences > Notifications).

For more information about third party plugins and how to install them, check out the Plugins page in the Deluge Wiki.

After configuring, testing, and tweaking enhancements and plugins, you have a more than capable torrent box that costs mere pennies a day to operate. Find a quiet and out of the way spot to plug it in, load it up with torrents, and leave it to do the heavy lifting of downloading and seeding for you.