aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/doc/tools.md
diff options
context:
space:
mode:
Diffstat (limited to 'support/doc/tools.md')
-rw-r--r--support/doc/tools.md73
1 files changed, 70 insertions, 3 deletions
diff --git a/support/doc/tools.md b/support/doc/tools.md
index 175c22cd8..1956dc572 100644
--- a/support/doc/tools.md
+++ b/support/doc/tools.md
@@ -239,26 +239,43 @@ These scripts should be run on the server, in `peertube-latest` directory.
239To parse PeerTube last log file: 239To parse PeerTube last log file:
240 240
241```bash 241```bash
242$ # Basic installation
242$ cd /var/www/peertube/peertube-latest 243$ cd /var/www/peertube/peertube-latest
243$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run parse-log -- --level info 244$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run parse-log -- --level info
245
246$ # Docker installation
247$ cd /var/www/peertube-docker
248$ docker-compose exec -u peertube peertube npm run parse-log -- --level info
244``` 249```
245 250
246`--level` is optional and could be `info`/`warn`/`error` 251`--level` is optional and could be `info`/`warn`/`error`
247 252
248You can also remove SQL or HTTP logs using `--not-tags`: 253You can also remove SQL or HTTP logs using `--not-tags` (PeerTube >= 3.2):
249 254
250``` 255```bash
256$ # Basic installation
251$ cd /var/www/peertube/peertube-latest 257$ cd /var/www/peertube/peertube-latest
252$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run parse-log -- --level debug --not-tags http sql 258$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run parse-log -- --level debug --not-tags http sql
259
260$ # Docker installation
261$ cd /var/www/peertube-docker
262$ docker-compose exec -u peertube peertube npm run parse-log -- --level debug --not-tags http sql
253``` 263```
254 264
255### regenerate-thumbnails.js 265### regenerate-thumbnails.js
256 266
267**PeerTube >= 3.2**
268
257Regenerating local video thumbnails could be useful because new PeerTube releases may increase thumbnail sizes: 269Regenerating local video thumbnails could be useful because new PeerTube releases may increase thumbnail sizes:
258 270
259``` 271```bash
272$ # Basic installation
260$ cd /var/www/peertube/peertube-latest 273$ cd /var/www/peertube/peertube-latest
261$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run regenerate-thumbnails 274$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run regenerate-thumbnails
275
276$ # Docker installation
277$ cd /var/www/peertube-docker
278$ docker-compose exec -u peertube peertube npm run regenerate-thumbnails
262``` 279```
263 280
264### create-transcoding-job.js 281### create-transcoding-job.js
@@ -266,23 +283,41 @@ $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production
266You can use this script to force transcoding of an existing video. PeerTube needs to be running. 283You can use this script to force transcoding of an existing video. PeerTube needs to be running.
267 284
268To generate transcoding jobs depending on the instance configuration: 285To generate transcoding jobs depending on the instance configuration:
286
269```bash 287```bash
288$ # Basic installation
270$ cd /var/www/peertube/peertube-latest 289$ cd /var/www/peertube/peertube-latest
271$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- -v [videoUUID] 290$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- -v [videoUUID]
291
292$ # Docker installation
293$ cd /var/www/peertube-docker
294$ docker-compose exec -u peertube peertube npm run create-transcoding-job -- -v [videoUUID]
272``` 295```
273 296
274Or to transcode to a specific resolution: 297Or to transcode to a specific resolution:
298
275```bash 299```bash
300$ # Basic installation
276$ cd /var/www/peertube/peertube-latest 301$ cd /var/www/peertube/peertube-latest
277$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- -v [videoUUID] -r [resolution] 302$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- -v [videoUUID] -r [resolution]
303
304$ # Docker installation
305$ cd /var/www/peertube-docker
306$ docker-compose exec -u peertube peertube npm run create-transcoding-job -- -v [videoUUID] -r [resolution]
278``` 307```
308
279The resolution should be an integer (`1080`, `720`, `480`, etc.) 309The resolution should be an integer (`1080`, `720`, `480`, etc.)
280 310
281To generate an HLS playlist for a video: 311To generate an HLS playlist for a video:
282 312
283```bash 313```bash
314$ # Basic installation
284$ cd /var/www/peertube/peertube-latest 315$ cd /var/www/peertube/peertube-latest
285$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- --generate-hls -v [videoUUID] 316$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- --generate-hls -v [videoUUID]
317
318$ # Docker installation
319$ cd /var/www/peertube-docker
320$ docker-compose exec -u peertube peertube npm run create-transcoding-job -- --generate-hls -v [videoUUID]
286``` 321```
287 322
288### create-import-video-file-job.js 323### create-import-video-file-job.js
@@ -290,8 +325,13 @@ $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production
290You can use this script to import a video file to replace an already uploaded file or to add a new resolution to a video. PeerTube needs to be running. 325You can use this script to import a video file to replace an already uploaded file or to add a new resolution to a video. PeerTube needs to be running.
291 326
292```bash 327```bash
328$ # Basic installation
293$ cd /var/www/peertube/peertube-latest 329$ cd /var/www/peertube/peertube-latest
294$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-import-video-file-job -- -v [videoUUID] -i [videoFile] 330$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-import-video-file-job -- -v [videoUUID] -i [videoFile]
331
332$ # Docker installation
333$ cd /var/www/peertube-docker
334$ docker-compose exec -u peertube peertube npm run create-import-video-file-job -- -v [videoUUID] -i [videoFile]
295``` 335```
296 336
297### prune-storage.js 337### prune-storage.js
@@ -312,8 +352,13 @@ very large files that are too large for streaming. This script re-transcodes
312these videos so that they can be watched properly, even on slow connections. 352these videos so that they can be watched properly, even on slow connections.
313 353
314```bash 354```bash
355$ # Basic installation
315$ cd /var/www/peertube/peertube-latest 356$ cd /var/www/peertube/peertube-latest
316$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run optimize-old-videos 357$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run optimize-old-videos
358
359$ # Docker installation
360$ cd /var/www/peertube-docker
361$ docker-compose exec -u peertube peertube npm run optimize-old-videos
317``` 362```
318 363
319 364
@@ -325,8 +370,13 @@ invalid torrent files and invalid URLs in your database. To fix this, you have
325to run the command below (keep in mind your follower instances will NOT update their URLs). 370to run the command below (keep in mind your follower instances will NOT update their URLs).
326 371
327```bash 372```bash
373$ # Basic installation
328$ cd /var/www/peertube/peertube-latest 374$ cd /var/www/peertube/peertube-latest
329$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run update-host 375$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run update-host
376
377$ # Docker installation
378$ cd /var/www/peertube-docker
379$ docker-compose exec -u peertube peertube npm run update-host
330``` 380```
331 381
332### reset-password.js 382### reset-password.js
@@ -334,8 +384,13 @@ $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production
334To reset a user password from CLI, run: 384To reset a user password from CLI, run:
335 385
336```bash 386```bash
387$ # Basic installation
337$ cd /var/www/peertube/peertube-latest 388$ cd /var/www/peertube/peertube-latest
338$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u target_username 389$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u target_username
390
391$ # Docker installation
392$ cd /var/www/peertube-docker
393$ docker-compose exec -u peertube peertube npm run reset-password -- -u target_username
339``` 394```
340 395
341 396
@@ -349,6 +404,10 @@ To install/update a plugin or a theme from the disk:
349```bash 404```bash
350$ cd /var/www/peertube/peertube-latest 405$ cd /var/www/peertube/peertube-latest
351$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:install -- --plugin-path /local/plugin/path 406$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:install -- --plugin-path /local/plugin/path
407
408$ # Docker installation
409$ cd /var/www/peertube-docker
410$ docker-compose exec -u peertube peertube npm run plugin:install -- --plugin-path /local/plugin/path
352``` 411```
353 412
354From NPM: 413From NPM:
@@ -356,6 +415,10 @@ From NPM:
356```bash 415```bash
357$ cd /var/www/peertube/peertube-latest 416$ cd /var/www/peertube/peertube-latest
358$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:install -- --npm-name peertube-plugin-myplugin 417$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:install -- --npm-name peertube-plugin-myplugin
418
419$ # Docker installation
420$ cd /var/www/peertube-docker
421$ docker-compose exec -u peertube peertube npm run plugin:install -- --npm-name peertube-plugin-myplugin
359``` 422```
360 423
361To uninstall a plugin or a theme: 424To uninstall a plugin or a theme:
@@ -363,6 +426,10 @@ To uninstall a plugin or a theme:
363```bash 426```bash
364$ cd /var/www/peertube/peertube-latest 427$ cd /var/www/peertube/peertube-latest
365$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin 428$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin
429
430$ # Docker installation
431$ cd /var/www/peertube-docker
432$ docker-compose exec -u peertube peertube npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin
366``` 433```
367 434
368### REPL (Read Eval Print Loop) 435### REPL (Read Eval Print Loop)