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.md222
1 files changed, 111 insertions, 111 deletions
diff --git a/support/doc/tools.md b/support/doc/tools.md
index 9a20ea64e..3b8eec4b1 100644
--- a/support/doc/tools.md
+++ b/support/doc/tools.md
@@ -40,16 +40,16 @@ Install the [PeerTube dependencies](/support/doc/dependencies.md) except Postgre
40Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server): 40Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server):
41 41
42```bash 42```bash
43$ git clone https://github.com/Chocobozzz/PeerTube.git 43git clone https://github.com/Chocobozzz/PeerTube.git
44$ CLONE="$(pwd)/PeerTube" 44CLONE="$(pwd)/PeerTube"
45$ cd ${CLONE} 45cd ${CLONE}
46``` 46```
47 47
48Install dependencies and build CLI tools: 48Install dependencies and build CLI tools:
49 49
50```bash 50```bash
51$ NOCLIENT=1 yarn install --pure-lockfile 51NOCLIENT=1 yarn install --pure-lockfile
52$ npm run setup:cli 52npm run setup:cli
53``` 53```
54 54
55### CLI wrapper 55### CLI wrapper
@@ -78,8 +78,8 @@ You can access it as `peertube` via an alias in your `.bashrc` like `alias peert
78The wrapper can keep track of instances you have an account on. We limit to one account per instance for now. 78The wrapper can keep track of instances you have an account on. We limit to one account per instance for now.
79 79
80```bash 80```bash
81$ peertube auth add -u 'PEERTUBE_URL' -U 'PEERTUBE_USER' --password 'PEERTUBE_PASSWORD' 81peertube auth add -u 'PEERTUBE_URL' -U 'PEERTUBE_USER' --password 'PEERTUBE_PASSWORD'
82$ peertube auth list 82peertube auth list
83┌──────────────────────────────┬──────────────────────────────┐ 83┌──────────────────────────────┬──────────────────────────────┐
84│ instance │ login │ 84│ instance │ login │
85├──────────────────────────────┼──────────────────────────────┤ 85├──────────────────────────────┼──────────────────────────────┤
@@ -90,16 +90,16 @@ $ peertube auth list
90You can now use that account to upload videos without feeding the same parameters again. 90You can now use that account to upload videos without feeding the same parameters again.
91 91
92```bash 92```bash
93$ peertube up <videoFile> 93peertube up <videoFile>
94``` 94```
95 95
96To list, install, uninstall dynamically plugins/themes of an instance: 96To list, install, uninstall dynamically plugins/themes of an instance:
97 97
98```bash 98```bash
99$ peertube plugins list 99peertube plugins list
100$ peertube plugins install --path /local/plugin/path 100peertube plugins install --path /local/plugin/path
101$ peertube plugins install --npm-name peertube-plugin-myplugin 101peertube plugins install --npm-name peertube-plugin-myplugin
102$ peertube plugins uninstall --npm-name peertube-plugin-myplugin 102peertube plugins uninstall --npm-name peertube-plugin-myplugin
103``` 103```
104 104
105#### peertube-import-videos.js 105#### peertube-import-videos.js
@@ -108,7 +108,7 @@ You can use this script to import videos from all [supported sites of youtube-dl
108Be sure you own the videos or have the author's authorization to do so. 108Be sure you own the videos or have the author's authorization to do so.
109 109
110```sh 110```sh
111$ node dist/server/tools/peertube-import-videos.js \ 111node dist/server/tools/peertube-import-videos.js \
112 -u 'PEERTUBE_URL' \ 112 -u 'PEERTUBE_URL' \
113 -U 'PEERTUBE_USER' \ 113 -U 'PEERTUBE_USER' \
114 --password 'PEERTUBE_PASSWORD' \ 114 --password 'PEERTUBE_PASSWORD' \
@@ -152,8 +152,8 @@ You can use this script to import videos directly from the CLI.
152Videos will be publicly available after transcoding (you can see them before that in your account on the web interface). 152Videos will be publicly available after transcoding (you can see them before that in your account on the web interface).
153 153
154```bash 154```bash
155$ cd ${CLONE} 155cd ${CLONE}
156$ node dist/server/tools/peertube-upload.js --help 156node dist/server/tools/peertube-upload.js --help
157``` 157```
158 158
159#### peertube-plugins.js 159#### peertube-plugins.js
@@ -161,15 +161,15 @@ $ node dist/server/tools/peertube-upload.js --help
161Install/update/uninstall or list local or NPM PeerTube plugins: 161Install/update/uninstall or list local or NPM PeerTube plugins:
162 162
163```bash 163```bash
164$ cd ${CLONE} 164cd ${CLONE}
165$ node dist/server/tools/peertube-plugins.js --help 165node dist/server/tools/peertube-plugins.js --help
166$ node dist/server/tools/peertube-plugins.js list --help 166node dist/server/tools/peertube-plugins.js list --help
167$ node dist/server/tools/peertube-plugins.js install --help 167node dist/server/tools/peertube-plugins.js install --help
168$ node dist/server/tools/peertube-plugins.js update --help 168node dist/server/tools/peertube-plugins.js update --help
169$ node dist/server/tools/peertube-plugins.js uninstall --help 169node dist/server/tools/peertube-plugins.js uninstall --help
170 170
171$ node dist/server/tools/peertube-plugins.js install --path /my/plugin/path 171node dist/server/tools/peertube-plugins.js install --path /my/plugin/path
172$ node dist/server/tools/peertube-plugins.js install --npm-name peertube-theme-example 172node dist/server/tools/peertube-plugins.js install --npm-name peertube-theme-example
173``` 173```
174 174
175#### peertube-redundancy.js 175#### peertube-redundancy.js
@@ -179,25 +179,25 @@ Manage (list/add/remove) video redundancies:
179To list your videos that are duplicated by remote instances: 179To list your videos that are duplicated by remote instances:
180 180
181```bash 181```bash
182$ node dist/server/tools/peertube.js redundancy list-remote-redundancies 182node dist/server/tools/peertube.js redundancy list-remote-redundancies
183``` 183```
184 184
185To list remote videos that your instance duplicated: 185To list remote videos that your instance duplicated:
186 186
187```bash 187```bash
188$ node dist/server/tools/peertube.js redundancy list-my-redundancies 188node dist/server/tools/peertube.js redundancy list-my-redundancies
189``` 189```
190 190
191To duplicate a specific video in your redundancy system: 191To duplicate a specific video in your redundancy system:
192 192
193```bash 193```bash
194$ node dist/server/tools/peertube.js redundancy add --video 823 194node dist/server/tools/peertube.js redundancy add --video 823
195``` 195```
196 196
197To remove a video redundancy: 197To remove a video redundancy:
198 198
199```bash 199```bash
200$ node dist/server/tools/peertube.js redundancy remove --video 823 200node dist/server/tools/peertube.js redundancy remove --video 823
201``` 201```
202 202
203## Server tools 203## Server tools
@@ -209,13 +209,13 @@ These scripts should be run on the server, in `peertube-latest` directory.
209To parse PeerTube last log file: 209To parse PeerTube last log file:
210 210
211```bash 211```bash
212$ # Basic installation 212# Basic installation
213$ cd /var/www/peertube/peertube-latest 213cd /var/www/peertube/peertube-latest
214$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run parse-log -- --level info 214sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run parse-log -- --level info
215 215
216$ # Docker installation 216# Docker installation
217$ cd /var/www/peertube-docker 217cd /var/www/peertube-docker
218$ docker-compose exec -u peertube peertube npm run parse-log -- --level info 218docker-compose exec -u peertube peertube npm run parse-log -- --level info
219``` 219```
220 220
221`--level` is optional and could be `info`/`warn`/`error` 221`--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
223You can also remove SQL or HTTP logs using `--not-tags` (PeerTube >= 3.2): 223You can also remove SQL or HTTP logs using `--not-tags` (PeerTube >= 3.2):
224 224
225```bash 225```bash
226$ # Basic installation 226# Basic installation
227$ cd /var/www/peertube/peertube-latest 227cd /var/www/peertube/peertube-latest
228$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run parse-log -- --level debug --not-tags http sql 228sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run parse-log -- --level debug --not-tags http sql
229 229
230$ # Docker installation 230# Docker installation
231$ cd /var/www/peertube-docker 231cd /var/www/peertube-docker
232$ docker-compose exec -u peertube peertube npm run parse-log -- --level debug --not-tags http sql 232docker-compose exec -u peertube peertube npm run parse-log -- --level debug --not-tags http sql
233``` 233```
234 234
235### regenerate-thumbnails.js 235### regenerate-thumbnails.js
@@ -239,13 +239,13 @@ $ docker-compose exec -u peertube peertube npm run parse-log -- --level debug --
239Regenerating local video thumbnails could be useful because new PeerTube releases may increase thumbnail sizes: 239Regenerating local video thumbnails could be useful because new PeerTube releases may increase thumbnail sizes:
240 240
241```bash 241```bash
242$ # Basic installation 242# Basic installation
243$ cd /var/www/peertube/peertube-latest 243cd /var/www/peertube/peertube-latest
244$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run regenerate-thumbnails 244sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run regenerate-thumbnails
245 245
246$ # Docker installation 246# Docker installation
247$ cd /var/www/peertube-docker 247cd /var/www/peertube-docker
248$ docker-compose exec -u peertube peertube npm run regenerate-thumbnails 248docker-compose exec -u peertube peertube npm run regenerate-thumbnails
249``` 249```
250 250
251### create-transcoding-job.js 251### create-transcoding-job.js
@@ -255,25 +255,25 @@ You can use this script to force transcoding of an existing video. PeerTube need
255To generate transcoding jobs depending on the instance configuration: 255To generate transcoding jobs depending on the instance configuration:
256 256
257```bash 257```bash
258$ # Basic installation 258# Basic installation
259$ cd /var/www/peertube/peertube-latest 259cd /var/www/peertube/peertube-latest
260$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- -v [videoUUID] 260sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- -v [videoUUID]
261 261
262$ # Docker installation 262# Docker installation
263$ cd /var/www/peertube-docker 263cd /var/www/peertube-docker
264$ docker-compose exec -u peertube peertube npm run create-transcoding-job -- -v [videoUUID] 264docker-compose exec -u peertube peertube npm run create-transcoding-job -- -v [videoUUID]
265``` 265```
266 266
267Or to transcode to a specific resolution: 267Or to transcode to a specific resolution:
268 268
269```bash 269```bash
270$ # Basic installation 270# Basic installation
271$ cd /var/www/peertube/peertube-latest 271cd /var/www/peertube/peertube-latest
272$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- -v [videoUUID] -r [resolution] 272sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- -v [videoUUID] -r [resolution]
273 273
274$ # Docker installation 274# Docker installation
275$ cd /var/www/peertube-docker 275cd /var/www/peertube-docker
276$ docker-compose exec -u peertube peertube npm run create-transcoding-job -- -v [videoUUID] -r [resolution] 276docker-compose exec -u peertube peertube npm run create-transcoding-job -- -v [videoUUID] -r [resolution]
277``` 277```
278 278
279The resolution should be an integer (`1080`, `720`, `480`, etc.) 279The resolution should be an integer (`1080`, `720`, `480`, etc.)
@@ -281,13 +281,13 @@ The resolution should be an integer (`1080`, `720`, `480`, etc.)
281To generate an HLS playlist for a video: 281To generate an HLS playlist for a video:
282 282
283```bash 283```bash
284$ # Basic installation 284# Basic installation
285$ cd /var/www/peertube/peertube-latest 285cd /var/www/peertube/peertube-latest
286$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- --generate-hls -v [videoUUID] 286sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- --generate-hls -v [videoUUID]
287 287
288$ # Docker installation 288# Docker installation
289$ cd /var/www/peertube-docker 289cd /var/www/peertube-docker
290$ docker-compose exec -u peertube peertube npm run create-transcoding-job -- --generate-hls -v [videoUUID] 290docker-compose exec -u peertube peertube npm run create-transcoding-job -- --generate-hls -v [videoUUID]
291``` 291```
292 292
293### create-import-video-file-job.js 293### 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
296You 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. 296You 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.
297 297
298```bash 298```bash
299$ # Basic installation 299# Basic installation
300$ cd /var/www/peertube/peertube-latest 300cd /var/www/peertube/peertube-latest
301$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-import-video-file-job -- -v [videoUUID] -i [videoFile] 301sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-import-video-file-job -- -v [videoUUID] -i [videoFile]
302 302
303$ # Docker installation 303# Docker installation
304$ cd /var/www/peertube-docker 304cd /var/www/peertube-docker
305$ docker-compose exec -u peertube peertube npm run create-import-video-file-job -- -v [videoUUID] -i [videoFile] 305docker-compose exec -u peertube peertube npm run create-import-video-file-job -- -v [videoUUID] -i [videoFile]
306``` 306```
307 307
308### create-move-video-storage-job.js 308### create-move-video-storage-job.js
@@ -312,25 +312,25 @@ $ docker-compose exec -u peertube peertube npm run create-import-video-file-job
312Use this script to move all video files or a specific video file to object storage. 312Use this script to move all video files or a specific video file to object storage.
313 313
314```bash 314```bash
315$ # Basic installation 315# Basic installation
316$ cd /var/www/peertube/peertube-latest 316cd /var/www/peertube/peertube-latest
317$ 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] 317sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-move-video-storage-job -- --to-object-storage -v [videoUUID]
318 318
319$ # Docker installation 319# Docker installation
320$ cd /var/www/peertube-docker 320cd /var/www/peertube-docker
321$ docker-compose exec -u peertube peertube npm run create-move-video-storage-job -- --to-object-storage -v [videoUUID] 321docker-compose exec -u peertube peertube npm run create-move-video-storage-job -- --to-object-storage -v [videoUUID]
322``` 322```
323 323
324The script can also move all video files that are not already in object storage: 324The script can also move all video files that are not already in object storage:
325 325
326```bash 326```bash
327$ # Basic installation 327# Basic installation
328$ cd /var/www/peertube/peertube-latest 328cd /var/www/peertube/peertube-latest
329$ 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 329sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-move-video-storage-job -- --to-object-storage --all-videos
330 330
331$ # Docker installation 331# Docker installation
332$ cd /var/www/peertube-docker 332cd /var/www/peertube-docker
333$ docker-compose exec -u peertube peertube npm run create-move-video-storage-job -- --to-object-storage --all-videos 333docker-compose exec -u peertube peertube npm run create-move-video-storage-job -- --to-object-storage --all-videos
334``` 334```
335 335
336 336
@@ -340,8 +340,8 @@ Some transcoded videos or shutdown at a bad time can leave some unused files on
340Stop PeerTube and delete these files (a confirmation will be demanded first): 340Stop PeerTube and delete these files (a confirmation will be demanded first):
341 341
342```bash 342```bash
343$ cd /var/www/peertube/peertube-latest 343cd /var/www/peertube/peertube-latest
344$ sudo systemctl stop peertube && sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run prune-storage 344sudo systemctl stop peertube && sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run prune-storage
345``` 345```
346 346
347 347
@@ -353,13 +353,13 @@ invalid torrent files and invalid URLs in your database. To fix this, you have
353to run the command below (keep in mind your follower instances will NOT update their URLs). 353to run the command below (keep in mind your follower instances will NOT update their URLs).
354 354
355```bash 355```bash
356$ # Basic installation 356# Basic installation
357$ cd /var/www/peertube/peertube-latest 357cd /var/www/peertube/peertube-latest
358$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run update-host 358sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run update-host
359 359
360$ # Docker installation 360# Docker installation
361$ cd /var/www/peertube-docker 361cd /var/www/peertube-docker
362$ docker-compose exec -u peertube peertube npm run update-host 362docker-compose exec -u peertube peertube npm run update-host
363``` 363```
364 364
365### reset-password.js 365### reset-password.js
@@ -367,13 +367,13 @@ $ docker-compose exec -u peertube peertube npm run update-host
367To reset a user password from CLI, run: 367To reset a user password from CLI, run:
368 368
369```bash 369```bash
370$ # Basic installation 370# Basic installation
371$ cd /var/www/peertube/peertube-latest 371cd /var/www/peertube/peertube-latest
372$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u target_username 372sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u target_username
373 373
374$ # Docker installation 374# Docker installation
375$ cd /var/www/peertube-docker 375cd /var/www/peertube-docker
376$ docker-compose exec -u peertube peertube npm run reset-password -- -u target_username 376docker-compose exec -u peertube peertube npm run reset-password -- -u target_username
377``` 377```
378 378
379 379
@@ -385,32 +385,32 @@ If PeerTube is running, you need to restart it for the changes to take effect (w
385To install/update a plugin or a theme from the disk: 385To install/update a plugin or a theme from the disk:
386 386
387```bash 387```bash
388$ cd /var/www/peertube/peertube-latest 388cd /var/www/peertube/peertube-latest
389$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:install -- --plugin-path /local/plugin/path 389sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:install -- --plugin-path /local/plugin/path
390 390
391$ # Docker installation 391# Docker installation
392$ cd /var/www/peertube-docker 392cd /var/www/peertube-docker
393$ docker-compose exec -u peertube peertube npm run plugin:install -- --plugin-path /local/plugin/path 393docker-compose exec -u peertube peertube npm run plugin:install -- --plugin-path /local/plugin/path
394``` 394```
395 395
396From NPM: 396From NPM:
397 397
398```bash 398```bash
399$ cd /var/www/peertube/peertube-latest 399cd /var/www/peertube/peertube-latest
400$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:install -- --npm-name peertube-plugin-myplugin 400sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:install -- --npm-name peertube-plugin-myplugin
401 401
402$ # Docker installation 402# Docker installation
403$ cd /var/www/peertube-docker 403cd /var/www/peertube-docker
404$ docker-compose exec -u peertube peertube npm run plugin:install -- --npm-name peertube-plugin-myplugin 404docker-compose exec -u peertube peertube npm run plugin:install -- --npm-name peertube-plugin-myplugin
405``` 405```
406 406
407To uninstall a plugin or a theme: 407To uninstall a plugin or a theme:
408 408
409```bash 409```bash
410$ cd /var/www/peertube/peertube-latest 410cd /var/www/peertube/peertube-latest
411$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin 411sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin
412 412
413$ # Docker installation 413# Docker installation
414$ cd /var/www/peertube-docker 414cd /var/www/peertube-docker
415$ docker-compose exec -u peertube peertube npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin 415docker-compose exec -u peertube peertube npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin
416``` 416```