Outils pour utilisateurs

Outils du site


peertube_installation_et_configuration

Ceci est une ancienne révision du document !


Peertube ? Installation et configurations

Peertube est un logiciel libre pour reprendre le contrôle de vos vidéos en ligne.

PeerTube, développé par Framasoft, est l'alternative libre et décentralisée aux plateformes vidéos, qui vous donne accès à plus de 400 000 vidéos proposées par 60 000 utilisateur⋅ices et visionnées plus de 15 millions de fois

Ce logiciel en ligne permet donc d'héberger toutes sortes de vidéos et de fichiers audio et il permet également de faire de la diffusion en direct - du live streaming

Le site officiel - la page github

Installation sur Debian 10 apache

On installe au préalable quelques outils :

apt install htop nano nload iotop wget locate tmux net-tools

On commence ensuite en suivant ce beau tuto tout en gardant un oeil sur la documentation officielle

Il y a un choix à faire sur le format des vidéos et de la diffusion : WebTorrent transcoding ou HLS transcoding

Installation ligne droite

Copié collé brut à compléter …

apt install curl
curl -sL https://deb.nodesource.com/setup_10.x | bash -E -
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 unzip xz-utils nodejs yarn ffmpeg postgresql postgresql-contrib postgresql postgresql-client g++ make redis-server
mkdir -p /var/www/tube.futuretic.fr
useradd -s /bin/bash -d /var/www/tube.futuretic.fr peertube
chown -R peertube.peertube /var/www/tube.futuretic.fr
chmod 2770 /var/www/tube.futuretic.fr
su - postgres
createuser peertube -d -P -R
createdb -O peertube peertube
psql -c "CREATE EXTENSION pg_trgm;" peertube
psql -c "CREATE EXTENSION unaccent;" peertube
exit
su - peertube
mkdir -p config storage versions etc var/log/apache2
cd versions
VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4)
wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.tar.xz"
tar -xJf peertube-${VERSION}.tar.xz
rm -f peertube-${VERSION}.tar.xz
cd ../
ln -s versions/peertube-${VERSION} ./peertube-latest
cd ./peertube-latest
yarn install --production --pure-lockfile
cp ./config/production.yaml.example ../../config/production.yaml
cp ./config/local-test.json ../../config/local-production.json
nano config/production.yaml
...
webserver:
  https: true
  hostname: 'tube.futuretic.fr'
  port: 443
...
database:
  hostname: 'localhost'
  port: 5432
  suffix: ''
  username: 'peertube'
  password: 'peertube'
...
storage:
  tmp: '/var/www/tube.futuretic.fr/storage/tmp/' # Used to download data (imports etc), store uploaded files before processing...
  avatars: '/var/www/tube.futuretic.fr/storage/avatars/'
  videos: '/var/www/tube.futuretic.fr/storage/videos/'
  streaming_playlists: '/var/www/tube.futuretic.fr/storage/streaming-playlists/'
  redundancy: '/var/www/tube.futuretic.fr/storage/videos/'
  logs: '/var/www/tube.futuretic.fr/storage/logs/'
  previews: '/var/www/tube.futuretic.fr/storage/previews/'
  thumbnails: '/var/www/tube.futuretic.fr/storage/thumbnails/'
  torrents: '/var/www/tube.futuretic.fr/storage/torrents/'
  captions: '/var/www/tube.futuretic.fr/storage/captions/'
  cache: '/var/www/tube.futuretic.fr/storage/cache/'
  plugins: '/var/www/tube.futuretic.fr/storage/plugins/'
...
instance:
  name: 'PeerTube FuturEtic'
  short_description: 'PeerTube, a federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.'
  description: 'Peertube FuturEtic, nos vidéos à nous' # Support markdown

virer le préfixe _prod dans fichier config !

Ajouter cette ligne (enabled: true) dans la partie email faire marcher l'envoi de mail en smtp :

email:
  enabled: true
cp /var/www/tube.futuretic.fr/peertube-latest/support/sysctl.d/30-peertube-tcp.conf /etc/sysctl.d/
cp /var/www/tube.futuretic.fr/peertube-latest/support/systemd/peertube.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable peertube
systemctl start peertube
systemctl status peertube
su - peertube
cd peertube-latest
# à faire en tant que root il me semble
NODE_CONFIG_DIR=/var/www/tube.futuretic.fr/config NODE_ENV=production npm run reset-password -- -u root

Installer Apache2 et ses modules

apt install apache2
a2enmod proxy proxy_http proxy_wstunnel ssl http2 rewrite headers

Générer un certificat ssl après avoir installé snap puis certbot

apt install snapd
snap install core
snap install hello-world
snap refresh core
snap install --classic certbot
ln -s /snap/bin/certbot /usr/bin/certbot

Pour générer ce premier certificat, on va utiliser le vhost par défaut d'apache 000-default.conf en changeant simplement le ServerName pour tube.futuretic.fr

cd /etc/apache2/sites-enabled/
cd ../sites-available/
nano 000-default.conf 
systemctl reload apache2
certbot certonly --apache

On va ensuite pouvoir mettre en place le vhost définitif

vhost apache 
peertube_installation_et_configuration.1619041746.txt.gz · Dernière modification : 2021/04/21 21:49 de Labomedia