diff options
Diffstat (limited to 'support')
-rw-r--r-- | support/doc/dependencies.md | 8 | ||||
-rw-r--r-- | support/doc/tools.md | 161 | ||||
-rw-r--r-- | support/docker/production/Dockerfile.buster | 3 | ||||
-rw-r--r-- | support/docker/production/config/custom-environment-variables.yaml | 7 | ||||
-rw-r--r-- | support/docker/production/config/production.yaml | 8 | ||||
-rwxr-xr-x | support/docker/production/entrypoint.sh | 9 | ||||
-rw-r--r-- | support/nginx/peertube | 2 |
7 files changed, 26 insertions, 172 deletions
diff --git a/support/doc/dependencies.md b/support/doc/dependencies.md index 8fe190320..7c3fcd55b 100644 --- a/support/doc/dependencies.md +++ b/support/doc/dependencies.md | |||
@@ -1,5 +1,7 @@ | |||
1 | # Dependencies | 1 | # Dependencies |
2 | 2 | ||
3 | :warning: **Warning**: dependencies guide is maintained by the community. Some parts may be outdated! :warning: | ||
4 | |||
3 | Follow the below guides, and check their versions match [required external dependencies versions](https://github.com/Chocobozzz/PeerTube/blob/master/engines.yaml). You can check them automatically via `sudo npx engineslist`. | 5 | Follow the below guides, and check their versions match [required external dependencies versions](https://github.com/Chocobozzz/PeerTube/blob/master/engines.yaml). You can check them automatically via `sudo npx engineslist`. |
4 | 6 | ||
5 | _note_: only **LTS** versions of external dependencies are supported. If no LTS version matching the version constraint is available, only **release** versions are supported. | 7 | _note_: only **LTS** versions of external dependencies are supported. If no LTS version matching the version constraint is available, only **release** versions are supported. |
@@ -554,6 +556,12 @@ rc-service redis start | |||
554 | rc-service postgresql-11 start | 556 | rc-service postgresql-11 start |
555 | ``` | 557 | ``` |
556 | 558 | ||
559 | 6. Create Python version symlink for youtube-dl: | ||
560 | |||
561 | ``` | ||
562 | sudo ln -s /usr/bin/python3 /usr/bin/python | ||
563 | ``` | ||
564 | |||
557 | ## OpenBSD | 565 | ## OpenBSD |
558 | 566 | ||
559 | 1. Install Packages: | 567 | 1. Install Packages: |
diff --git a/support/doc/tools.md b/support/doc/tools.md index 433aaeff7..78ace1344 100644 --- a/support/doc/tools.md +++ b/support/doc/tools.md | |||
@@ -10,7 +10,6 @@ | |||
10 | - [CLI wrapper](#cli-wrapper) | 10 | - [CLI wrapper](#cli-wrapper) |
11 | - [peertube-import-videos.js](#peertube-import-videosjs) | 11 | - [peertube-import-videos.js](#peertube-import-videosjs) |
12 | - [peertube-upload.js](#peertube-uploadjs) | 12 | - [peertube-upload.js](#peertube-uploadjs) |
13 | - [peertube-watch.js](#peertube-watchjs) | ||
14 | - [peertube-plugins.js](#peertube-pluginsjs) | 13 | - [peertube-plugins.js](#peertube-pluginsjs) |
15 | - [peertube-redundancy.js](#peertube-redundancyjs) | 14 | - [peertube-redundancy.js](#peertube-redundancyjs) |
16 | - [Server tools](#server-tools) | 15 | - [Server tools](#server-tools) |
@@ -22,11 +21,6 @@ | |||
22 | - [update-host.js](#update-hostjs) | 21 | - [update-host.js](#update-hostjs) |
23 | - [reset-password.js](#reset-passwordjs) | 22 | - [reset-password.js](#reset-passwordjs) |
24 | - [plugin install/uninstall](#plugin-installuninstall) | 23 | - [plugin install/uninstall](#plugin-installuninstall) |
25 | - [REPL (Read Eval Print Loop)](#repl-read-eval-print-loop) | ||
26 | - [.help](#help) | ||
27 | - [Lodash example](#lodash-example) | ||
28 | - [YoutubeDL example](#youtubedl-example) | ||
29 | - [Models examples](#models-examples) | ||
30 | 24 | ||
31 | <!-- END doctoc generated TOC please keep comment here to allow auto update --> | 25 | <!-- END doctoc generated TOC please keep comment here to allow auto update --> |
32 | 26 | ||
@@ -75,8 +69,6 @@ You can access it as `peertube` via an alias in your `.bashrc` like `alias peert | |||
75 | auth [action] register your accounts on remote instances to use them with other commands | 69 | auth [action] register your accounts on remote instances to use them with other commands |
76 | upload|up upload a video | 70 | upload|up upload a video |
77 | import-videos|import import a video from a streaming platform | 71 | import-videos|import import a video from a streaming platform |
78 | watch|w watch a video in the terminal ✩°。⋆ | ||
79 | repl initiate a REPL to access internals | ||
80 | plugins|p [action] manage instance plugins | 72 | plugins|p [action] manage instance plugins |
81 | redundancy|r [action] manage video redundancies | 73 | redundancy|r [action] manage video redundancies |
82 | help [cmd] display help for [cmd] | 74 | help [cmd] display help for [cmd] |
@@ -100,12 +92,6 @@ You can now use that account to upload videos without feeding the same parameter | |||
100 | $ peertube up <videoFile> | 92 | $ peertube up <videoFile> |
101 | ``` | 93 | ``` |
102 | 94 | ||
103 | And now that your video is online, you can watch it from the confort of your terminal (use `peertube watch --help` to see the supported players): | ||
104 | |||
105 | ```bash | ||
106 | $ peertube watch https://peertube.cpy.re/videos/watch/e8a1af4e-414a-4d58-bfe6-2146eed06d10 | ||
107 | ``` | ||
108 | |||
109 | To list, install, uninstall dynamically plugins/themes of an instance: | 95 | To list, install, uninstall dynamically plugins/themes of an instance: |
110 | 96 | ||
111 | ```bash | 97 | ```bash |
@@ -169,22 +155,6 @@ $ cd ${CLONE} | |||
169 | $ node dist/server/tools/peertube-upload.js --help | 155 | $ node dist/server/tools/peertube-upload.js --help |
170 | ``` | 156 | ``` |
171 | 157 | ||
172 | #### peertube-watch.js | ||
173 | |||
174 | You can use this script to play videos directly from the CLI. | ||
175 | |||
176 | It provides support for different players: | ||
177 | |||
178 | - ascii (default ; plays in ascii art in your terminal!) | ||
179 | - mpv | ||
180 | - mplayer | ||
181 | - vlc | ||
182 | - stdout | ||
183 | - xbmc | ||
184 | - airplay | ||
185 | - chromecast | ||
186 | |||
187 | |||
188 | #### peertube-plugins.js | 158 | #### peertube-plugins.js |
189 | 159 | ||
190 | Install/update/uninstall or list local or NPM PeerTube plugins: | 160 | Install/update/uninstall or list local or NPM PeerTube plugins: |
@@ -413,134 +383,3 @@ $ # Docker installation | |||
413 | $ cd /var/www/peertube-docker | 383 | $ cd /var/www/peertube-docker |
414 | $ docker-compose exec -u peertube peertube npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin | 384 | $ docker-compose exec -u peertube peertube npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin |
415 | ``` | 385 | ``` |
416 | |||
417 | ### REPL (Read Eval Print Loop) | ||
418 | |||
419 | If you want to interact with the application libraries and objects even when PeerTube is not running, there is a REPL for that. | ||
420 | |||
421 | usage: `node ./dist/server/tools/peertube-repl.js` | ||
422 | |||
423 | "The default evaluator will, by default, assign the result of the most recently evaluated expression to the special variable `_` (underscore). Explicitly setting `_` to a value will disable this behavior." | ||
424 | |||
425 | - type `.help` to list commands available in the repl, notice it starts with a dot | ||
426 | - type `.exit` to exit, note that you still have to press CTRL-C to actually exit, or press CTRL-C (3 times) without typing `.exit` to exit | ||
427 | - type `context` to list all available objects and libraries in the context, note: `Promise` is also available but it's not listed in the context, in case you need promises for something | ||
428 | - type `env` to see the loaded environment variables | ||
429 | - type `path` to access path library | ||
430 | - type `lodash` to access lodash library | ||
431 | - type `uuidv1` to access uuid/v1 library | ||
432 | - type `uuidv3` to access uuid/v3 library | ||
433 | - type `uuidv4` to access uuid/v4 library | ||
434 | - type `uuidv5` to access uuid/v5 library | ||
435 | - type `YoutubeDL` to access youtube-dl library | ||
436 | - type `cli` to access the cli helpers object | ||
437 | - type `logger` to access the logger; if you log to it, it will write to stdout and to the peertube.log file | ||
438 | - type `constants` to access the constants loaded by the server | ||
439 | - type `coreUtils` to access the core-utils helpers object | ||
440 | - type `ffmpegUtils` to access the ffmpeg-utils helpers object | ||
441 | - type `peertubeCryptoUtils` to access the peertube-crypto helpers object | ||
442 | - type `signupUtils` to access the signup helpers object | ||
443 | - type `utils` to access the utils helpers object | ||
444 | - type `YoutubeDLUtils` to access the youtube-dl helpers object | ||
445 | - type `sequelizeTypescript` to access sequelizeTypescript | ||
446 | - type `modelsUtils` to access the models/utils | ||
447 | - type `models` to access the shortcut to sequelizeTypescript.models | ||
448 | - type `transaction` to access the shortcut to sequelizeTypescript.transaction | ||
449 | - type `query` to access the shortcut to sequelizeTypescript.query | ||
450 | - type `queryInterface` to access the shortcut to sequelizeTypescript.queryInterface | ||
451 | |||
452 | #### .help | ||
453 | |||
454 | ``` | ||
455 | PeerTube [1.0.0] (b10eb595)> .help | ||
456 | .break Sometimes you get stuck, this gets you out | ||
457 | .clear Break, and also clear the local context | ||
458 | .editor Enter editor mode | ||
459 | .exit Exit the repl | ||
460 | .help Print this help message | ||
461 | .load Load JS from a file into the REPL session | ||
462 | .r Reset REPL | ||
463 | .reset Reset REPL | ||
464 | .save Save all evaluated commands in this REPL session to a file | ||
465 | PeerTube [1.0.0] (b10eb595)> | ||
466 | ``` | ||
467 | |||
468 | #### Lodash example | ||
469 | |||
470 | ``` | ||
471 | PeerTube [1.0.0] (b10eb595)> lodash.keys(context) | ||
472 | [ 'global', | ||
473 | 'console', | ||
474 | 'DTRACE_NET_SERVER_CONNECTION', | ||
475 | 'DTRACE_NET_STREAM_END', | ||
476 | 'DTRACE_HTTP_SERVER_REQUEST', | ||
477 | 'DTRACE_HTTP_SERVER_RESPONSE', | ||
478 | 'DTRACE_HTTP_CLIENT_REQUEST', | ||
479 | 'DTRACE_HTTP_CLIENT_RESPONSE', | ||
480 | 'process', | ||
481 | 'Buffer', | ||
482 | 'clearImmediate', | ||
483 | 'clearInterval', | ||
484 | 'clearTimeout', | ||
485 | 'setImmediate', | ||
486 | 'setInterval', | ||
487 | 'setTimeout', | ||
488 | 'XMLHttpRequest', | ||
489 | 'compact2string', | ||
490 | 'module', | ||
491 | 'require', | ||
492 | 'path', | ||
493 | 'repl', | ||
494 | 'context', | ||
495 | 'env', | ||
496 | 'lodash', | ||
497 | 'uuidv1', | ||
498 | 'uuidv3', | ||
499 | 'uuidv4', | ||
500 | 'uuidv5', | ||
501 | 'cli', | ||
502 | 'logger', | ||
503 | 'constants', | ||
504 | 'Sequelize', | ||
505 | 'sequelizeTypescript', | ||
506 | 'modelsUtils', | ||
507 | 'models', | ||
508 | 'transaction', | ||
509 | 'query', | ||
510 | 'queryInterface', | ||
511 | 'YoutubeDL', | ||
512 | 'coreUtils', | ||
513 | 'ffmpegUtils', | ||
514 | 'peertubeCryptoUtils', | ||
515 | 'signupUtils', | ||
516 | 'utils', | ||
517 | 'YoutubeDLUtils' ] | ||
518 | PeerTube [1.0.0] (b10eb595)> | ||
519 | ``` | ||
520 | |||
521 | #### YoutubeDL example | ||
522 | ``` | ||
523 | YoutubeDL.getInfo('https://www.youtube.com/watch?v=I5ZN289jjDo', function(err, data) {console.log(err, data)}) | ||
524 | ``` | ||
525 | |||
526 | #### Models examples | ||
527 | ``` | ||
528 | PeerTube [1.0.0] (b10eb595)> new models.ActorModel({id: 3}).getVideoChannel().then(function(data){console.log(data.dataValues.name)}) | ||
529 | Promise { | ||
530 | _bitField: 0, | ||
531 | _fulfillmentHandler0: undefined, | ||
532 | _rejectionHandler0: undefined, | ||
533 | _promise0: undefined, | ||
534 | _receiver0: undefined } | ||
535 | PeerTube [1.0.0] (b10eb595)> Main root channel | ||
536 | PeerTube [1.0.0] (b10eb595)> let out; new models.UserModel({id: 1}).getAccount().then(function (data) {out = data.dataValues.id}) | ||
537 | Promise { | ||
538 | _bitField: 0, | ||
539 | _fulfillmentHandler0: undefined, | ||
540 | _rejectionHandler0: undefined, | ||
541 | _promise0: undefined, | ||
542 | _receiver0: undefined } | ||
543 | PeerTube [1.0.0] (b10eb595)> out | ||
544 | 2 | ||
545 | PeerTube [1.0.0] (b10eb595)> | ||
546 | ``` | ||
diff --git a/support/docker/production/Dockerfile.buster b/support/docker/production/Dockerfile.buster index 2ff0591f9..163c514f5 100644 --- a/support/docker/production/Dockerfile.buster +++ b/support/docker/production/Dockerfile.buster | |||
@@ -33,7 +33,8 @@ RUN mkdir /data /config | |||
33 | RUN chown -R peertube:peertube /data /config | 33 | RUN chown -R peertube:peertube /data /config |
34 | 34 | ||
35 | ENV NODE_ENV production | 35 | ENV NODE_ENV production |
36 | ENV NODE_CONFIG_DIR /config | 36 | ENV NODE_CONFIG_DIR /app/config:/app/support/docker/production/config:/config |
37 | ENV PEERTUBE_LOCAL_CONFIG /config | ||
37 | 38 | ||
38 | VOLUME /data | 39 | VOLUME /data |
39 | VOLUME /config | 40 | VOLUME /config |
diff --git a/support/docker/production/config/custom-environment-variables.yaml b/support/docker/production/config/custom-environment-variables.yaml index 1b474582a..7c430a995 100644 --- a/support/docker/production/config/custom-environment-variables.yaml +++ b/support/docker/production/config/custom-environment-variables.yaml | |||
@@ -68,6 +68,13 @@ object_storage: | |||
68 | prefix: "PEERTUBE_OBJECT_STORAGE_VIDEOS_PREFIX" | 68 | prefix: "PEERTUBE_OBJECT_STORAGE_VIDEOS_PREFIX" |
69 | base_url: "PEERTUBE_OBJECT_STORAGE_VIDEOS_BASE_URL" | 69 | base_url: "PEERTUBE_OBJECT_STORAGE_VIDEOS_BASE_URL" |
70 | 70 | ||
71 | webadmin: | ||
72 | configuration: | ||
73 | edit: | ||
74 | allowed: | ||
75 | __name: "PEERTUBE_ALLOW_WEBADMIN_CONFIG" | ||
76 | __format: "json" | ||
77 | |||
71 | log: | 78 | log: |
72 | level: "PEERTUBE_LOG_LEVEL" | 79 | level: "PEERTUBE_LOG_LEVEL" |
73 | log_ping_requests: | 80 | log_ping_requests: |
diff --git a/support/docker/production/config/production.yaml b/support/docker/production/config/production.yaml index 8c8f8d6bc..3bff8a0b0 100644 --- a/support/docker/production/config/production.yaml +++ b/support/docker/production/config/production.yaml | |||
@@ -55,7 +55,13 @@ storage: | |||
55 | captions: '../data/captions/' | 55 | captions: '../data/captions/' |
56 | cache: '../data/cache/' | 56 | cache: '../data/cache/' |
57 | plugins: '../data/plugins/' | 57 | plugins: '../data/plugins/' |
58 | # Overridable client files : logo.svg, favicon.png and icons/*.png (PWA) in client/dist/assets/images | 58 | # Overridable client files in client/dist/assets/images : |
59 | # - logo.svg | ||
60 | # - favicon.png | ||
61 | # - default-playlist.jpg | ||
62 | # - default-avatar-account.png | ||
63 | # - default-avatar-video-channel.png | ||
64 | # - and icons/*.png (PWA) | ||
59 | # Could contain for example assets/images/favicon.png | 65 | # Could contain for example assets/images/favicon.png |
60 | # If the file exists, peertube will serve it | 66 | # If the file exists, peertube will serve it |
61 | # If not, peertube will fallback to the default fil | 67 | # If not, peertube will fallback to the default fil |
diff --git a/support/docker/production/entrypoint.sh b/support/docker/production/entrypoint.sh index 7dd626b9f..261055e84 100755 --- a/support/docker/production/entrypoint.sh +++ b/support/docker/production/entrypoint.sh | |||
@@ -1,15 +1,8 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | set -e | 2 | set -e |
3 | 3 | ||
4 | # Populate config directory | ||
5 | if [ -z "$(ls -A /config)" ]; then | ||
6 | cp /app/support/docker/production/config/* /config | ||
7 | fi | ||
8 | 4 | ||
9 | # Always copy default and custom env configuration file, in cases where new keys were added | 5 | find /config ! -user peertube -exec chown peertube:peertube {} \; || true |
10 | cp /app/config/default.yaml /config | ||
11 | cp /app/support/docker/production/config/custom-environment-variables.yaml /config | ||
12 | find /config ! -user peertube -exec chown peertube:peertube {} \; | ||
13 | 6 | ||
14 | # first arg is `-f` or `--some-option` | 7 | # first arg is `-f` or `--some-option` |
15 | # or first arg is `something.conf` | 8 | # or first arg is `something.conf` |
diff --git a/support/nginx/peertube b/support/nginx/peertube index 3ef62367c..2b1600d97 100644 --- a/support/nginx/peertube +++ b/support/nginx/peertube | |||
@@ -172,7 +172,7 @@ server { | |||
172 | 172 | ||
173 | # Bypass PeerTube for performance reasons. Optional. | 173 | # Bypass PeerTube for performance reasons. Optional. |
174 | # Should be consistent with client-overrides assets list in /server/controllers/client.ts | 174 | # Should be consistent with client-overrides assets list in /server/controllers/client.ts |
175 | location ~ ^/client/(assets/images/(icons/icon-36x36\.png|icons/icon-48x48\.png|icons/icon-72x72\.png|icons/icon-96x96\.png|icons/icon-144x144\.png|icons/icon-192x192\.png|icons/icon-512x512\.png|logo\.svg|favicon\.png))$ { | 175 | location ~ ^/client/(assets/images/(icons/icon-36x36\.png|icons/icon-48x48\.png|icons/icon-72x72\.png|icons/icon-96x96\.png|icons/icon-144x144\.png|icons/icon-192x192\.png|icons/icon-512x512\.png|logo\.svg|favicon\.png|default-playlist\.jpg|default-avatar-account\.png|default-avatar-video-channel\.png))$ { |
176 | add_header Cache-Control "public, max-age=31536000, immutable"; # Cache 1 year | 176 | add_header Cache-Control "public, max-age=31536000, immutable"; # Cache 1 year |
177 | 177 | ||
178 | root /var/www/peertube; | 178 | root /var/www/peertube; |