Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add qbittorrent #212

Merged
merged 1 commit into from Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -105,6 +105,9 @@ Awesome DeFi apps you can deploy on Akash
### Media
- [FreeFlix Nucleus](freeflix-nucleus)

### Peer-to-peer File Sharing
- [qBittorrent](qbittorrent)

### Data Visualization
- [UFO Sightings](ufo-data-vis)

Expand Down
38 changes: 38 additions & 0 deletions qbittorrent/README.md
@@ -0,0 +1,38 @@
# qBittorrent

The [qBittorrent](https://www.qbittorrent.org/) project aims to provide an open-source software alternative to µTorrent. The provided deployment configuration ([`deploy-ssh-tunnel.yaml`](deploy-ssh-tunnel.yaml)) enables a relatively secure means of torrenting on Akash via qBittorrent. Please use this responsibly.

![qBittorrent](qBittorrent.png)

# Overview

The deployment uses a custom image (`ghcr.io/spacepotahto/qbittorrent:1.0.0`, code [here](https://github.com/spacepotahto/docker-qbittorrent-server)) that bundles the qBittorrent client ([base image](https://github.com/linuxserver/docker-qbittorrent) provided by LinuxServer.io) with a HTTP file server. This allows the user to access the qBitorrent WebUI to download files to the Akash provider, and to download the downloaded files through the HTTP file server. `deploy.yaml` and `deploy-ssh-tunnel.yaml` (recommended) differs in how security is handled.

# `deploy.yaml`

This configuration deploys the qBittorrent client + File Server, and the user can access them using their web browser. However, by default the Akash deployment is accessible through HTTP only, so traffic between the user and the qBittorrent WebUI + file server is unencrypted. Thus, it's recommended to enabled HTTPS. One way to do so is to use a custom domain with CloudFlare SSL as described in this [guide](https://teeyeeyang.medium.com/how-to-use-a-custom-domain-with-your-akash-deployment-5916585734a2) written by a community member. The downside is the traffic goes through CloudFlare. For personal use, using [`deploy-ssh-tunnel.yaml`](deploy-ssh-tunnel.yaml) instead is recommended.

## Usage
Once deployed, the qBittorrent WebUI is accessible at `http://<HOSTED URI>`. The default username and password is `admin` and `adminadmin` respectively. They can be changed via the WebUI settings once authenticated.

When downloading files using the WebUI, keep the default download location at `/downloads`. Once the files finish downloading, you can download the files to your computer by accessing the HTTP file server that serves `/downloads` at `http://<HOSTED URI>:<THE FORWARDED EXTERNAL PORT OF 5000>`.

# `deploy-ssh-tunnel.yaml` (Recommended)

Since this is likely for personal use only, it's also possible to utilize a SSH tunnel in lieu of HTTPS to establish an encyrpted connection between the user and qBittorrent WebUI + file server. The diagram below illustrates how this works:

![SSH Tunnel](ssh-tunnel.png)


The qBittorrent WebUI + file server deployment is not exposed to the public internet, and is only accessible from the SSH enabled deployment. The SSH enabled deployment is only accessible by the user through an encrypted connection. Thus the user can securely access the qBittorrent WebUI + file server through SSH tunneling.

## Usage
The [`deploy-ssh-tunnel.yaml`](deploy-ssh-tunnel.yaml) is configured to enable SSH tunneling (using the `ghcr.io/spacepotahto/openssh-server:1.0.0` image, code [here](https://github.com/spacepotahto/docker-openssh-server)), with the option to use password based or key based (generally safer) authentication through setting environment variables. Once deployed, you can establish the SSH tunnel with:

```
ssh -p <THE FORWARDED EXTERNAL PORT OF 2222> -N -L 8080:web:8080 -L 5000:web:5000 <USER_NAME>@<PROVIDER HOST>
```

Then in your browser, you can navigate to `http://localhost:8080` to access the qBittorrent WebUI. The default username and password is `admin` and `adminadmin` respectively. They can be changed via the WebUI settings once authenticated.

When adding the torrent files or magnet links using the WebUI, keep the default download location at `/downloads`. Once the files finish downloading, you can download the files to your computer by accessing the HTTP file server that serves `/downloads` at `http://localhost:5000`. Due to the SSH tunneling, your file download is done through an encrypted connection.
83 changes: 83 additions & 0 deletions qbittorrent/deploy-ssh-tunnel.yaml
@@ -0,0 +1,83 @@
---
version: "2.0"

services:
web:
image: ghcr.io/spacepotahto/qbittorrent:1.0.0
expose:
# Web app
- port: 8080
as: 8080
to:
- service: ssh
# File server
- port: 5000
as: 5000
to:
- service: ssh
# Optional listening port
# See also https://github.com/qbittorrent/qBittorrent/wiki/Explanation-of-Options-in-qBittorrent#Listening_Port
- port: 6881
as: 6881
to:
- global: true
ssh:
image: ghcr.io/spacepotahto/openssh-server:1.0.0
depends_on:
- web
env:
# See all options at https://github.com/linuxserver/docker-openssh-server#usage
# Note supplying key for authentication is generally safer than password based authentication
# - PUBLIC_KEY=yourpublickey
- PASSWORD_ACCESS=true
- USER_PASSWORD=yourpassword
- USER_NAME=username
expose:
- port: 2222
as: 2222
to:
- global: true

profiles:
compute:
web:
resources:
cpu:
units: 1
memory:
size: 1Gi
storage:
# Specify [<Expected Total Files Download Size> + 1]Gi
size: 2Gi
ssh:
resources:
cpu:
units: 0.5
memory:
size: 512Mi
storage:
size: 512Mi
placement:
westcoast:
attributes:
host: akash
signedBy:
anyOf:
- "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63"
pricing:
web:
denom: uakt
amount: 1000
ssh:
denom: uakt
amount: 1000

deployment:
web:
westcoast:
profile: web
count: 1
ssh:
westcoast:
profile: ssh
count: 1
48 changes: 48 additions & 0 deletions qbittorrent/deploy.yaml
@@ -0,0 +1,48 @@
---
version: "2.0"

services:
web:
image: ghcr.io/spacepotahto/qbittorrent:1.0.0
expose:
- port: 8080
as: 80
to:
- global: true
- port: 6881
as: 6881
to:
- global: true
- port: 5000
as: 5000
to:
- global: true

profiles:
compute:
web:
resources:
cpu:
units: 1
memory:
size: 1Gi
storage:
# Specify [<Expected Total Files Download Size> + 1]Gi
size: 2Gi
placement:
westcoast:
attributes:
host: akash
signedBy:
anyOf:
- "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63"
pricing:
web:
denom: uakt
amount: 1000

deployment:
web:
westcoast:
profile: web
count: 1
Binary file added qbittorrent/qBittorrent.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added qbittorrent/ssh-tunnel.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.