Remove $ for bash commands

It prevents easy copy
This commit is contained in:
Chocobozzz 2023-04-04 09:16:53 +02:00
parent b5f38b7898
commit 00ee545c24
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
11 changed files with 258 additions and 258 deletions

View File

@ -91,10 +91,10 @@ to install the dependencies.
1) Fork the Github repository. 1) Fork the Github repository.
1) Run the following commands. 1) Run the following commands.
``` ```
$ git clone https://github.com/Chocobozzz/PeerTube git clone https://github.com/Chocobozzz/PeerTube
$ cd PeerTube cd PeerTube
$ git remote add me git@github.com:YOUR_GITHUB_USERNAME/PeerTube.git git remote add me git@github.com:YOUR_GITHUB_USERNAME/PeerTube.git
$ yarn install --pure-lockfile yarn install --pure-lockfile
``` ```
Note that development is done on the `develop` branch. If you want to hack on Note that development is done on the `develop` branch. If you want to hack on
@ -104,7 +104,7 @@ the `yarn install --pure-lockfile` command.
When you create a new branch you should also tell to use your repo for upload When you create a new branch you should also tell to use your repo for upload
not default one. To do just do: not default one. To do just do:
``` ```
$ git push --set-upstream me <your branch name> git push --set-upstream me <your branch name>
``` ```
Then, create a postgres database and user with the values set in the Then, create a postgres database and user with the values set in the
@ -121,8 +121,8 @@ Enter password for new role: peertube
Then enable extensions PeerTube needs: Then enable extensions PeerTube needs:
``` ```
$ sudo -u postgres psql -c "CREATE EXTENSION pg_trgm;" peertube_dev sudo -u postgres psql -c "CREATE EXTENSION pg_trgm;" peertube_dev
$ sudo -u postgres psql -c "CREATE EXTENSION unaccent;" peertube_dev sudo -u postgres psql -c "CREATE EXTENSION unaccent;" peertube_dev
``` ```
Peertube also requires a running redis server, no special setup is needed for Peertube also requires a running redis server, no special setup is needed for
@ -141,7 +141,7 @@ You can get a complete PeerTube development setup with Gitpod, a free one-click
To develop on the server-side: To develop on the server-side:
``` ```
$ npm run dev:server npm run dev:server
``` ```
Then, the server will listen on `localhost:9000`. When server source files Then, the server will listen on `localhost:9000`. When server source files
@ -157,7 +157,7 @@ More detailed documentation is available:
To develop on the client side: To develop on the client side:
``` ```
$ npm run dev:client npm run dev:client
``` ```
The API will listen on `localhost:9000` and the frontend on `localhost:3000`. The API will listen on `localhost:9000` and the frontend on `localhost:3000`.
@ -175,7 +175,7 @@ File changes are automatically recompiled, injected in the web browser (no need
and the web server is automatically restarted. and the web server is automatically restarted.
``` ```
$ npm run dev npm run dev
``` ```
### Embed ### Embed
@ -185,7 +185,7 @@ The generated files (HTML entrypoint and multiple JS and CSS files) are served b
The following command will compile embed files and run the PeerTube server: The following command will compile embed files and run the PeerTube server:
``` ```
$ npm run dev:embed npm run dev:embed
``` ```
### RTL layout ### RTL layout
@ -193,7 +193,7 @@ $ npm run dev:embed
To test RTL (right-to-left) layout using `ar` locale: To test RTL (right-to-left) layout using `ar` locale:
``` ```
$ npm run dev -- --ar-locale npm run dev -- --ar-locale
``` ```
### Testing ### Testing
@ -211,23 +211,23 @@ Create a PostgreSQL user **with the same name as your username** in order to avo
Then, we can create the databases (if they don't already exist): Then, we can create the databases (if they don't already exist):
``` ```
$ sudo -u postgres createuser you_username --createdb --superuser sudo -u postgres createuser you_username --createdb --superuser
$ createdb -O peertube peertube_test{1,2,3} createdb -O peertube peertube_test{1,2,3}
``` ```
Build the application and flush the old tests data: Build the application and flush the old tests data:
``` ```
$ npm run build npm run build
$ npm run clean:server:test npm run clean:server:test
``` ```
To run 3 nodes: To run 3 nodes:
``` ```
$ NODE_APP_INSTANCE=1 NODE_ENV=test npm start NODE_APP_INSTANCE=1 NODE_ENV=test npm start
$ NODE_APP_INSTANCE=2 NODE_ENV=test npm start NODE_APP_INSTANCE=2 NODE_ENV=test npm start
$ NODE_APP_INSTANCE=3 NODE_ENV=test npm start NODE_APP_INSTANCE=3 NODE_ENV=test npm start
``` ```
Then you will get access to the three nodes at `http://127.0.0.1:900{1,2,3}` Then you will get access to the three nodes at `http://127.0.0.1:900{1,2,3}`

View File

@ -2923,8 +2923,8 @@ This version is a pre release because it contains many important changes, and re
**Important:** Before upgrading run the following commands (no need to stop PeerTube) on your PeerTube database (in this example it's *peertube_prod*): **Important:** Before upgrading run the following commands (no need to stop PeerTube) on your PeerTube database (in this example it's *peertube_prod*):
``` ```
$ sudo -u postgres psql peertube_prod -c 'CREATE EXTENSION IF NOT EXISTS unaccent;' sudo -u postgres psql peertube_prod -c 'CREATE EXTENSION IF NOT EXISTS unaccent;'
$ sudo -u postgres psql peertube_prod -c 'CREATE EXTENSION IF NOT EXISTS pg_trgm;' sudo -u postgres psql peertube_prod -c 'CREATE EXTENSION IF NOT EXISTS pg_trgm;'
``` ```
You will need [PostgreSQL Contrib](https://www.postgresql.org/docs/9.6/static/contrib.html). You will need [PostgreSQL Contrib](https://www.postgresql.org/docs/9.6/static/contrib.html).

View File

@ -7,7 +7,7 @@
Some endpoints need authentication. We use OAuth 2.0 so first fetch the client tokens: Some endpoints need authentication. We use OAuth 2.0 so first fetch the client tokens:
```bash ```bash
$ curl https://peertube.example.com/api/v1/oauth-clients/local curl https://peertube.example.com/api/v1/oauth-clients/local
``` ```
Response example: Response example:
@ -24,7 +24,7 @@ Response example:
Now you can fetch the user token: Now you can fetch the user token:
```bash ```bash
$ curl -X POST \ curl -X POST \
-d "client_id=v1ikx5hnfop4mdpnci8nsqh93c45rldf&client_secret=AjWiOapPltI6EnsWQwlFarRtLh4u8tDt&grant_type=password&response_type=code&username=your_user&password=your_password" \ -d "client_id=v1ikx5hnfop4mdpnci8nsqh93c45rldf&client_secret=AjWiOapPltI6EnsWQwlFarRtLh4u8tDt&grant_type=password&response_type=code&username=your_user&password=your_password" \
https://peertube.example.com/api/v1/users/token https://peertube.example.com/api/v1/users/token
``` ```
@ -43,14 +43,14 @@ Response example:
Just use the `access_token` in the `Authorization` header: Just use the `access_token` in the `Authorization` header:
```bash ```bash
$ curl -H 'Authorization: Bearer 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0' https://peertube.example.com/api/v1/jobs/completed curl -H 'Authorization: Bearer 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0' https://peertube.example.com/api/v1/jobs/completed
``` ```
## List videos ## List videos
```bash ```bash
$ curl https://peertube.example.com/api/v1/videos curl https://peertube.example.com/api/v1/videos
``` ```
## Libraries ## Libraries

View File

@ -5,9 +5,9 @@
### Build & Publish ### Build & Publish
``` ```
$ cd client/src/standalone/player/ cd client/src/standalone/player/
$ npm run build npm run build
$ npm publish --access=public npm publish --access=public
``` ```
## @peertube/peertube-types ## @peertube/peertube-types
@ -17,9 +17,9 @@ Typescript definition files generation is controlled by the various `tsconfig.ty
The complete types package is generated via: The complete types package is generated via:
``` ```
$ npm run generate-types-package 4.x.x npm run generate-types-package 4.x.x
$ cd packages/types/dist cd packages/types/dist
$ npm publish --access=public npm publish --access=public
``` ```
> See [scripts/generate-types-package.ts](scripts/generate-types-package.ts) for details. > See [scripts/generate-types-package.ts](scripts/generate-types-package.ts) for details.

View File

@ -9,7 +9,7 @@ Will generate XLIFF base files for Angular (`angular.xlf`) and JSON files for th
Then, it will merge new translation keys into localized Angular files (`angular.fr-FR.xlf` etc). Then, it will merge new translation keys into localized Angular files (`angular.fr-FR.xlf` etc).
``` ```
$ npm run i18n:update npm run i18n:update
``` ```

View File

@ -5,7 +5,7 @@
To open a report of client build: To open a report of client build:
``` ```
$ npm run build -- --analyze-bundle && npm run client-report npm run build -- --analyze-bundle && npm run client-report
``` ```
## API benchmark ## API benchmark
@ -13,11 +13,11 @@ $ npm run build -- --analyze-bundle && npm run client-report
To benchmark the REST API and save result in `benchmark.json`: To benchmark the REST API and save result in `benchmark.json`:
``` ```
$ node dist/scripts/benchmark.js -o benchmark.json node dist/scripts/benchmark.js -o benchmark.json
``` ```
You can also grep on a specific test: You can also grep on a specific test:
``` ```
$ node dist/scripts/benchmark.js --grep homepage node dist/scripts/benchmark.js --grep homepage
``` ```

View File

@ -5,19 +5,19 @@
Prepare PostgreSQL user so PeerTube can delete/create the test databases: Prepare PostgreSQL user so PeerTube can delete/create the test databases:
```bash ```bash
$ sudo -u postgres createuser you_username --createdb --superuser sudo -u postgres createuser you_username --createdb --superuser
``` ```
Prepare databases: Prepare databases:
```bash ```bash
$ npm run clean:server:test npm run clean:server:test
``` ```
Build PeerTube: Build PeerTube:
```bash ```bash
$ npm run build npm run build
``` ```
## Server tests ## Server tests
@ -27,20 +27,20 @@ $ npm run build
Run docker containers needed by some test files: Run docker containers needed by some test files:
```bash ```bash
$ sudo docker run -p 9444:9000 chocobozzz/s3-ninja sudo docker run -p 9444:9000 chocobozzz/s3-ninja
$ sudo docker run -p 10389:10389 chocobozzz/docker-test-openldap sudo docker run -p 10389:10389 chocobozzz/docker-test-openldap
``` ```
Ensure you also have these commands: Ensure you also have these commands:
```bash ```bash
$ exiftool --help exiftool --help
$ parallel --help parallel --help
``` ```
Otherwise, install the packages. On Debian-based systems (like Debian, Ubuntu or Mint): Otherwise, install the packages. On Debian-based systems (like Debian, Ubuntu or Mint):
```bash ```bash
$ sudo apt-get install parallel libimage-exiftool-perl sudo apt-get install parallel libimage-exiftool-perl
``` ```
### Test ### Test
@ -48,7 +48,7 @@ $ sudo apt-get install parallel libimage-exiftool-perl
To run all test suites: To run all test suites:
```bash ```bash
$ npm run test # See scripts/test.sh to run a particular suite npm run test # See scripts/test.sh to run a particular suite
``` ```
Most of tests can be run using: Most of tests can be run using:
@ -100,7 +100,7 @@ tail -f test1/logs/peertube.log | npm run parse-log -- --level debug --files -
To run tests on local web browsers (comment web browsers you don't have in `client/e2e/wdio.local.conf.ts`): To run tests on local web browsers (comment web browsers you don't have in `client/e2e/wdio.local.conf.ts`):
```bash ```bash
$ PEERTUBE2_E2E_PASSWORD=password npm run e2e:local PEERTUBE2_E2E_PASSWORD=password npm run e2e:local
``` ```
### Browserstack tests ### Browserstack tests
@ -108,7 +108,7 @@ $ PEERTUBE2_E2E_PASSWORD=password npm run e2e:local
To run tests on browser stack: To run tests on browser stack:
```bash ```bash
$ BROWSERSTACK_USER=your_user BROWSERSTACK_KEY=your_key npm run e2e:browserstack BROWSERSTACK_USER=your_user BROWSERSTACK_KEY=your_key npm run e2e:browserstack
``` ```
### Add E2E tests ### Add E2E tests
@ -116,6 +116,6 @@ $ BROWSERSTACK_USER=your_user BROWSERSTACK_KEY=your_key npm run e2e:browserstack
To add E2E tests and quickly run tests using a local Chrome: To add E2E tests and quickly run tests using a local Chrome:
```bash ```bash
$ cd client/e2e cd client/e2e
$ ../node_modules/.bin/wdio wdio.local-test.conf.ts # you can also add --mochaOpts.grep to only run tests you want ../node_modules/.bin/wdio wdio.local-test.conf.ts # you can also add --mochaOpts.grep to only run tests you want
``` ```

View File

@ -97,7 +97,7 @@ docker-compose exec -u peertube peertube npm run reset-password -- -u root
You can also grep your peertube container's logs for the default `root` password. You're going to want to run `docker-compose logs peertube | grep -A1 root` to search the log output for your new PeerTube's instance admin credentials which will look something like this. You can also grep your peertube container's logs for the default `root` password. You're going to want to run `docker-compose logs peertube | grep -A1 root` to search the log output for your new PeerTube's instance admin credentials which will look something like this.
```bash ```bash
$ docker-compose logs peertube | grep -A1 root docker-compose logs peertube | grep -A1 root
peertube_1 | [example.com:443] 2019-11-16 04:26:06.082 info: Username: root peertube_1 | [example.com:443] 2019-11-16 04:26:06.082 info: Username: root
peertube_1 | [example.com:443] 2019-11-16 04:26:06.083 info: User password: abcdefghijklmnop peertube_1 | [example.com:443] 2019-11-16 04:26:06.083 info: User password: abcdefghijklmnop
@ -110,7 +110,7 @@ peertube_1 | [example.com:443] 2019-11-16 04:26:06.083 info: User password: abc
Run `cat ./docker-volume/opendkim/keys/*/*.txt` to display your DKIM DNS TXT Record containing the public key to configure to your domain : Run `cat ./docker-volume/opendkim/keys/*/*.txt` to display your DKIM DNS TXT Record containing the public key to configure to your domain :
```bash ```bash
$ cat ./docker-volume/opendkim/keys/*/*.txt cat ./docker-volume/opendkim/keys/*/*.txt
peertube._domainkey.mydomain.tld. IN TXT ( "v=DKIM1; h=sha256; k=rsa; " peertube._domainkey.mydomain.tld. IN TXT ( "v=DKIM1; h=sha256; k=rsa; "
"p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Dx7wLGPFVaxVQ4TGym/eF89aQ8oMxS9v5BCc26Hij91t2Ci8Fl12DHNVqZoIPGm+9tTIoDVDFEFrlPhMOZl8i4jU9pcFjjaIISaV2+qTa8uV1j3MyByogG8pu4o5Ill7zaySYFsYB++cHJ9pjbFSC42dddCYMfuVgrBsLNrvEi3dLDMjJF5l92Uu8YeswFe26PuHX3Avr261n" "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Dx7wLGPFVaxVQ4TGym/eF89aQ8oMxS9v5BCc26Hij91t2Ci8Fl12DHNVqZoIPGm+9tTIoDVDFEFrlPhMOZl8i4jU9pcFjjaIISaV2+qTa8uV1j3MyByogG8pu4o5Ill7zaySYFsYB++cHJ9pjbFSC42dddCYMfuVgrBsLNrvEi3dLDMjJF5l92Uu8YeswFe26PuHX3Avr261n"
@ -132,20 +132,20 @@ See the production guide ["What now" section](https://docs.joinpeertube.org/inst
Pull the latest images: Pull the latest images:
```shell ```shell
$ cd /your/peertube/directory cd /your/peertube/directory
$ docker-compose pull docker-compose pull
``` ```
Stop, delete the containers and internal volumes (to invalidate static client files shared by `peertube` and `webserver` containers): Stop, delete the containers and internal volumes (to invalidate static client files shared by `peertube` and `webserver` containers):
```shell ```shell
$ docker-compose down -v docker-compose down -v
``` ```
Rerun PeerTube: Rerun PeerTube:
```shell ```shell
$ docker-compose up -d docker-compose up -d
``` ```
## Build ## Build
@ -153,9 +153,9 @@ $ docker-compose up -d
### Production ### Production
```shell ```shell
$ git clone https://github.com/chocobozzz/PeerTube /tmp/peertube git clone https://github.com/chocobozzz/PeerTube /tmp/peertube
$ cd /tmp/peertube cd /tmp/peertube
$ docker build . -f ./support/docker/production/Dockerfile.bullseye docker build . -f ./support/docker/production/Dockerfile.bullseye
``` ```
### Development ### Development

View File

@ -947,13 +947,13 @@ Steps:
If you develop a plugin, clone the `peertube-plugin-quickstart` repository: If you develop a plugin, clone the `peertube-plugin-quickstart` repository:
``` ```
$ git clone https://framagit.org/framasoft/peertube/peertube-plugin-quickstart.git peertube-plugin-mysupername git clone https://framagit.org/framasoft/peertube/peertube-plugin-quickstart.git peertube-plugin-mysupername
``` ```
If you develop a theme, clone the `peertube-theme-quickstart` repository: If you develop a theme, clone the `peertube-theme-quickstart` repository:
``` ```
$ git clone https://framagit.org/framasoft/peertube/peertube-theme-quickstart.git peertube-theme-mysupername git clone https://framagit.org/framasoft/peertube/peertube-theme-quickstart.git peertube-theme-mysupername
``` ```
### Configure your repository ### Configure your repository
@ -961,8 +961,8 @@ $ git clone https://framagit.org/framasoft/peertube/peertube-theme-quickstart.gi
Set your repository URL: Set your repository URL:
``` ```
$ cd peertube-plugin-mysupername # or cd peertube-theme-mysupername cd peertube-plugin-mysupername # or cd peertube-theme-mysupername
$ git remote set-url origin https://your-git-repo git remote set-url origin https://your-git-repo
``` ```
### Update README ### Update README
@ -970,7 +970,7 @@ $ git remote set-url origin https://your-git-repo
Update `README.md` file: Update `README.md` file:
``` ```
$ $EDITOR README.md $EDITOR README.md
``` ```
### Update package.json ### Update package.json
@ -1100,19 +1100,19 @@ If you added client scripts, you'll need to build them using webpack.
Install webpack: Install webpack:
``` ```
$ npm install npm install
``` ```
Add/update your files in the `clientFiles` array of `webpack.config.js`: Add/update your files in the `clientFiles` array of `webpack.config.js`:
``` ```
$ $EDITOR ./webpack.config.js $EDITOR ./webpack.config.js
``` ```
Build your client files: Build your client files:
``` ```
$ npm run build npm run build
``` ```
You built files are in the `dist/` directory. Check `package.json` to correctly point to them. You built files are in the `dist/` directory. Check `package.json` to correctly point to them.
@ -1129,31 +1129,31 @@ You'll need to have a local PeerTube instance:
* Build PeerTube: * Build PeerTube:
``` ```
$ npm run build npm run build
``` ```
* Build the CLI: * Build the CLI:
``` ```
$ npm run setup:cli npm run setup:cli
``` ```
* Run PeerTube (you can access to your instance on `localhost:9000`): * Run PeerTube (you can access to your instance on `localhost:9000`):
``` ```
$ NODE_ENV=dev npm start NODE_ENV=dev npm start
``` ```
* Register the instance via the CLI: * Register the instance via the CLI:
``` ```
$ node ./dist/server/tools/peertube.js auth add -u 'http://localhost:9000' -U 'root' --password 'test' node ./dist/server/tools/peertube.js auth add -u 'http://localhost:9000' -U 'root' --password 'test'
``` ```
Then, you can install or reinstall your local plugin/theme by running: Then, you can install or reinstall your local plugin/theme by running:
``` ```
$ node ./dist/server/tools/peertube.js plugins install --path /your/absolute/plugin-or-theme/path node ./dist/server/tools/peertube.js plugins install --path /your/absolute/plugin-or-theme/path
``` ```
### Publish ### Publish
@ -1161,7 +1161,7 @@ $ node ./dist/server/tools/peertube.js plugins install --path /your/absolute/plu
Go in your plugin/theme directory, and run: Go in your plugin/theme directory, and run:
``` ```
$ npm publish npm publish
``` ```
Every time you want to publish another version of your plugin/theme, just update the `version` key from the `package.json` Every time you want to publish another version of your plugin/theme, just update the `version` key from the `package.json`
@ -1179,7 +1179,7 @@ If for a particular reason you don't want to maintain your plugin/theme anymore
you can deprecate it. The plugin index will automatically remove it preventing users to find/install it from the PeerTube admin interface: you can deprecate it. The plugin index will automatically remove it preventing users to find/install it from the PeerTube admin interface:
```bash ```bash
$ npm deprecate peertube-plugin-xxx@"> 0.0.0" "explain here why you deprecate your plugin/theme" npm deprecate peertube-plugin-xxx@"> 0.0.0" "explain here why you deprecate your plugin/theme"
``` ```
## Plugin & Theme hooks/helpers API ## Plugin & Theme hooks/helpers API

View File

@ -17,25 +17,25 @@ Follow the steps of the [dependencies guide](/support/doc/dependencies.md).
Create a `peertube` user with `/var/www/peertube` home: Create a `peertube` user with `/var/www/peertube` home:
```bash ```bash
$ sudo useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube sudo useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube
``` ```
Set its password: Set its password:
```bash ```bash
$ sudo passwd peertube sudo passwd peertube
``` ```
Ensure the peertube root directory is traversable by nginx: Ensure the peertube root directory is traversable by nginx:
```bash ```bash
$ ls -ld /var/www/peertube # Should be drwxr-xr-x ls -ld /var/www/peertube # Should be drwxr-xr-x
``` ```
**On FreeBSD** **On FreeBSD**
```bash ```bash
$ sudo pw useradd -n peertube -d /var/www/peertube -s /usr/local/bin/bash -m sudo pw useradd -n peertube -d /var/www/peertube -s /usr/local/bin/bash -m
$ sudo passwd peertube sudo passwd peertube
``` ```
or use `adduser` to create it interactively. or use `adduser` to create it interactively.
@ -44,22 +44,22 @@ or use `adduser` to create it interactively.
Create the production database and a peertube user inside PostgreSQL: Create the production database and a peertube user inside PostgreSQL:
```bash ```bash
$ cd /var/www/peertube cd /var/www/peertube
$ sudo -u postgres createuser -P peertube sudo -u postgres createuser -P peertube
``` ```
Here you should enter a password for PostgreSQL `peertube` user, that should be copied in `production.yaml` file. Here you should enter a password for PostgreSQL `peertube` user, that should be copied in `production.yaml` file.
Don't just hit enter else it will be empty. Don't just hit enter else it will be empty.
```bash ```bash
$ sudo -u postgres createdb -O peertube -E UTF8 -T template0 peertube_prod sudo -u postgres createdb -O peertube -E UTF8 -T template0 peertube_prod
``` ```
Then enable extensions PeerTube needs: Then enable extensions PeerTube needs:
```bash ```bash
$ sudo -u postgres psql -c "CREATE EXTENSION pg_trgm;" peertube_prod sudo -u postgres psql -c "CREATE EXTENSION pg_trgm;" peertube_prod
$ sudo -u postgres psql -c "CREATE EXTENSION unaccent;" peertube_prod sudo -u postgres psql -c "CREATE EXTENSION unaccent;" peertube_prod
``` ```
### :page_facing_up: Prepare PeerTube directory ### :page_facing_up: Prepare PeerTube directory
@ -67,35 +67,35 @@ $ sudo -u postgres psql -c "CREATE EXTENSION unaccent;" peertube_prod
Fetch the latest tagged version of Peertube: Fetch the latest tagged version of Peertube:
```bash ```bash
$ 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" 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"
``` ```
Open the peertube directory, create a few required directories: Open the peertube directory, create a few required directories:
```bash ```bash
$ cd /var/www/peertube cd /var/www/peertube
$ sudo -u peertube mkdir config storage versions sudo -u peertube mkdir config storage versions
$ sudo -u peertube chmod 750 config/ sudo -u peertube chmod 750 config/
``` ```
Download the latest version of the Peertube client, unzip it and remove the zip: Download the latest version of the Peertube client, unzip it and remove the zip:
```bash ```bash
$ cd /var/www/peertube/versions cd /var/www/peertube/versions
$ # Releases are also available on https://builds.joinpeertube.org/release # Releases are also available on https://builds.joinpeertube.org/release
$ sudo -u peertube wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" sudo -u peertube wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip"
$ sudo -u peertube unzip -q peertube-${VERSION}.zip && sudo -u peertube rm peertube-${VERSION}.zip sudo -u peertube unzip -q peertube-${VERSION}.zip && sudo -u peertube rm peertube-${VERSION}.zip
``` ```
Install Peertube: Install Peertube:
```bash ```bash
$ cd /var/www/peertube cd /var/www/peertube
$ sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest
$ cd ./peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile cd ./peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile
``` ```
### :wrench: PeerTube configuration ### :wrench: PeerTube configuration
@ -104,15 +104,15 @@ Copy the default configuration file that contains the default configuration prov
You **must not** update this file. You **must not** update this file.
```bash ```bash
$ cd /var/www/peertube cd /var/www/peertube
$ sudo -u peertube cp peertube-latest/config/default.yaml config/default.yaml sudo -u peertube cp peertube-latest/config/default.yaml config/default.yaml
``` ```
Now copy the production example configuration: Now copy the production example configuration:
```bash ```bash
$ cd /var/www/peertube cd /var/www/peertube
$ sudo -u peertube cp peertube-latest/config/production.yaml.example config/production.yaml sudo -u peertube cp peertube-latest/config/production.yaml.example config/production.yaml
``` ```
Then edit the `config/production.yaml` file according to your webserver and database configuration. In particular: Then edit the `config/production.yaml` file according to your webserver and database configuration. In particular:
@ -134,45 +134,45 @@ We only provide official configuration files for Nginx.
Copy the nginx configuration template: Copy the nginx configuration template:
```bash ```bash
$ sudo cp /var/www/peertube/peertube-latest/support/nginx/peertube /etc/nginx/sites-available/peertube sudo cp /var/www/peertube/peertube-latest/support/nginx/peertube /etc/nginx/sites-available/peertube
``` ```
Then set the domain for the webserver configuration file. Then set the domain for the webserver configuration file.
Replace `[peertube-domain]` with the domain for the peertube server. Replace `[peertube-domain]` with the domain for the peertube server.
```bash ```bash
$ sudo sed -i 's/${WEBSERVER_HOST}/[peertube-domain]/g' /etc/nginx/sites-available/peertube sudo sed -i 's/${WEBSERVER_HOST}/[peertube-domain]/g' /etc/nginx/sites-available/peertube
$ sudo sed -i 's/${PEERTUBE_HOST}/127.0.0.1:9000/g' /etc/nginx/sites-available/peertube sudo sed -i 's/${PEERTUBE_HOST}/127.0.0.1:9000/g' /etc/nginx/sites-available/peertube
``` ```
Then modify the webserver configuration file. Please pay attention to the `alias` keys of the static locations. 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). It should correspond to the paths of your storage directories (set in the configuration file inside the `storage` key).
```bash ```bash
$ sudo vim /etc/nginx/sites-available/peertube sudo vim /etc/nginx/sites-available/peertube
``` ```
Activate the configuration file: Activate the configuration file:
```bash ```bash
$ sudo ln -s /etc/nginx/sites-available/peertube /etc/nginx/sites-enabled/peertube 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](https://letsencrypt.org/): To generate the certificate for your domain as required to make https work you can use [Let's Encrypt](https://letsencrypt.org/):
```bash ```bash
$ sudo systemctl stop nginx sudo systemctl stop nginx
$ sudo certbot certonly --standalone --post-hook "systemctl restart nginx" sudo certbot certonly --standalone --post-hook "systemctl restart nginx"
$ sudo systemctl reload nginx sudo systemctl reload nginx
``` ```
Certbot should have installed a cron to automatically renew your certificate. Certbot should have installed a cron to automatically renew your certificate.
Since our nginx template supports webroot renewal, we suggest you to update the renewal config file to use the `webroot` authenticator: Since our nginx template supports webroot renewal, we suggest you to update the renewal config file to use the `webroot` authenticator:
```bash ```bash
$ # Replace authenticator = standalone by authenticator = webroot # Replace authenticator = standalone by authenticator = webroot
$ # Add webroot_path = /var/www/certbot # Add webroot_path = /var/www/certbot
$ sudo vim /etc/letsencrypt/renewal/your-domain.com.conf sudo vim /etc/letsencrypt/renewal/your-domain.com.conf
``` ```
If you plan to have many concurrent viewers on your PeerTube instance, consider increasing `worker_connections` value: https://nginx.org/en/docs/ngx_core_module.html#worker_connections. If you plan to have many concurrent viewers on your PeerTube instance, consider increasing `worker_connections` value: https://nginx.org/en/docs/ngx_core_module.html#worker_connections.
@ -183,15 +183,15 @@ If you plan to have many concurrent viewers on your PeerTube instance, consider
On FreeBSD you can use [Dehydrated](https://dehydrated.io/) `security/dehydrated` for [Let's Encrypt](https://letsencrypt.org/) On FreeBSD you can use [Dehydrated](https://dehydrated.io/) `security/dehydrated` for [Let's Encrypt](https://letsencrypt.org/)
```bash ```bash
$ sudo pkg install dehydrated sudo pkg install dehydrated
``` ```
</details> </details>
### :alembic: Linux TCP/IP Tuning ### :alembic: Linux TCP/IP Tuning
```bash ```bash
$ sudo cp /var/www/peertube/peertube-latest/support/sysctl.d/30-peertube-tcp.conf /etc/sysctl.d/ 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 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 Your distro may enable this by default, but at least Debian 9 does not, and the default FIFO
@ -203,33 +203,33 @@ links as we often encounter in a video server.
If your OS uses systemd, copy the configuration template: If your OS uses systemd, copy the configuration template:
```bash ```bash
$ sudo cp /var/www/peertube/peertube-latest/support/systemd/peertube.service /etc/systemd/system/ sudo cp /var/www/peertube/peertube-latest/support/systemd/peertube.service /etc/systemd/system/
``` ```
Check the service file (PeerTube paths and security directives): Check the service file (PeerTube paths and security directives):
```bash ```bash
$ sudo vim /etc/systemd/system/peertube.service sudo vim /etc/systemd/system/peertube.service
``` ```
Tell systemd to reload its config: Tell systemd to reload its config:
```bash ```bash
$ sudo systemctl daemon-reload sudo systemctl daemon-reload
``` ```
If you want to start PeerTube on boot: If you want to start PeerTube on boot:
```bash ```bash
$ sudo systemctl enable peertube sudo systemctl enable peertube
``` ```
Run: Run:
```bash ```bash
$ sudo systemctl start peertube sudo systemctl start peertube
$ sudo journalctl -feu peertube sudo journalctl -feu peertube
``` ```
<details> <details>
@ -238,14 +238,14 @@ $ sudo journalctl -feu peertube
On FreeBSD, copy the startup script and update rc.conf: On FreeBSD, copy the startup script and update rc.conf:
```bash ```bash
$ sudo install -m 0555 /var/www/peertube/peertube-latest/support/freebsd/peertube /usr/local/etc/rc.d/ sudo install -m 0555 /var/www/peertube/peertube-latest/support/freebsd/peertube /usr/local/etc/rc.d/
$ sudo sysrc peertube_enable="YES" sudo sysrc peertube_enable="YES"
``` ```
Run: Run:
```bash ```bash
$ sudo service peertube start sudo service peertube start
``` ```
</details> </details>
@ -255,20 +255,20 @@ $ sudo service peertube start
If your OS uses OpenRC, copy the service script: If your OS uses OpenRC, copy the service script:
```bash ```bash
$ sudo cp /var/www/peertube/peertube-latest/support/init.d/peertube /etc/init.d/ sudo cp /var/www/peertube/peertube-latest/support/init.d/peertube /etc/init.d/
``` ```
If you want to start PeerTube on boot: If you want to start PeerTube on boot:
```bash ```bash
$ sudo rc-update add peertube default sudo rc-update add peertube default
``` ```
Run and print last logs: Run and print last logs:
```bash ```bash
$ sudo /etc/init.d/peertube start sudo /etc/init.d/peertube start
$ tail -f /var/log/peertube/peertube.log tail -f /var/log/peertube/peertube.log
``` ```
</details> </details>
@ -278,7 +278,7 @@ The administrator username is `root` and the password is automatically generated
logs (path defined in `production.yaml`). You can also set another password with: logs (path defined in `production.yaml`). You can also set another password with:
```bash ```bash
$ cd /var/www/peertube/peertube-latest && NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u root cd /var/www/peertube/peertube-latest && NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u root
``` ```
Alternatively you can set the environment variable `PT_INITIAL_ROOT_PASSWORD`, Alternatively you can set the environment variable `PT_INITIAL_ROOT_PASSWORD`,
@ -300,8 +300,8 @@ Now your instance is up you can:
Run the upgrade script (the password it asks is PeerTube's database user password): Run the upgrade script (the password it asks is PeerTube's database user password):
```bash ```bash
$ cd /var/www/peertube/peertube-latest/scripts && sudo -H -u peertube ./upgrade.sh cd /var/www/peertube/peertube-latest/scripts && sudo -H -u peertube ./upgrade.sh
$ sudo systemctl restart peertube # Or use your OS command to restart PeerTube if you don't use systemd sudo systemctl restart peertube # Or use your OS command to restart PeerTube if you don't use systemd
``` ```
<details> <details>
@ -310,7 +310,7 @@ $ sudo systemctl restart peertube # Or use your OS command to restart PeerTube i
Make a SQL backup Make a SQL backup
```bash ```bash
$ SQL_BACKUP_PATH="backup/sql-peertube_prod-$(date -Im).bak" && \ SQL_BACKUP_PATH="backup/sql-peertube_prod-$(date -Im).bak" && \
cd /var/www/peertube && sudo -u peertube mkdir -p backup && \ cd /var/www/peertube && sudo -u peertube mkdir -p backup && \
sudo -u postgres pg_dump -F c peertube_prod | sudo -u peertube tee "$SQL_BACKUP_PATH" >/dev/null sudo -u postgres pg_dump -F c peertube_prod | sudo -u peertube tee "$SQL_BACKUP_PATH" >/dev/null
``` ```
@ -318,13 +318,13 @@ $ SQL_BACKUP_PATH="backup/sql-peertube_prod-$(date -Im).bak" && \
Fetch the latest tagged version of Peertube: Fetch the latest tagged version of Peertube:
```bash ```bash
$ 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" 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"
``` ```
Download the new version and unzip it: Download the new version and unzip it:
```bash ```bash
$ cd /var/www/peertube/versions && \ cd /var/www/peertube/versions && \
sudo -u peertube wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" && \ sudo -u peertube wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" && \
sudo -u peertube unzip -o peertube-${VERSION}.zip && \ sudo -u peertube unzip -o peertube-${VERSION}.zip && \
sudo -u peertube rm peertube-${VERSION}.zip sudo -u peertube rm peertube-${VERSION}.zip
@ -333,21 +333,21 @@ $ cd /var/www/peertube/versions && \
Install node dependencies: Install node dependencies:
```bash ```bash
$ cd /var/www/peertube/versions/peertube-${VERSION} && \ cd /var/www/peertube/versions/peertube-${VERSION} && \
sudo -H -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: Copy new configuration defaults values and update your configuration file:
```bash ```bash
$ sudo -u peertube cp /var/www/peertube/versions/peertube-${VERSION}/config/default.yaml /var/www/peertube/config/default.yaml sudo -u peertube cp /var/www/peertube/versions/peertube-${VERSION}/config/default.yaml /var/www/peertube/config/default.yaml
$ diff -u /var/www/peertube/versions/peertube-${VERSION}/config/production.yaml.example /var/www/peertube/config/production.yaml diff -u /var/www/peertube/versions/peertube-${VERSION}/config/production.yaml.example /var/www/peertube/config/production.yaml
``` ```
Change the link to point to the latest version: Change the link to point to the latest version:
```bash ```bash
$ cd /var/www/peertube && \ cd /var/www/peertube && \
sudo unlink ./peertube-latest && \ sudo unlink ./peertube-latest && \
sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest
``` ```
@ -358,8 +358,8 @@ $ cd /var/www/peertube && \
Check for configuration changes, and report them in your `config/production.yaml` file: Check for configuration changes, and report them in your `config/production.yaml` file:
```bash ```bash
$ cd /var/www/peertube/versions cd /var/www/peertube/versions
$ diff -u "$(ls --sort=t | head -2 | tail -1)/config/production.yaml.example" "$(ls --sort=t | head -1)/config/production.yaml.example" diff -u "$(ls --sort=t | head -2 | tail -1)/config/production.yaml.example" "$(ls --sort=t | head -1)/config/production.yaml.example"
``` ```
### Update nginx configuration ### Update nginx configuration
@ -367,8 +367,8 @@ $ diff -u "$(ls --sort=t | head -2 | tail -1)/config/production.yaml.example" "$
Check changes in nginx configuration: Check changes in nginx configuration:
```bash ```bash
$ cd /var/www/peertube/versions cd /var/www/peertube/versions
$ diff -u "$(ls --sort=t | head -2 | tail -1)/support/nginx/peertube" "$(ls --sort=t | head -1)/support/nginx/peertube" diff -u "$(ls --sort=t | head -2 | tail -1)/support/nginx/peertube" "$(ls --sort=t | head -1)/support/nginx/peertube"
``` ```
### Update systemd service ### Update systemd service
@ -376,8 +376,8 @@ $ diff -u "$(ls --sort=t | head -2 | tail -1)/support/nginx/peertube" "$(ls --so
Check changes in systemd configuration: Check changes in systemd configuration:
```bash ```bash
$ cd /var/www/peertube/versions cd /var/www/peertube/versions
$ diff -u "$(ls --sort=t | head -2 | tail -1)/support/systemd/peertube.service" "$(ls --sort=t | head -1)/support/systemd/peertube.service" diff -u "$(ls --sort=t | head -2 | tail -1)/support/systemd/peertube.service" "$(ls --sort=t | head -1)/support/systemd/peertube.service"
``` ```
### Restart PeerTube ### Restart PeerTube
@ -385,19 +385,19 @@ $ diff -u "$(ls --sort=t | head -2 | tail -1)/support/systemd/peertube.service"
If you changed your nginx configuration: If you changed your nginx configuration:
```bash ```bash
$ sudo systemctl reload nginx sudo systemctl reload nginx
``` ```
If you changed your systemd configuration: If you changed your systemd configuration:
```bash ```bash
$ sudo systemctl daemon-reload sudo systemctl daemon-reload
``` ```
Restart PeerTube and check the logs: Restart PeerTube and check the logs:
```bash ```bash
$ sudo systemctl restart peertube && sudo journalctl -fu peertube sudo systemctl restart peertube && sudo journalctl -fu peertube
``` ```
### Things went wrong? ### Things went wrong?
@ -405,9 +405,9 @@ $ sudo systemctl restart peertube && sudo journalctl -fu peertube
Change `peertube-latest` destination to the previous version and restore your SQL backup: Change `peertube-latest` destination to the previous version and restore your SQL backup:
```bash ```bash
$ OLD_VERSION="v0.42.42" && SQL_BACKUP_PATH="backup/sql-peertube_prod-2018-01-19T10:18+01:00.bak" && \ OLD_VERSION="v0.42.42" && SQL_BACKUP_PATH="backup/sql-peertube_prod-2018-01-19T10:18+01:00.bak" && \
cd /var/www/peertube && sudo -u peertube unlink ./peertube-latest && \ cd /var/www/peertube && sudo -u peertube unlink ./peertube-latest && \
sudo -u peertube ln -s "versions/peertube-$OLD_VERSION" peertube-latest && \ sudo -u peertube ln -s "versions/peertube-$OLD_VERSION" peertube-latest && \
sudo -u postgres pg_restore -c -C -d postgres "$SQL_BACKUP_PATH" && \ sudo -u postgres pg_restore -c -C -d postgres "$SQL_BACKUP_PATH" && \
sudo systemctl restart peertube sudo systemctl restart peertube
``` ```

View File

@ -40,16 +40,16 @@ Install the [PeerTube dependencies](/support/doc/dependencies.md) except Postgre
Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server): Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server):
```bash ```bash
$ git clone https://github.com/Chocobozzz/PeerTube.git git clone https://github.com/Chocobozzz/PeerTube.git
$ CLONE="$(pwd)/PeerTube" CLONE="$(pwd)/PeerTube"
$ cd ${CLONE} cd ${CLONE}
``` ```
Install dependencies and build CLI tools: Install dependencies and build CLI tools:
```bash ```bash
$ NOCLIENT=1 yarn install --pure-lockfile NOCLIENT=1 yarn install --pure-lockfile
$ npm run setup:cli npm run setup:cli
``` ```
### CLI wrapper ### CLI wrapper
@ -78,8 +78,8 @@ You can access it as `peertube` via an alias in your `.bashrc` like `alias peert
The wrapper can keep track of instances you have an account on. We limit to one account per instance for now. The wrapper can keep track of instances you have an account on. We limit to one account per instance for now.
```bash ```bash
$ peertube auth add -u 'PEERTUBE_URL' -U 'PEERTUBE_USER' --password 'PEERTUBE_PASSWORD' peertube auth add -u 'PEERTUBE_URL' -U 'PEERTUBE_USER' --password 'PEERTUBE_PASSWORD'
$ peertube auth list peertube auth list
┌──────────────────────────────┬──────────────────────────────┐ ┌──────────────────────────────┬──────────────────────────────┐
│ instance │ login │ │ instance │ login │
├──────────────────────────────┼──────────────────────────────┤ ├──────────────────────────────┼──────────────────────────────┤
@ -90,16 +90,16 @@ $ peertube auth list
You can now use that account to upload videos without feeding the same parameters again. You can now use that account to upload videos without feeding the same parameters again.
```bash ```bash
$ peertube up <videoFile> peertube up <videoFile>
``` ```
To list, install, uninstall dynamically plugins/themes of an instance: To list, install, uninstall dynamically plugins/themes of an instance:
```bash ```bash
$ peertube plugins list peertube plugins list
$ peertube plugins install --path /local/plugin/path peertube plugins install --path /local/plugin/path
$ peertube plugins install --npm-name peertube-plugin-myplugin peertube plugins install --npm-name peertube-plugin-myplugin
$ peertube plugins uninstall --npm-name peertube-plugin-myplugin peertube plugins uninstall --npm-name peertube-plugin-myplugin
``` ```
#### peertube-import-videos.js #### peertube-import-videos.js
@ -108,7 +108,7 @@ You can use this script to import videos from all [supported sites of youtube-dl
Be sure you own the videos or have the author's authorization to do so. Be sure you own the videos or have the author's authorization to do so.
```sh ```sh
$ node dist/server/tools/peertube-import-videos.js \ node dist/server/tools/peertube-import-videos.js \
-u 'PEERTUBE_URL' \ -u 'PEERTUBE_URL' \
-U 'PEERTUBE_USER' \ -U 'PEERTUBE_USER' \
--password 'PEERTUBE_PASSWORD' \ --password 'PEERTUBE_PASSWORD' \
@ -152,8 +152,8 @@ You can use this script to import videos directly from the CLI.
Videos will be publicly available after transcoding (you can see them before that in your account on the web interface). Videos will be publicly available after transcoding (you can see them before that in your account on the web interface).
```bash ```bash
$ cd ${CLONE} cd ${CLONE}
$ node dist/server/tools/peertube-upload.js --help node dist/server/tools/peertube-upload.js --help
``` ```
#### peertube-plugins.js #### peertube-plugins.js
@ -161,15 +161,15 @@ $ node dist/server/tools/peertube-upload.js --help
Install/update/uninstall or list local or NPM PeerTube plugins: Install/update/uninstall or list local or NPM PeerTube plugins:
```bash ```bash
$ cd ${CLONE} cd ${CLONE}
$ node dist/server/tools/peertube-plugins.js --help node dist/server/tools/peertube-plugins.js --help
$ node dist/server/tools/peertube-plugins.js list --help node dist/server/tools/peertube-plugins.js list --help
$ node dist/server/tools/peertube-plugins.js install --help node dist/server/tools/peertube-plugins.js install --help
$ node dist/server/tools/peertube-plugins.js update --help node dist/server/tools/peertube-plugins.js update --help
$ node dist/server/tools/peertube-plugins.js uninstall --help node dist/server/tools/peertube-plugins.js uninstall --help
$ node dist/server/tools/peertube-plugins.js install --path /my/plugin/path node dist/server/tools/peertube-plugins.js install --path /my/plugin/path
$ node dist/server/tools/peertube-plugins.js install --npm-name peertube-theme-example node dist/server/tools/peertube-plugins.js install --npm-name peertube-theme-example
``` ```
#### peertube-redundancy.js #### peertube-redundancy.js
@ -179,25 +179,25 @@ Manage (list/add/remove) video redundancies:
To list your videos that are duplicated by remote instances: To list your videos that are duplicated by remote instances:
```bash ```bash
$ node dist/server/tools/peertube.js redundancy list-remote-redundancies node dist/server/tools/peertube.js redundancy list-remote-redundancies
``` ```
To list remote videos that your instance duplicated: To list remote videos that your instance duplicated:
```bash ```bash
$ node dist/server/tools/peertube.js redundancy list-my-redundancies node dist/server/tools/peertube.js redundancy list-my-redundancies
``` ```
To duplicate a specific video in your redundancy system: To duplicate a specific video in your redundancy system:
```bash ```bash
$ node dist/server/tools/peertube.js redundancy add --video 823 node dist/server/tools/peertube.js redundancy add --video 823
``` ```
To remove a video redundancy: To remove a video redundancy:
```bash ```bash
$ node dist/server/tools/peertube.js redundancy remove --video 823 node dist/server/tools/peertube.js redundancy remove --video 823
``` ```
## Server tools ## Server tools
@ -209,13 +209,13 @@ These scripts should be run on the server, in `peertube-latest` directory.
To parse PeerTube last log file: To parse PeerTube last log file:
```bash ```bash
$ # Basic installation # Basic installation
$ cd /var/www/peertube/peertube-latest cd /var/www/peertube/peertube-latest
$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run parse-log -- --level info sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run parse-log -- --level info
$ # Docker installation # Docker installation
$ cd /var/www/peertube-docker cd /var/www/peertube-docker
$ docker-compose exec -u peertube peertube npm run parse-log -- --level info docker-compose exec -u peertube peertube npm run parse-log -- --level info
``` ```
`--level` is optional and could be `info`/`warn`/`error` `--level` is optional and could be `info`/`warn`/`error`
@ -223,13 +223,13 @@ $ docker-compose exec -u peertube peertube npm run parse-log -- --level info
You can also remove SQL or HTTP logs using `--not-tags` (PeerTube >= 3.2): You can also remove SQL or HTTP logs using `--not-tags` (PeerTube >= 3.2):
```bash ```bash
$ # Basic installation # Basic installation
$ cd /var/www/peertube/peertube-latest cd /var/www/peertube/peertube-latest
$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run parse-log -- --level debug --not-tags http sql sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run parse-log -- --level debug --not-tags http sql
$ # Docker installation # Docker installation
$ cd /var/www/peertube-docker cd /var/www/peertube-docker
$ docker-compose exec -u peertube peertube npm run parse-log -- --level debug --not-tags http sql docker-compose exec -u peertube peertube npm run parse-log -- --level debug --not-tags http sql
``` ```
### regenerate-thumbnails.js ### regenerate-thumbnails.js
@ -239,13 +239,13 @@ $ docker-compose exec -u peertube peertube npm run parse-log -- --level debug --
Regenerating local video thumbnails could be useful because new PeerTube releases may increase thumbnail sizes: Regenerating local video thumbnails could be useful because new PeerTube releases may increase thumbnail sizes:
```bash ```bash
$ # Basic installation # Basic installation
$ cd /var/www/peertube/peertube-latest cd /var/www/peertube/peertube-latest
$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run regenerate-thumbnails sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run regenerate-thumbnails
$ # Docker installation # Docker installation
$ cd /var/www/peertube-docker cd /var/www/peertube-docker
$ docker-compose exec -u peertube peertube npm run regenerate-thumbnails docker-compose exec -u peertube peertube npm run regenerate-thumbnails
``` ```
### create-transcoding-job.js ### create-transcoding-job.js
@ -255,25 +255,25 @@ You can use this script to force transcoding of an existing video. PeerTube need
To generate transcoding jobs depending on the instance configuration: To generate transcoding jobs depending on the instance configuration:
```bash ```bash
$ # Basic installation # Basic installation
$ cd /var/www/peertube/peertube-latest cd /var/www/peertube/peertube-latest
$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- -v [videoUUID] sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- -v [videoUUID]
$ # Docker installation # Docker installation
$ cd /var/www/peertube-docker cd /var/www/peertube-docker
$ docker-compose exec -u peertube peertube npm run create-transcoding-job -- -v [videoUUID] docker-compose exec -u peertube peertube npm run create-transcoding-job -- -v [videoUUID]
``` ```
Or to transcode to a specific resolution: Or to transcode to a specific resolution:
```bash ```bash
$ # Basic installation # Basic installation
$ cd /var/www/peertube/peertube-latest cd /var/www/peertube/peertube-latest
$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- -v [videoUUID] -r [resolution] sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- -v [videoUUID] -r [resolution]
$ # Docker installation # Docker installation
$ cd /var/www/peertube-docker cd /var/www/peertube-docker
$ docker-compose exec -u peertube peertube npm run create-transcoding-job -- -v [videoUUID] -r [resolution] docker-compose exec -u peertube peertube npm run create-transcoding-job -- -v [videoUUID] -r [resolution]
``` ```
The resolution should be an integer (`1080`, `720`, `480`, etc.) The resolution should be an integer (`1080`, `720`, `480`, etc.)
@ -281,13 +281,13 @@ The resolution should be an integer (`1080`, `720`, `480`, etc.)
To generate an HLS playlist for a video: To generate an HLS playlist for a video:
```bash ```bash
$ # Basic installation # Basic installation
$ cd /var/www/peertube/peertube-latest cd /var/www/peertube/peertube-latest
$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- --generate-hls -v [videoUUID] sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- --generate-hls -v [videoUUID]
$ # Docker installation # Docker installation
$ cd /var/www/peertube-docker cd /var/www/peertube-docker
$ docker-compose exec -u peertube peertube npm run create-transcoding-job -- --generate-hls -v [videoUUID] docker-compose exec -u peertube peertube npm run create-transcoding-job -- --generate-hls -v [videoUUID]
``` ```
### create-import-video-file-job.js ### create-import-video-file-job.js
@ -296,13 +296,13 @@ You can use this script to import a video file to replace an already uploaded fi
You can then create a transcoding job using `npm run create-transcoding-job` if you need to optimize your file or create an HLS version of it. You can then create a transcoding job using `npm run create-transcoding-job` if you need to optimize your file or create an HLS version of it.
```bash ```bash
$ # Basic installation # Basic installation
$ cd /var/www/peertube/peertube-latest cd /var/www/peertube/peertube-latest
$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-import-video-file-job -- -v [videoUUID] -i [videoFile] sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-import-video-file-job -- -v [videoUUID] -i [videoFile]
$ # Docker installation # Docker installation
$ cd /var/www/peertube-docker cd /var/www/peertube-docker
$ docker-compose exec -u peertube peertube npm run create-import-video-file-job -- -v [videoUUID] -i [videoFile] docker-compose exec -u peertube peertube npm run create-import-video-file-job -- -v [videoUUID] -i [videoFile]
``` ```
### create-move-video-storage-job.js ### create-move-video-storage-job.js
@ -312,25 +312,25 @@ $ docker-compose exec -u peertube peertube npm run create-import-video-file-job
Use this script to move all video files or a specific video file to object storage. Use this script to move all video files or a specific video file to object storage.
```bash ```bash
$ # Basic installation # Basic installation
$ cd /var/www/peertube/peertube-latest cd /var/www/peertube/peertube-latest
$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-move-video-storage-job -- --to-object-storage -v [videoUUID] sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-move-video-storage-job -- --to-object-storage -v [videoUUID]
$ # Docker installation # Docker installation
$ cd /var/www/peertube-docker cd /var/www/peertube-docker
$ docker-compose exec -u peertube peertube npm run create-move-video-storage-job -- --to-object-storage -v [videoUUID] docker-compose exec -u peertube peertube npm run create-move-video-storage-job -- --to-object-storage -v [videoUUID]
``` ```
The script can also move all video files that are not already in object storage: The script can also move all video files that are not already in object storage:
```bash ```bash
$ # Basic installation # Basic installation
$ cd /var/www/peertube/peertube-latest cd /var/www/peertube/peertube-latest
$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-move-video-storage-job -- --to-object-storage --all-videos sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-move-video-storage-job -- --to-object-storage --all-videos
$ # Docker installation # Docker installation
$ cd /var/www/peertube-docker cd /var/www/peertube-docker
$ docker-compose exec -u peertube peertube npm run create-move-video-storage-job -- --to-object-storage --all-videos docker-compose exec -u peertube peertube npm run create-move-video-storage-job -- --to-object-storage --all-videos
``` ```
@ -340,8 +340,8 @@ Some transcoded videos or shutdown at a bad time can leave some unused files on
Stop PeerTube and delete these files (a confirmation will be demanded first): Stop PeerTube and delete these files (a confirmation will be demanded first):
```bash ```bash
$ cd /var/www/peertube/peertube-latest cd /var/www/peertube/peertube-latest
$ sudo systemctl stop peertube && sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run prune-storage sudo systemctl stop peertube && sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run prune-storage
``` ```
@ -353,13 +353,13 @@ invalid torrent files and invalid URLs in your database. To fix this, you have
to run the command below (keep in mind your follower instances will NOT update their URLs). to run the command below (keep in mind your follower instances will NOT update their URLs).
```bash ```bash
$ # Basic installation # Basic installation
$ cd /var/www/peertube/peertube-latest cd /var/www/peertube/peertube-latest
$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run update-host sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run update-host
$ # Docker installation # Docker installation
$ cd /var/www/peertube-docker cd /var/www/peertube-docker
$ docker-compose exec -u peertube peertube npm run update-host docker-compose exec -u peertube peertube npm run update-host
``` ```
### reset-password.js ### reset-password.js
@ -367,13 +367,13 @@ $ docker-compose exec -u peertube peertube npm run update-host
To reset a user password from CLI, run: To reset a user password from CLI, run:
```bash ```bash
$ # Basic installation # Basic installation
$ cd /var/www/peertube/peertube-latest cd /var/www/peertube/peertube-latest
$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u target_username sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u target_username
$ # Docker installation # Docker installation
$ cd /var/www/peertube-docker cd /var/www/peertube-docker
$ docker-compose exec -u peertube peertube npm run reset-password -- -u target_username docker-compose exec -u peertube peertube npm run reset-password -- -u target_username
``` ```
@ -385,32 +385,32 @@ If PeerTube is running, you need to restart it for the changes to take effect (w
To install/update a plugin or a theme from the disk: To install/update a plugin or a theme from the disk:
```bash ```bash
$ cd /var/www/peertube/peertube-latest cd /var/www/peertube/peertube-latest
$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:install -- --plugin-path /local/plugin/path sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:install -- --plugin-path /local/plugin/path
$ # Docker installation # Docker installation
$ cd /var/www/peertube-docker cd /var/www/peertube-docker
$ docker-compose exec -u peertube peertube npm run plugin:install -- --plugin-path /local/plugin/path docker-compose exec -u peertube peertube npm run plugin:install -- --plugin-path /local/plugin/path
``` ```
From NPM: From NPM:
```bash ```bash
$ cd /var/www/peertube/peertube-latest cd /var/www/peertube/peertube-latest
$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:install -- --npm-name peertube-plugin-myplugin sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:install -- --npm-name peertube-plugin-myplugin
$ # Docker installation # Docker installation
$ cd /var/www/peertube-docker cd /var/www/peertube-docker
$ docker-compose exec -u peertube peertube npm run plugin:install -- --npm-name peertube-plugin-myplugin docker-compose exec -u peertube peertube npm run plugin:install -- --npm-name peertube-plugin-myplugin
``` ```
To uninstall a plugin or a theme: To uninstall a plugin or a theme:
```bash ```bash
$ cd /var/www/peertube/peertube-latest cd /var/www/peertube/peertube-latest
$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin
$ # Docker installation # Docker installation
$ cd /var/www/peertube-docker cd /var/www/peertube-docker
$ docker-compose exec -u peertube peertube npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin docker-compose exec -u peertube peertube npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin
``` ```