Skip to content

Advanced Setup Linux

Phil Jaenke edited this page Mar 11, 2021 · 1 revision

Starting Points

You'll need a Linux system with Docker 19.30 or later. Distribution doesn't matter; we test with Alpine, Arch, CentOS 7, CentOS 8, and Ubuntu.

The only files necessary are the example docker-compose.yml and docker.env - you should NOT clone the entire repository!

Configuring the base system

The base system MUST have a specific directory structure and you MUST host configuration files on local disk. This is extremely non-optional as the applications make extensive use of SQLite and have frequent read/write activity. Using NFS for the configuration store has been proven repeatedly to result in database corruption and data loss.

We could tell you to 'curl blah.blah/random.script.sh | bash' but that will always be stupid. So instead, you can copy and paste this easy to read and understand set of commands that will create the necessary directory layout:

mkdir -p /opt/talecaster
mkdir -p /opt/talecaster/shared
for c in nntp torrent television movies music; do
    mkdir -p /opt/talecaster/config/$c
done
## This is only necessary if you want to use a local blackhole directory, and not strictly required.
mkdir -p /opt/talecaster/blackhole

Now you'll need to create your non-root TaleCaster user. We like talecaster and group media using UID 30000 and GID 30000 so we made it default. You can use whatever you want though. If you are using NFS, the UID and GID must be consistent across all hosts. Even if using Active Directory with Kerberos. This is because the TaleCaster containers are NOT AD-aware or AD-capable and therefore must use raw UID/GID.

Configuring docker.env

The docker.env file is pretty self-explanatory, being an environment file. You must ensure that tcuid, tcgid, tcuser, tcgroup match the user you created or are using. You should update the NNTP_PASSWORD, TORRENT_PASSWORD, NNTP_USER, and TORRENT_USER variables to be unique to your environment!

From there, review the rest of the settings to make sure they look the way you like and away we go.

  • Note: VPN isn't quite done yet as of March 11 2021. Sorry. It's proving messier than planned.

Configuring docker-compose.yml

The compose file now requires updating to match your system. You must configure the volumes area at the bottom of the file if you touch nothing else! You should review the docker-compose documentation for details on configuring volumes.

IMPORTANT: Do not alter the /opt/talecaster/shared, /opt/talecaster/config, /etc/localtime, or /sys volumes!

IMPORTANT: Do NOT alter the networks configuration at this time! The IPs must be statically assigned due to working around several Docker defects.

When configuring volumes, it is NOT necessary that they be present or mounted on the local host if using NFS or CIFS drivers. It is required that your volumes be under /opt/talecaster if they are directly mounted on or from the host (e.g. combined storage/application.) Volumes should NOT be root-owned! You must configure these volumes:

  • tc-downloads - where any downloaded files or files for import need to be placed
  • tc-television - where television media is stored
  • tc-movies - where movie media is stored
  • tc-music - where music media is stored
  • tc-blackhole - where nzb and magnet files will be stored if they cannot be passed direct to downlaoders

If importing locally, it is recommended that the tc-downloads volume be mounted on the host at /opt/talecaster/downloads, bearing in mind that all files placed must be owned by the TaleCaster user and group. NEVER overlay or bind mount media volumes as they will cause problems with the host storage drivers due to the size of media and volume of read/write activity. You must use 1:1 mapping or a network storage driver.

Bringing up TaleCaster for the first time

So we've downloaded two files, made a couple directories, and edited those files to match our system. Lots to go, right?

Oh yeah.

Put the docker-compose.yml and docker.env file in /opt/talecaster.

Now: cd /opt/talecaster; docker-compose --env-file /opt/talecaster/docker.env up --no-start && docker-compose --env-file /opt/talecaster/docker.env start

Great. Point your browser at http://yourhostname/. Unless you changed HTTP_PORT then point it at the correct port. If you see the TaleCaster user interface? You're done. The download agents and directories are automatically configured at first start and stored persistently.

What about upgrades and security patches?

Containers using the .NET runtime will automatically upgrade .NET any time it is bumped in latest. The .NET version always tracks latest for that reason. Security updates are published as soon as we're reasonably able to, and applications are regularly updated. If you want to be really safe, since the configuration is stored persistently and passwords are updated every boot, you can run this handy script from cron:

#!/usr/bin/env bash
# Let's update TaleCaster!
YAML=/opt/talecaster/docker-compose.yml
ENVF=/opt/talecaster/docker.env
docker-compose --file $YAML --env-file $ENVF pull
docker-compose --file $YAML --env-file $ENVF stop
docker-compose --file $YAML --env-file $ENVF up --no-start
docker-compose --file $YAML --env-file $ENVF start
## And let's be hygenic.
docker image prune -f

Yep. That simple.