Docker stack inc. ExpressVPN

docker-compose.yml

# Docker compose to set up containers for all services you need:
# VPN
#   Sonarr, Radarr, Lidarr, Qbittorrent
# Non-VPN
#   Plex, get_iplayer
# Before running docker-compose, you should pre-create all of the following folders.
# Folders for Docker State:
#  /volume1/dockerdata.             - root where this docker-compose.yml should live
#  /volume1/dockerdata/plex         - Plex config and DB
#  /volume1/dockerdata/sonarr       - Sonarr config and DB
#  /volume1/dockerdata/radarr       - Radarr config and DB
#  /volume1/dockerdata/lidarr       - Lidarr config and DB
#  /volume1/dockerdata/qbt          - QBitorrent config and DB
#  /volume1/dockerdata/prowlarr     - Prowlarr config and DB
#  /volume1/dockerdata/get_iplayer  - Get_iPlayer config and DB
# Folders for Media etc:
#  /volume1/photo                   - Root storage for photo files
#  /volume1/music                   - Root storage for music files
#  /volume1/video                   - Root storage for video files
#  /volume1/video/TV                - folder for Sonarr/Plex TV shows
#  /volume1/video/Films             - folder for Radarr/Plex Movies
#  /volume1/video/Downloads         - QBT folder for TV downloads (that Sonarr will process)
#  /volume1/video/FilmDownloads     - QBT folder for Movie downloads (that Radarr will process)
#  /volume1/video/MusicDownloads    - QBT folder for Music downloads (that Lidarr will process)
#  /volume1/video/Downloads/iPlayer - Destination folder for get_iplayer. See https://github.com/Webreaper/SonarrAutoImport
# 
# Note that Sonarr and Radarr don't necessarily need the VPN if you're using Prowlarr for the indexers. 
# But Prowlarr should be behind the VPN to avoid ISPs that block indexers.

services:
    expressvpn:
        image: polkaned/expressvpn
        container_name: expressvpn
        environment:
            - ACTIVATION_CODE=YOUR_CODE_HERE
        cap_add:
            - NET_ADMIN
        devices:
            - "/dev/net/tun:/dev/net/tun"
        privileged: true
        tty: true
        ports:
            # QBT UI Port
            - 8090:8090
            # Bittorrent port
            - 6881:6881
            - 6881:6881/udp
            # Web port
            - 8080:8080
            - 9117:9117
            # Sonarr port
            - 8989:8989
            # Radarr port
            - 7878:7878
            # Lidarr port
            - 8686:8686
            # Prowlarr port
            - 9696:9696
        command: /bin/bash
        restart: unless-stopped

    qbittorrent:
        image: linuxserver/qbittorrent
        container_name: qbittorrent
        environment:
            - PUID=1024
            - PGID=101
            - TZ=Europe/London
            - UMASK_SET=022
            - WEBUI_PORT=8090
        volumes:
            - /volume1/dockerdata/qbt/config:/config
            - /volume1/video/Seeding:/downloads
            - /volume1/video/Downloads:/tvdownloads 
            - /volume1/video/FilmDownloads:/filmdownloads 
            - /volume1/video/MusicDownloads:/musicdownloads
        network_mode: service:expressvpn
        restart: unless-stopped

    prowlarr:
        image: linuxserver/prowlarr:develop
        container_name: prowlarr
        environment:
            - PUID=1024
            - PGID=101
            - TZ=GB
        volumes:
            - /volume1/dockerdata/prowlarr:/config
        restart: unless-stopped
        network_mode: service:expressvpn
        depends_on:
            - expressvpn
            - qbittorrent
            
    sonarr:
        image: linuxserver/sonarr:latest
        container_name: sonarr_v3
        environment:
            - PUID=1024
            - PGID=101
            - TZ=GB
        volumes:
            - /etc/localtime:/etc/localtime:ro
            - /volume1/dockerdata/sonarr/config:/config
            - /volume1/video/TV:/tv
            - /volume1/video/Downloads:/downloads
        restart: unless-stopped
        network_mode: service:expressvpn
        depends_on:
            - prowlarr
            - qbittorrent

    radarr:
        image: linuxserver/radarr:latest
        container_name: radarr_v3
        environment:
            - PUID=1024
            - PGID=101
            - TZ=GB
        volumes:
            - /etc/localtime:/etc/localtime:ro
            - /volume1/dockerdata/radarr3/config:/config
            - /volume1/video/Films:/movies
            - /volume1/video/FilmDownloads:/downloads
        restart: unless-stopped
        network_mode: service:expressvpn
        depends_on:
            - prowlarr
            - qbittorrent

    lidarr:
        image: linuxserver/lidarr
        container_name: lidarr
        environment:
            - PUID=1024
            - PGID=101
            - TZ=GB
        volumes:
            - /etc/localtime:/etc/localtime:ro
            - /volume1/dockerdata/lidarr/config:/config
            - /volume1/music:/music
            - /volume1/video/MusicDownloads:/downloads
        restart: unless-stopped
        network_mode: service:expressvpn
        depends_on:
            - prowlarr
            - qbittorrent
    plex:
        container_name: plex
        image: linuxserver/plex
        devices:
            - /dev/dri:/dev/dri
        privileged: true
        environment:
            PGID: '101'
            PUID: '1024'
            VERSION: docker
        network_mode: host
        restart: unless-stopped
        volumes:
            - /volume1/dockerdata/plex:/config:rw
            - /volume1/video/TV:/tv:rw
            - /volume1/video/Films:/movies:rw
            - /volume1/music:/music:rw
    get_player:
        container_name: get_iplayer
        image: kolonuk/get_iplayer
        environment:
            PGID: '101'
            PUID: '1024'
        ports:
            - 8181:8181/tcp
        restart: unless-stopped
        volumes:
            - /etc/localtime:/etc/localtime:ro
            - /volume1/dockerdata/get_iplayer:/root/.get_iplayer:rw
            - /volume1/video/Downloads/iPlayer:/root/output:rw  

