X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=support%2Fdoc%2Fproduction.md;h=fd29571596efb76b0b99cd3ad464f67ce1fc2638;hb=396f224b5c798ff4a300ca5c937ddee7a9dfee47;hp=5c21ab772f5c71fb35ea71704123819aa21d68cc;hpb=749cedcc6043f98e9182f4e2246e90538d03ffa5;p=github%2FChocobozzz%2FPeerTube.git diff --git a/support/doc/production.md b/support/doc/production.md index 5c21ab772..fd2957159 100644 --- a/support/doc/production.md +++ b/support/doc/production.md @@ -1,15 +1,15 @@ # Production guide * [Installation](#installation) - * [Upgrade](#upgrade) + * [Upgrade](#upgrade) ## Installation -**Please don't install PeerTube for production on a small device behind a low bandwidth connection (example: a Raspberry PI behind your ADSL link) because it could slow down the fediverse.** +Please don't install PeerTube for production on a small device behind a low bandwidth connection (example: a Raspberry PI behind your ADSL link) because it could slow down the fediverse. See the [FAQ](https://github.com/Chocobozzz/PeerTube/blob/develop/FAQ.md#should-i-have-a-big-server-to-run-peertube) for more information. ### Dependencies -Follow the steps of the [dependencies guide](dependencies.md). +**Follow the steps of the [dependencies guide](dependencies.md).** ### PeerTube user @@ -24,6 +24,14 @@ Set its password: $ sudo passwd peertube ``` +**On FreeBSD** + +``` +$ sudo pw useradd -n peertube -d /var/www/peertube -s /usr/local/bin/bash -m +$ sudo passwd peertube +``` +or use `adduser` to create it interactively. + ### Database Create the production database and a peertube user inside PostgreSQL: @@ -51,7 +59,13 @@ $ sudo -u peertube wget -q "https://github.com/Chocobozzz/PeerTube/releases/down $ sudo -u peertube unzip peertube-${VERSION}.zip && sudo -u peertube rm peertube-${VERSION}.zip ``` -Install Peertube +*If you're using CentOS7, do not forget to activate the devtoolset-7 software collection. +And after that, follow the step as usual. Do not forget to exit the environment after installing Peertube:* +``` +$ sudo scl enable devtoolset-7 bash +``` + +Install Peertube: ``` $ cd ../ && sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest $ cd ./peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile @@ -68,6 +82,8 @@ $ cd /var/www/peertube && sudo -u peertube cp peertube-latest/config/production. Then edit the `config/production.yaml` file according to your webserver configuration. +**PeerTube does not support webserver host change**. Keep in mind your domain name is definitive after your first PeerTube start. + ### Webserver We only provide official configuration files for Nginx. @@ -109,9 +125,16 @@ Now you have the certificates you can reload nginx: $ sudo systemctl reload nginx ``` -### Systemd +**FreeBSD** +On FreeBSD you can use [Dehydrated](https://dehydrated.io/) `security/dehydrated` for [Let's Encrypt](https://letsencrypt.org/) + +``` +$ sudo pkg install dehydrated +``` + +### systemd -Copy the SystemD configuration template: +If your OS uses systemd, copy the configuration template: ``` $ sudo cp /var/www/peertube/peertube-latest/support/systemd/peertube.service /etc/systemd/system/ @@ -136,7 +159,7 @@ If you want to start PeerTube on boot: $ sudo systemctl enable peertube ``` -### Run +Run: ``` $ sudo systemctl start peertube @@ -145,7 +168,7 @@ $ sudo journalctl -feu peertube ### FreeBSD -Copy the startup script and update rc.conf: +If you're using FreeBSD, copy the startup script and update rc.conf: ``` $ sudo cp /var/www/peertube/peertube-latest/support/freebsd/peertube /usr/local/etc/rc.d/ @@ -153,7 +176,7 @@ $ sudo chmod +x /usr/local/etc/rc.d/peertube $ sudo echo peertube_enable="YES" >> /etc/rc.conf ``` -#### Run +Run: ``` $ sudo service peertube start @@ -168,15 +191,25 @@ logs. You can set another password with: $ cd /var/www/peertube/peertube-latest && NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u root ``` -Now you can subscribe to the mailing list for PeerTube administrators: https://framalistes.org/sympa/subscribe/peertube-admin +### What now? + +Now your instance is up you can: + + * Subscribe to the mailing list for PeerTube administrators: https://framalistes.org/sympa/subscribe/peertube-admin + * Add you instance to the public PeerTube instances index if you want to: https://instances.peertu.be/ ## Upgrade +### PeerTube code + +**Check the changelog (in particular BREAKING CHANGES!):** https://github.com/Chocobozzz/PeerTube/blob/develop/CHANGELOG.md + #### Auto (minor versions only) +The password it asks is PeerTube's database user password. + ``` -$ cd /var/www/peertube/peertube-latest/scripts && sudo -u peertube ./upgrade.sh -$ sudo systemctl restart peertube && sudo journalctl -fu peertube +$ cd /var/www/peertube/peertube-latest/scripts && sudo -H -u peertube ./upgrade.sh ``` #### Manually @@ -208,7 +241,7 @@ Install node dependencies: ``` $ cd /var/www/peertube/versions/peertube-${VERSION} && \ - sudo -u peertube yarn install --production --pure-lockfile + sudo -H -u peertube yarn install --production --pure-lockfile ``` Copy new configuration defaults values and update your configuration file: @@ -226,13 +259,45 @@ $ cd /var/www/peertube && \ sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest ``` +### nginx + +Check changes in nginx configuration: + +``` +$ cd /var/www/peertube/versions +$ diff "$(ls --sort=t | head -2 | tail -1)/support/nginx/peertube" "$(ls --sort=t | head -1)/support/nginx/peertube" +``` + +### systemd + +Check changes in systemd configuration: + +``` +$ cd /var/www/peertube/versions +$ diff "$(ls --sort=t | head -2 | tail -1)/support/systemd/peertube.service" "$(ls --sort=t | head -1)/support/systemd/peertube.service" +``` + +### Restart PeerTube + +If you changed your nginx configuration: + +``` +$ sudo systemctl reload nginx +``` + +If you changed your systemd configuration: + +``` +$ sudo systemctl daemon-reload +``` + +Restart PeerTube and check the logs: -Restart PeerTube: ``` -$ sudo systemctl restart peertube +$ sudo systemctl restart peertube && sudo journalctl -fu peertube ``` -### Things went wrong? +### Things went wrong? Change `peertube-latest` destination to the previous version and restore your SQL backup: