Categories
Docker Linux

How To Install Extensions In FreshRSS When Using Docker Compose

```
version: "2.1"
services:
  freshrss:
    image: lscr.io/linuxserver/freshrss
    container_name: freshrss
    environment:
      - PUID=1000
      - PGID=100
      - TZ=America/Detroit
      - CRON_MIN=0,15,30,45
    volumes:
      - /srv/dev-disk-by-uuid-865e9bc7-b641-472e-be84-a6d7988d63ee/AppData/freshrss2:/config
      - /srv/dev-disk-by-uuid-865e9bc7-b641-472e-be84-a6d7988d63ee/AppData/freshrss2/www/freshrss/extensions:/extensions
    ports:
      - 8182:80
      - 467:443
Categories
Linux Raspberry Pi

How To Configure Gluetun With AirVPN, qBittorrent and SABnzbd in Docker Compose

Recently I had to scratch my head for a few hours to get all this to work together in Portainer stacks, so I thought I’d list my process here for anyone else having trouble.

This guide assumes that you have

  • An Airvpn account
  • Docker and Docker Compose installed
  • I used Portainer stacks for the YAML files listed below

Go to: https://airvpn.org/generator/

Under Protocols, choose Wireguard UDP
Select your options, the click “Generate” at the bottom of the page.
Your system will download a .conf filed called something like: AirVPN_Canada_UDP-1637.conf
Open this file in a text editor.

It’s going to look something like this:

[Interface]
Address = 10.111.111.111/32, 1234:1234:1234:1234:1234:1234:1234:123a/128
PrivateKey = dGhpcyBpcyB5b3VyIHByaXZhdGUga2V5Cg==
DNS = 10.111.0.1, g3g3:67ff:g96g:b993::1

[Peer]
PublicKey = dGhpcyBpcyB5b3VyIHB1YmxpYyBrZXk=
PresharedKey = dGhpcyBpcyB5b3VyIHByZXNoYXJlZCBrZXkK=
Endpoint = ca.vpn.airdns.org:1638
AllowedIPs = 0.0.0.0/0, ::/0
PersistentKeepalive = 15

For your docker compose yaml file you will need:

  • The first part of Address before the comma on line 2 (10.111.111.111/32)
  • The PrivateKey
  • The PresharedKey

Your gluetun Docker Compose file will look something like this:

version: "3"
services:
  gluetun:
    image: qmcgaw/gluetun
    container_name: gluetun_wireguard #change this if needed
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    ports:
      - 8888:8888/tcp
      - 8388:8388/tcp
      - 8388:8388/udp
      - 8100:8000 # Remote Control VPN
      - 7979:7979 # qbittorrent
      - 8080:8080 # sabnzbd
    volumes:
      - /path/to/your/folder:/gluetun #change this if needed
    environment:
      - SERVER_COUNTRIES=Canada #change this if needed
      - VPN_SERVICE_PROVIDER=airvpn
      - VPN_TYPE=wireguard
      - WIREGUARD_PRIVATE_KEY=dGhpcyBpcyB5b3VyIHByaXZhdGUga2V5Cg== # this comes from your downloaded .conf file
      - WIREGUARD_PRESHARED_KEY=dGhpcyBpcyB5b3VyIHByZXNoYXJlZCBrZXkK= # this comes from your downloaded .conf file
      - WIREGUARD_ADDRESSES=10.111.111.111/32 # this comes from your downloaded .conf file
      - FIREWALL_VPN_INPUT_PORTS=8888
      - TZ=America/Detroit #change this if needed

Next up are your qBittorrent and SABnzbd Docker Compose files.

The primary difference between these and “non-gluetun” compose yamls is that “ports:” are not used in the yaml.
(I’ve left them in the yaml files below, but they are commented out.)
That is handled by the gluetun yaml file shown above like this:

      - 7979:7979 # qbittorrent
      - 8080:8080 # sabnzbd

qBittorrent YAML

version: "2.1"
services:
  qbittorrent:
    image: ghcr.io/linuxserver/qbittorrent
    network_mode: "container:gluetun_wireguard"
    container_name: qbittorrent-gluetun # change this if you'd like
    environment:
      - PUID=1000 # type "id" without quotes at the command line to find your own
      - PGID=1000 # type "id" without quotes at the command line to find your own
      - TZ=America/Detroit # change this if you'd like
      - WEBUI_PORT=7979
      - UMASK_SET=002
    volumes:
      - /home/pi/docker/qbittorrent:/config # you will probably need to change all these volumes
      - /mnt/OMV-Download/Finished-Downloads:/downloads
      - /mnt/OMV-Download/Incomplete-Downloads:/downloads/incomplete
      - /mnt/OMV-Download/Finished-Torrents:/downloads/finished-torrents
      - /mnt/OMV-Download/Torrent-Watch:/downloads/watch
      - /home/pi/docker/shared:/shared
#    ports:
#      - 7979:7979
#      - 6881:6881/udp
#      - 6881:6881
    restart: unless-stopped

SABnzbd YAML

version: "2.1"
services:
  sabnzbd:
    image: ghcr.io/linuxserver/sabnzbd
    network_mode: "container:gluetun_wireguard"
    container_name: sabnzbd-gluetun # change this if you'd like
    environment:
      - PUID=1000 # type "id" without quotes at the command line to find your own
      - PGID=1000 # type "id" without quotes at the command line to find your own
      - TZ=America/Detroit
    volumes:
      - /home/pi/docker/sabnzbd:/config # you will probably need to change all these volumes
      - /home/pi/docker/shared:/shared
      - /home/pi/docker/sabnzbd/scripts:/scripts
      - /mnt/OMV-Download/Finished-Downloads:/downloads
      - /home/pi/docker/sabnzbd/incomplete_downloads:/incomplete-downloads      
      - /mnt/OMV-Download/Torrent-Watch:/watch
      - /mnt/OMV-Media:/categories
      - /mnt/OMV-Media/Movies:/movies
      - /mnt/OMV-Media/Television:/television

#    ports:
#      - 8080:8080
    restart: always
Categories
Home Assistant Linux Raspberry Pi

Home Assistant – How To Run Shell Command

This brief tutorial will show you how to run a shell command and how to use it to mount media from your NAS.

(This is being written because I spent way too much time searching for how to run a Shell Command in Home Assistant.)

First, you need to know what shell command you want to run. For the purpose of this tutorial, I wanted to mount my media from a separate computer into the media section in Home Assistant running Home Assistant OS 5.12 on a Raspberry Pi3.

Put this in the Home Assistant configuration.yaml:

shell_command:

mount_media_folder: mount -t cifs -o username=myname,password=mypassword,domain=WORKGROUP //192.168.50.223/Media /media
  • username=myname (this will be your login name used to access your server hosting the media)
  • password=mypassword (this will be your password used to access your server hosting the media)
  • domain=WORKGROUP (Workgroup is a peer to peer windows computer network and this is what most are named)
  • //192.168.50.223/Media (IP address and folder of your computer/server/NAS where your media is)

mount_media_folder” is going to be the name of your shell command.

This part: mount -t cifs -o username=myname,password=mypassword,domain=WORKGROUP //192.168.50.223/Media is basically what you would put in fstab to mount your share.

This part: /media is where it’s being mounted in Home Assistant. This will make it show up in the Media Browser in HA.

To run Shell Command

In Home Assistant, go to:

  • Developer Tools
  • Services
  • Service drop down box

Find shell_command.mount_media_folder and then click the “Call Service” button.

<end of tutorial!>

Categories
Linux Logitech Media Server Raspberry Pi

Common Logitech Media Server (LMS) Commands

I’ve tried multiple self-hosted audio streaming options including: Ampache, Airsonic, Mopidy, Volumio and more.

However, I always come back to Logitech Media Server.
In my opinion, it’s the best for streaming your audio to your desk (It’s not so great for taking your tunes with you.)

I’m always tinkering or trying out new Logitech Media Server installs, and this is an accumulated Cheat Sheet of Linux/Raspberry Pi commands that I’ve used over the years.

Start, Stop, and Restart LMS

  • sudo service logitechmediaserver start
  • sudo service logitechmediaserver stop
  • sudo service logitechmediaserver restart

Get proper ownership of the main LMS directory

  • sudo chown squeezeboxserver -R /var/lib/squeezeboxserver/

Backup your LMS files

  • sudo cp -r /var/lib/squeezeboxserver MyBackupDirectory

Restore your LMS files

  • sudo service logitechmediaserver stop
  • cd MyBackupDirectory
  • sudo cp -r squeezeboxserver /var/lib/
  • sudo chown squeezeboxserver -R /var/lib/squeezeboxserver/
  • sudo service logitechmediaserver start

Need to copy your favorites back over and the “OPML Playlist Browser & Editor” isn’t cooperating?

CD to the folder where your backup is and use these commands

  • sudo service logitechmediaserver stop
  • sudo cp favorites.opml /var/lib/squeezeboxserver/prefs
  • sudo chown squeezeboxserver /var/lib/squeezeboxserver/prefs/favorites.opml
  • sudo service logitechmediaserver start

Restore just your plugins

  • sudo service logitechmediaserver stop
  • cd MyBackupDirectory/squeezeboxserver/cache/Installed Plugins
  • sudo cp -r Plugins /var/lib/squeezeboxserver/cache/InstalledPlugins/
  • sudo chown squeezeboxserver -R /var/lib/squeezeboxserver/
  • sudo service logitechmediaserver start

Installed a plugin and LMS won’t start?

  • sudo service logitechmediaserver stop
  • cd /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins
    sudo rm -r MyBadPlugin
  • sudo service logitechmediaserver start

Want to start over without reinstalling?

  • sudo service logitechmediaserver stop
  • cd /var/lib/squeezeboxserver/cache
  • sudo rm *.db
    • If you’d like to verify that you are deleting the correct db first, try this: echo sudo rm *.db which shows which db will be deleted or sudo rm -i *.db which will prompt you to delete the db before it happens.
  • sudo service logitechmediaserver start

Delete everything

  • sudo rm -r /var/lib/squeezeboxserver
  • sudo rm -r /etc/squeezeboxserver