Docker Compose for Entertainment Stack

My very own docker compose stack for entertainment.

They are all in the same network of ‘entertainment’ so linking apps together is as easy as http://prowlarr:9696 – no need for ip address of prowlarr 🙂

# bazarr
# jellyfin
# overseerr
# plex
# prowlarr
# radarr
# sonarr
# tautulli
# watchtower

version: "3.6"

services:          
    bazarr:
        image: lscr.io/linuxserver/bazarr:latest
        container_name: bazarr
        environment:
            - PUID=1000
            - PGID=1000
            - TZ=Australia/Perth
        volumes:
            - bazarr_config:/config
            - /mnt/media:/mnt/media
            - /mnt/storage:/mnt/storage
            - /mnt/downloads:/mnt/downloads
        ports:
            - 6767:6767
        restart: unless-stopped
        networks:
            - myNetwork
    
    jellyfin:
        image: lscr.io/linuxserver/jellyfin:latest
        container_name: jellyfin
        environment:
            - PUID=1000
            - PGID=1000
            - TZ=Australia/Perth
            - JELLYFIN_PublishedServerUrl=192.168.0.5 # optional
        volumes:
            - jellyfin_config:/config
            - /mnt/media:/mnt/media
            - /mnt/storage:/mnt/storage
            - /mnt/downloads:/mnt/downloads
        ports:
            - 8096:8096
            - 8920:8920 # optional
            - 7359:7359/udp # optional
            - 1900:1900/udp # optional
        restart: unless-stopped
        networks:
            - myNetwork
    
    overseerr:
        container_name: overseerr
        hostname: overseerr
        image: sctx/overseerr:latest
        restart: unless-stopped
        ports:
            - 5055:5055
        volumes:
            - overseerr_config:/app/config
            - /mnt/media:/mnt/media
            - /mnt/storage:/mnt/storage
            - /mnt/downloads:/mnt/downloads
        environment:
            - LOG_LEVEL=debug
            - TZ=Australia/Perth
        networks:
            - myNetwork
                     
    plex:
        image: lscr.io/linuxserver/plex:latest
        container_name: plex
        network_mode: host
        ports:
            - 32400:32400
        environment:
            - PUID=1000
            - PGID=1000
            - TZ=Australia/Perth
            - VERSION=docker
            - PLEX_CLAIM= # optional
        volumes:
            - /mnt/plex:/config
            - /mnt/media:/mnt/media
            - /mnt/storage:/mnt/storage
            - /mnt/downloads:/mnt/downloads
        restart: unless-stopped
        # networks:
        #    - myNetwork
                    
    prowlarr:
        image: lscr.io/linuxserver/prowlarr:latest
        container_name: prowlarr
        environment:
            - PUID=1000
            - PGID=1000
            - TZ=Australia/Perth
        volumes:
            - prowlarr_config:/config
            - /mnt/media:/mnt/media
            - /mnt/storage:/mnt/storage
            - /mnt/downloads:/mnt/downloads
        ports:
            - 9696:9696
        restart: unless-stopped
        networks:
            - myNetwork
            
    radarr:
        image: lscr.io/linuxserver/radarr:latest
        container_name: radarr
        environment:
            - PUID=1000
            - PGID=1000
            - TZ=Australia/Perth
        volumes:
            - radarr_config:/config
            - /mnt/media:/mnt/media
            - /mnt/storage:/mnt/storage
            - /mnt/downloads:/mnt/downloads
        ports:
            - 7878:7878
        restart: unless-stopped
        networks:
            - myNetwork
            
    sonarr:
        image: lscr.io/linuxserver/sonarr:latest
        container_name: sonarr
        environment:
            - PUID=1000
            - PGID=1000
            - TZ=Australia/Perth
        volumes:
            - sonarr_config:/config
            - /mnt/media:/mnt/media
            - /mnt/storage:/mnt/storage
            - /mnt/downloads:/mnt/downloads
        ports:
            - 8989:8989
        restart: unless-stopped
        networks:
            - myNetwork
            
    tautulli:
        image: lscr.io/linuxserver/tautulli:latest
        container_name: tautulli
        environment:
            - PUID=1000
            - PGID=1000
            - TZ=Australia/Perth
        volumes:
            - tautulli_config:/config
        ports:
            - 8181:8181
        restart: unless-stopped
        networks:
            - myNetwork
        
    watchtower:
        container_name: watchtower
        hostname: watchtower
        image: containrrr/watchtower
        environment:
            - TZ=Australia/Perth
        restart: unless-stopped
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
        command: --cleanup
            
