Ceci est une ancienne révision du document !
Peertube
BROUILLON
Le tuto est tester et optimiser pour Debian stretch x64. Avec la documentation officielle , elle est généraliser pour toutes les configurations
Dépendance
apt remove apache2* apt install curl sudo unzip vim apt-transport-https apt install ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git
NB: ffmpeg > 3
nano /etc/apt/sources.list deb http://ftp.debian.org/debian stretch-backports main apt update && apt upgrade
Certbot
apt install python-certbot-nginx nginx -t stretch-backports certbot --nginx certbot --nginx certonly
nodeJS 8.x
Dans les sources :
apt install nodejs -t stretch-backports
Sinon:
Yarn > 1.5
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list apt update && apt install yarn
je ne sais pas
systemctl start redis postgresql
PeerTube user
Créer un user peertube avec /var/www/peertube home:
J'ai pas réussi mon premier essai sans le sudo , j 'ai besoin d'un coach adduser user sudo
sudo useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube
Le mot de passe:
sudo passwd peertube
Database
sudo -u postgres createuser -P peertube sudo -u postgres createdb -O peertube peertube_prod
sudo -u postgres psql -c "CREATE EXTENSION pg_trgm;" peertube_prod sudo -u postgres psql -c "CREATE EXTENSION unaccent;" peertube_prod
Mise en place de Peertube
Préparer le répertoire PeerTube
Vérification de la dernière version:
VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4) && echo "Latest Peertube version is $VERSION"
Ouvrir le répertoire Peertube et mettre des droits
cd /var/www/peertube && sudo -u peertube mkdir config storage versions && cd versions
Télécharger la dernière version du client Peertube, décompresser et enlever le zip :
sudo -u peertube wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" sudo -u peertube unzip peertube-${VERSION}.zip && sudo -u peertube rm peertube-${VERSION}.zip
Installation de Peertube
cd ../ && sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest cd ./peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile
PeerTube configuration
Copier l’exemple de configuration:
cd /var/www/peertube && sudo -u peertube cp peertube-latest/config/production.yaml.example config/production.yaml
Éditer le fichier config/production.yaml
PeerTube ne supporte pas le changement d'host , il est définitif
Webserver
Copier la configuration nginx:
sudo cp /var/www/peertube/peertube-latest/support/nginx/peertube /etc/nginx/sites-available/peertube
Then modify the webserver configuration file. Please pay attention to the alias keys of the static locations. It should correspond to the paths of your storage directories (set in the configuration file inside the storage key).
sudo vim /etc/nginx/sites-available/peertube
Activer le fichier de configuration :
sudo ln -s /etc/nginx/sites-available/peertube /etc/nginx/sites-enabled/peertube
To generate the certificate for your domain as required to make https work you can use Let's Encrypt:
sudo systemctl stop nginx sudo vim /etc/nginx/sites-available/peertube # Comment ssl_certificate and ssl_certificate_key lines sudo certbot --authenticator standalone --installer nginx --post-hook "systemctl start nginx" sudo vim /etc/nginx/sites-available/peertube # Uncomment ssl_certificate and ssl_certificate_key lines sudo systemctl reload nginx
Ce rappeler qu'il faut le renouveler tous les 90 jours !
Recharger nginx:
sudo systemctl reload nginx
TCP/IP Tuning
sudo cp /var/www/peertube/peertube-latest/support/sysctl.d/30-peertube-tcp.conf /etc/sysctl.d/ sudo sysctl -p /etc/sysctl.d/30-peertube-tcp.conf
Your distro may enable this by default, but at least Debian 9 does not, and the default FIFO scheduler is quite prone to “Buffer Bloat” and extreme latency when dealing with slower client links as we often encounter in a video server.
systemd
Si votre OS utilise systemd, copier la configuration suivante:
sudo cp /var/www/peertube/peertube-latest/support/systemd/peertube.service /etc/systemd/system/
mettre à jour le fichier service :
sudo vim /etc/systemd/system/peertube.service
Dire au systemd de relire la config:
sudo systemctl daemon-reload
Si vous voulez que Peerture redémarre au boot:
sudo systemctl enable peertube
Démarrer:
sudo systemctl start peertube sudo journalctl -feu peertube
Configuration css
--mainColor: #{$orange-color};
--mainHoverColor: #{$orange-hoover-color};
--mainBackgroundColor: #{$bg-color};
--mainForegroundColor: #{$fg-color};
--menuBackgroundColor: #{$menu-background};
--menuForegroundColor: #{$menu-color};
--submenuColor: #{$sub-menu-color};
--inputColor: #{$input-background-color};
--inputPlaceholderColor: #{$input-placeholder-color};
source : https://github.com/Chocobozzz/PeerTube/blob/develop/support/doc/production.md





