Raspberry Pi - Setup

Installation des paquets

sudo apt install \
zsh \
vim \
git \
zsh-autosuggestions \
zsh-syntax-highlighting \
rsync \
wget curl

Sécurisation du user

sudo visudo

Ajouter la ligne :

nomuser        ALL=(ALL:ALL) ALL

Supprimer la config sans password :

sudo rm /etc/sudoers.d/010_pi-nopasswd

Installer les paquets nécessaires

sudo apt update
sudo apt upgrade
sudo apt install nginx certbot software-properties-common python3-certbot-dns-ovh

Création de la configuration OVH

sudo mkdir -p certbot
sudo vim certbot/ovh.ini

Renseigner les variables suivantes dans certbot/ovh.ini :

dns_ovh_endpoint = ovh-eu
dns_ovh_application_key = xxx
dns_ovh_application_secret = xxx
dns_ovh_consumer_key = xxx

Créer un script generate-certificate.sh pour générer un certificat :

#!/bin/bash

echo "$(date +"%d:%m:%Y %H:%M:%S")"

certbot certonly --dns-ovh --dns-ovh-credentials /home/nomuser/certbot/ovh.ini --non-interactive --agree-tos --email user@email.fr -d domain.com -d *.domain.com

Gérer les droits sur les fichiers :

sudo chmod 600 certbot/ovh.ini
sudo chmod +x certbot/generate-certificate.sh

Créer une cron :

sudo crontab -e

Ajouter la ligne :

0 12 * * 1 /home/nomuser/certbot/generate-certificate.sh > /var/log/certbot.cron.log 2>&1

Ça tentera un renouvellement des DNS chaque lundi à 12h.

qbittorrent

Installation

Documentation officielle

Configuration dans l'interface

-> Tools -> Options

Downloads

  • Changer le "Default Save Path" vers
    dossier/plex/videos
  • Activer et changer "Keep incomplete torrents in" vers
    dossier/plex/downloading
  • Activer et changer "Copy .torrent files to:" vers
    dossier/plex/torrents

Web UI

  • Changer le nom d'utilisateur et le mot de passe
  • Mettre le port 8000

Configuration dans Nginx

Voir la configuration finale sur le repo sid ;)

Plex

Installation

curl https://downloads.plex.tv/plex-keys/PlexSign.key | gpg --dearmor | sudo tee /usr/share/keyrings/plex-archive-keyring.gpg >/dev/null

echo "deb [signed-by=/usr/share/keyrings/plex-archive-keyring.gpg] https://downloads.plex.tv/repo/deb public main" | sudo tee /etc/apt/sources.list.d/plexmediaserver.list

sudo apt update 

sudo apt install plexmediaserver