networks:
    myNetwork:
        name: entertainment     
           
volumes:
    bazarr_config:
    jellyfin_config:
    overseerr_config:
    prowlarr_config:
    radarr_config:
    sonarr_config:
    tautulli_config:

Plex settings in web app (Subtitles, Audio)

Dad Help #1

Using the web app version of Plex – https://app.plex.tv my Dad was unsure on how to change the audio settings and turn subtitles on / off. Hopefully these might help someone else’s Dad too 😉

Mouseover the movie until the bottom Plex bar appears and click on the ‘Settings’

Then change any of the settings

Once finished, click the Settings button again to close the options

😀

Portainer – Deleting broken stack throwing errors (Linux)

Every now and again a stack will break and throw and error that the docker-compose.yml does not exist so it can not be deleted..

To remove the stack a new one will need to be created. If you copy the link to the broken container, it will show an ID number.
Take note of this as it directly refers to the location of the missing docker-compose.yml file.

In the terminal, list the contents of the stored docker-compose.yml files (default):

sudo ls /var/lib/docker/volumes/portainer_data/_data/compose/


The number you took down earlier should be missing.
Let’s make a directory with your missing number:

sudo mkdir /var/lib/docker/volumes/portainer_data/_data/compose/<number>


Now we need to make up a docker-compose.yml file:

sudo nano /var/lib/docker/volumes/portainer_data/_data/compose/<number>/docker-compose.yml


Just so a change is made, I place a single # (hash / pound) to comment as to register a change.

Save the file by pressing [ctrl] + [X], then [Y], then [enter].

Now go back to your portainer webUI and the broken stack will delete!

😀

ExpressVPN – Hourly random smart server reconnect (Linux)

This will force a disconnect, then a re-connect to a random server hourly. There are a few other options included. The original article can be sourced here.

Firstly open a terminal and type:

sudo crontab -e


This will open the CRON list where you can set script to run at certain intervals. In this case we want this event to happen on reboot.
Add at the bottom:

# MY CRON FILE
MAILTO=""
@reboot expressvpn connect


Now save the file by pressing [ctrl] + [X], then [Y], then [enter].
Now reboot your system.

sudo reboot


Once again in the terminal, type:

expressvpn status


This will tell you which server you are connected too. To make this switch locations automatically, type this in the terminal:

sudo nano /usr/sbin/smartexpressvpn.sh


Now paste this into the blank file:

expressvpn disconnect
expressvpn refresh

# Chose any of the below
# This will make you hop all over the world
VPN=$(expressvpn list all | tail -n +4 | awk '{ print $1 }' | shuf -n 1)

# This will make you hop around using recommended connections
# VPN=$(expressvpn list all | grep ‘\Y$’ | tail -n +4 | awk '{ print $1 }' | shuf -n 1)

# Use a custom list to connect to servers in the vicinity.
# VPN=$(cat /mnt/scripts/conf/expressvpn_EU_list.txt | tail -n +4 | awk '{ print $1 }' | shuf -n 1)

expressvpn connect $VPN


Save the file by pressing [ctrl] + [X], then [Y], then [enter].
Now we need to make this bash script file executable and we do that by running the following commands from terminal:

sudo chmod +x /usr/sbin/smartexpressvpn.sh


If you want to test the script, type this in the command line:

/usr/sbin/smartexpressvpn.sh


Check where you are connected by typing:

expressvpn status


