From 277644059fe3721e0850eafeb09ca03e50aa5647 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Sun, 23 Jul 2023 20:07:48 -0600 Subject: split jellyfin entry, ready to publish qbt, minor tweaks and notes --- src/blog/a/manga_server_with_komga.md | 7 +- src/blog/a/torrenting_with_qbittorrent.md | 339 +++++++++++++++++++++ .../temp/jellyfin_server_with_sonarr_radarr.md | 264 ++++++++++++++-- 3 files changed, 584 insertions(+), 26 deletions(-) create mode 100644 src/blog/a/torrenting_with_qbittorrent.md (limited to 'src/blog') diff --git a/src/blog/a/manga_server_with_komga.md b/src/blog/a/manga_server_with_komga.md index 77599ea..7b11d7c 100644 --- a/src/blog/a/manga_server_with_komga.md +++ b/src/blog/a/manga_server_with_komga.md @@ -12,6 +12,8 @@ I've been wanting to set up a manga media server to hoard some mangas/comics and I'm going to run it as an exposed service using a subdomain of my own, so the steps are taking that into account, if you want to run it locally (or on a LAN/VPN) then it is going to be easier/with less steps (you're on your own). Also, as you might notice I don't like to use D\*ck\*r images or anything (ew). +==At the time of editing this entry (06-28-2023) Komga has already upgraded to `v.1.0.0` and it introduces some breaking changes if you already had your instance set up. Read more [here](https://komga.org/installation/upgrade.html#prepare-for-v1-0-0).== The only change I did here was changing the port to the new default. + As always, all commands are run as root unless stated otherwise. # Table of contents @@ -347,7 +349,7 @@ This `komga` package creates a `komga` (service) user and group which is tied to Configure it by editing `/etc/komga.conf`: ```sh -SERVER_PORT=8989 +SERVER_PORT=25600 SERVER_SERVLET_CONTEXT_PATH=/ # this depends a lot of how it's going to be served (domain, subdomain, ip, etc) KOMGA_LIBRARIES_SCAN_CRON="0 0 * * * ?" @@ -364,7 +366,6 @@ KOMGA_DATABASE_BACKUP_SCHEDULE="0 0 */8 * * ?" My changes (shown above): -- Port on `8989` because `8080` its too generic. - `cron` schedules. - It's not actually `cron` but rather a `cron`-like syntax used by [Spring](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/support/CronSequenceGenerator.html) as stated in the [Komga config](https://komga.org/installation/configuration.html#optional-configuration). - Added the remember me key. @@ -382,7 +383,7 @@ server { server_name komga.yourdomain.com; # change accordingly to your wanted subdomain and domain name location / { - proxy_pass http://localhost:8989; # change 8989 to the port you want to use + proxy_pass http://localhost:25600; # change port if needed proxy_http_version 1.1; proxy_set_header Host $host; diff --git a/src/blog/a/torrenting_with_qbittorrent.md b/src/blog/a/torrenting_with_qbittorrent.md new file mode 100644 index 0000000..c3a0b82 --- /dev/null +++ b/src/blog/a/torrenting_with_qbittorrent.md @@ -0,0 +1,339 @@ +title: Set up qBitTorrent with Jackett for use with Starr apps +author: David Luévano +lang: en +summary: How to set up a torrenting solution with qBitTorrent in preparation for a media server with Jellyfin and Starr apps, on Arch. With Jackett and flaresolverr, too. +tags: server + tools + code + tutorial + english + +Riding on my excitement of having a good internet connection and having setup my *home server* now it's time to self host a media server for movies, series and anime. I'll setup qBitTorrent as the downloader, Jackett for the trackers, the *Starr apps* for the automatic downloading and Jellyfin as the media server manager/media viewer. This was going to be a single entry but it ended up being a really long one so I'm splitting it, this being the first part. + +I'll be exposing my stuff on a subdomain only so I can access it while out of home and for SSL certificates (not required), but shouldn't be necessary and instead you can use a VPN ([how to set up](https://blog.luevano.xyz/a/vpn_server_with_openvpn.html)). For your reference, whenever I say "Starr apps" (\*arr apps) I mean the family of apps such as Sonarr, Radarr, Bazarr, Readarr, Lidarr, etc.. + +Most of my config is based on the [TRaSH-Guides](https://trash-guides.info/) (will be mentioned as "TRaSH" going forward). Specially get familiar with the [TRaSH: Native folder structure](https://trash-guides.info/Hardlinks/How-to-setup-for/Native/) and with the [TRaSH: Hardlinks and instant moves](https://trash-guides.info/Hardlinks/Hardlinks-and-Instant-Moves/). Will also use the default configurations based on the respective documentation for each Starr app and service, except when stated otherwise. + +Everything here is performed in ==arch btw== and all commands should be run as root unless stated otherwise. + +==Also kindly note that I do not condone the use of torrenting for illegal activities. I take no responsibility for what you do when setting up anything shown here. It is for you to check your local laws before using automated downloaders such as Sonarr and Radarr.== + +# Table of contents + +[TOC] + +# Prerequisites + +The specific programs are mostly recommendations, if you're familiar with something else or want to change things around, feel free to do so but everything will be written with them in mind. + +If you want to expose to a (sub)domain, then similar to my early [tutorial](https://blog.luevano.xyz/tag/@tutorial.html) entries (specially the [website](https://blog.luevano.xyz/a/website_with_nginx.html) for the reverse proxy plus certificates): + +- `nginx` for the reverse proxy. +- `certbot` for the SSL certificates. +- `ufw` for the firewall. +- `yay` to install AUR packages. + - I mentioned how to install and use it on my previous entry: [Manga server with Komga: yay](https://blog.luevano.xyz/a/manga_server_with_komga.html#yay). +- An **A** (and/or **AAAA**) or a **CNAME** for `isos` (or whatever you want to call it). + - For automation software (qBitTorrent, Jackett, Starr apps, etc.). One subdomain per service can be used instead. + +==Note: I'm using the explicit `127.0.0.1` ip instead of `localhost` in the reverse proxies/services config as `localhost` resolves to `ipv6` sometimes which is not configured on my server correctly.== If you have it configured you can use localhost without any issue. + +## Directory structure + +Basically following [TRaSH: Native folder structure](https://trash-guides.info/Hardlinks/How-to-setup-for/Native/) except for the directory permissions part, I'll do the same as with my [Komga setup guide](https://blog.luevano.xyz/a/manga_server_with_komga#set-default-directory-permissions.html) to stablish default group permissions. + +The desired behaviour is: set `servarr` as group ownership, set write access to group and whenever a new directory/file is created, inherit these permission settings. `servarr` is going to be a service user and I'll use the root of a mounted drive at `/mnt/a`. + +1. Create a service user called `servarr` (it could just be a group, too): + +```sh +useradd -r -s /usr/bin/nologin -M -c "Servarr applications" servarr +``` + +2. Create the `torrents` directory and set default permissions: + +```sh +cd /mnt/a # change this according to your setup +mkdir torrents +chown servarr:servarr torrents +chmod g+w torrents +chmod g+s torrents +setfacl -d -m g::rwx torrents +setfacl -d -m o::rx torrents +``` + +3. Check that the permissions are set correctly (`getfacl torrents`) + +``` +# file: torrents/ +# owner: servarr +# group: servarr +# flags: -s- +user::rwx +group::rwx +other::r-x +default:user::rwx +default:group::rwx +default:other::r-x +``` + +4. Create the subdirectories you want with any user (I'll be using `servarr` personally): + +```sh +mkdir torrents/{tv,movies,anime} +chown -R servarr: torrents +``` + +5. Finally repeat steps 2 - 4 for the `media` directory. + +The final directory structure should be the following: + +``` +root_dir +├── torrents +│ ├── movies +│ ├── music +│ └── tv +└── media + ├── movies + ├── music + └── tv +``` + +Where `root_dir` is `/mnt/a` in my case. This is going to be the reference for the following applications set up. + +Later, add the necessary users to the `servarr` group if they need write access, by executing: + +```sh +gpasswd -a servarr +``` + +# Jackett + +[Jackett](https://github.com/Jackett/Jackett) is a "proxy server" (or "middle-ware") that translates queries from apps (such as the Starr apps in this case) into tracker-specific http queries. Note that there is an alternative called [Prowlarr](https://github.com/Prowlarr/Prowlarr) that is better integrated with most if not all Starr apps, requiring less maintenance; I'll still be sticking with Jackett, though. + +Install from the AUR with `yay`: + +```sh +yay -S jackett +``` + +I'll be using the default `9117` port, but change accordingly if you decide on another one. + +## Reverse proxy + +I'm going to have most of the services under the same subdomain, with different subdirectories. Create the config file `isos.conf` at the usual `sites-available/enabled` path for `nginx`: + +```nginx +server { + listen 80; + server_name isos.yourdomain.com; + + location /jack { # you can change this to jackett or anything you'd like, but it has to match the jackett config on the next steps + proxy_pass http://127.0.0.1:9117; # change the port according to what you want + + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $http_host; + proxy_redirect off; + } +} +``` + +This is the basic reverse proxy config as shown in [Jackett: Running Jackett behind a reverse proxy](https://github.com/Jackett/Jackett#running-jackett-behind-a-reverse-proxy). The rest of the services will be added under different `location` block on their respective steps. + +### SSL certificate + +Create/extend the certificate by running: + +```sh +certbot --nginx +``` + +That will automatically detect the new subdomain config and create/extend your existing certificate(s). Restart the `nginx` service for changes to take effect: + +```sh +systemctl restart nginx.service +``` + +## Start using Jackett + +You can now `start`/`enable` the `jackett.service`: + +```sh +systemctl enable jackett.service +systemctl start jackett.service +``` + +It will autocreate the default configuration under `/var/lib/jackett/ServerConfig.json`, which you need to edit at least to change the `BasePathOverride` to match what you used in the `nginx` config: + +```json +{ + "Port": 9117, + "SomeOtherConfigs": "some_other_values", + "BasePathOverride": "/jack", + "MoreConfigs": "more_values", +} +``` + +Also modify the `Port` if you changed it. Restart the `jackett` service: + +```sh +systemctl restart jackett.service +``` + +It should now be available at `https://isos.yourdomain.com/jack`. ==Add an admin password right away== by scroll down and until the first config setting; don't forget to click on "Set Password". Change any other config you want from the Web UI, too (you'll need to click on "Apply server settings"). + +### Indexers + +For Jackett, an indexer is just a configured tracker for some of the commonly known torrent sites. Jackett comes with a lot of pre-configured public and private indexers which usually have multiple URLs (mirrors) per indexer, useful when the main torrent site is down. Some indexers come with extra features/configuration depending on what the site specializes on. + +To add an indexer click on the "+ Add Indexer" at the top of the Web UI and look for indexers you want, then click on the "+" icon on the far-most right for each indexer or select the ones you want (clicking on the checkbox on the far-most left of the indexer) and scroll all the way to the bottom to click on "Add Selected". They then will show as a list with some available actions such as "Copy RSS Feed", "Copy Torznab Feed", "Copy Potato Feed", a button to search, configure, delete and test the indexer, as shown below: + +![Jacket: configured indexers](${SURL}/images/b/jack/jack_configured_indexers.png "Jackett: configured indexers") + +You can manually test the indexers by doing a basic search to see if they return anything, either by searching on each individual indexer by clicking on the magnifying glass icon on the right of the indexer or clicking on "Manual Search" button which is next to the "+ Add Indexer" button at the top right. + +Explore each indexer's configuration in case there is stuff you might want to change. + +## FlareSolverr + +[FlareSolverr](https://github.com/FlareSolverr/FlareSolverr) is used to bypass *certain* protection that some torrent sites have. This is not 100% necessary and only needed for some trackers sometimes, it also doesn't work 100%. + +You could install from the AUR with `yay`: + +```sh +yay -S flaresolverr-bin +``` + +At the time of writing, the `flaresolverr` package didn't work for me because of `python-selenium`. `flaresolverr-bin` was updated around the time I was writing this, so that is what I'm using and what's working fine so far, it contains almost everything needed (it has self contained libraries) except for `xfvb`. + +Install dependencies via `pacman`: + +```sh +pacman -S xorg-server-xvfb +``` + +You can now `start`/`enable` the `flaresolverr.service`: + +```sh +systemctl enable flaresolverr.service +systemctl start flaresolverr.service +``` + +Verify that the service started correctly by checking the logs: + +```sh +journalctl -fxeu flaresolverr +``` + +It should show "Test successful" and "Serving on http://0.0.0.0:8191" (which is the default). Jackett will need to be configured if FlareSolverr is served on anything different than the default. This doesn't need to be exposed or anything, it's just an internal API that Jackett (or anything you want) will use. + +# qBitTorrent + +[qBitTorrent](https://wiki.archlinux.org/title/QBittorrent) is a fast, stable and light BitTorrent client that comes with many features and in my opinion it's a really user friendly client and my personal choice for years now. But you can choose whatever client you want, there are more lightweight alternatives such as [Transmission](https://wiki.archlinux.org/title/transmission). + +Install the `qbittorrent-nox` package ("nox" as in "no X server"): + +```sh +pacman -S qbittorrent-nox +``` + +By default the package doesn't create any (service) user, but it is recommended to have one so you can run the service under it. Create the user, I'll call it `qbittorrent` and leave it with the default homedir (`/home`): + +```sh +useradd -r -m qbittorrent +``` + +==Add the `qbittorrent` user to the `servarr` group:== + +```sh +gpasswd -a qbittorrent servarr +``` + +Decide a port number you're going to run the service on for the next steps, the default is `8080` but I'll use `30000`; it doesn't matter much, as long as it matches for all the config. This is the `qbittorrent` service port, it is used to connect to the instance itself through the Web UI or via API, ==you also need to open a port for listening to peer connections.== Choose any port you want, for example `50000` and open it with your firewall, `ufw` in my case: + +```sh +ufw allow 50000/tcp comment "qBitTorrent - Listening port" +``` + +## Reverse proxy + +Add the following `location` block into the `isos.conf` with whatever subdirectory name you want, I'll call it `qbt`: + +```nginx +location /qbt/ { + proxy_pass http://localhost:30000/; # change port to whatever number you want + proxy_http_version 1.1; + + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Host $http_host; + proxy_set_header X-Forwarded-For $remote_addr; + + proxy_cookie_path / "/; Secure"; + proxy_read_timeout 600s; + proxy_send_timeout 600s; +} +``` + +This is taken from [qBitTorrent: Nginx reverse proxy for Web UI](https://github.com/qbittorrent/qBittorrent/wiki/NGINX-Reverse-Proxy-for-Web-UI). Restart the `nginx` service for the changes to take effect: + +```sh +systemctl restart nginx.service +``` + +## Start using qBitTorrent + +You can now `start`/`enable` the `qbittorrent-nox@.service` using the service account created (`qbittorrent`): + +```sh +systemctl enable `qbittorrent-nox@qbittorrent.service +systemctl start `qbittorrent-nox@qbittorrent.service +``` + +This will start `qbittorrent` using default config. You need to change the port (in my case to `30000`) and set `qbittorrent` to restart on exit (the Web UI has a close button). I guess this can be done before enabling/starting the service, but either way let's create a "drop-in" file by "editing" the service: + +```sh +systemctl edit `qbittorrent-nox@qbittorrent.service +``` + +Which will bring up a file editing mode containing the service unit and a space where you can add/override anything, add: + +```ini +[Service] +Environment="QBT_WEBUI_PORT=30000" # or whatever port number you want +Restart=on-success +RestartSec=5s +``` + +When exiting from the file (if you wrote anything) it will create the override config. Restart the service for changes to take effect (you might be asked to reload the systemd daemon): + +```sh +systemctl restart `qbittorrent-nox@qbittorrent.service +``` + +You can now head to `https://isos.yourdomain.com/qbt/` and login with user `admin` and password `adminadmin` (by default). ==Change the default password right away== by going to *Tools -> Options -> Web UI -> Authentication*. The Web UI is basically the same as the normal desktop UI so if you've used it it will feel familiar. From here you can threat it as a normal torrent client and even start using for other stuff other than the specified here. + +### Configuration + +It should be usable already but you can go further and fine tune it, specially to some kind of "convention" as shown in [TRaSH: qBitTorrent basic setup](https://trash-guides.info/Downloaders/qBittorrent/Basic-Setup/) and subsequent `qbittorrent` guides. + +I use all the suggested settings by *TRaSH*, where the only "changes" are for personal paths, ports, and in general connection settings that depend on my setup. The only super important setting I noticed that can affect our setup (meaning what is described in this entry) is the *Web UI -> Authentication* for the "Bypass authentication for clients on localhost". This will be an issue because the reverse proxy is accessing `qbittorrent` via `localhost`, so this will make the service open to the world, experiment at your own risk. + +Finally, add categories by following [TRaSH: qBitTorrent how to add categories](https://trash-guides.info/Downloaders/qBittorrent/How-to-add-categories/), basically right clicking on *Categories -> All (x)* (located at the left of the Web UI) and then on "Add category"; I use the same "Category" and "Save Path" (`tv` and `tv`, for example), where the "Save Path" will be a subdirectory of the configured global directory for torrents ([TRaSH: qBitTorent paths and categories breakdown](https://trash-guides.info/Downloaders/qBittorrent/How-to-add-categories/#paths-and-categories-breakdown)). I added 3: `tv`, `movies` and `anime`. + +### Trackers + +Often some of the trackers that come with torrents are dead or just don't work. You have the option to add extra trackers to torrents either by: + +- Automatically add a predefined list on new torrents: configure at *Tools -> Options -> BitTorrent*, enable the last option "Automatically add these trackers to new downloads" then add the list of trackers. This should only be done on public torrents as private ones might ban you or something. +- Manually add a list of trackers to individual torrents: configure by selecting a torrent, clicking on *Trackers* on the bottom of the Web UI, right clicking on an empty space and selecting "Add trackers..." then add the list of trackers. + +On both options, the list of trackers need to have at least one new line in between each new tracker. You can find trackers from the following sources: + +- [List of stable trackers](https://newtrackon.com/list) +- [ngosang/trackerslist](https://github.com/ngosang/trackerslist) + - It also mentions [Third party tools](https://github.com/ngosang/trackerslist#third-party-tools) to automate this process. + +Both sources maintain an updated list of trackers. You also might need to enable an advanced option so all the new trackers are contacted ([Only first tracker contacted](https://github.com/qbittorrent/qBittorrent/issues/7882)): configure at *Tools -> Options -> Advanced -> libtorrent Section* and enable both "Always announce to all tiers" and "Always announce to all trackers in a tier". diff --git a/src/blog/temp/jellyfin_server_with_sonarr_radarr.md b/src/blog/temp/jellyfin_server_with_sonarr_radarr.md index 5ef573e..60251a7 100644 --- a/src/blog/temp/jellyfin_server_with_sonarr_radarr.md +++ b/src/blog/temp/jellyfin_server_with_sonarr_radarr.md @@ -1,7 +1,7 @@ title: Set up a media server with Jellyfin, Sonarr and Radarr author: David Luévano lang: en -summary: How to set up a media server with Jellyfin, Sonarr and Radarr, on Arch. With qBitTorrent and Jackett with flaresolverr also. +summary: How to set up a media server with Jellyfin, Sonarr and Radarr, on Arch. With qBitTorrent, Jackett, flaresolverr and Bazarr, too. tags: server tools code @@ -10,7 +10,7 @@ tags: server Riding on my excitement of having a good internet connection and having setup my *home server* now it's time to self host a media server for movies, series and anime. I'll be exposing my stuff on a subdomain only so I can access it while out of home and for SSL certificates (not required), but shouldn't be necessary and instead you can use a VPN ([how to set up](https://blog.luevano.xyz/a/vpn_server_with_openvpn.html)). For your reference, whenever I say "Starr apps" (\*arr apps) I mean the family of apps such as Sonarr, Radarr, Readarr, Lidarr, etc.. -Most of my config is based on [TRaSH-Guides](https://trash-guides.info/), in case I forget to mention it explicitly on its respective areas, which will be mentioned as "TRaSH" going forward. Specially get familiar with the [TRaSH: Native folder structure](https://trash-guides.info/Hardlinks/How-to-setup-for/Native/) and with the [TRaSH: Hardlinks and instant moves](https://trash-guides.info/Hardlinks/Hardlinks-and-Instant-Moves/). Will use default configurations based on the respective documentation for each service (Sonarr, Radarr, Bazarr), except when stated otherwise. +Most of my config is based on the [TRaSH-Guides](https://trash-guides.info/) (will be mentioned as "TRaSH" going forward). Specially get familiar with the [TRaSH: Native folder structure](https://trash-guides.info/Hardlinks/How-to-setup-for/Native/) and with the [TRaSH: Hardlinks and instant moves](https://trash-guides.info/Hardlinks/Hardlinks-and-Instant-Moves/). Will also use the default configurations based on the respective documentation for each Starr application and service, except when stated otherwise. Everything here is performed in ==arch btw== and all commands should be run as root unless stated otherwise. @@ -22,19 +22,18 @@ Everything here is performed in ==arch btw== and all commands should be run as r # Prerequisites -- A firewall is always strongly recommended to secure your service, and in this case we need to open some ports, specially for `qbittorrent`. I like to use `ufw`, but anything you're comfortable with works. +The specific programs are mostly recommendations, if you're familiar with something else or want to change things around, feel free to do so but everything will be written with them in mind. -If you want to expose to a (sub)domain, then similar to my early [tutorial](https://blog.luevano.xyz/tag/@tutorial.html) entries (specially the [website](https://blog.luevano.xyz/a/website_with_nginx.html) for the reverse proxy plus certificates) I'll use: +If you want to expose to a (sub)domain, then similar to my early [tutorial](https://blog.luevano.xyz/tag/@tutorial.html) entries (specially the [website](https://blog.luevano.xyz/a/website_with_nginx.html) for the reverse proxy plus certificates): - `nginx` for the reverse proxy. - `certbot` for the SSL certificates. +- `ufw` for the firewall. - `yay` to install AUR packages. - I mentioned how to install and use it on my previous entry: [Manga server with Komga: yay](https://blog.luevano.xyz/a/manga_server_with_komga.html#yay). - An **A** (and/or **AAAA**) or a **CNAME** for `jellyfin`. - Optionally, another one for all automation software (Jackett, Starr apps, etc.). You can use one subdomain per service, but I'll put them all under `isos` in the examples shown. -You don't need to use these in specific, but everything will be written with these in mind. - ## Directory structure Basically following [TRaSH: Native folder structure](https://trash-guides.info/Hardlinks/How-to-setup-for/Native/) except for the directory permissions part, I'll do the same as with my [Komga setup guide](https://blog.luevano.xyz/a/manga_server_with_komga#set-default-directory-permissions.html) to stablish default group permissions. @@ -152,7 +151,7 @@ certbot --nginx That will automatically detect the new subdomain config and create/extend your existing certificate(s). Restart the `nginx` service for changes to take effect: ```sh -systemctl restart nginx +systemctl restart nginx.service ``` ## Start using Jackett @@ -339,7 +338,7 @@ location /qbt/ { This is taken from [qBitTorrent: Nginx reverse proxy for Web UI](https://github.com/qbittorrent/qBittorrent/wiki/NGINX-Reverse-Proxy-for-Web-UI). Restart the `nginx` service for the changes to take effect: ```sh -systemctl restart nginx +systemctl restart nginx.service ``` ## Start using qBitTorrent @@ -382,6 +381,21 @@ I use all the suggested settings, where the only "changes" are for personal path Finally, add categories by following [TRaSH: qBitTorrent how to add categories](https://trash-guides.info/Downloaders/qBittorrent/How-to-add-categories/). I added 3: `tv`, `movies` and `anime`. +### Trackers + +Often some of the trackers that come with torrents are dead or just don't work. You have the option to add extra trackers to torrents either by: + +- Automatically add a predefined list on new torrents: configure at *Tools -> Options -> BitTorrent*, enable the last option "Automatically add these trackers to new downloads" then add the list of trackers. This should only be done on public torrents as private ones might ban you or something. +- Manually add a list of trackers to individual torrents: configure by selecting a torrent, clicking on *Trackers* on the bottom of the Web UI, right clicking on an empty space and selecting "Add trackers..." then add the list of trackers. + +On both options, the list of trackers need to have at least one new line in between each new tracker. You can find trackers from the following sources: + +- [List of stable trackers](https://newtrackon.com/list) +- [ngosang/trackerslist](https://github.com/ngosang/trackerslist) + - It also mentions [Third party tools](https://github.com/ngosang/trackerslist#third-party-tools) to automate this process. + +Both sources maintain an updated list of trackers. You also might need to enable an advanced option so all the new trackers are contacted ([Only first tracker contacted](https://github.com/qbittorrent/qBittorrent/issues/7882)): configure at *Tools -> Options -> Advanced -> libtorrent Section* and enable both "Always announce to all tiers" and "Always announce to all trackers in a tier". + # Radarr [Radarr](https://radarr.video/) is a movie collection manager that can be used to download movies via torrents. This is actually a fork of Sonarr, so they're pretty similar, I just wanted to set up movies first. @@ -428,7 +442,7 @@ location /radarr/api { This is taken from [Radarr Nginx reverse proxy configuration](https://wiki.servarr.com/radarr/installation#nginx). Restart the `nginx` service for the changes to take effect: ```sh -systemctl restart nginx +systemctl restart nginx.service ``` ## Start using Radarr @@ -460,7 +474,9 @@ Note that if you want to have an anime movies library, it is recommended to run ### Configuration -This is the most tedious part, but I'm going to go for most of the defaults plus recommended configs (by [TRaSH](https://trash-guides.info/)) according to the official [Radarr: Quick start guide](https://wiki.servarr.com/radarr/quick-start-guide). Anything that is either not mentioned in the guide, or that is specific to how I'm setting up stuff in this entry will be stated below. +Will be following the official [Radarr: Quick start guide](https://wiki.servarr.com/radarr/quick-start-guide) as well as the recommendations by [TRaSH: Radarr](https://trash-guides.info/Radarr/). + +Anything that is not mentioned in either guide or that is specific to how I'm setting up stuff will be stated below. #### Media Management @@ -531,9 +547,11 @@ When it selects a torrent it sends it to qBitTorrent and you can even go ahead a After the movie is downloaded and processed by Radarr, it will create the appropriate hardlinks to the `media/movies` directory, as set in [Directory structure](#directory-structure). +Optionally, you can add subtitles using [Bazarr](#bazarr). + # Sonarr -[Sonarr](https://sonarr.tv/) is a TV series collection manager that can be used to download series via torrents. As mentioned in [Radarr](#radarr). Most of the install process, configuration and whatnot is going to be basically the same as with [Radarr](#radarr). +[Sonarr](https://sonarr.tv/) is a TV series collection manager that can be used to download series via torrents. As mentioned in [Radarr](#radarr). Most of the install process, configuration and whatnot is going to be basically the same as with Radarr. Install from the AUR with `yay`: @@ -547,7 +565,7 @@ yay -S sonarr gpasswd -a sonarr servarr ``` -The default port that Sonarr uses is `8989` for http, this should be fine for you, but I'll change it to `7979` as it's already in use for Komga for me, as shown in my [Manga server with Komga](https://blog.luevano.xyz/a/manga_server_with_komga.html). +The default port that Radarr uses is `8989` for http (the one we need for our reverse proxy). ## Reverse proxy @@ -557,7 +575,7 @@ Add the following `location` blocks into the `isos.conf`, I'll leave it as `sona ```nginx location /sonarr { - proxy_pass http://localhost:7979/sonarr; # change port if needed, this is not the default + proxy_pass http://localhost:8989/sonarr; # change port if needed proxy_http_version 1.1; proxy_set_header Host $proxy_host; # this differs from the radarr reverse proxy @@ -572,14 +590,14 @@ location /sonarr { # Allow the API External Access via NGINX location /sonarr/api { auth_basic off; - proxy_pass http://localhost:7979; # change port if needed, this is not the default + proxy_pass http://localhost:8989; # change port if needed } ``` This is taken from [Sonarr: Nginx reverse proxy configuration](https://wiki.servarr.com/sonarr/installation#nginx). Restart the `nginx` service for the changes to take effect: ```sh -systemctl restart nginx +systemctl restart nginx.service ``` ## Start using Sonarr @@ -591,11 +609,10 @@ systemctl enable sonarr.service systemctl start sonarr.service ``` -This will start the service and create the default configs under `/var/lib/sonarr`. We need to change the `URLBase` as we're running the reverse proxy under a subdirectory (`/sonarr`) and in my case the `Port`. Edit `/var/lib/sonarr/config.xml`: +This will start the service and create the default configs under `/var/lib/sonarr`. We need to change the `URLBase` as we're running the reverse proxy under a subdirectory (`/sonarr`). Edit `/var/lib/sonarr/config.xml`: ```xml ... -7979 /sonarr ... ``` @@ -612,7 +629,9 @@ Similar to [Radarr](#radarr) if you want to have an anime library, it is recomme ### Configuration -Also the most tedious part, will go for most of the defaults plus recommended configs (by [TRaSH](https://trash-guides.info/)) according to the official [Sonarr: Quick start guide](https://wiki.servarr.com/sonarr/quick-start-guide), as with [Radarr](#radarr). Anything that is either not mentioned in the guide, or that is specific to how I'm setting up stuff in this entry will be stated below. +Will be following the official [Sonarr: Quick start guide](https://wiki.servarr.com/sonarr/quick-start-guide) as well as the recommendations by [TRaSH: Sonarr](https://trash-guides.info/Sonarr/). + +Anything that is not mentioned in either guide or that is specific to how I'm setting up stuff will be stated below. #### Media Management @@ -627,13 +646,13 @@ Will basically do the same as in [Radarr: Quality](#quality): set minimum of `0` #### Profiles -This is a bit different than with [Radarr](#radarr), the way it is configured is by setting "Release profiles". I took the profiles from [TRaSH: WEB-DL Release profile regex](https://trash-guides.info/Sonarr/Sonarr-Release-Profile-RegEx/). The only possible change I'll do is disable the Low Quality Groups after some testing if this results in some issues, similar with Radarr's "LQ" custom format. +This is a bit different than with [Radarr](#radarr), the way it is configured is by setting "Release profiles". I took the profiles from [TRaSH: WEB-DL Release profile regex](https://trash-guides.info/Sonarr/Sonarr-Release-Profile-RegEx/). The only possible change I'll do is disable the Low Quality Groups and/or the "Golden rule" filter (for `x265` encoded video). For me it ended up looking like this: ![Sonarr: Release profiles](${SURL}/images/b/sonarr/sonarr_release_profiles.png "Sonarr: Release profiles") -But yours can differ as is mostly personal preference. For the "Quality profile" I'll be using the default "HD-1080p" most of the time, but I also created a "WEB(720/1080/2160)" because some shows are not present in only one quality. +But yours can differ as is mostly personal preference. For the "Quality profile" I'll be using the default "HD-1080p" most of the time, but I also created a "HD + WEB (720/1080)" which works best for some. #### Download clients @@ -672,7 +691,7 @@ Add by going to *Series -> Add New*. Basically just follow the [Sonarr: Library I personally use: - Monitor: All Episodes. -- Quiality Profile: "WEB(720/1080/2160)". This depends on what I want for that how, lately I've been experimenting with this one. +- Quiality Profile: "HD + WEB (720/1080)". This depends on what I want for that how, lately I've been experimenting with this one. - Series Type: Standard. For now I'm just downloading shows, but it has an Anime option. - Tags: the "indexer_name" I want to use to download the movie, I've been using all indexers so I just use all tags as I'm experimenting and trying multiple options. - Season Folder: enabled. I like as much organization as possible. @@ -693,6 +712,8 @@ Then it will bring a window with the search results, where it shows the indexer After the movie is downloaded and processed by Sonarr, it will create the appropriate hardlinks to the `media/tv` directory, as set in [Directory structure](#directory-structure). +Optionally, you can add subtitles using [Bazarr](#bazarr). + # Jellyfin [Jellyfin](https://wiki.archlinux.org/title/Jellyfin) is a media server "manager", usually used to manage and organize video content (movies, TV series, etc.) which could be compared with [Plex](https://wiki.archlinux.org/title/plex) or [Emby](https://wiki.archlinux.org/title/Emby) for example (take them as possible alternatives). @@ -791,7 +812,7 @@ certbot --nginx Similarly to the `isos` subdomain, that will autodetect the new subdomain and extend the existing certificate(s). Restart the `nginx` service for changes to take effect: ```sh -systemctl restart nginx +systemctl restart nginx.service ``` ## Start using Jellyfin @@ -807,7 +828,7 @@ Then navigate to `https://jellyfin.yourdomain.com` and either continue with the The initial setup wizard makes you create an user (will be the admin for now) and at least one library, though these can be done later. For more check [Jellyfin: Quick start](https://jellyfin.org/docs/general/quick-start/). -Remember to use the configured directory as mentioned in [Directory structure](#directory-structure). Any other configuration (like adding users or libraries) can be done at the dashboard: click on the 3 horizontal lines on the top left of the Web UI then click on *Administration -> Dashboard*. I didn't configure much other than adding a couple of users for me and friends, I wouldn't recommend using the admin account to watch (personal preference). +Remember to use the configured directory as mentioned in [Directory structure](#directory-structure). Any other configuration (like adding users or libraries) can be done at the dashboard: click on the 3 horizontal lines on the top left of the Web UI then navigate to *Administration -> Dashboard*. I didn't configure much other than adding a couple of users for me and friends, I wouldn't recommend using the admin account to watch (personal preference). Once there is at least one library it will show at *Home* along with the latest movies (if any) similar to the following (don't judge, these are just the latest I added due to friend's requests): @@ -816,3 +837,200 @@ Once there is at least one library it will show at *Home* along with the latest And inside the "Movies" library you can see the whole catalog where you can filter or just scroll as well as seeing *Suggestions* (I think this starts getting populated afte a while) and *Genres*: ![Jellyfin: Library catalog options](${SURL}/images/b/jellyfin/jellyfin_library_catalog_options.png "Jellyfin: Library catalog options") + +### Plugins + +You can also install/activate [plugins](https://jellyfin.org/docs/general/server/plugins/) to get extra features. Most of the plugins you might want to use are already available in the official repositories and can be found in the "Catalog". There are a lot of plugins that are focused around anime and TV metadata, as well as an Open Subtitles plugin to automatically download missing subtitles (though this is managed with [Bazarr](#bazarr)). + +To activate plugins click on the 3 horizontal lines on the top left of the Web UI then navigate to *Administration -> Dashboard -> Advanced -> Plugins* and click on the *Catalog* tab (top of the Web UI). Here you can select the plugins you want to install. By default only the official ones are shown, for more you can add more [repositories](https://jellyfin.org/docs/general/server/plugins/#repositories). + +The only plugin I'm using is the "Playback Reporting", to get a summary of what is being used in the instance. But I might experiment with some anime-focused plugins when the time comes. + +### Transcoding + +Although not recommended and explicitly set to not download any `x265`/`HEVC` content (by using the [Golden rule](https://trash-guides.info/Sonarr/Sonarr-Release-Profile-RegEx/#golden-rule)) there might be cases where the only option you have is to download such content. If that is the case and you happen to have a way to do [Hardware Acceleration](https://jellyfin.org/docs/general/administration/hardware-acceleration/), for example by having an NVIDIA graphics card (in my case) then you should enable it to avoid using lots of resources on your system. + +Using hardware acceleration will leverage your GPU to do the transcoding and save resources on your CPU. I tried streaming `x265` content and it basically used 70-80% on all cores of my CPU, while on the other hand using my GPU it used the normal amount on the CPU (70-80% on a single core). + +This will be the steps to install on an [NVIDIA](https://jellyfin.org/docs/general/administration/hardware-acceleration/nvidia/) graphics card, specifically a GTX 1660 Ti. But more info and guides can be found at [Jellyfin: Hardware Acceleration](https://jellyfin.org/docs/general/administration/hardware-acceleration/) for other acceleration methods. + +#### NVIDIA drivers + +Ensure you have the NVIDIA drivers and utils installed. I've you've done this in the past then you can skip this part, else you might be using the default `nouveau` drivers. Follow the next steps to set up the NVIDIA drivers, which basically is a summary of [NVIDIA: Installation](https://wiki.archlinux.org/title/NVIDIA#Installation) for my setup, so ==double check the wiki in case you have an older NVIDIA graphics card==. + +Install the `nvidia` and `nvidia-utils` packages: + +```sh +pacman -S nvidia nvidia-utils +``` + +Modify `/etc/mkinitcpio.conf` to remove `kms` from the `HOOKS` array. It should look like this (commented line is how it was for me before the change): + +```sh +... +# HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block filesystems fsck) +HOOKS=(base udev autodetect modconf keyboard keymap consolefont block filesystems fsck) +... +``` + +[Regenerate the initramfs](https://wiki.archlinux.org/title/Mkinitcpio#Image_creation_and_activation) by executing: + +```sh +mkinitcpio -P +``` + +Finally, reboot the system. After the reboot you should be able to check your GPU info and processes being run with the GPU by executing `nvidia-smi`. + +#### Enable hardware acceleration + +Install from the AUR with `yay`: + +```sh +yay -S jellyfin-ffmpeg6-bin +``` + +This provides the `jellyfin-ffmpeg` executable, which is necessary for Jellyfin to do hardware acceleration, it needs to be this specific one. + +Then in the Jellyfin go to the transcoding settings by clicking on the 3 horizontal lines on the top left of the Web UI and navigating to *Administration -> Dashboard -> Playback -> Transcoding* and: + +- Change the *Hardware acceleration* from "None" to "Nvidia NVENC". +- Some other options will pop up, just make sure you enable "HEVC" (which is `x265`) in the list of *Enable hardware encoding for:*. +- Scroll down and specify the `ffmpeg` path, which is `/usr/lib/jellyfin-ffmpeg/ffmpeg`. + +Don't forget to click "Save" at the bottom of the Web UI, it will ask if you want to enable hardware acceleration. + +# Bazarr + +[Bazarr](https://www.bazarr.media/) is a companion for Sonarr and Radarr that manages and downloads subtitles. + +Install from the AUR with `yay`: + +```sh +yay -S bazarr +``` + +==Add the `bazarr` user to the `servarr` group:== + +```sh +gpasswd -a bazarr servarr +``` + +The default port that Bazarr uses is `6767` for http (the one we need for our reverse proxy), and it has pre-configured the default ports for Radarr and Sonarr. + +## Reverse proxy + +Basically the same as with [Radarr: Reverse proxy](#reverse-proxy-2) and [Sonarr: Reverse proxy](#reverse-proxy-3), ==except that the `proxy_pass` (needs `/bazarr`) is different.== + +Add the following setting in the `server` block of the `isos.conf`: + +```nginx +server { + # server_name and other directives + ... + + # Increase http2 max sizes + large_client_header_buffers 4 16k; + + # some other blocks like location blocks + ... +} +``` + +Then add the following `location` blocks in the `isos.conf`, where I'll keep it as `/bazarr`: + +```nginx +location /bazarr { + proxy_pass http://localhost:6767/bazarr; # change port if needed + proxy_http_version 1.1; + + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + + proxy_redirect off; +} +# Allow the Bazarr API through if you enable Auth on the block above +location /bazarr/api { + auth_request off; + proxy_pass http://localhost:6767/bazarr/api; +} +``` + +This is taken from [Bazarr: Reverse proxy help](https://wiki.bazarr.media/Additional-Configuration/Reverse-Proxy-Help/). Restart the `nginx` service for the changes to take effect: + +```sh +systemctl restart nginx.service +``` + +## Start using Bazarr + +You can now `start`/`enable` the `bazarr.service` if you haven't already: + +```sh +systemctl start bazarr.service +systemctl enable bazarr.service +``` + +This will start the service and create the default configs under `/var/lib/bazarr`. We need to change the `base_url` for the necessary services as we're running them under a reverse proxy and under subdirectories. Edit `/var/lib/bazarr/config/config.ini`: + +```ini +[general] +port = 6767 +base_url = /bazarr + +[sonarr] +port = 8989 +base_url = /sonarr + +[radarr] +port = 7878 +base_url = /radarr +``` + +Then restart the `bazarr` service: + +```sh +systemctl restart bazarr.service +``` + +Now `https://isos.yourdomain.com/bazarr` is accessible. Again go straight to secure the instance by adding authentication under *Settings -> General -> Security*. I added the "Forms" option, just fill in the username and password then click on save changes on the top left of the page. You can restart the service again and check that it asks for login credentials. I also disabled *Settings -> General -> Updates -> Automatic*. + +### Configuration + +Will be following the official [Bazarr: Setup guide](https://wiki.bazarr.media/Getting-Started/setup-guide/) as well as the recommendations by [TRaSH: Bazarr](https://trash-guides.info/Bazarr/). + +Anything that is not mentioned in either guide or that is specific to how I'm setting up stuff will be stated below. + +#### Providers + +This doesn't require much thinking and its up to personal preference, but I'll list the ones I added: + +- [OpenSubtitles.com](https://www.opensubtitles.com/): requires an account (the `.org` option is deprecated). + - For a free account it only lets you download around 20 subtitles per day, and they contain ads. You could pay for a VIP account ($3 per month) and that will give you 1000 subtitles per day and no ads. But if you're fine with 20 ads per day you can try to get rid of the ads by running an automated script. Such option can be found at [brianspilner01/media-server-scripts: sub-clean.sh](https://github.com/brianspilner01/media-server-scripts/blob/master/sub-clean.sh). +- YIFY Subtitles +- Subscenter +- Supersubtitles +- TVSubtitles +- Subtitulamos.tv: Spanish subtitles provider. +- Argenteam: LATAM Spanish subtitles provider. +- Subdivx: LATAM Spanish / Spanish subtitles provider. + +I've tested this setup for the following languages (with all default settings as stated in the guides): + +- English +- Spanish + +I tried with "Latin American Spanish" but they're hard to find, those two work pretty good. + +None of these require an [Anti-Captcha](https://anti-captcha.com/) account (which is a paid service), but I created one anyways in case I need it. Though you need to add credits to it (pretty cheap though) if you ever use it. + +# WIP + +- Description on qbittorrent listening port, openning with ufw, specify at the beginning or on the config part +- Change all reverse proxy and configs for 127.0.0.1 instead of localhost +- Change jackett config for the 127.0.0.1 ip +- Change the reverse proxy's api location parts +- Flaresolverr now works with -bin, needs to install xorg-server-xvfb \ No newline at end of file -- cgit v1.2.3-70-g09d2