diff options
Diffstat (limited to 'support/doc')
-rw-r--r-- | support/doc/api/openapi.yaml | 14 | ||||
-rw-r--r-- | support/doc/tools.md | 98 |
2 files changed, 61 insertions, 51 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index 9848c93ee..cb6ba9af5 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml | |||
@@ -1434,6 +1434,8 @@ components: | |||
1434 | - type: array | 1434 | - type: array |
1435 | items: | 1435 | items: |
1436 | type: number | 1436 | type: number |
1437 | style: form | ||
1438 | explode: false | ||
1437 | tagsOneOf: | 1439 | tagsOneOf: |
1438 | name: tagsOneOf | 1440 | name: tagsOneOf |
1439 | in: query | 1441 | in: query |
@@ -1445,6 +1447,8 @@ components: | |||
1445 | - type: array | 1447 | - type: array |
1446 | items: | 1448 | items: |
1447 | type: string | 1449 | type: string |
1450 | style: form | ||
1451 | explode: false | ||
1448 | tagsAllOf: | 1452 | tagsAllOf: |
1449 | name: tagsAllOf | 1453 | name: tagsAllOf |
1450 | in: query | 1454 | in: query |
@@ -1456,6 +1460,8 @@ components: | |||
1456 | - type: array | 1460 | - type: array |
1457 | items: | 1461 | items: |
1458 | type: string | 1462 | type: string |
1463 | style: form | ||
1464 | explode: false | ||
1459 | languageOneOf: | 1465 | languageOneOf: |
1460 | name: languageOneOf | 1466 | name: languageOneOf |
1461 | in: query | 1467 | in: query |
@@ -1463,10 +1469,12 @@ components: | |||
1463 | description: language id of the video | 1469 | description: language id of the video |
1464 | schema: | 1470 | schema: |
1465 | oneOf: | 1471 | oneOf: |
1466 | - type: number | 1472 | - type: string |
1467 | - type: array | 1473 | - type: array |
1468 | items: | 1474 | items: |
1469 | type: number | 1475 | type: string |
1476 | style: form | ||
1477 | explode: false | ||
1470 | licenceOneOf: | 1478 | licenceOneOf: |
1471 | name: licenceOneOf | 1479 | name: licenceOneOf |
1472 | in: query | 1480 | in: query |
@@ -1478,6 +1486,8 @@ components: | |||
1478 | - type: array | 1486 | - type: array |
1479 | items: | 1487 | items: |
1480 | type: number | 1488 | type: number |
1489 | style: form | ||
1490 | explode: false | ||
1481 | nsfw: | 1491 | nsfw: |
1482 | name: nsfw | 1492 | name: nsfw |
1483 | in: query | 1493 | in: query |
diff --git a/support/doc/tools.md b/support/doc/tools.md index 1c7739525..4f806a9db 100644 --- a/support/doc/tools.md +++ b/support/doc/tools.md | |||
@@ -4,13 +4,13 @@ | |||
4 | <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | 4 | <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
5 | **Table of Contents** | 5 | **Table of Contents** |
6 | 6 | ||
7 | - [CLI wrapper](#cli-wrapper) | ||
8 | - [Remote Tools](#remote-tools) | 7 | - [Remote Tools](#remote-tools) |
9 | - [Dependencies](#dependencies) | 8 | - [Dependencies](#dependencies) |
10 | - [Installation](#installation) | 9 | - [Installation](#installation) |
11 | - [peertube-import-videos.js](#peertube-import-videosjs) | 10 | - [CLI wrapper](#cli-wrapper) |
12 | - [peertube-upload.js](#peertube-uploadjs) | 11 | - [peertube-import-videos.js](#peertube-import-videosjs) |
13 | - [peertube-watch.js](#peertube-watchjs) | 12 | - [peertube-upload.js](#peertube-uploadjs) |
13 | - [peertube-watch.js](#peertube-watchjs) | ||
14 | - [Server tools](#server-tools) | 14 | - [Server tools](#server-tools) |
15 | - [parse-log](#parse-log) | 15 | - [parse-log](#parse-log) |
16 | - [create-transcoding-job.js](#create-transcoding-jobjs) | 16 | - [create-transcoding-job.js](#create-transcoding-jobjs) |
@@ -26,9 +26,40 @@ | |||
26 | 26 | ||
27 | <!-- END doctoc generated TOC please keep comment here to allow auto update --> | 27 | <!-- END doctoc generated TOC please keep comment here to allow auto update --> |
28 | 28 | ||
29 | ## CLI wrapper | 29 | ## Remote Tools |
30 | |||
31 | You need at least 512MB RAM to run the script. | ||
32 | Scripts can be launched directly from a PeerTube server, or from a separate server, even a desktop PC. | ||
33 | You need to follow all the following steps even if you are on a PeerTube server (including cloning the git repository in a different directory than your production installation because the scripts utilize non-production dependencies). | ||
34 | |||
35 | ### Dependencies | ||
36 | |||
37 | Install the [PeerTube dependencies](dependencies.md). | ||
38 | |||
39 | ### Installation | ||
40 | |||
41 | Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server): | ||
42 | |||
43 | ``` | ||
44 | $ git clone https://github.com/Chocobozzz/PeerTube.git | ||
45 | $ CLONE="$(pwd)/PeerTube" | ||
46 | ``` | ||
47 | |||
48 | Run ``yarn install --pure-lockfile`` | ||
49 | ``` | ||
50 | $ cd ${CLONE} | ||
51 | $ yarn install --pure-lockfile | ||
52 | ``` | ||
53 | |||
54 | Build server tools: | ||
55 | ``` | ||
56 | $ cd ${CLONE} | ||
57 | $ npm run build:server | ||
58 | ``` | ||
59 | |||
60 | ### CLI wrapper | ||
30 | 61 | ||
31 | The wrapper provides a convenient interface to most scripts, and requires the [same dependencies](#dependencies). You can access it as `peertube` via an alias in your `.bashrc` like `alias peertube="node ${PEERTUBE_PATH}/dist/server/tools/peertube.js"`: | 62 | The wrapper provides a convenient interface to the following scripts. You can access it as `peertube` via an alias in your `.bashrc` like `alias peertube="node /your/peertube/directory/dist/server/tools/peertube.js"`: |
32 | 63 | ||
33 | ``` | 64 | ``` |
34 | Usage: peertube [command] [options] | 65 | Usage: peertube [command] [options] |
@@ -51,12 +82,12 @@ The wrapper provides a convenient interface to most scripts, and requires the [s | |||
51 | The wrapper can keep track of instances you have an account on. We limit to one account per instance for now. | 82 | The wrapper can keep track of instances you have an account on. We limit to one account per instance for now. |
52 | 83 | ||
53 | ```bash | 84 | ```bash |
54 | $ peertube auth add -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD" | 85 | $ peertube auth add -u 'PEERTUBE_URL' -U 'PEERTUBE_USER' --password 'PEERTUBE_PASSWORD' |
55 | $ peertube auth list | 86 | $ peertube auth list |
56 | ┌──────────────────────────────┬──────────────────────────────┐ | 87 | ┌──────────────────────────────┬──────────────────────────────┐ |
57 | │ instance │ login │ | 88 | │ instance │ login │ |
58 | ├──────────────────────────────┼──────────────────────────────┤ | 89 | ├──────────────────────────────┼──────────────────────────────┤ |
59 | │ "PEERTUBE_URL" │ "PEERTUBE_USER" │ | 90 | │ 'PEERTUBE_URL' │ 'PEERTUBE_USER' │ |
60 | └──────────────────────────────┴──────────────────────────────┘ | 91 | └──────────────────────────────┴──────────────────────────────┘ |
61 | ``` | 92 | ``` |
62 | 93 | ||
@@ -72,53 +103,22 @@ And now that your video is online, you can watch it from the confort of your ter | |||
72 | $ peertube watch https://peertube.cpy.re/videos/watch/e8a1af4e-414a-4d58-bfe6-2146eed06d10 | 103 | $ peertube watch https://peertube.cpy.re/videos/watch/e8a1af4e-414a-4d58-bfe6-2146eed06d10 |
73 | ``` | 104 | ``` |
74 | 105 | ||
75 | ## Remote Tools | 106 | #### peertube-import-videos.js |
76 | |||
77 | You need at least 512MB RAM to run the script. | ||
78 | Scripts can be launched directly from a PeerTube server, or from a separate server, even a desktop PC. | ||
79 | You need to follow all the following steps even if you are on a PeerTube server (including cloning the git repository in a different directory than your production installation because the scripts utilize non-production dependencies). | ||
80 | |||
81 | ### Dependencies | ||
82 | |||
83 | Install the [PeerTube dependencies](dependencies.md). | ||
84 | |||
85 | ### Installation | ||
86 | |||
87 | Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server): | ||
88 | |||
89 | ``` | ||
90 | $ git clone https://github.com/Chocobozzz/PeerTube.git | ||
91 | $ CLONE="$(pwd)/PeerTube" | ||
92 | ``` | ||
93 | |||
94 | Run ``yarn install`` | ||
95 | ``` | ||
96 | $ cd ${CLONE} | ||
97 | $ yarn install | ||
98 | ``` | ||
99 | |||
100 | Build server tools: | ||
101 | ``` | ||
102 | $ cd ${CLONE} | ||
103 | $ npm run build:server | ||
104 | ``` | ||
105 | |||
106 | ### peertube-import-videos.js | ||
107 | 107 | ||
108 | You can use this script to import videos from all [supported sites of youtube-dl](https://rg3.github.io/youtube-dl/supportedsites.html) into PeerTube. | 108 | You can use this script to import videos from all [supported sites of youtube-dl](https://rg3.github.io/youtube-dl/supportedsites.html) into PeerTube. |
109 | Be sure you own the videos or have the author's authorization to do so. | 109 | Be sure you own the videos or have the author's authorization to do so. |
110 | 110 | ||
111 | ```sh | 111 | ```sh |
112 | $ node dist/server/tools/peertube-import-videos.js \ | 112 | $ node dist/server/tools/peertube-import-videos.js \ |
113 | -u "PEERTUBE_URL" \ | 113 | -u 'PEERTUBE_URL' \ |
114 | -U "PEERTUBE_USER" \ | 114 | -U 'PEERTUBE_USER' \ |
115 | --password "PEERTUBE_PASSWORD" \ | 115 | --password 'PEERTUBE_PASSWORD' \ |
116 | -t "TARGET_URL" | 116 | -t 'TARGET_URL' |
117 | ``` | 117 | ``` |
118 | 118 | ||
119 | * `PEERTUBE_URL` : the full URL of your PeerTube server where you want to import, eg: https://peertube.cpy.re | 119 | * `PEERTUBE_URL` : the full URL of your PeerTube server where you want to import, eg: https://peertube.cpy.re |
120 | * `PEERTUBE_USER` : your PeerTube account where videos will be uploaded | 120 | * `PEERTUBE_USER` : your PeerTube account where videos will be uploaded |
121 | * `PEERTUBE_PASSWORD` : password of your PeerTube account (if omitted, you will be prompted for it) | 121 | * `PEERTUBE_PASSWORD` : password of your PeerTube account (if `PEERTUBE_PASSWORD` is omitted, you will be prompted for it) |
122 | * `TARGET_URL` : the target url you want to import. Examples: | 122 | * `TARGET_URL` : the target url you want to import. Examples: |
123 | * YouTube: | 123 | * YouTube: |
124 | * Channel: https://www.youtube.com/channel/ChannelId | 124 | * Channel: https://www.youtube.com/channel/ChannelId |
@@ -133,7 +133,7 @@ Already downloaded videos will not be uploaded twice, so you can run and re-run | |||
133 | Videos will be publicly available after transcoding (you can see them before that in your account on the web interface). | 133 | Videos will be publicly available after transcoding (you can see them before that in your account on the web interface). |
134 | 134 | ||
135 | 135 | ||
136 | ### peertube-upload.js | 136 | #### peertube-upload.js |
137 | 137 | ||
138 | You can use this script to import videos directly from the CLI. | 138 | You can use this script to import videos directly from the CLI. |
139 | 139 | ||
@@ -144,7 +144,7 @@ $ cd ${CLONE} | |||
144 | $ node dist/server/tools/peertube-upload.js --help | 144 | $ node dist/server/tools/peertube-upload.js --help |
145 | ``` | 145 | ``` |
146 | 146 | ||
147 | ### peertube-watch.js | 147 | #### peertube-watch.js |
148 | 148 | ||
149 | You can use this script to play videos directly from the CLI. | 149 | You can use this script to play videos directly from the CLI. |
150 | 150 | ||
@@ -198,10 +198,10 @@ $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production | |||
198 | ### prune-storage.js | 198 | ### prune-storage.js |
199 | 199 | ||
200 | Some transcoded videos or shutdown at a bad time can leave some unused files on your storage. | 200 | Some transcoded videos or shutdown at a bad time can leave some unused files on your storage. |
201 | To delete them (a confirmation will be demanded first): | 201 | Stop PeerTube and delete these files (a confirmation will be demanded first): |
202 | 202 | ||
203 | ``` | 203 | ``` |
204 | $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run prune-storage | 204 | $ sudo systemctl stop peertube && sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run prune-storage |
205 | ``` | 205 | ``` |
206 | 206 | ||
207 | ### optimize-old-videos.js | 207 | ### optimize-old-videos.js |