This should have changed!
Now to make this run every hour of every day automagically!

sudo crontab -e


Modify the contents to:

# MY CRON FILE
MAILTO=""
@reboot expressvpn connect
0 */1 * * * /usr/sbin/smartexpressvpn.sh


Save the file by pressing [ctrl] + [X], then [Y], then [enter].

You’re done!
Every hour on the hour your expressvpn should change locations.
Thanks to Ubuntu 101 for the guide and the commenters for cleaning up the code.

😀

T300RS Thrustmaster Wheel – Forza 5 menu constantly pops up (Windows)

Recently was given a T300RS Thustmaster Wheel, kept [alt] + [tab] ‘ing out of the game to configure the options. When re-joining my game I could not exit out of the menu screen.

After a little hunting on the internet I found you can flick to windowed mode, then fullscreen and this solves the issue.

Or if you prefer a shortcut:

[alt] + [enter]

Do this twice, and your game should flick to windowed mode then back to fullscreen.

😀

WordPress – Solving 404 error when changing permalinks on Nginx

I’m currently running WordPress on a Virtual Linux Machine (Debian 11) using Nginx as my web server engine.
Being new to the world of blogging I noticed my URL’s end with https://richay.com.au/?page_id=2
Where an easier URL to remember would be much better. This feature is offered in the admin panel of WordPress in Settings -> Permalinks
Where I chose to have my post name as my link.

This immediately gave 404 errors on all except my homepage of https://richay.com.au/
To remedy this and have my links working again, I had to edit my Nginx default settings:

sudo nano /etc/nginx/sites-enabled/default


Replacing the part of the code:

location / {
    try_files $uri $uri/ =404;
}


With:

location / {
    try_files $uri $uri/ /index.php?$args;
}


All links started working instantly and my page does not show the miserable 404 error.
My blog page is now https://richay.com.au/blog/

🙂

Accessing Kali Linux through Guacamole SSH

SSH failed to connect my Kali through guacamole. Reading up, I found this article from 3rd May 2022 on reddit.

“Knowing very little about any of this, but it seems like Guacamole only supports ssh-dss and ssh-rsa, and both have been disabled in Ubuntu.

DSS was removed 8 years ago and it seems from my quick google that RSA has been deprecated, so hopefully Guacamole updates sometime soon.

In the meantime a workaround is adding “HostKeyAlgorithms +ssh-rsa” to the end of /etc/ssh/sshd_config on the Ubuntu machine and restart sshd. Note: I don’t have an understanding of the security implications of this, so use at your own risk”

-UniqueCSX


This involves editing sshd_config

sudo nano /etc/ssh/sshd_config


Then adding

HostKeyAlgorithms +ssh-rsa


[ctrl] + [x] to exit, [y] to overwrite, [enter] to confirm

Use at your own risk, hopefully by the time you read this the roundabout way wont be needed.

😀

Nextcloud – NAS storage 0770 error

Common Nextcloud first run error. Usually appears after changing the /data location.

In my case, it was when I setup Nextcloud to use my Windows NAS.

The easiest solution is to edit the config.php file on your install server (change the path to reflect your install location).

A) For regular installation:

sudo nano /var/www/nextcloud/config/config.php


B) For Docker

sudo docker exec -it nextcloud /bin/bash
nano /config/www/nextcloud/config/config.php


In here we can add the line

'check_data_directory_permissions' => false,

[ctrl] + [x], then [y] to save, then [enter] to write and close.

This will skip the permission check and allow use of the mounted storage.
Much easier way than dealing with permissions and messing with fstab.

😀

Windows share with Linux (fstab)

One major hurdle I had when starting off was being able to use my NAS (Network Attached Storage) with my Linux VM’s (Virtual Machines).

Debian 11 is my flavour of choice, with cifs-utils being installed as a prerequisite.

Linux needs to mount the shares on bootup to achieve maximum uptime and autonomy. I achieved in editing the fstab file.

sudo nano /etc/fstab


This allows me to edit the Linux system’s filesystem table.
Scrolling down to the bottom, I added these lines, replacing everything in the brackets with my configuration.

//[URL]/[sharename] /media/[mountpoint] cifs vers=3.0,credentials=/home/[username]/.sharelogin,iocharset=utf8,file_mode=0777,dir_mode=0777,uid=[username],gid=[username],nofail 0 0


To not have my share login info so easily accessible, I placed them in them in a file called ‘credentials’ located in the /home/[username] directory with permissions -rw------- and it is owned by my user.

sudo nano /home/[username]/.sharelogin


The layout of this file:

username=[username]
password=[password]
domain=[domain]


I currently only use username and password for my shares so remove the domain altogether from the file.

😀