diff options
Diffstat (limited to 'support')
-rw-r--r-- | support/doc/api/openapi.yaml | 920 | ||||
-rw-r--r-- | support/doc/dependencies.md | 2 | ||||
-rw-r--r-- | support/doc/plugins/guide.md | 4 | ||||
-rw-r--r-- | support/docker/production/Dockerfile.buster | 2 | ||||
-rw-r--r-- | support/nginx/peertube | 9 |
5 files changed, 685 insertions, 252 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index d4fe15664..4fbf5b055 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml | |||
@@ -12,8 +12,6 @@ info: | |||
12 | url: 'https://joinpeertube.org/img/brand.png' | 12 | url: 'https://joinpeertube.org/img/brand.png' |
13 | altText: PeerTube Project Homepage | 13 | altText: PeerTube Project Homepage |
14 | description: | | 14 | description: | |
15 | # Introduction | ||
16 | |||
17 | The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite | 15 | The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite |
18 | HTTP/REST library for your programming language to use PeerTube. The spec API is fully compatible with | 16 | HTTP/REST library for your programming language to use PeerTube. The spec API is fully compatible with |
19 | [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO) | 17 | [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO) |
@@ -23,13 +21,14 @@ info: | |||
23 | - [Go](https://framagit.org/framasoft/peertube/clients/go) | 21 | - [Go](https://framagit.org/framasoft/peertube/clients/go) |
24 | - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin) | 22 | - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin) |
25 | 23 | ||
26 | See the [Quick Start guide](https://docs.joinpeertube.org/api-rest-getting-started) so you can play with the PeerTube API. | 24 | See the [REST API quick start](https://docs.joinpeertube.org/api-rest-getting-started) for a few |
25 | examples of using with the PeerTube API. | ||
27 | 26 | ||
28 | # Authentication | 27 | # Authentication |
29 | 28 | ||
30 | When you sign up for an account, you are given the possibility to generate | 29 | When you sign up for an account on a PeerTube instance, you are given the possibility |
31 | sessions, and authenticate using this session token. One session token can | 30 | to generate sessions on it, and authenticate there using a session token. Only __one |
32 | currently be used at a time. | 31 | session token can currently be used at a time__. |
33 | 32 | ||
34 | ## Roles | 33 | ## Roles |
35 | 34 | ||
@@ -48,6 +47,30 @@ info: | |||
48 | "error": "Token is invalid." // example exposed error message | 47 | "error": "Token is invalid." // example exposed error message |
49 | } | 48 | } |
50 | ``` | 49 | ``` |
50 | |||
51 | # Rate limits | ||
52 | |||
53 | We are rate-limiting all endpoints of PeerTube's API. Custom values can be set by administrators: | ||
54 | |||
55 | | Endpoint | Calls | Time frame | | ||
56 | |-------------------------|------------------|---------------------------| | ||
57 | | `/*` | 50 | 10 seconds | | ||
58 | | `POST /users/token` | 15 | 5 minutes | | ||
59 | | `POST /users/register` | 2¹ | 5 minutes | | ||
60 | | `POST /users/ask-send-verify-email` | 3 | 5 minutes | | ||
61 | |||
62 | Depending on the endpoint, ¹failed requests are not taken into account. A service | ||
63 | limit is announced by a `429 Too Many Requests` status code. | ||
64 | |||
65 | You can get details about the current state of your rate limit by reading the | ||
66 | following headers: | ||
67 | |||
68 | | Header | Description | | ||
69 | |-------------------------|------------------------------------------------------------| | ||
70 | | X-RateLimit-Limit | Number of max requests allowed in the current time period | | ||
71 | | X-RateLimit-Remaining | Number of remaining requests in the current time period | | ||
72 | | X-RateLimit-Reset | Timestamp of end of current time period as UNIX timestamp | | ||
73 | | Retry-After | Seconds to delay after the first `429` is received | | ||
51 | externalDocs: | 74 | externalDocs: |
52 | url: https://docs.joinpeertube.org/api-rest-reference.html | 75 | url: https://docs.joinpeertube.org/api-rest-reference.html |
53 | tags: | 76 | tags: |
@@ -101,7 +124,7 @@ tags: | |||
101 | Redundancy is part of the inter-server solidarity that PeerTube fosters. | 124 | Redundancy is part of the inter-server solidarity that PeerTube fosters. |
102 | Manage the list of instances you wish to help by seeding their videos according | 125 | Manage the list of instances you wish to help by seeding their videos according |
103 | to the policy of video selection of your choice. Note that you have a similar functionality | 126 | to the policy of video selection of your choice. Note that you have a similar functionality |
104 | to mirror individual videos, see `Video Mirroring`. | 127 | to mirror individual videos, see [video mirroring](#tag/Video-Mirroring). |
105 | externalDocs: | 128 | externalDocs: |
106 | url: https://docs.joinpeertube.org/admin-following-instances?id=instances-redundancy | 129 | url: https://docs.joinpeertube.org/admin-following-instances?id=instances-redundancy |
107 | - name: Plugins | 130 | - name: Plugins |
@@ -115,6 +138,50 @@ tags: | |||
115 | - name: Video | 138 | - name: Video |
116 | description: | | 139 | description: | |
117 | Operations dealing with listing, uploading, fetching or modifying videos. | 140 | Operations dealing with listing, uploading, fetching or modifying videos. |
141 | - name: Video Upload | ||
142 | description: | | ||
143 | Operations dealing with adding video or audio. PeerTube supports two upload modes, and three import modes. | ||
144 | |||
145 | ### Upload | ||
146 | |||
147 | - [_legacy_](#operation/uploadLegacy), where the video file is sent in a single request | ||
148 | - [_resumable_](#operation/uploadResumableInit), where the video file is sent in chunks | ||
149 | |||
150 | You can upload videos more reliably by using the resumable variant. Its protocol lets | ||
151 | you resume an upload operation after a network interruption or other transmission failure, | ||
152 | saving time and bandwidth in the event of network failures. | ||
153 | |||
154 | Favor using resumable uploads in any of the following cases: | ||
155 | - You are transferring large files | ||
156 | - The likelihood of a network interruption is high | ||
157 | - Uploads are originating from a device with a low-bandwidth or unstable Internet connection, | ||
158 | such as a mobile device | ||
159 | |||
160 | ### Import | ||
161 | |||
162 | - _URL_-based: where the URL points to any service supported by [youtube-dl](https://ytdl-org.github.io/youtube-dl/) | ||
163 | - _magnet_-based: where the URI resolves to a BitTorrent ressource containing a single supported video file | ||
164 | - _torrent_-based: where the metainfo file resolves to a BitTorrent ressource containing a single supported video file | ||
165 | |||
166 | The import function is practical when the desired video/audio is available online. It makes PeerTube | ||
167 | download it for you, saving you as much bandwidth and avoiding any instability or limitation your network might have. | ||
168 | - name: Video Captions | ||
169 | description: Operations dealing with listing, adding and removing closed captions of a video. | ||
170 | - name: Video Channels | ||
171 | description: Operations dealing with the creation, modification and listing of videos within a channel. | ||
172 | - name: Video Comments | ||
173 | description: > | ||
174 | Operations dealing with comments to a video. Comments are organized in threads: adding a | ||
175 | comment in response to the video starts a thread, adding a reply to a comment adds it to | ||
176 | its root comment thread. | ||
177 | - name: Video Blocks | ||
178 | description: Operations dealing with blocking videos (removing them from view and preventing interactions). | ||
179 | - name: Video Rates | ||
180 | description: Like/dislike a video. | ||
181 | - name: Video Playlists | ||
182 | description: Operations dealing with playlists of videos. Playlists are bound to users and/or channels. | ||
183 | - name: Feeds | ||
184 | description: Server syndication feeds | ||
118 | - name: Search | 185 | - name: Search |
119 | description: | | 186 | description: | |
120 | The search helps to find _videos_ or _channels_ from within the instance and beyond. | 187 | The search helps to find _videos_ or _channels_ from within the instance and beyond. |
@@ -124,27 +191,11 @@ tags: | |||
124 | 191 | ||
125 | Administrators can also enable the use of a remote search system, indexing | 192 | Administrators can also enable the use of a remote search system, indexing |
126 | videos and channels not could be not federated by the instance. | 193 | videos and channels not could be not federated by the instance. |
127 | - name: Video Comments | 194 | - name: Video Mirroring |
128 | description: > | 195 | description: | |
129 | Operations dealing with comments to a video. Comments are organized in | 196 | PeerTube instances can mirror videos from one another, and help distribute some videos. |
130 | threads. | 197 | |
131 | - name: Video Playlists | 198 | For importing videos as your own, refer to [video imports](#tag/Video-Upload/paths/~1videos~1imports/post). |
132 | description: > | ||
133 | Operations dealing with playlists of videos. Playlists are bound to users | ||
134 | and/or channels. | ||
135 | - name: Video Channels | ||
136 | description: > | ||
137 | Operations dealing with the creation, modification and listing of videos within a channel. | ||
138 | - name: Video Blocks | ||
139 | description: > | ||
140 | Operations dealing with blocking videos (removing them from view and | ||
141 | preventing interactions). | ||
142 | - name: Video Rates | ||
143 | description: > | ||
144 | Like/dislike a video. | ||
145 | - name: Feeds | ||
146 | description: > | ||
147 | Server syndication feeds | ||
148 | x-tagGroups: | 199 | x-tagGroups: |
149 | - name: Accounts | 200 | - name: Accounts |
150 | tags: | 201 | tags: |
@@ -157,6 +208,7 @@ x-tagGroups: | |||
157 | - name: Videos | 208 | - name: Videos |
158 | tags: | 209 | tags: |
159 | - Video | 210 | - Video |
211 | - Video Upload | ||
160 | - Video Captions | 212 | - Video Captions |
161 | - Video Channels | 213 | - Video Channels |
162 | - Video Comments | 214 | - Video Comments |
@@ -228,7 +280,7 @@ paths: | |||
228 | application/json: | 280 | application/json: |
229 | schema: | 281 | schema: |
230 | $ref: '#/components/schemas/VideoListResponse' | 282 | $ref: '#/components/schemas/VideoListResponse' |
231 | x-code-samples: | 283 | x-codeSamples: |
232 | - lang: JavaScript | 284 | - lang: JavaScript |
233 | source: | | 285 | source: | |
234 | fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos') | 286 | fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos') |
@@ -292,6 +344,9 @@ paths: | |||
292 | application/json: | 344 | application/json: |
293 | schema: | 345 | schema: |
294 | $ref: '#/components/schemas/ServerConfig' | 346 | $ref: '#/components/schemas/ServerConfig' |
347 | examples: | ||
348 | nightly: | ||
349 | externalValue: https://peertube2.cpy.re/api/v1/config | ||
295 | /config/about: | 350 | /config/about: |
296 | get: | 351 | get: |
297 | summary: Get instance "About" information | 352 | summary: Get instance "About" information |
@@ -304,6 +359,9 @@ paths: | |||
304 | application/json: | 359 | application/json: |
305 | schema: | 360 | schema: |
306 | $ref: '#/components/schemas/ServerConfigAbout' | 361 | $ref: '#/components/schemas/ServerConfigAbout' |
362 | examples: | ||
363 | nightly: | ||
364 | externalValue: https://peertube2.cpy.re/api/v1/config/about | ||
307 | /config/custom: | 365 | /config/custom: |
308 | get: | 366 | get: |
309 | summary: Get instance runtime configuration | 367 | summary: Get instance runtime configuration |
@@ -566,13 +624,24 @@ paths: | |||
566 | tags: | 624 | tags: |
567 | - Users | 625 | - Users |
568 | operationId: getUserId | 626 | operationId: getUserId |
627 | parameters: | ||
628 | - name: withStats | ||
629 | in: query | ||
630 | description: include statistics about the user (only available as a moderator/admin) | ||
631 | schema: | ||
632 | type: boolean | ||
569 | responses: | 633 | responses: |
570 | '200': | 634 | '200': |
571 | description: successful operation | 635 | x-summary: successful operation |
636 | description: | | ||
637 | As an admin/moderator, you can request a response augmented with statistics about the user's | ||
638 | moderation relations and videos usage, by using the `withStats` parameter. | ||
572 | content: | 639 | content: |
573 | application/json: | 640 | application/json: |
574 | schema: | 641 | schema: |
575 | $ref: '#/components/schemas/User' | 642 | oneOf: |
643 | - $ref: '#/components/schemas/User' | ||
644 | - $ref: '#/components/schemas/UserWithStats' | ||
576 | put: | 645 | put: |
577 | summary: Update a user | 646 | summary: Update a user |
578 | security: | 647 | security: |
@@ -655,7 +724,7 @@ paths: | |||
655 | content: | 724 | content: |
656 | application/json: | 725 | application/json: |
657 | schema: | 726 | schema: |
658 | $ref: '#/components/schemas/VideoImport' | 727 | $ref: '#/components/schemas/VideoImportsList' |
659 | /users/me/video-quota-used: | 728 | /users/me/video-quota-used: |
660 | get: | 729 | get: |
661 | summary: Get my user used quota | 730 | summary: Get my user used quota |
@@ -670,7 +739,14 @@ paths: | |||
670 | content: | 739 | content: |
671 | application/json: | 740 | application/json: |
672 | schema: | 741 | schema: |
673 | type: number | 742 | type: object |
743 | properties: | ||
744 | videoQuotaUsed: | ||
745 | type: number | ||
746 | example: 16810141515 | ||
747 | videoQuotaUsedDaily: | ||
748 | type: number | ||
749 | example: 1681014151 | ||
674 | '/users/me/videos/{videoId}/rating': | 750 | '/users/me/videos/{videoId}/rating': |
675 | get: | 751 | get: |
676 | summary: Get rate of my user for a video | 752 | summary: Get rate of my user for a video |
@@ -728,6 +804,10 @@ paths: | |||
728 | responses: | 804 | responses: |
729 | '200': | 805 | '200': |
730 | description: successful operation | 806 | description: successful operation |
807 | content: | ||
808 | application/json: | ||
809 | schema: | ||
810 | $ref: '#/components/schemas/VideoChannelList' | ||
731 | post: | 811 | post: |
732 | tags: | 812 | tags: |
733 | - My Subscriptions | 813 | - My Subscriptions |
@@ -1109,6 +1189,7 @@ paths: | |||
1109 | /videos/categories: | 1189 | /videos/categories: |
1110 | get: | 1190 | get: |
1111 | summary: List available video categories | 1191 | summary: List available video categories |
1192 | operationId: getCategories | ||
1112 | tags: | 1193 | tags: |
1113 | - Video | 1194 | - Video |
1114 | responses: | 1195 | responses: |
@@ -1126,6 +1207,7 @@ paths: | |||
1126 | /videos/licences: | 1207 | /videos/licences: |
1127 | get: | 1208 | get: |
1128 | summary: List available video licences | 1209 | summary: List available video licences |
1210 | operationId: getLicences | ||
1129 | tags: | 1211 | tags: |
1130 | - Video | 1212 | - Video |
1131 | responses: | 1213 | responses: |
@@ -1143,6 +1225,7 @@ paths: | |||
1143 | /videos/languages: | 1225 | /videos/languages: |
1144 | get: | 1226 | get: |
1145 | summary: List available video languages | 1227 | summary: List available video languages |
1228 | operationId: getLanguages | ||
1146 | tags: | 1229 | tags: |
1147 | - Video | 1230 | - Video |
1148 | responses: | 1231 | responses: |
@@ -1159,7 +1242,8 @@ paths: | |||
1159 | externalValue: https://peertube2.cpy.re/api/v1/videos/languages | 1242 | externalValue: https://peertube2.cpy.re/api/v1/videos/languages |
1160 | /videos/privacies: | 1243 | /videos/privacies: |
1161 | get: | 1244 | get: |
1162 | summary: List available video privacies | 1245 | summary: List available video privacy policies |
1246 | operationId: getPrivacyPolicies | ||
1163 | tags: | 1247 | tags: |
1164 | - Video | 1248 | - Video |
1165 | responses: | 1249 | responses: |
@@ -1201,16 +1285,11 @@ paths: | |||
1201 | type: string | 1285 | type: string |
1202 | format: binary | 1286 | format: binary |
1203 | category: | 1287 | category: |
1204 | description: Video category | 1288 | $ref: '#/components/schemas/VideoCategorySet' |
1205 | type: integer | ||
1206 | example: 4 | ||
1207 | licence: | 1289 | licence: |
1208 | description: Video licence | 1290 | $ref: '#/components/schemas/VideoLicenceSet' |
1209 | type: integer | ||
1210 | example: 2 | ||
1211 | language: | 1291 | language: |
1212 | description: Video language | 1292 | $ref: '#/components/schemas/VideoLanguageSet' |
1213 | type: string | ||
1214 | privacy: | 1293 | privacy: |
1215 | $ref: '#/components/schemas/VideoPrivacySet' | 1294 | $ref: '#/components/schemas/VideoPrivacySet' |
1216 | description: | 1295 | description: |
@@ -1323,10 +1402,13 @@ paths: | |||
1323 | /videos/upload: | 1402 | /videos/upload: |
1324 | post: | 1403 | post: |
1325 | summary: Upload a video | 1404 | summary: Upload a video |
1405 | description: Uses a single request to upload a video. | ||
1406 | operationId: uploadLegacy | ||
1326 | security: | 1407 | security: |
1327 | - OAuth2: [] | 1408 | - OAuth2: [] |
1328 | tags: | 1409 | tags: |
1329 | - Video | 1410 | - Video |
1411 | - Video Upload | ||
1330 | responses: | 1412 | responses: |
1331 | '200': | 1413 | '200': |
1332 | description: successful operation | 1414 | description: successful operation |
@@ -1356,80 +1438,7 @@ paths: | |||
1356 | content: | 1438 | content: |
1357 | multipart/form-data: | 1439 | multipart/form-data: |
1358 | schema: | 1440 | schema: |
1359 | type: object | 1441 | $ref: '#/components/schemas/VideoUploadRequestLegacy' |
1360 | properties: | ||
1361 | videofile: | ||
1362 | description: Video file | ||
1363 | type: string | ||
1364 | format: binary | ||
1365 | channelId: | ||
1366 | description: Channel id that will contain this video | ||
1367 | type: integer | ||
1368 | thumbnailfile: | ||
1369 | description: Video thumbnail file | ||
1370 | type: string | ||
1371 | format: binary | ||
1372 | previewfile: | ||
1373 | description: Video preview file | ||
1374 | type: string | ||
1375 | format: binary | ||
1376 | privacy: | ||
1377 | $ref: '#/components/schemas/VideoPrivacySet' | ||
1378 | category: | ||
1379 | description: Video category | ||
1380 | type: integer | ||
1381 | example: 4 | ||
1382 | licence: | ||
1383 | description: Video licence | ||
1384 | type: integer | ||
1385 | example: 2 | ||
1386 | language: | ||
1387 | description: Video language | ||
1388 | type: string | ||
1389 | description: | ||
1390 | description: Video description | ||
1391 | type: string | ||
1392 | waitTranscoding: | ||
1393 | description: Whether or not we wait transcoding before publish the video | ||
1394 | type: boolean | ||
1395 | support: | ||
1396 | description: A text tell the audience how to support the video creator | ||
1397 | example: Please support my work on <insert crowdfunding plateform>! <3 | ||
1398 | type: string | ||
1399 | nsfw: | ||
1400 | description: Whether or not this video contains sensitive content | ||
1401 | type: boolean | ||
1402 | name: | ||
1403 | description: Video name | ||
1404 | type: string | ||
1405 | minLength: 3 | ||
1406 | maxLength: 120 | ||
1407 | tags: | ||
1408 | description: Video tags (maximum 5 tags each between 2 and 30 characters) | ||
1409 | type: array | ||
1410 | minItems: 1 | ||
1411 | maxItems: 5 | ||
1412 | uniqueItems: true | ||
1413 | items: | ||
1414 | type: string | ||
1415 | minLength: 2 | ||
1416 | maxLength: 30 | ||
1417 | commentsEnabled: | ||
1418 | description: Enable or disable comments for this video | ||
1419 | type: boolean | ||
1420 | downloadEnabled: | ||
1421 | description: Enable or disable downloading for this video | ||
1422 | type: boolean | ||
1423 | originallyPublishedAt: | ||
1424 | description: Date when the content was originally published | ||
1425 | type: string | ||
1426 | format: date-time | ||
1427 | scheduleUpdate: | ||
1428 | $ref: '#/components/schemas/VideoScheduledUpdate' | ||
1429 | required: | ||
1430 | - videofile | ||
1431 | - channelId | ||
1432 | - name | ||
1433 | encoding: | 1442 | encoding: |
1434 | videofile: | 1443 | videofile: |
1435 | contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream | 1444 | contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream |
@@ -1437,7 +1446,7 @@ paths: | |||
1437 | contentType: image/jpeg | 1446 | contentType: image/jpeg |
1438 | previewfile: | 1447 | previewfile: |
1439 | contentType: image/jpeg | 1448 | contentType: image/jpeg |
1440 | x-code-samples: | 1449 | x-codeSamples: |
1441 | - lang: Shell | 1450 | - lang: Shell |
1442 | source: | | 1451 | source: | |
1443 | ## DEPENDENCIES: jq | 1452 | ## DEPENDENCIES: jq |
@@ -1466,14 +1475,177 @@ paths: | |||
1466 | --form videofile=@"$FILE_PATH" \ | 1475 | --form videofile=@"$FILE_PATH" \ |
1467 | --form channelId=$CHANNEL_ID \ | 1476 | --form channelId=$CHANNEL_ID \ |
1468 | --form name="$NAME" | 1477 | --form name="$NAME" |
1478 | /videos/upload-resumable: | ||
1479 | post: | ||
1480 | summary: Initialize the resumable upload of a video | ||
1481 | description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to initialize the upload of a video | ||
1482 | operationId: uploadResumableInit | ||
1483 | security: | ||
1484 | - OAuth2: [] | ||
1485 | tags: | ||
1486 | - Video | ||
1487 | - Video Upload | ||
1488 | parameters: | ||
1489 | - name: X-Upload-Content-Length | ||
1490 | in: header | ||
1491 | schema: | ||
1492 | type: number | ||
1493 | example: 2469036 | ||
1494 | required: true | ||
1495 | description: Number of bytes that will be uploaded in subsequent requests. Set this value to the size of the file you are uploading. | ||
1496 | - name: X-Upload-Content-Type | ||
1497 | in: header | ||
1498 | schema: | ||
1499 | type: string | ||
1500 | format: mimetype | ||
1501 | example: video/mp4 | ||
1502 | required: true | ||
1503 | description: MIME type of the file that you are uploading. Depending on your instance settings, acceptable values might vary. | ||
1504 | requestBody: | ||
1505 | content: | ||
1506 | application/json: | ||
1507 | schema: | ||
1508 | $ref: '#/components/schemas/VideoUploadRequestResumable' | ||
1509 | responses: | ||
1510 | '200': | ||
1511 | description: file already exists, send a [`resume`](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) request instead | ||
1512 | '201': | ||
1513 | description: created | ||
1514 | headers: | ||
1515 | Location: | ||
1516 | schema: | ||
1517 | type: string | ||
1518 | format: url | ||
1519 | example: /api/v1/videos/upload-resumable?upload_id=471e97554f21dec3b8bb5d4602939c51 | ||
1520 | Content-Length: | ||
1521 | schema: | ||
1522 | type: number | ||
1523 | example: 0 | ||
1524 | '400': | ||
1525 | description: invalid file field, schedule date or parameter | ||
1526 | '413': | ||
1527 | description: video file too large, due to quota, absolute max file size or concurrent partial upload limit | ||
1528 | '415': | ||
1529 | description: video type unsupported | ||
1530 | put: | ||
1531 | summary: Send chunk for the resumable upload of a video | ||
1532 | description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to continue, pause or resume the upload of a video | ||
1533 | operationId: uploadResumable | ||
1534 | security: | ||
1535 | - OAuth2: [] | ||
1536 | tags: | ||
1537 | - Video | ||
1538 | - Video Upload | ||
1539 | parameters: | ||
1540 | - name: upload_id | ||
1541 | in: path | ||
1542 | required: true | ||
1543 | description: | | ||
1544 | Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is | ||
1545 | not valid anymore and you need to initialize a new upload. | ||
1546 | schema: | ||
1547 | type: string | ||
1548 | - name: Content-Range | ||
1549 | in: header | ||
1550 | schema: | ||
1551 | type: string | ||
1552 | example: bytes 0-262143/2469036 | ||
1553 | required: true | ||
1554 | description: | | ||
1555 | Specifies the bytes in the file that the request is uploading. | ||
1556 | |||
1557 | For example, a value of `bytes 0-262143/1000000` shows that the request is sending the first | ||
1558 | 262144 bytes (256 x 1024) in a 2,469,036 byte file. | ||
1559 | - name: Content-Length | ||
1560 | in: header | ||
1561 | schema: | ||
1562 | type: number | ||
1563 | example: 262144 | ||
1564 | required: true | ||
1565 | description: | | ||
1566 | Size of the chunk that the request is sending. | ||
1567 | |||
1568 | The chunk size __must be a multiple of 256 KB__, and unlike [Google Resumable](https://developers.google.com/youtube/v3/guides/using_resumable_upload_protocol) | ||
1569 | doesn't mandate for chunks to have the same size throughout the upload sequence. | ||
1570 | |||
1571 | Remember that larger chunks are more efficient. PeerTube's web client uses chunks varying from | ||
1572 | 1048576 bytes (~1MB) and increases or reduces size depending on connection health. | ||
1573 | requestBody: | ||
1574 | content: | ||
1575 | application/octet-stream: | ||
1576 | schema: | ||
1577 | type: string | ||
1578 | format: binary | ||
1579 | responses: | ||
1580 | '200': | ||
1581 | description: last chunk received | ||
1582 | headers: | ||
1583 | Content-Length: | ||
1584 | schema: | ||
1585 | type: number | ||
1586 | content: | ||
1587 | application/json: | ||
1588 | schema: | ||
1589 | $ref: '#/components/schemas/VideoUploadResponse' | ||
1590 | '308': | ||
1591 | description: resume incomplete | ||
1592 | headers: | ||
1593 | Range: | ||
1594 | schema: | ||
1595 | type: string | ||
1596 | example: bytes=0-262143 | ||
1597 | Content-Length: | ||
1598 | schema: | ||
1599 | type: number | ||
1600 | example: 0 | ||
1601 | '403': | ||
1602 | description: video didn't pass upload filter | ||
1603 | '413': | ||
1604 | description: video file too large, due to quota or max body size limit set by the reverse-proxy | ||
1605 | '422': | ||
1606 | description: video unreadable | ||
1607 | delete: | ||
1608 | summary: Cancel the resumable upload of a video, deleting any data uploaded so far | ||
1609 | description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to cancel the upload of a video | ||
1610 | operationId: uploadResumableCancel | ||
1611 | security: | ||
1612 | - OAuth2: [] | ||
1613 | tags: | ||
1614 | - Video | ||
1615 | - Video Upload | ||
1616 | parameters: | ||
1617 | - name: upload_id | ||
1618 | in: path | ||
1619 | required: true | ||
1620 | description: | | ||
1621 | Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is | ||
1622 | not valid anymore and the upload session has already been deleted with its data ;-) | ||
1623 | schema: | ||
1624 | type: string | ||
1625 | - name: Content-Length | ||
1626 | in: header | ||
1627 | required: true | ||
1628 | schema: | ||
1629 | type: number | ||
1630 | example: 0 | ||
1631 | responses: | ||
1632 | '204': | ||
1633 | description: upload cancelled | ||
1634 | headers: | ||
1635 | Content-Length: | ||
1636 | schema: | ||
1637 | type: number | ||
1638 | example: 0 | ||
1469 | /videos/imports: | 1639 | /videos/imports: |
1470 | post: | 1640 | post: |
1471 | summary: Import a video | 1641 | summary: Import a video |
1472 | description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator) | 1642 | description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator) |
1643 | operationId: importVideo | ||
1473 | security: | 1644 | security: |
1474 | - OAuth2: [] | 1645 | - OAuth2: [] |
1475 | tags: | 1646 | tags: |
1476 | - Video | 1647 | - Video |
1648 | - Video Upload | ||
1477 | requestBody: | 1649 | requestBody: |
1478 | content: | 1650 | content: |
1479 | multipart/form-data: | 1651 | multipart/form-data: |
@@ -1504,16 +1676,11 @@ paths: | |||
1504 | privacy: | 1676 | privacy: |
1505 | $ref: '#/components/schemas/VideoPrivacySet' | 1677 | $ref: '#/components/schemas/VideoPrivacySet' |
1506 | category: | 1678 | category: |
1507 | description: Video category | 1679 | $ref: '#/components/schemas/VideoCategorySet' |
1508 | type: integer | ||
1509 | example: 4 | ||
1510 | licence: | 1680 | licence: |
1511 | description: Video licence | 1681 | $ref: '#/components/schemas/VideoLicenceSet' |
1512 | type: integer | ||
1513 | example: 2 | ||
1514 | language: | 1682 | language: |
1515 | description: Video language | 1683 | $ref: '#/components/schemas/VideoLanguageSet' |
1516 | type: string | ||
1517 | description: | 1684 | description: |
1518 | description: Video description | 1685 | description: Video description |
1519 | type: string | 1686 | type: string |
@@ -1576,6 +1743,7 @@ paths: | |||
1576 | /videos/live: | 1743 | /videos/live: |
1577 | post: | 1744 | post: |
1578 | summary: Create a live | 1745 | summary: Create a live |
1746 | operationId: createLive | ||
1579 | security: | 1747 | security: |
1580 | - OAuth2: [] | 1748 | - OAuth2: [] |
1581 | tags: | 1749 | tags: |
@@ -1615,14 +1783,11 @@ paths: | |||
1615 | privacy: | 1783 | privacy: |
1616 | $ref: '#/components/schemas/VideoPrivacySet' | 1784 | $ref: '#/components/schemas/VideoPrivacySet' |
1617 | category: | 1785 | category: |
1618 | description: Live video/replay category | 1786 | $ref: '#/components/schemas/VideoCategorySet' |
1619 | type: string | ||
1620 | licence: | 1787 | licence: |
1621 | description: Live video/replay licence | 1788 | $ref: '#/components/schemas/VideoLicenceSet' |
1622 | type: string | ||
1623 | language: | 1789 | language: |
1624 | description: Live video/replay language | 1790 | $ref: '#/components/schemas/VideoLanguageSet' |
1625 | type: string | ||
1626 | description: | 1791 | description: |
1627 | description: Live video/replay description | 1792 | description: Live video/replay description |
1628 | type: string | 1793 | type: string |
@@ -1664,7 +1829,8 @@ paths: | |||
1664 | 1829 | ||
1665 | /videos/live/{id}: | 1830 | /videos/live/{id}: |
1666 | get: | 1831 | get: |
1667 | summary: Get a live information | 1832 | summary: Get information about a live |
1833 | operationId: getLiveId | ||
1668 | security: | 1834 | security: |
1669 | - OAuth2: [] | 1835 | - OAuth2: [] |
1670 | tags: | 1836 | tags: |
@@ -1680,7 +1846,8 @@ paths: | |||
1680 | schema: | 1846 | schema: |
1681 | $ref: '#/components/schemas/LiveVideoResponse' | 1847 | $ref: '#/components/schemas/LiveVideoResponse' |
1682 | put: | 1848 | put: |
1683 | summary: Update a live information | 1849 | summary: Update information about a live |
1850 | operationId: updateLiveId | ||
1684 | security: | 1851 | security: |
1685 | - OAuth2: [] | 1852 | - OAuth2: [] |
1686 | tags: | 1853 | tags: |
@@ -1704,6 +1871,7 @@ paths: | |||
1704 | /users/me/abuses: | 1871 | /users/me/abuses: |
1705 | get: | 1872 | get: |
1706 | summary: List my abuses | 1873 | summary: List my abuses |
1874 | operationId: getMyAbuses | ||
1707 | security: | 1875 | security: |
1708 | - OAuth2: [] | 1876 | - OAuth2: [] |
1709 | tags: | 1877 | tags: |
@@ -1719,22 +1887,29 @@ paths: | |||
1719 | in: query | 1887 | in: query |
1720 | schema: | 1888 | schema: |
1721 | $ref: '#/components/schemas/AbuseStateSet' | 1889 | $ref: '#/components/schemas/AbuseStateSet' |
1890 | - $ref: '#/components/parameters/abusesSort' | ||
1722 | - $ref: '#/components/parameters/start' | 1891 | - $ref: '#/components/parameters/start' |
1723 | - $ref: '#/components/parameters/count' | 1892 | - $ref: '#/components/parameters/count' |
1724 | - $ref: '#/components/parameters/abusesSort' | ||
1725 | responses: | 1893 | responses: |
1726 | '200': | 1894 | '200': |
1727 | description: successful operation | 1895 | description: successful operation |
1728 | content: | 1896 | content: |
1729 | application/json: | 1897 | application/json: |
1730 | schema: | 1898 | schema: |
1731 | type: array | 1899 | type: object |
1732 | items: | 1900 | properties: |
1733 | $ref: '#/components/schemas/Abuse' | 1901 | total: |
1902 | type: integer | ||
1903 | example: 1 | ||
1904 | data: | ||
1905 | type: array | ||
1906 | items: | ||
1907 | $ref: '#/components/schemas/Abuse' | ||
1734 | 1908 | ||
1735 | /abuses: | 1909 | /abuses: |
1736 | get: | 1910 | get: |
1737 | summary: List abuses | 1911 | summary: List abuses |
1912 | operationId: getAbuses | ||
1738 | security: | 1913 | security: |
1739 | - OAuth2: | 1914 | - OAuth2: |
1740 | - admin | 1915 | - admin |
@@ -1807,9 +1982,15 @@ paths: | |||
1807 | content: | 1982 | content: |
1808 | application/json: | 1983 | application/json: |
1809 | schema: | 1984 | schema: |
1810 | type: array | 1985 | type: object |
1811 | items: | 1986 | properties: |
1812 | $ref: '#/components/schemas/Abuse' | 1987 | total: |
1988 | type: integer | ||
1989 | example: 1 | ||
1990 | data: | ||
1991 | type: array | ||
1992 | items: | ||
1993 | $ref: '#/components/schemas/Abuse' | ||
1813 | 1994 | ||
1814 | post: | 1995 | post: |
1815 | summary: Report an abuse | 1996 | summary: Report an abuse |
@@ -2124,15 +2305,7 @@ paths: | |||
2124 | content: | 2305 | content: |
2125 | application/json: | 2306 | application/json: |
2126 | schema: | 2307 | schema: |
2127 | type: object | 2308 | $ref: '#/components/schemas/VideoChannelList' |
2128 | properties: | ||
2129 | total: | ||
2130 | type: integer | ||
2131 | example: 1 | ||
2132 | data: | ||
2133 | type: array | ||
2134 | items: | ||
2135 | $ref: '#/components/schemas/VideoChannel' | ||
2136 | post: | 2309 | post: |
2137 | summary: Create a video channel | 2310 | summary: Create a video channel |
2138 | security: | 2311 | security: |
@@ -2324,7 +2497,8 @@ paths: | |||
2324 | 2497 | ||
2325 | /video-playlists/privacies: | 2498 | /video-playlists/privacies: |
2326 | get: | 2499 | get: |
2327 | summary: List available playlist privacies | 2500 | summary: List available playlist privacy policies |
2501 | operationId: getPlaylistPrivacyPolicies | ||
2328 | tags: | 2502 | tags: |
2329 | - Video Playlists | 2503 | - Video Playlists |
2330 | responses: | 2504 | responses: |
@@ -2343,6 +2517,7 @@ paths: | |||
2343 | /video-playlists: | 2517 | /video-playlists: |
2344 | get: | 2518 | get: |
2345 | summary: List video playlists | 2519 | summary: List video playlists |
2520 | operationId: getPlaylists | ||
2346 | tags: | 2521 | tags: |
2347 | - Video Playlists | 2522 | - Video Playlists |
2348 | parameters: | 2523 | parameters: |
@@ -2367,6 +2542,7 @@ paths: | |||
2367 | post: | 2542 | post: |
2368 | summary: Create a video playlist | 2543 | summary: Create a video playlist |
2369 | description: 'If the video playlist is set as public, the videoChannelId is mandatory.' | 2544 | description: 'If the video playlist is set as public, the videoChannelId is mandatory.' |
2545 | operationId: createPlaylist | ||
2370 | security: | 2546 | security: |
2371 | - OAuth2: [] | 2547 | - OAuth2: [] |
2372 | tags: | 2548 | tags: |
@@ -2666,14 +2842,7 @@ paths: | |||
2666 | content: | 2842 | content: |
2667 | application/json: | 2843 | application/json: |
2668 | schema: | 2844 | schema: |
2669 | properties: | 2845 | $ref: '#/components/schemas/VideoChannelList' |
2670 | total: | ||
2671 | type: integer | ||
2672 | example: 1 | ||
2673 | data: | ||
2674 | type: array | ||
2675 | items: | ||
2676 | $ref: '#/components/schemas/VideoChannel' | ||
2677 | '/accounts/{name}/ratings': | 2846 | '/accounts/{name}/ratings': |
2678 | get: | 2847 | get: |
2679 | summary: List ratings of an account | 2848 | summary: List ratings of an account |
@@ -2931,9 +3100,7 @@ paths: | |||
2931 | content: | 3100 | content: |
2932 | application/json: | 3101 | application/json: |
2933 | schema: | 3102 | schema: |
2934 | type: array | 3103 | $ref: '#/components/schemas/VideoChannelList' |
2935 | items: | ||
2936 | $ref: '#/components/schemas/VideoChannel' | ||
2937 | '500': | 3104 | '500': |
2938 | description: search index unavailable | 3105 | description: search index unavailable |
2939 | /blocklist/accounts: | 3106 | /blocklist/accounts: |
@@ -3168,13 +3335,6 @@ paths: | |||
3168 | tags: | 3335 | tags: |
3169 | - Feeds | 3336 | - Feeds |
3170 | summary: List comments on videos | 3337 | summary: List comments on videos |
3171 | servers: | ||
3172 | - url: 'https://peertube2.cpy.re' | ||
3173 | description: Live Test Server (live data - latest nightly version) | ||
3174 | - url: 'https://peertube3.cpy.re' | ||
3175 | description: Live Test Server (live data - latest RC version) | ||
3176 | - url: 'https://peertube.cpy.re' | ||
3177 | description: Live Test Server (live data - stable version) | ||
3178 | parameters: | 3338 | parameters: |
3179 | - name: format | 3339 | - name: format |
3180 | in: path | 3340 | in: path |
@@ -3227,18 +3387,33 @@ paths: | |||
3227 | application/xml: | 3387 | application/xml: |
3228 | schema: | 3388 | schema: |
3229 | $ref: '#/components/schemas/VideoCommentsForXML' | 3389 | $ref: '#/components/schemas/VideoCommentsForXML' |
3390 | examples: | ||
3391 | nightly: | ||
3392 | externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local | ||
3230 | application/rss+xml: | 3393 | application/rss+xml: |
3231 | schema: | 3394 | schema: |
3232 | $ref: '#/components/schemas/VideoCommentsForXML' | 3395 | $ref: '#/components/schemas/VideoCommentsForXML' |
3396 | examples: | ||
3397 | nightly: | ||
3398 | externalValue: https://peertube2.cpy.re/feeds/video-comments.rss?filter=local | ||
3233 | text/xml: | 3399 | text/xml: |
3234 | schema: | 3400 | schema: |
3235 | $ref: '#/components/schemas/VideoCommentsForXML' | 3401 | $ref: '#/components/schemas/VideoCommentsForXML' |
3402 | examples: | ||
3403 | nightly: | ||
3404 | externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local | ||
3236 | application/atom+xml: | 3405 | application/atom+xml: |
3237 | schema: | 3406 | schema: |
3238 | $ref: '#/components/schemas/VideoCommentsForXML' | 3407 | $ref: '#/components/schemas/VideoCommentsForXML' |
3408 | examples: | ||
3409 | nightly: | ||
3410 | externalValue: https://peertube2.cpy.re/feeds/video-comments.atom?filter=local | ||
3239 | application/json: | 3411 | application/json: |
3240 | schema: | 3412 | schema: |
3241 | type: object | 3413 | type: object |
3414 | examples: | ||
3415 | nightly: | ||
3416 | externalValue: https://peertube2.cpy.re/feeds/video-comments.json?filter=local | ||
3242 | '400': | 3417 | '400': |
3243 | x-summary: field inconsistencies | 3418 | x-summary: field inconsistencies |
3244 | description: > | 3419 | description: > |
@@ -3253,13 +3428,6 @@ paths: | |||
3253 | tags: | 3428 | tags: |
3254 | - Feeds | 3429 | - Feeds |
3255 | summary: List videos | 3430 | summary: List videos |
3256 | servers: | ||
3257 | - url: 'https://peertube2.cpy.re' | ||
3258 | description: Live Test Server (live data - latest nightly version) | ||
3259 | - url: 'https://peertube3.cpy.re' | ||
3260 | description: Live Test Server (live data - latest RC version) | ||
3261 | - url: 'https://peertube.cpy.re' | ||
3262 | description: Live Test Server (live data - stable version) | ||
3263 | parameters: | 3431 | parameters: |
3264 | - name: format | 3432 | - name: format |
3265 | in: path | 3433 | in: path |
@@ -3316,19 +3484,93 @@ paths: | |||
3316 | application/rss+xml: | 3484 | application/rss+xml: |
3317 | schema: | 3485 | schema: |
3318 | $ref: '#/components/schemas/VideosForXML' | 3486 | $ref: '#/components/schemas/VideosForXML' |
3487 | examples: | ||
3488 | nightly: | ||
3489 | externalValue: https://peertube2.cpy.re/feeds/videos.rss?filter=local | ||
3319 | text/xml: | 3490 | text/xml: |
3320 | schema: | 3491 | schema: |
3321 | $ref: '#/components/schemas/VideosForXML' | 3492 | $ref: '#/components/schemas/VideosForXML' |
3493 | examples: | ||
3494 | nightly: | ||
3495 | externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local | ||
3322 | application/atom+xml: | 3496 | application/atom+xml: |
3323 | schema: | 3497 | schema: |
3324 | $ref: '#/components/schemas/VideosForXML' | 3498 | $ref: '#/components/schemas/VideosForXML' |
3499 | examples: | ||
3500 | nightly: | ||
3501 | externalValue: https://peertube2.cpy.re/feeds/videos.atom?filter=local | ||
3325 | application/json: | 3502 | application/json: |
3326 | schema: | 3503 | schema: |
3327 | type: object | 3504 | type: object |
3505 | examples: | ||
3506 | nightly: | ||
3507 | externalValue: https://peertube2.cpy.re/feeds/videos.json?filter=local | ||
3328 | '404': | 3508 | '404': |
3329 | description: video channel or account not found | 3509 | description: video channel or account not found |
3330 | '406': | 3510 | '406': |
3331 | description: accept header unsupported | 3511 | description: accept header unsupported |
3512 | '/feeds/subscriptions.{format}': | ||
3513 | get: | ||
3514 | tags: | ||
3515 | - Feeds | ||
3516 | - Account | ||
3517 | summary: List videos of subscriptions tied to a token | ||
3518 | parameters: | ||
3519 | - name: format | ||
3520 | in: path | ||
3521 | required: true | ||
3522 | description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))' | ||
3523 | schema: | ||
3524 | type: string | ||
3525 | enum: | ||
3526 | - xml | ||
3527 | - rss | ||
3528 | - rss2 | ||
3529 | - atom | ||
3530 | - atom1 | ||
3531 | - json | ||
3532 | - json1 | ||
3533 | - name: accountId | ||
3534 | in: query | ||
3535 | description: limit listing to a specific account | ||
3536 | schema: | ||
3537 | type: string | ||
3538 | required: true | ||
3539 | - name: token | ||
3540 | in: query | ||
3541 | description: private token allowing access | ||
3542 | schema: | ||
3543 | type: string | ||
3544 | required: true | ||
3545 | - $ref: '#/components/parameters/sort' | ||
3546 | - $ref: '#/components/parameters/nsfw' | ||
3547 | - $ref: '#/components/parameters/filter' | ||
3548 | responses: | ||
3549 | '204': | ||
3550 | description: successful operation | ||
3551 | headers: | ||
3552 | Cache-Control: | ||
3553 | schema: | ||
3554 | type: string | ||
3555 | default: 'max-age=900' # 15 min cache | ||
3556 | content: | ||
3557 | application/xml: | ||
3558 | schema: | ||
3559 | $ref: '#/components/schemas/VideosForXML' | ||
3560 | application/rss+xml: | ||
3561 | schema: | ||
3562 | $ref: '#/components/schemas/VideosForXML' | ||
3563 | text/xml: | ||
3564 | schema: | ||
3565 | $ref: '#/components/schemas/VideosForXML' | ||
3566 | application/atom+xml: | ||
3567 | schema: | ||
3568 | $ref: '#/components/schemas/VideosForXML' | ||
3569 | application/json: | ||
3570 | schema: | ||
3571 | type: object | ||
3572 | '406': | ||
3573 | description: accept header unsupported | ||
3332 | /plugins: | 3574 | /plugins: |
3333 | get: | 3575 | get: |
3334 | tags: | 3576 | tags: |
@@ -3823,7 +4065,7 @@ components: | |||
3823 | name: categoryOneOf | 4065 | name: categoryOneOf |
3824 | in: query | 4066 | in: query |
3825 | required: false | 4067 | required: false |
3826 | description: category id of the video (see [/videos/categories](#tag/Video/paths/~1videos~1categories/get)) | 4068 | description: category id of the video (see [/videos/categories](#operation/getCategories)) |
3827 | schema: | 4069 | schema: |
3828 | oneOf: | 4070 | oneOf: |
3829 | - type: integer | 4071 | - type: integer |
@@ -3841,6 +4083,7 @@ components: | |||
3841 | oneOf: | 4083 | oneOf: |
3842 | - type: string | 4084 | - type: string |
3843 | - type: array | 4085 | - type: array |
4086 | maxItems: 5 | ||
3844 | items: | 4087 | items: |
3845 | type: string | 4088 | type: string |
3846 | style: form | 4089 | style: form |
@@ -3862,7 +4105,7 @@ components: | |||
3862 | name: languageOneOf | 4105 | name: languageOneOf |
3863 | in: query | 4106 | in: query |
3864 | required: false | 4107 | required: false |
3865 | description: language id of the video (see [/videos/languages](#tag/Video/paths/~1videos~1languages/get)). Use `_unknown` to filter on videos that don't have a video language | 4108 | description: language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language |
3866 | schema: | 4109 | schema: |
3867 | oneOf: | 4110 | oneOf: |
3868 | - type: string | 4111 | - type: string |
@@ -3875,7 +4118,7 @@ components: | |||
3875 | name: licenceOneOf | 4118 | name: licenceOneOf |
3876 | in: query | 4119 | in: query |
3877 | required: false | 4120 | required: false |
3878 | description: licence id of the video (see [/videos/licences](#tag/Video/paths/~1videos~1licences/get)) | 4121 | description: licence id of the video (see [/videos/licences](#operation/getLicences)) |
3879 | schema: | 4122 | schema: |
3880 | oneOf: | 4123 | oneOf: |
3881 | - type: integer | 4124 | - type: integer |
@@ -3959,19 +4202,16 @@ components: | |||
3959 | - video-live-ending | 4202 | - video-live-ending |
3960 | securitySchemes: | 4203 | securitySchemes: |
3961 | OAuth2: | 4204 | OAuth2: |
3962 | description: > | 4205 | description: | |
3963 | In the header: *Authorization: Bearer <token\>* | ||
3964 | |||
3965 | |||
3966 | Authenticating via OAuth requires the following steps: | 4206 | Authenticating via OAuth requires the following steps: |
3967 | 4207 | - Have an activated account | |
3968 | |||
3969 | - Have an account with sufficient authorization levels | ||
3970 | |||
3971 | - [Generate](https://docs.joinpeertube.org/api-rest-getting-started) a | 4208 | - [Generate](https://docs.joinpeertube.org/api-rest-getting-started) a |
3972 | Bearer Token | 4209 | Bearer Token for that account at `/api/v1/users/token` |
4210 | - Make authenticated requests, putting *Authorization: Bearer <token\>* | ||
4211 | - Profit, depending on the role assigned to the account | ||
3973 | 4212 | ||
3974 | - Make Authenticated Requests | 4213 | Note that the __access token is valid for 1 day__ and, and is given |
4214 | along with a __refresh token valid for 2 weeks__. | ||
3975 | type: oauth2 | 4215 | type: oauth2 |
3976 | flows: | 4216 | flows: |
3977 | password: | 4217 | password: |
@@ -3991,25 +4231,33 @@ components: | |||
3991 | minLength: 36 | 4231 | minLength: 36 |
3992 | maxLength: 36 | 4232 | maxLength: 36 |
3993 | 4233 | ||
4234 | VideoCategorySet: | ||
4235 | type: integer | ||
4236 | description: category id of the video (see [/videos/categories](#operation/getCategories)) | ||
3994 | VideoConstantNumber-Category: | 4237 | VideoConstantNumber-Category: |
3995 | properties: | 4238 | properties: |
3996 | id: | 4239 | id: |
3997 | type: integer | 4240 | $ref: '#/components/schemas/VideoCategorySet' |
3998 | description: category id of the video (see [/videos/categories](#tag/Video/paths/~1videos~1categories/get)) | ||
3999 | label: | 4241 | label: |
4000 | type: string | 4242 | type: string |
4243 | |||
4244 | VideoLicenceSet: | ||
4245 | type: integer | ||
4246 | description: licence id of the video (see [/videos/licences](#operation/getLicences)) | ||
4001 | VideoConstantNumber-Licence: | 4247 | VideoConstantNumber-Licence: |
4002 | properties: | 4248 | properties: |
4003 | id: | 4249 | id: |
4004 | type: integer | 4250 | $ref: '#/components/schemas/VideoLicenceSet' |
4005 | description: licence id of the video (see [/videos/licences](#tag/Video/paths/~1videos~1licences/get)) | ||
4006 | label: | 4251 | label: |
4007 | type: string | 4252 | type: string |
4253 | |||
4254 | VideoLanguageSet: | ||
4255 | type: string | ||
4256 | description: language id of the video (see [/videos/languages](#operation/getLanguages)) | ||
4008 | VideoConstantString-Language: | 4257 | VideoConstantString-Language: |
4009 | properties: | 4258 | properties: |
4010 | id: | 4259 | id: |
4011 | type: string | 4260 | $ref: '#/components/schemas/VideoLanguageSet' |
4012 | description: language id of the video (see [/videos/languages](#tag/Video/paths/~1videos~1languages/get)) | ||
4013 | label: | 4261 | label: |
4014 | type: string | 4262 | type: string |
4015 | 4263 | ||
@@ -4019,7 +4267,7 @@ components: | |||
4019 | - 1 | 4267 | - 1 |
4020 | - 2 | 4268 | - 2 |
4021 | - 3 | 4269 | - 3 |
4022 | description: 'The video playlist privacy (Public = `1`, Unlisted = `2`, Private = `3`)' | 4270 | description: Video playlist privacy policy (see [/video-playlists/privacies]) |
4023 | VideoPlaylistPrivacyConstant: | 4271 | VideoPlaylistPrivacyConstant: |
4024 | properties: | 4272 | properties: |
4025 | id: | 4273 | id: |
@@ -4032,7 +4280,7 @@ components: | |||
4032 | enum: | 4280 | enum: |
4033 | - 1 | 4281 | - 1 |
4034 | - 2 | 4282 | - 2 |
4035 | description: 'The video playlist type (Regular = `1`, Watch Later = `2`)' | 4283 | description: The video playlist type (Regular = `1`, Watch Later = `2`) |
4036 | VideoPlaylistTypeConstant: | 4284 | VideoPlaylistTypeConstant: |
4037 | properties: | 4285 | properties: |
4038 | id: | 4286 | id: |
@@ -4047,7 +4295,7 @@ components: | |||
4047 | - 2 | 4295 | - 2 |
4048 | - 3 | 4296 | - 3 |
4049 | - 4 | 4297 | - 4 |
4050 | description: 'The video privacy (Public = `1`, Unlisted = `2`, Private = `3`, Internal = `4`)' | 4298 | description: privacy id of the video (see [/videos/privacies](#operation/getPrivacyPolicies)) |
4051 | VideoPrivacyConstant: | 4299 | VideoPrivacyConstant: |
4052 | properties: | 4300 | properties: |
4053 | id: | 4301 | id: |
@@ -4118,12 +4366,17 @@ components: | |||
4118 | - captions | 4366 | - captions |
4119 | example: [spamOrMisleading] | 4367 | example: [spamOrMisleading] |
4120 | 4368 | ||
4369 | VideoResolutionSet: | ||
4370 | type: integer | ||
4371 | description: | | ||
4372 | Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`) | ||
4373 | |||
4374 | `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos. | ||
4375 | example: 240 | ||
4121 | VideoResolutionConstant: | 4376 | VideoResolutionConstant: |
4122 | properties: | 4377 | properties: |
4123 | id: | 4378 | id: |
4124 | type: integer | 4379 | $ref: '#/components/schemas/VideoResolutionSet' |
4125 | description: 'Video resolution (240, 360, 720, 1080, 1440 or 2160)' | ||
4126 | example: 240 | ||
4127 | label: | 4380 | label: |
4128 | type: string | 4381 | type: string |
4129 | example: 240p | 4382 | example: 240p |
@@ -4507,6 +4760,16 @@ components: | |||
4507 | format: date-time | 4760 | format: date-time |
4508 | video: | 4761 | video: |
4509 | $ref: '#/components/schemas/Video' | 4762 | $ref: '#/components/schemas/Video' |
4763 | VideoImportsList: | ||
4764 | properties: | ||
4765 | total: | ||
4766 | type: integer | ||
4767 | example: 1 | ||
4768 | data: | ||
4769 | type: array | ||
4770 | maxItems: 100 | ||
4771 | items: | ||
4772 | $ref: '#/components/schemas/VideoImport' | ||
4510 | Abuse: | 4773 | Abuse: |
4511 | properties: | 4774 | properties: |
4512 | id: | 4775 | id: |
@@ -4540,7 +4803,7 @@ components: | |||
4540 | message: | 4803 | message: |
4541 | type: string | 4804 | type: string |
4542 | minLength: 2 | 4805 | minLength: 2 |
4543 | maxLength: 3000 | 4806 | maxLength: 3000 |
4544 | byModerator: | 4807 | byModerator: |
4545 | type: boolean | 4808 | type: boolean |
4546 | createdAt: | 4809 | createdAt: |
@@ -4717,6 +4980,8 @@ components: | |||
4717 | host: | 4980 | host: |
4718 | type: string | 4981 | type: string |
4719 | format: hostname | 4982 | format: hostname |
4983 | hostRedundancyAllowed: | ||
4984 | type: boolean | ||
4720 | followingCount: | 4985 | followingCount: |
4721 | type: integer | 4986 | type: integer |
4722 | followersCount: | 4987 | followersCount: |
@@ -4831,7 +5096,7 @@ components: | |||
4831 | enabledResolutions: | 5096 | enabledResolutions: |
4832 | type: array | 5097 | type: array |
4833 | items: | 5098 | items: |
4834 | type: integer | 5099 | $ref: '#/components/schemas/VideoResolutionSet' |
4835 | import: | 5100 | import: |
4836 | type: object | 5101 | type: object |
4837 | properties: | 5102 | properties: |
@@ -5032,6 +5297,7 @@ components: | |||
5032 | type: boolean | 5297 | type: boolean |
5033 | user: | 5298 | user: |
5034 | type: object | 5299 | type: object |
5300 | description: Settings that apply to new users, if registration is enabled | ||
5035 | properties: | 5301 | properties: |
5036 | videoQuota: | 5302 | videoQuota: |
5037 | type: integer | 5303 | type: integer |
@@ -5039,18 +5305,34 @@ components: | |||
5039 | type: integer | 5305 | type: integer |
5040 | transcoding: | 5306 | transcoding: |
5041 | type: object | 5307 | type: object |
5308 | description: Settings pertaining to transcoding jobs | ||
5042 | properties: | 5309 | properties: |
5043 | enabled: | 5310 | enabled: |
5044 | type: boolean | 5311 | type: boolean |
5045 | allowAdditionalExtensions: | 5312 | allowAdditionalExtensions: |
5046 | type: boolean | 5313 | type: boolean |
5314 | description: Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos | ||
5047 | allowAudioFiles: | 5315 | allowAudioFiles: |
5048 | type: boolean | 5316 | type: boolean |
5317 | description: If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file | ||
5049 | threads: | 5318 | threads: |
5050 | type: integer | 5319 | type: integer |
5320 | description: Amount of threads used by ffmpeg for 1 transcoding job | ||
5321 | concurrency: | ||
5322 | type: number | ||
5323 | description: Amount of transcoding jobs to execute in parallel | ||
5324 | profile: | ||
5325 | type: string | ||
5326 | enum: | ||
5327 | - default | ||
5328 | description: | | ||
5329 | New profiles can be added by plugins ; available in core PeerTube: 'default'. | ||
5051 | resolutions: | 5330 | resolutions: |
5052 | type: object | 5331 | type: object |
5332 | description: Resolutions to transcode _new videos_ to | ||
5053 | properties: | 5333 | properties: |
5334 | 0p: | ||
5335 | type: boolean | ||
5054 | 240p: | 5336 | 240p: |
5055 | type: boolean | 5337 | type: boolean |
5056 | 360p: | 5338 | 360p: |
@@ -5065,8 +5347,15 @@ components: | |||
5065 | type: boolean | 5347 | type: boolean |
5066 | 2160p: | 5348 | 2160p: |
5067 | type: boolean | 5349 | type: boolean |
5350 | webtorrent: | ||
5351 | type: object | ||
5352 | description: WebTorrent-specific settings | ||
5353 | properties: | ||
5354 | enabled: | ||
5355 | type: boolean | ||
5068 | hls: | 5356 | hls: |
5069 | type: object | 5357 | type: object |
5358 | description: HLS-specific settings | ||
5070 | properties: | 5359 | properties: |
5071 | enabled: | 5360 | enabled: |
5072 | type: boolean | 5361 | type: boolean |
@@ -5133,6 +5422,7 @@ components: | |||
5133 | PredefinedAbuseReasons: | 5422 | PredefinedAbuseReasons: |
5134 | description: Reason categories that help triage reports | 5423 | description: Reason categories that help triage reports |
5135 | type: array | 5424 | type: array |
5425 | maxItems: 8 | ||
5136 | items: | 5426 | items: |
5137 | type: string | 5427 | type: string |
5138 | enum: | 5428 | enum: |
@@ -5202,6 +5492,98 @@ components: | |||
5202 | id: | 5492 | id: |
5203 | type: integer | 5493 | type: integer |
5204 | example: 37 | 5494 | example: 37 |
5495 | VideoUploadRequestCommon: | ||
5496 | properties: | ||
5497 | name: | ||
5498 | description: Video name | ||
5499 | type: string | ||
5500 | channelId: | ||
5501 | description: Channel id that will contain this video | ||
5502 | type: integer | ||
5503 | privacy: | ||
5504 | $ref: '#/components/schemas/VideoPrivacySet' | ||
5505 | category: | ||
5506 | $ref: '#/components/schemas/VideoCategorySet' | ||
5507 | licence: | ||
5508 | $ref: '#/components/schemas/VideoLicenceSet' | ||
5509 | language: | ||
5510 | $ref: '#/components/schemas/VideoLanguageSet' | ||
5511 | description: | ||
5512 | description: Video description | ||
5513 | type: string | ||
5514 | waitTranscoding: | ||
5515 | description: Whether or not we wait transcoding before publish the video | ||
5516 | type: boolean | ||
5517 | support: | ||
5518 | description: A text tell the audience how to support the video creator | ||
5519 | example: Please support my work on <insert crowdfunding plateform>! <3 | ||
5520 | type: string | ||
5521 | nsfw: | ||
5522 | description: Whether or not this video contains sensitive content | ||
5523 | type: boolean | ||
5524 | tags: | ||
5525 | description: Video tags (maximum 5 tags each between 2 and 30 characters) | ||
5526 | type: array | ||
5527 | minItems: 1 | ||
5528 | maxItems: 5 | ||
5529 | uniqueItems: true | ||
5530 | items: | ||
5531 | type: string | ||
5532 | minLength: 2 | ||
5533 | maxLength: 30 | ||
5534 | commentsEnabled: | ||
5535 | description: Enable or disable comments for this video | ||
5536 | type: boolean | ||
5537 | downloadEnabled: | ||
5538 | description: Enable or disable downloading for this video | ||
5539 | type: boolean | ||
5540 | originallyPublishedAt: | ||
5541 | description: Date when the content was originally published | ||
5542 | type: string | ||
5543 | format: date-time | ||
5544 | scheduleUpdate: | ||
5545 | $ref: '#/components/schemas/VideoScheduledUpdate' | ||
5546 | thumbnailfile: | ||
5547 | description: Video thumbnail file | ||
5548 | type: string | ||
5549 | format: binary | ||
5550 | previewfile: | ||
5551 | description: Video preview file | ||
5552 | type: string | ||
5553 | format: binary | ||
5554 | required: | ||
5555 | - channelId | ||
5556 | - name | ||
5557 | VideoUploadRequestLegacy: | ||
5558 | allOf: | ||
5559 | - $ref: '#/components/schemas/VideoUploadRequestCommon' | ||
5560 | - type: object | ||
5561 | required: | ||
5562 | - videofile | ||
5563 | properties: | ||
5564 | videofile: | ||
5565 | description: Video file | ||
5566 | type: string | ||
5567 | format: binary | ||
5568 | VideoUploadRequestResumable: | ||
5569 | allOf: | ||
5570 | - $ref: '#/components/schemas/VideoUploadRequestCommon' | ||
5571 | - type: object | ||
5572 | required: | ||
5573 | - filename | ||
5574 | properties: | ||
5575 | filename: | ||
5576 | description: Video filename including extension | ||
5577 | type: string | ||
5578 | format: filename | ||
5579 | thumbnailfile: | ||
5580 | description: Video thumbnail file | ||
5581 | type: string | ||
5582 | format: binary | ||
5583 | previewfile: | ||
5584 | description: Video preview file | ||
5585 | type: string | ||
5586 | format: binary | ||
5205 | VideoUploadResponse: | 5587 | VideoUploadResponse: |
5206 | properties: | 5588 | properties: |
5207 | video: | 5589 | video: |
@@ -5238,35 +5620,45 @@ components: | |||
5238 | $ref: '#/components/schemas/Video' | 5620 | $ref: '#/components/schemas/Video' |
5239 | User: | 5621 | User: |
5240 | properties: | 5622 | properties: |
5241 | id: | 5623 | account: |
5242 | type: integer | 5624 | $ref: '#/components/schemas/Account' |
5243 | readOnly: true | 5625 | autoPlayNextVideo: |
5244 | username: | 5626 | type: boolean |
5627 | description: Automatically start playing the upcoming video after the currently playing video | ||
5628 | autoPlayNextVideoPlaylist: | ||
5629 | type: boolean | ||
5630 | description: Automatically start playing the video on the playlist after the currently playing video | ||
5631 | autoPlayVideo: | ||
5632 | type: boolean | ||
5633 | description: Automatically start playing the video on the watch page | ||
5634 | blocked: | ||
5635 | type: boolean | ||
5636 | blockedReason: | ||
5637 | type: string | ||
5638 | createdAt: | ||
5245 | type: string | 5639 | type: string |
5246 | description: The user username | ||
5247 | minLength: 1 | ||
5248 | maxLength: 50 | ||
5249 | email: | 5640 | email: |
5250 | type: string | 5641 | type: string |
5251 | format: email | 5642 | format: email |
5252 | description: The user email | 5643 | description: The user email |
5644 | emailVerified: | ||
5645 | type: boolean | ||
5646 | description: Has the user confirmed their email address? | ||
5647 | id: | ||
5648 | type: integer | ||
5649 | readOnly: true | ||
5253 | pluginAuth: | 5650 | pluginAuth: |
5254 | type: string | 5651 | type: string |
5255 | description: Auth plugin to use to authenticate the user | 5652 | description: Auth plugin to use to authenticate the user |
5256 | theme: | 5653 | lastLoginDate: |
5257 | type: string | 5654 | type: string |
5258 | description: Theme enabled by this user | 5655 | format: date-time |
5259 | emailVerified: | 5656 | noInstanceConfigWarningModal: |
5657 | type: boolean | ||
5658 | noWelcomeModal: | ||
5260 | type: boolean | 5659 | type: boolean |
5261 | description: Has the user confirmed their email address? | ||
5262 | nsfwPolicy: | 5660 | nsfwPolicy: |
5263 | $ref: '#/components/schemas/NSFWPolicy' | 5661 | $ref: '#/components/schemas/NSFWPolicy' |
5264 | webtorrentEnabled: | ||
5265 | type: boolean | ||
5266 | description: Enable P2P in the player | ||
5267 | autoPlayVideo: | ||
5268 | type: boolean | ||
5269 | description: Automatically start playing the video on the watch page | ||
5270 | role: | 5662 | role: |
5271 | $ref: '#/components/schemas/UserRole' | 5663 | $ref: '#/components/schemas/UserRole' |
5272 | roleLabel: | 5664 | roleLabel: |
@@ -5275,38 +5667,49 @@ components: | |||
5275 | - User | 5667 | - User |
5276 | - Moderator | 5668 | - Moderator |
5277 | - Administrator | 5669 | - Administrator |
5278 | videoQuota: | 5670 | theme: |
5279 | type: integer | ||
5280 | description: The user video quota | ||
5281 | videoQuotaDaily: | ||
5282 | type: integer | ||
5283 | description: The user daily video quota | ||
5284 | videosCount: | ||
5285 | type: integer | ||
5286 | abusesCount: | ||
5287 | type: integer | ||
5288 | abusesAcceptedCount: | ||
5289 | type: integer | ||
5290 | abusesCreatedCount: | ||
5291 | type: integer | ||
5292 | videoCommentsCount: | ||
5293 | type: integer | ||
5294 | noInstanceConfigWarningModal: | ||
5295 | type: boolean | ||
5296 | noWelcomeModal: | ||
5297 | type: boolean | ||
5298 | blocked: | ||
5299 | type: boolean | ||
5300 | blockedReason: | ||
5301 | type: string | 5671 | type: string |
5302 | createdAt: | 5672 | description: Theme enabled by this user |
5673 | username: | ||
5303 | type: string | 5674 | type: string |
5304 | account: | 5675 | description: The user username |
5305 | $ref: '#/components/schemas/Account' | 5676 | minLength: 1 |
5677 | maxLength: 50 | ||
5306 | videoChannels: | 5678 | videoChannels: |
5307 | type: array | 5679 | type: array |
5308 | items: | 5680 | items: |
5309 | $ref: '#/components/schemas/VideoChannel' | 5681 | $ref: '#/components/schemas/VideoChannel' |
5682 | videoQuota: | ||
5683 | type: integer | ||
5684 | description: The user video quota in bytes | ||
5685 | example: -1 | ||
5686 | videoQuotaDaily: | ||
5687 | type: integer | ||
5688 | description: The user daily video quota in bytes | ||
5689 | example: -1 | ||
5690 | webtorrentEnabled: | ||
5691 | type: boolean | ||
5692 | description: Enable P2P in the player | ||
5693 | UserWithStats: | ||
5694 | allOf: | ||
5695 | - $ref: '#/components/schemas/User' | ||
5696 | - properties: | ||
5697 | # optionally present fields: they require WITH_STATS scope | ||
5698 | videosCount: | ||
5699 | type: integer | ||
5700 | description: Count of videos published | ||
5701 | abusesCount: | ||
5702 | type: integer | ||
5703 | description: Count of reports/abuses of which the user is a target | ||
5704 | abusesAcceptedCount: | ||
5705 | type: integer | ||
5706 | description: Count of reports/abuses created by the user and accepted/acted upon by the moderation team | ||
5707 | abusesCreatedCount: | ||
5708 | type: integer | ||
5709 | description: Count of reports/abuses created by the user | ||
5710 | videoCommentsCount: | ||
5711 | type: integer | ||
5712 | description: Count of comments published | ||
5310 | AddUser: | 5713 | AddUser: |
5311 | properties: | 5714 | properties: |
5312 | username: | 5715 | username: |
@@ -5314,6 +5717,7 @@ components: | |||
5314 | description: The user username | 5717 | description: The user username |
5315 | minLength: 1 | 5718 | minLength: 1 |
5316 | maxLength: 50 | 5719 | maxLength: 50 |
5720 | pattern: '/^[a-z0-9._]{1,50}$/' | ||
5317 | password: | 5721 | password: |
5318 | type: string | 5722 | type: string |
5319 | format: password | 5723 | format: password |
@@ -5333,6 +5737,7 @@ components: | |||
5333 | channelName: | 5737 | channelName: |
5334 | type: string | 5738 | type: string |
5335 | description: The user default channel username | 5739 | description: The user default channel username |
5740 | pattern: '/^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\-_.:]+$/' | ||
5336 | role: | 5741 | role: |
5337 | $ref: '#/components/schemas/UserRole' | 5742 | $ref: '#/components/schemas/UserRole' |
5338 | adminFlags: | 5743 | adminFlags: |
@@ -5406,7 +5811,11 @@ components: | |||
5406 | type: string | 5811 | type: string |
5407 | description: Id of the video | 5812 | description: Id of the video |
5408 | rating: | 5813 | rating: |
5409 | type: number | 5814 | type: string |
5815 | enum: | ||
5816 | - like | ||
5817 | - dislike | ||
5818 | - none | ||
5410 | description: Rating of the video | 5819 | description: Rating of the video |
5411 | required: | 5820 | required: |
5412 | - id | 5821 | - id |
@@ -5416,8 +5825,12 @@ components: | |||
5416 | video: | 5825 | video: |
5417 | $ref: '#/components/schemas/Video' | 5826 | $ref: '#/components/schemas/Video' |
5418 | rating: | 5827 | rating: |
5419 | type: number | 5828 | type: string |
5420 | description: 'Rating of the video' | 5829 | enum: |
5830 | - like | ||
5831 | - dislike | ||
5832 | - none | ||
5833 | description: Rating of the video | ||
5421 | required: | 5834 | required: |
5422 | - video | 5835 | - video |
5423 | - rating | 5836 | - rating |
@@ -5495,6 +5908,17 @@ components: | |||
5495 | bulkVideosSupportUpdate: | 5908 | bulkVideosSupportUpdate: |
5496 | type: boolean | 5909 | type: boolean |
5497 | description: 'Update the support field for all videos of this channel' | 5910 | description: 'Update the support field for all videos of this channel' |
5911 | VideoChannelList: | ||
5912 | properties: | ||
5913 | total: | ||
5914 | type: integer | ||
5915 | example: 1 | ||
5916 | data: | ||
5917 | type: array | ||
5918 | items: | ||
5919 | allOf: | ||
5920 | - $ref: '#/components/schemas/VideoChannel' | ||
5921 | - $ref: '#/components/schemas/Actor' | ||
5498 | 5922 | ||
5499 | MRSSPeerLink: | 5923 | MRSSPeerLink: |
5500 | type: object | 5924 | type: object |
diff --git a/support/doc/dependencies.md b/support/doc/dependencies.md index 9666d72af..939772a9d 100644 --- a/support/doc/dependencies.md +++ b/support/doc/dependencies.md | |||
@@ -307,7 +307,7 @@ brew services run redis | |||
307 | ``` | 307 | ``` |
308 | 308 | ||
309 | On macOS, the `postgresql` user can be `_postgres` instead of `postgres`. | 309 | On macOS, the `postgresql` user can be `_postgres` instead of `postgres`. |
310 | If `sudo -u postgres createuser -P peertube` gives you an error, you can try `sudo -u _postgres createuser -U peertube`. | 310 | If `sudo -u postgres createuser -P peertube` gives you an `unknown user: postgres` error, you can try `sudo -u _postgres createuser -U peertube`. |
311 | 311 | ||
312 | ## Gentoo | 312 | ## Gentoo |
313 | 313 | ||
diff --git a/support/doc/plugins/guide.md b/support/doc/plugins/guide.md index 53d53c26d..5b7d1cb31 100644 --- a/support/doc/plugins/guide.md +++ b/support/doc/plugins/guide.md | |||
@@ -261,8 +261,8 @@ function register ({ | |||
261 | router.get('/ping', (req, res) => res.json({ message: 'pong' })) | 261 | router.get('/ping', (req, res) => res.json({ message: 'pong' })) |
262 | 262 | ||
263 | // Users are automatically authenticated | 263 | // Users are automatically authenticated |
264 | router.get('/auth', (res, res) => { | 264 | router.get('/auth', async (res, res) => { |
265 | const user = peertubeHelpers.user.getAuthUser(res) | 265 | const user = await peertubeHelpers.user.getAuthUser(res) |
266 | 266 | ||
267 | const isAdmin = user.role === 0 | 267 | const isAdmin = user.role === 0 |
268 | const isModerator = user.role === 1 | 268 | const isModerator = user.role === 1 |
diff --git a/support/docker/production/Dockerfile.buster b/support/docker/production/Dockerfile.buster index b3822964d..2ff0591f9 100644 --- a/support/docker/production/Dockerfile.buster +++ b/support/docker/production/Dockerfile.buster | |||
@@ -7,7 +7,7 @@ ARG NPM_RUN_BUILD_OPTS | |||
7 | 7 | ||
8 | # Install dependencies | 8 | # Install dependencies |
9 | RUN apt update \ | 9 | RUN apt update \ |
10 | && apt install -y --no-install-recommends openssl ffmpeg python ca-certificates gnupg gosu build-essential \ | 10 | && apt install -y --no-install-recommends openssl ffmpeg python ca-certificates gnupg gosu build-essential curl \ |
11 | && gosu nobody true \ | 11 | && gosu nobody true \ |
12 | && rm /var/lib/apt/lists/* -fR | 12 | && rm /var/lib/apt/lists/* -fR |
13 | 13 | ||
diff --git a/support/nginx/peertube b/support/nginx/peertube index 00ce1d0dc..d03f14613 100644 --- a/support/nginx/peertube +++ b/support/nginx/peertube | |||
@@ -78,6 +78,15 @@ server { | |||
78 | try_files /dev/null @api; | 78 | try_files /dev/null @api; |
79 | } | 79 | } |
80 | 80 | ||
81 | location = /api/v1/videos/upload-resumable { | ||
82 | if ($request_method = 'PUT') { | ||
83 | client_max_body_size 0; | ||
84 | proxy_request_buffering off; | ||
85 | } | ||
86 | |||
87 | try_files /dev/null @api; | ||
88 | } | ||
89 | |||
81 | location = /api/v1/videos/upload { | 90 | location = /api/v1/videos/upload { |
82 | limit_except POST HEAD { deny all; } | 91 | limit_except POST HEAD { deny all; } |
83 | 92 | ||