diff options
Diffstat (limited to 'support/doc')
-rw-r--r-- | support/doc/api/openapi.yaml | 346 | ||||
-rw-r--r-- | support/doc/tools.md | 26 |
2 files changed, 360 insertions, 12 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index 30a250c70..b0473c7e7 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml | |||
@@ -130,9 +130,6 @@ paths: | |||
130 | summary: Get the account by name | 130 | summary: Get the account by name |
131 | parameters: | 131 | parameters: |
132 | - $ref: '#/components/parameters/name' | 132 | - $ref: '#/components/parameters/name' |
133 | - $ref: '#/components/parameters/start' | ||
134 | - $ref: '#/components/parameters/count' | ||
135 | - $ref: '#/components/parameters/sort' | ||
136 | responses: | 133 | responses: |
137 | '200': | 134 | '200': |
138 | description: successful operation | 135 | description: successful operation |
@@ -204,6 +201,10 @@ paths: | |||
204 | tags: | 201 | tags: |
205 | - Accounts | 202 | - Accounts |
206 | summary: Get all accounts | 203 | summary: Get all accounts |
204 | parameters: | ||
205 | - $ref: '#/components/parameters/start' | ||
206 | - $ref: '#/components/parameters/count' | ||
207 | - $ref: '#/components/parameters/sort' | ||
207 | responses: | 208 | responses: |
208 | '200': | 209 | '200': |
209 | description: successful operation | 210 | description: successful operation |
@@ -233,6 +234,10 @@ paths: | |||
233 | responses: | 234 | responses: |
234 | '200': | 235 | '200': |
235 | description: successful operation | 236 | description: successful operation |
237 | content: | ||
238 | application/json: | ||
239 | schema: | ||
240 | $ref: '#/components/schemas/ServerConfigAbout' | ||
236 | /config/custom: | 241 | /config/custom: |
237 | get: | 242 | get: |
238 | summary: Get the runtime configuration of the server | 243 | summary: Get the runtime configuration of the server |
@@ -244,6 +249,10 @@ paths: | |||
244 | responses: | 249 | responses: |
245 | '200': | 250 | '200': |
246 | description: successful operation | 251 | description: successful operation |
252 | content: | ||
253 | application/json: | ||
254 | schema: | ||
255 | $ref: '#/components/schemas/ServerConfigCustom' | ||
247 | put: | 256 | put: |
248 | summary: Set the runtime configuration of the server | 257 | summary: Set the runtime configuration of the server |
249 | tags: | 258 | tags: |
@@ -726,8 +735,7 @@ paths: | |||
726 | type: string | 735 | type: string |
727 | format: binary | 736 | format: binary |
728 | encoding: | 737 | encoding: |
729 | profileImage: | 738 | avatarfile: |
730 | # only accept png/jpeg | ||
731 | contentType: image/png, image/jpeg | 739 | contentType: image/png, image/jpeg |
732 | /videos: | 740 | /videos: |
733 | get: | 741 | get: |
@@ -829,9 +837,11 @@ paths: | |||
829 | thumbnailfile: | 837 | thumbnailfile: |
830 | description: Video thumbnail file | 838 | description: Video thumbnail file |
831 | type: string | 839 | type: string |
840 | format: binary | ||
832 | previewfile: | 841 | previewfile: |
833 | description: Video preview file | 842 | description: Video preview file |
834 | type: string | 843 | type: string |
844 | format: binary | ||
835 | category: | 845 | category: |
836 | description: Video category | 846 | description: Video category |
837 | type: string | 847 | type: string |
@@ -874,6 +884,11 @@ paths: | |||
874 | format: date-time | 884 | format: date-time |
875 | scheduleUpdate: | 885 | scheduleUpdate: |
876 | $ref: '#/components/schemas/VideoScheduledUpdate' | 886 | $ref: '#/components/schemas/VideoScheduledUpdate' |
887 | encoding: | ||
888 | thumbnailfile: | ||
889 | contentType: image/jpeg | ||
890 | previewfile: | ||
891 | contentType: image/jpeg | ||
877 | get: | 892 | get: |
878 | summary: Get a video by its id | 893 | summary: Get a video by its id |
879 | tags: | 894 | tags: |
@@ -1029,9 +1044,11 @@ paths: | |||
1029 | thumbnailfile: | 1044 | thumbnailfile: |
1030 | description: Video thumbnail file | 1045 | description: Video thumbnail file |
1031 | type: string | 1046 | type: string |
1047 | format: binary | ||
1032 | previewfile: | 1048 | previewfile: |
1033 | description: Video preview file | 1049 | description: Video preview file |
1034 | type: string | 1050 | type: string |
1051 | format: binary | ||
1035 | privacy: | 1052 | privacy: |
1036 | $ref: '#/components/schemas/VideoPrivacySet' | 1053 | $ref: '#/components/schemas/VideoPrivacySet' |
1037 | category: | 1054 | category: |
@@ -1080,6 +1097,13 @@ paths: | |||
1080 | - videofile | 1097 | - videofile |
1081 | - channelId | 1098 | - channelId |
1082 | - name | 1099 | - name |
1100 | encoding: | ||
1101 | videofile: | ||
1102 | contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream | ||
1103 | thumbnailfile: | ||
1104 | contentType: image/jpeg | ||
1105 | previewfile: | ||
1106 | contentType: image/jpeg | ||
1083 | x-code-samples: | 1107 | x-code-samples: |
1084 | - lang: Shell | 1108 | - lang: Shell |
1085 | source: | | 1109 | source: | |
@@ -1142,9 +1166,11 @@ paths: | |||
1142 | thumbnailfile: | 1166 | thumbnailfile: |
1143 | description: Video thumbnail file | 1167 | description: Video thumbnail file |
1144 | type: string | 1168 | type: string |
1169 | format: binary | ||
1145 | previewfile: | 1170 | previewfile: |
1146 | description: Video preview file | 1171 | description: Video preview file |
1147 | type: string | 1172 | type: string |
1173 | format: binary | ||
1148 | privacy: | 1174 | privacy: |
1149 | $ref: '#/components/schemas/VideoPrivacySet' | 1175 | $ref: '#/components/schemas/VideoPrivacySet' |
1150 | category: | 1176 | category: |
@@ -1188,6 +1214,13 @@ paths: | |||
1188 | required: | 1214 | required: |
1189 | - channelId | 1215 | - channelId |
1190 | - name | 1216 | - name |
1217 | encoding: | ||
1218 | torrentfile: | ||
1219 | contentType: application/x-bittorrent | ||
1220 | thumbnailfile: | ||
1221 | contentType: image/jpeg | ||
1222 | previewfile: | ||
1223 | contentType: image/jpeg | ||
1191 | /videos/abuse: | 1224 | /videos/abuse: |
1192 | get: | 1225 | get: |
1193 | summary: Get list of reported video abuses | 1226 | summary: Get list of reported video abuses |
@@ -1308,6 +1341,9 @@ paths: | |||
1308 | description: The file to upload. | 1341 | description: The file to upload. |
1309 | type: string | 1342 | type: string |
1310 | format: binary | 1343 | format: binary |
1344 | encoding: | ||
1345 | captionfile: | ||
1346 | contentType: text/vtt, application/x-subrip | ||
1311 | responses: | 1347 | responses: |
1312 | '204': | 1348 | '204': |
1313 | $ref: '#/paths/~1users~1me/put/responses/204' | 1349 | $ref: '#/paths/~1users~1me/put/responses/204' |
@@ -1952,7 +1988,7 @@ components: | |||
1952 | description: 'Video file size in bytes' | 1988 | description: 'Video file size in bytes' |
1953 | torrentUrl: | 1989 | torrentUrl: |
1954 | type: string | 1990 | type: string |
1955 | torrentDownaloadUrl: | 1991 | torrentDownloadUrl: |
1956 | type: string | 1992 | type: string |
1957 | fileUrl: | 1993 | fileUrl: |
1958 | type: string | 1994 | type: string |
@@ -2227,8 +2263,6 @@ components: | |||
2227 | properties: | 2263 | properties: |
2228 | id: | 2264 | id: |
2229 | type: number | 2265 | type: number |
2230 | uuid: | ||
2231 | type: string | ||
2232 | url: | 2266 | url: |
2233 | type: string | 2267 | type: string |
2234 | name: | 2268 | name: |
@@ -2249,8 +2283,12 @@ components: | |||
2249 | allOf: | 2283 | allOf: |
2250 | - $ref: '#/components/schemas/Actor' | 2284 | - $ref: '#/components/schemas/Actor' |
2251 | - properties: | 2285 | - properties: |
2286 | userId: | ||
2287 | type: string | ||
2252 | displayName: | 2288 | displayName: |
2253 | type: string | 2289 | type: string |
2290 | description: | ||
2291 | type: string | ||
2254 | User: | 2292 | User: |
2255 | properties: | 2293 | properties: |
2256 | id: | 2294 | id: |
@@ -2294,18 +2332,102 @@ components: | |||
2294 | type: number | 2332 | type: number |
2295 | ServerConfig: | 2333 | ServerConfig: |
2296 | properties: | 2334 | properties: |
2335 | instance: | ||
2336 | type: object | ||
2337 | properties: | ||
2338 | name: | ||
2339 | type: string | ||
2340 | shortDescription: | ||
2341 | type: string | ||
2342 | defaultClientRoute: | ||
2343 | type: string | ||
2344 | isNSFW: | ||
2345 | type: boolean | ||
2346 | defaultNSFWPolicy: | ||
2347 | type: string | ||
2348 | customizations: | ||
2349 | type: object | ||
2350 | properties: | ||
2351 | javascript: | ||
2352 | type: string | ||
2353 | css: | ||
2354 | type: string | ||
2355 | plugin: | ||
2356 | type: object | ||
2357 | properties: | ||
2358 | registered: | ||
2359 | type: array | ||
2360 | items: | ||
2361 | type: string | ||
2362 | theme: | ||
2363 | type: object | ||
2364 | properties: | ||
2365 | registered: | ||
2366 | type: array | ||
2367 | items: | ||
2368 | type: string | ||
2369 | email: | ||
2370 | type: object | ||
2371 | properties: | ||
2372 | enabled: | ||
2373 | type: boolean | ||
2374 | contactForm: | ||
2375 | type: object | ||
2376 | properties: | ||
2377 | enabled: | ||
2378 | type: boolean | ||
2379 | serverVersion: | ||
2380 | type: string | ||
2381 | serverCommit: | ||
2382 | type: string | ||
2297 | signup: | 2383 | signup: |
2298 | type: object | 2384 | type: object |
2299 | properties: | 2385 | properties: |
2300 | allowed: | 2386 | allowed: |
2301 | type: boolean | 2387 | type: boolean |
2388 | allowedForCurrentIP: | ||
2389 | type: boolean | ||
2390 | requiresEmailVerification: | ||
2391 | type: boolean | ||
2302 | transcoding: | 2392 | transcoding: |
2303 | type: object | 2393 | type: object |
2304 | properties: | 2394 | properties: |
2395 | hls: | ||
2396 | type: object | ||
2397 | properties: | ||
2398 | enabled: | ||
2399 | type: boolean | ||
2305 | enabledResolutions: | 2400 | enabledResolutions: |
2306 | type: array | 2401 | type: array |
2307 | items: | 2402 | items: |
2308 | type: number | 2403 | type: number |
2404 | import: | ||
2405 | type: object | ||
2406 | properties: | ||
2407 | videos: | ||
2408 | type: object | ||
2409 | properties: | ||
2410 | http: | ||
2411 | type: object | ||
2412 | properties: | ||
2413 | enabled: | ||
2414 | type: boolean | ||
2415 | torrent: | ||
2416 | type: object | ||
2417 | properties: | ||
2418 | enabled: | ||
2419 | type: boolean | ||
2420 | autoBlacklist: | ||
2421 | type: object | ||
2422 | properties: | ||
2423 | videos: | ||
2424 | type: object | ||
2425 | properties: | ||
2426 | ofUsers: | ||
2427 | type: object | ||
2428 | properties: | ||
2429 | enabled: | ||
2430 | type: boolean | ||
2309 | avatar: | 2431 | avatar: |
2310 | type: object | 2432 | type: object |
2311 | properties: | 2433 | properties: |
@@ -2324,6 +2446,18 @@ components: | |||
2324 | video: | 2446 | video: |
2325 | type: object | 2447 | type: object |
2326 | properties: | 2448 | properties: |
2449 | image: | ||
2450 | type: object | ||
2451 | properties: | ||
2452 | extensions: | ||
2453 | type: array | ||
2454 | items: | ||
2455 | type: string | ||
2456 | size: | ||
2457 | type: object | ||
2458 | properties: | ||
2459 | max: | ||
2460 | type: number | ||
2327 | file: | 2461 | file: |
2328 | type: object | 2462 | type: object |
2329 | properties: | 2463 | properties: |
@@ -2331,6 +2465,202 @@ components: | |||
2331 | type: array | 2465 | type: array |
2332 | items: | 2466 | items: |
2333 | type: string | 2467 | type: string |
2468 | videoCaption: | ||
2469 | type: object | ||
2470 | properties: | ||
2471 | file: | ||
2472 | type: object | ||
2473 | properties: | ||
2474 | size: | ||
2475 | type: object | ||
2476 | properties: | ||
2477 | max: | ||
2478 | type: number | ||
2479 | extensions: | ||
2480 | type: array | ||
2481 | items: | ||
2482 | type: string | ||
2483 | user: | ||
2484 | type: object | ||
2485 | properties: | ||
2486 | videoQuota: | ||
2487 | type: number | ||
2488 | videoQuotaDaily: | ||
2489 | type: number | ||
2490 | trending: | ||
2491 | type: object | ||
2492 | properties: | ||
2493 | videos: | ||
2494 | type: object | ||
2495 | properties: | ||
2496 | intervalDays: | ||
2497 | type: number | ||
2498 | tracker: | ||
2499 | ype: object | ||
2500 | properties: | ||
2501 | enabled: | ||
2502 | type: boolean | ||
2503 | ServerConfigAbout: | ||
2504 | properties: | ||
2505 | instance: | ||
2506 | type: object | ||
2507 | properties: | ||
2508 | name: | ||
2509 | type: string | ||
2510 | shortDescription: | ||
2511 | type: string | ||
2512 | description: | ||
2513 | type: string | ||
2514 | terms: | ||
2515 | type: string | ||
2516 | ServerConfigCustom: | ||
2517 | properties: | ||
2518 | instance: | ||
2519 | type: object | ||
2520 | properties: | ||
2521 | name: | ||
2522 | type: string | ||
2523 | shortDescription: | ||
2524 | type: string | ||
2525 | description: | ||
2526 | type: string | ||
2527 | terms: | ||
2528 | type: string | ||
2529 | defaultClientRoute: | ||
2530 | type: string | ||
2531 | isNSFW: | ||
2532 | type: boolean | ||
2533 | defaultNSFWPolicy: | ||
2534 | type: string | ||
2535 | customizations: | ||
2536 | type: object | ||
2537 | properties: | ||
2538 | javascript: | ||
2539 | type: string | ||
2540 | css: | ||
2541 | type: string | ||
2542 | theme: | ||
2543 | type: object | ||
2544 | properties: | ||
2545 | default: | ||
2546 | type: string | ||
2547 | services: | ||
2548 | type: object | ||
2549 | properties: | ||
2550 | twitter: | ||
2551 | type: object | ||
2552 | properties: | ||
2553 | username: | ||
2554 | type: string | ||
2555 | whitelisted: | ||
2556 | type: boolean | ||
2557 | cache: | ||
2558 | type: object | ||
2559 | properties: | ||
2560 | previews: | ||
2561 | type: object | ||
2562 | properties: | ||
2563 | size: | ||
2564 | type: number | ||
2565 | captions: | ||
2566 | type: object | ||
2567 | properties: | ||
2568 | size: | ||
2569 | type: number | ||
2570 | signup: | ||
2571 | type: object | ||
2572 | properties: | ||
2573 | enabled: | ||
2574 | type: boolean | ||
2575 | limit: | ||
2576 | type: number | ||
2577 | requiresEmailVerification: | ||
2578 | type: boolean | ||
2579 | admin: | ||
2580 | type: object | ||
2581 | properties: | ||
2582 | email: | ||
2583 | type: string | ||
2584 | contactForm: | ||
2585 | type: object | ||
2586 | properties: | ||
2587 | enabled: | ||
2588 | type: boolean | ||
2589 | user: | ||
2590 | type: object | ||
2591 | properties: | ||
2592 | videoQuota: | ||
2593 | type: number | ||
2594 | videoQuotaDaily: | ||
2595 | type: number | ||
2596 | transcoding: | ||
2597 | type: object | ||
2598 | properties: | ||
2599 | enabled: | ||
2600 | type: boolean | ||
2601 | allowAdditionalExtensions: | ||
2602 | type: boolean | ||
2603 | allowAudioFiles: | ||
2604 | type: boolean | ||
2605 | threads: | ||
2606 | type: number | ||
2607 | resolutions: | ||
2608 | type: object | ||
2609 | properties: | ||
2610 | 240p: | ||
2611 | type: boolean | ||
2612 | 360p: | ||
2613 | type: boolean | ||
2614 | 480p: | ||
2615 | type: boolean | ||
2616 | 720p: | ||
2617 | type: boolean | ||
2618 | 1080p: | ||
2619 | type: boolean | ||
2620 | 2160p: | ||
2621 | type: boolean | ||
2622 | hls: | ||
2623 | type: object | ||
2624 | properties: | ||
2625 | enabled: | ||
2626 | type: boolean | ||
2627 | import: | ||
2628 | type: object | ||
2629 | properties: | ||
2630 | videos: | ||
2631 | type: object | ||
2632 | properties: | ||
2633 | http: | ||
2634 | type: object | ||
2635 | properties: | ||
2636 | enabled: | ||
2637 | type: boolean | ||
2638 | torrent: | ||
2639 | type: object | ||
2640 | properties: | ||
2641 | enabled: | ||
2642 | type: boolean | ||
2643 | autoBlacklist: | ||
2644 | type: object | ||
2645 | properties: | ||
2646 | videos: | ||
2647 | type: object | ||
2648 | properties: | ||
2649 | ofUsers: | ||
2650 | type: object | ||
2651 | properties: | ||
2652 | enabled: | ||
2653 | type: boolean | ||
2654 | followers: | ||
2655 | type: object | ||
2656 | properties: | ||
2657 | instance: | ||
2658 | type: object | ||
2659 | properties: | ||
2660 | enabled: | ||
2661 | type: boolean | ||
2662 | manualApproval: | ||
2663 | type: boolean | ||
2334 | Follow: | 2664 | Follow: |
2335 | properties: | 2665 | properties: |
2336 | id: | 2666 | id: |
diff --git a/support/doc/tools.md b/support/doc/tools.md index cf427ec84..dd2a03db7 100644 --- a/support/doc/tools.md +++ b/support/doc/tools.md | |||
@@ -11,6 +11,7 @@ | |||
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) | 13 | - [peertube-watch.js](#peertube-watchjs) |
14 | - [peertube-plugins.js](#peertube-pluginsjs) | ||
14 | - [Server tools](#server-tools) | 15 | - [Server tools](#server-tools) |
15 | - [parse-log](#parse-log) | 16 | - [parse-log](#parse-log) |
16 | - [create-transcoding-job.js](#create-transcoding-jobjs) | 17 | - [create-transcoding-job.js](#create-transcoding-jobjs) |
@@ -19,6 +20,7 @@ | |||
19 | - [optimize-old-videos.js](#optimize-old-videosjs) | 20 | - [optimize-old-videos.js](#optimize-old-videosjs) |
20 | - [update-host.js](#update-hostjs) | 21 | - [update-host.js](#update-hostjs) |
21 | - [reset-password.js](#reset-passwordjs) | 22 | - [reset-password.js](#reset-passwordjs) |
23 | - [plugin install/uninstall](#plugin-installuninstall) | ||
22 | - [REPL (Read Eval Print Loop)](#repl-read-eval-print-loop) | 24 | - [REPL (Read Eval Print Loop)](#repl-read-eval-print-loop) |
23 | - [.help](#help) | 25 | - [.help](#help) |
24 | - [Lodash example](#lodash-example) | 26 | - [Lodash example](#lodash-example) |
@@ -182,6 +184,22 @@ It provides support for different players: | |||
182 | - chromecast | 184 | - chromecast |
183 | 185 | ||
184 | 186 | ||
187 | #### peertube-plugins.js | ||
188 | |||
189 | Install/update/uninstall or list local or NPM PeerTube plugins: | ||
190 | |||
191 | ``` | ||
192 | $ cd ${CLONE} | ||
193 | $ node dist/server/tools/peertube-plugins.js --help | ||
194 | $ node dist/server/tools/peertube-plugins.js list --help | ||
195 | $ node dist/server/tools/peertube-plugins.js install --help | ||
196 | $ node dist/server/tools/peertube-plugins.js update --help | ||
197 | $ node dist/server/tools/peertube-plugins.js uninstall --help | ||
198 | |||
199 | $ node dist/server/tools/peertube-plugins.js install --path /my/plugin/path | ||
200 | $ node dist/server/tools/peertube-plugins.js install --npm-name peertube-theme-example | ||
201 | ``` | ||
202 | |||
185 | ## Server tools | 203 | ## Server tools |
186 | 204 | ||
187 | These scripts should be run on the server, in `peertube-latest` directory. | 205 | These scripts should be run on the server, in `peertube-latest` directory. |
@@ -262,22 +280,22 @@ $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production | |||
262 | The difference with `peertube plugins` CLI is that these scripts can be used even if PeerTube is not running. | 280 | The difference with `peertube plugins` CLI is that these scripts can be used even if PeerTube is not running. |
263 | If PeerTube is running, you need to restart it for the changes to take effect (whereas with `peertube plugins` CLI, plugins/themes are dynamically loaded on the server). | 281 | If PeerTube is running, you need to restart it for the changes to take effect (whereas with `peertube plugins` CLI, plugins/themes are dynamically loaded on the server). |
264 | 282 | ||
265 | To install a plugin or a theme from the disk: | 283 | To install/update a plugin or a theme from the disk: |
266 | 284 | ||
267 | ``` | 285 | ``` |
268 | $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run npm run plugin:install -- --plugin-path /local/plugin/path | 286 | $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:install -- --plugin-path /local/plugin/path |
269 | ``` | 287 | ``` |
270 | 288 | ||
271 | From NPM: | 289 | From NPM: |
272 | 290 | ||
273 | ``` | 291 | ``` |
274 | $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run npm run plugin:install -- --npm-name peertube-plugin-myplugin | 292 | $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:install -- --npm-name peertube-plugin-myplugin |
275 | ``` | 293 | ``` |
276 | 294 | ||
277 | To uninstall a plugin or a theme: | 295 | To uninstall a plugin or a theme: |
278 | 296 | ||
279 | ``` | 297 | ``` |
280 | $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin | 298 | $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run plugin:uninstall -- --npm-name peertube-plugin-myplugin |
281 | ``` | 299 | ``` |
282 | 300 | ||
283 | ### REPL ([Read Eval Print Loop](https://nodejs.org/docs/latest-v10.x/api/repl.html)) | 301 | ### REPL ([Read Eval Print Loop](https://nodejs.org/docs/latest-v10.x/api/repl.html)) |