Debian-based distribution installation

Note

This guide targets Debian 9 (Stretch), which is the latest Debian. It also apply to the latest Ubuntu

External dependencies

The guides will focus on installing reel2bits-specific components and dependencies. However, reel2bits requires a few external dependencies for which documentation is outside of this document scope.

Install system dependencies

On Debian-like systems, you can install them using:

sudo apt-get update
# Install dependencies
sudo apt-get install python3-pip python3-venv git rustc cargo
# reel2bits dependencies
sudo apt install build-essential sox ffmpeg libavcodec-extra libjpeg-dev libmagic-dev libpq-dev postgresql-client python3-dev make libtag1v5 libmagic1 libffi6 libsox-dev libsox-fmt-all libtag1-dev libffi-dev libgd-dev libmad0-dev libsndfile1-dev libid3tag0-dev libmediainfo-dev

Layout

All reel2bits-related files will be located under /home/reel2bits apart from database files and a few configuration files. We will also have a dedicated reel2bits user to launch the processes we need and own those files.

You are free to use different values here, just remember to adapt those in the next steps.

Create the user and the directory:

sudo useradd -r -s /usr/sbin/nologin -d /home/reel2bits -m reel2bits
cd /home/reel2bits

Log in as the newly created user from now on:

sudo -u reel2bits -H bash

Download latest reel2bits release

Locate the latest stable release from the release page like v0.5, or if you want to run the unstable, use the master branch.

Still under your reel2bits user:

# if release:
git clone -b v0.5 https://github.com/reel2bits/reel2bits/
# Or master
git clone https://github.com/reel2bits/reel2bits/

Python dependencies

Go to the project directory:

cd reel2bits

To avoid collisions with other software on your system, Python dependencies will be installed in a dedicated virtualenv.

First, create the virtualenv:

python3 -m venv /home/reel2bits/virtualenv

This will result in a virtualenv directory being created in /home/reel2bits/virtualenv.

In the rest of this guide, we’ll need to activate this environment to ensure dependencies are installed within it, and not directly on your host system.

This is done with the following command:

source /home/reel2bits/virtualenv/bin/activate

Finally, install the python dependencies:

pip install wheel
pip install -r api/requirements.txt

Warning

Further commands involving python should always be run after you activated the virtualenv, as described earlier, otherwise those commands will raise errors

Configuration file

Please look at the dedicated configuration page.

Sentry

If you know and use Sentry, you can install the python package:

pip install sentry-sdk[flask]

And setup your DSN in config.py.

Database setup

You should now be able to import the initial database structure:

# in the 'api' folder
flask db upgrade

This will create the required tables and rows.

Note

You can safely execute this command any time you want, this will only run unapplied migrations.

Then populate the database with default values (seeds):

# in the 'api' folder
flask db-datas 000-seeds

Test email sending

This step is tmportant if you configured the app to have user confirm their email !

flask test-email --email=EMAIL_TO_SEND_TEST_TO

Create an admin account

You can then create your first user account:

# in the 'api' folder
flask users create

Warning

If you don’t create an user, the first one to register from the web interface will be administrator !

Front installation

You also need to either get a frontend prebuild or build it yourself.

Pre-build

  • The URL for a stable release will be https://assets.reel2bits.org/front-dist-master-v0.5.zip.

  • The URL for master will be https://assets.reel2bits.org/front-dist-master.zip.

You can always go to https://assets.reel2bits.org/ to check the available archives, and test the link before downloading it.

Get the archive and extract:

sudo -u reel2bits -H bash
cd
wget <the URL defined earlier>
# use the stable or master name you got earlier too
unzip "front-dist-master-v0.5.zip" -d extract
# beware with this command, take care
rm -rf "reel2bits/front/dist/*"
cp -r extract/dist/* reel2bits/front/dist/
# same with this one
rm -rf "extract"

Warning

Any update to the frontend files needs either a restart of the reel2bits-web service, or wait until the file cache expires.

Build it yourself

Make sure you have Node.js installed then:

sudo -u reel2bits -H bash
cd reel2bits/front
yarn
npm run build

That’s it.

Systemd unit file

See Systemd configuration.

Reverse proxy setup

See reverse-proxy.