Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.
m11rtin edited this page Oct 1, 2020 · 8 revisions

Introduction

Flood is a WebUI for rtorrent, a popular BitTorrent client used in Linux machines. This document will walk through the steps of installing and configuring Flood via Docker. Please note that this document doesn't cover the installation and configuration for rtorrent or any other software.

Prerequisites

To follow this document, you will need:

  • A Linux machine with Docker installed (to install docker, follow the instructions for your specific system at https://docs.docker.com/install)
  • Basic knowledge of Linux commands

Document Setup

This document will use an Ubuntu 18.04 machine with Docker 18.06.1-ce installed.

Installation

  1. Flood doesn't have its own official docker hub image yet. You have to pull the latest source from GitHub and build it yourself. Don't download the source from the release tab as it is quite outdated.

    $ git clone https://github.com/jfurrow/flood.git /path/to/flood
    
  2. Change to the directory and build the docker image.

    $ cd /path/to/flood
    # docker build --network=host -t flood-github .
    

    Note: Do not forget the "." as it tells docker where the Dockerfile located. In the progress of building, you might get error messages. Don't worry as they will not affect the final build.

    Note: You might need/want to run docker with superuser permissions. You can do this using the sudo command.

  3. Create a container from the image created in step 2.

    # docker run --name <name> -e <env_var>=<value> -p <host_port>:3000 -v <path_to_data>:/data flood-github
    
    Parameters
    name description
    <name> The name for the container (optional)
    <env_var> Name of an environmental variable
    <value> Value for said environmental variable
    <host_port> Port number to be exposed to host (thus possibly also to the internet)
    <path_to_data> A directory for saving Flood's data
    Example
    # docker run --name flood-standalone \
        -e FLOOD_SECRET=$(openssl rand -hex 32) \
        -v /path/to/flood/data:/data \
        -p 80:3000 flood
    
  4. Access Flood via a browser. Change <host_addr> and <host_port> according to your configuration. <host_addr> is the address of the machine where Flood is running.

    https://<host_addr>:<host_port>/
    
    Example
    https://localhost:80/
    

Environmental variables

variable name accepted data type default description
FLOOD_BASE_URI String / The directory to access Flood
FLOOD_SECRET String flood A key for encrypting session cookie/JWT (strongly recommended to set and save)
RTORRENT_SCGI_HOST URL / IP Address localhost The address of your rtorrent SCGI socket
RTORRENT_SCGI_PORT Integer: 1-65535 5000 The port of your rtorrent SCGI socket
RTORRENT_SOCK boolean NotSet Enable UNIX socket connection to rtorrent
FLOOD_ENABLE_SSL boolean NotSet Enable bundled SSL encryption

Data

Currently all data including the database will be saved in the /data directory in the container. You should mount a host directory to it for future usage.

SSL

To use SSL encryption, you need to obtain an SSL certificate from a trusted CA or self-sign one. Place the public key in <path_to_data>/flood_ssl.cert and the private key in <path_to_data>/flood_ssl.key. After that, you can set -e FLOOD_ENABLE_SSL=true when creating the container.

Limitations

In its current configuration, Flood via Docker has the following limitations:

  • Fixed database path.
  • Fixed server port.
  • Fixed rtorrent socket location and name. It has to be located at /data/rtorrent.sock.
  • Fixed SSL certificate locations and names. They have to be located at:
    • Public Key: /data/flood_ssl.cert
    • Private Key: /data/flood_ssl.key