aboutsummaryrefslogtreecommitdiffhomepage
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/doc/api/embeds.md38
-rw-r--r--support/doc/api/openapi.yaml1038
-rw-r--r--support/doc/api/quickstart.md10
-rw-r--r--support/doc/docker.md99
-rw-r--r--support/doc/plugins/guide.md205
-rw-r--r--support/doc/production.md2
-rw-r--r--support/doc/tools.md32
-rw-r--r--support/doc/translation.md2
-rw-r--r--support/docker/production/.env26
-rw-r--r--support/docker/production/config/production.yaml1
-rw-r--r--support/docker/production/config/traefik.toml11
-rw-r--r--support/docker/production/docker-compose.yml7
-rw-r--r--support/nginx/peertube16
-rw-r--r--support/openapi/go/README.mustache121
-rw-r--r--support/openapi/go/def.yaml3
-rw-r--r--support/openapi/kotlin/README.mustache97
-rw-r--r--support/openapi/kotlin/def.yaml6
-rw-r--r--support/openapi/python/README.mustache47
-rw-r--r--support/openapi/python/def.yaml5
19 files changed, 1424 insertions, 342 deletions
diff --git a/support/doc/api/embeds.md b/support/doc/api/embeds.md
index ca480006d..e3df35efc 100644
--- a/support/doc/api/embeds.md
+++ b/support/doc/api/embeds.md
@@ -4,13 +4,14 @@ PeerTube lets you embed videos and programmatically control their playback. This
4 4
5## Playground 5## Playground
6 6
7Any PeerTube embed URL (ie `https://my-instance.example.com/videos/embed/52a10666-3a18-4e73-93da-e8d3c12c305a`) can be viewed as an embedding playground which 7Any PeerTube embed URL (ie `https://my-instance.example.com/videos/embed/52a10666-3a18-4e73-93da-e8d3c12c305a`) can be viewed as an embedding playground which
8allows you to test various aspects of PeerTube embeds. Simply replace `/embed` with `/test-embed` and visit the URL in a browser. 8allows you to test various aspects of PeerTube embeds. Simply replace `/embed` with `/test-embed` and visit the URL in a browser.
9For instance, the playground URL for the above embed URL is `https://my-instance.example.com/videos/test-embed/52a10666-3a18-4e73-93da-e8d3c12c305a`. 9For instance, the playground URL for the above embed URL is `https://my-instance.example.com/videos/test-embed/52a10666-3a18-4e73-93da-e8d3c12c305a`.
10 10
11## Quick Start 11## Quick Start
12 12
13Given an existing PeerTube embed `<iframe>`, one can use the PeerTube Embed API to control it by first including the library. You can include it via Yarn with: 13Given an existing PeerTube embed `<iframe>` **with API enabled** (`https://my-instance.example.com/videos/embed/52a10666-3a18-4e73-93da-e8d3c12c305a?api=1`),
14one can use the PeerTube Embed API to control it by first including the library. You can include it via Yarn with:
14 15
15``` 16```
16yarn add @peertube/embed-api 17yarn add @peertube/embed-api
@@ -27,7 +28,7 @@ import { PeerTubePlayer } from '@peertube/embed-api'
27Or use the minified build from NPM CDN in your HTML file: 28Or use the minified build from NPM CDN in your HTML file:
28 29
29``` 30```
30<script src="https://unpkg.com/@peertube/embed-api@0.0.1/build/player.min.js"></script> 31<script src="https://unpkg.com/@peertube/embed-api/build/player.min.js"></script>
31 32
32<script> 33<script>
33 const PeerTubePlayer = window['PeerTubePlayer'] 34 const PeerTubePlayer = window['PeerTubePlayer']
@@ -45,7 +46,7 @@ await player.ready // wait for the player to be ready
45// now you can use it! 46// now you can use it!
46player.play() 47player.play()
47player.seek(32) 48player.seek(32)
48player.stop() 49player.pause()
49``` 50```
50 51
51# Methods 52# Methods
@@ -94,11 +95,11 @@ Get the available playback rates, where `1` represents normal speed, `0.5` is ha
94 95
95Get the current playback rate. See `getPlaybackRates()` for more information. 96Get the current playback rate. See `getPlaybackRates()` for more information.
96 97
97## `setPlaybackRate(rate : number) : Promise<void>` 98## `setPlaybackRate(rate: number) : Promise<void>`
98 99
99Set the current playback rate. The passed rate should be a value as returned by `getPlaybackRates()`. 100Set the current playback rate. The passed rate should be a value as returned by `getPlaybackRates()`.
100 101
101## `setVolume(factor : number) : Promise<void>` 102## `setVolume(factor: number) : Promise<void>`
102 103
103Set the playback volume. Value should be between `0` and `1`. 104Set the playback volume. Value should be between `0` and `1`.
104 105
@@ -106,35 +107,40 @@ Set the playback volume. Value should be between `0` and `1`.
106 107
107Get the playback volume. Returns a value between `0` and `1`. 108Get the playback volume. Returns a value between `0` and `1`.
108 109
109# Events 110## `setCaption(id: string) : Promise<void>`
110 111
111You can subscribe to events by using `addEventListener()`. See above for details. 112Update current caption using the caption id.
112 113
113## Event `play` 114## `getCaptions(): Promise<{ id: string, label: string, src: string, mode: 'disabled' | 'showing' }>`
114 115
115Fired when playback begins or is resumed after pausing. 116Get video captions.
116 117
117## Event `pause` 118# Events
118 119
119Fired when playback is paused. 120You can subscribe to events by using `addEventListener()`. See above for details.
120 121
121## Event `playbackStatusUpdate` 122## Event `playbackStatusUpdate`
122 123
123Fired every half second to provide the current status of playback. The parameter of the callback will resemble: 124Fired every half second to provide the current status of playback.
125The parameter of the callback will resemble:
124 126
125```json 127```json
126{ 128{
127 "position": 22.3, 129 "position": 22.3,
128 "volume": 0.9, 130 "volume": 0.9,
131 "duration": "171.37499",
129 "playbackState": "playing" 132 "playbackState": "playing"
130} 133}
131``` 134```
132 135
133The `volume` field contains the volume from `0` (silent) to `1` (full volume). The `playbackState` can be `playing` or `paused`. More states may be added later. 136`duration` field and `ended` `playbackState` are available in PeerTube >= 2.2.
137
138The `volume` field contains the volume from `0` (silent) to `1` (full volume).
139The `playbackState` can be `unstarted`, `playing`, `paused` or `ended`. More states may be added later.
134 140
135## Event `playbackStatusChange` 141## Event `playbackStatusChange`
136 142
137Fired when playback transitions between states, such as `pausing` and `playing`. More states may be added later. 143Fired when playback transitions between states, such as `paused` and `playing`. More states may be added later.
138 144
139## Event `resolutionUpdate` 145## Event `resolutionUpdate`
140 146
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml
index 85f1102b4..9184d7827 100644
--- a/support/doc/api/openapi.yaml
+++ b/support/doc/api/openapi.yaml
@@ -13,20 +13,23 @@ info:
13 altText: PeerTube Project Homepage 13 altText: PeerTube Project Homepage
14 description: | 14 description: |
15 # Introduction 15 # Introduction
16 The PeerTube API is built on HTTP(S). Our API is RESTful. It has predictable 16
17 resource URLs. It returns HTTP response codes to indicate errors. It also 17 The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite
18 accepts and returns JSON in the HTTP body. You can use your favorite
19 HTTP/REST library for your programming language to use PeerTube. No official 18 HTTP/REST library for your programming language to use PeerTube. No official
20 SDK is currently provided, but the spec API is fully compatible with 19 SDK is currently provided, but the spec API is fully compatible with
21 [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO) 20 [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO)
22 which generates a client SDK in the language of your choice. 21 which generates a client SDK in the language of your choice.
23 22
23 See the [Quick Start guide](https://docs.joinpeertube.org/#/api-rest-getting-started) so you can play with the PeerTube API.
24
24 # Authentication 25 # Authentication
26
25 When you sign up for an account, you are given the possibility to generate 27 When you sign up for an account, you are given the possibility to generate
26 sessions, and authenticate using this session token. One session token can 28 sessions, and authenticate using this session token. One session token can
27 currently be used at a time. 29 currently be used at a time.
28 30
29 # Errors 31 # Errors
32
30 The API uses standard HTTP status codes to indicate the success or failure 33 The API uses standard HTTP status codes to indicate the success or failure
31 of the API call. The body of the response will be JSON in the following 34 of the API call. The body of the response will be JSON in the following
32 format. 35 format.
@@ -53,14 +56,14 @@ tags:
53 description: > 56 description: >
54 Jobs are long-running tasks enqueued and processed by the instance 57 Jobs are long-running tasks enqueued and processed by the instance
55 itself. No additional worker registration is currently available. 58 itself. No additional worker registration is currently available.
56 - name: Server Following 59 - name: Instance Follows
57 description: > 60 description: >
58 Managing servers which the instance interacts with is crucial to the 61 Managing servers which the instance interacts with is crucial to the
59 concept of federation in PeerTube and external video indexation. The PeerTube 62 concept of federation in PeerTube and external video indexation. The PeerTube
60 server then deals with inter-server ActivityPub operations and propagates 63 server then deals with inter-server ActivityPub operations and propagates
61 information across its social graph by posting activities to actors' inbox 64 information across its social graph by posting activities to actors' inbox
62 endpoints. 65 endpoints.
63 - name: Video Abuse 66 - name: Video Abuses
64 description: | 67 description: |
65 Video abuses deal with reports of local or remote videos alike. 68 Video abuses deal with reports of local or remote videos alike.
66 - name: Video 69 - name: Video
@@ -72,15 +75,15 @@ tags:
72 Videos from other instances federated by the instance (that is, instances 75 Videos from other instances federated by the instance (that is, instances
73 followed by the instance) can be found via keywords and other criteria of 76 followed by the instance) can be found via keywords and other criteria of
74 the advanced search. 77 the advanced search.
75 - name: Video Comment 78 - name: Video Comments
76 description: > 79 description: >
77 Operations dealing with comments to a video. Comments are organized in 80 Operations dealing with comments to a video. Comments are organized in
78 threads. 81 threads.
79 - name: Video Playlist 82 - name: Video Playlists
80 description: > 83 description: >
81 Operations dealing with playlists of videos. Playlists are bound to users 84 Operations dealing with playlists of videos. Playlists are bound to users
82 and/or channels. 85 and/or channels.
83 - name: Video Channel 86 - name: Video Channels
84 description: > 87 description: >
85 Operations dealing with creation, modification and video listing of a 88 Operations dealing with creation, modification and video listing of a
86 user's channels. 89 user's channels.
@@ -88,43 +91,46 @@ tags:
88 description: > 91 description: >
89 Operations dealing with blacklisting videos (removing them from view and 92 Operations dealing with blacklisting videos (removing them from view and
90 preventing interactions). 93 preventing interactions).
91 - name: Video Rate 94 - name: Video Rates
92 description: > 95 description: >
93 Voting for a video. 96 Like/dislike a video.
94x-tagGroups: 97x-tagGroups:
95 - name: Accounts 98 - name: Accounts
96 tags: 99 tags:
97 - Accounts 100 - Accounts
98 - User 101 - Users
99 - My User 102 - My User
103 - My Subscriptions
100 - name: Videos 104 - name: Videos
101 tags: 105 tags:
102 - Video 106 - Video
103 - Video Caption 107 - Video Caption
104 - Video Channel 108 - Video Channels
105 - Video Comment 109 - Video Comments
106 - Video Following 110 - Video Following
107 - Video Rate 111 - Video Rates
112 - Video Playlists
113 - Video Ownership Change
114 - name: Search
115 tags:
116 - Search
108 - name: Moderation 117 - name: Moderation
109 tags: 118 tags:
110 - Video Abuse 119 - Video Abuses
111 - Video Blacklist 120 - Video Blacklist
112 - name: Instance Configuration 121 - name: Instance Configuration
113 tags: 122 tags:
114 - Config 123 - Config
115 - Server Following 124 - Instance Follows
116 - name: Jobs 125 - name: Jobs
117 tags: 126 tags:
118 - Job 127 - Job
119 - name: Search
120 tags:
121 - Search
122paths: 128paths:
123 '/accounts/{name}': 129 '/accounts/{name}':
124 get: 130 get:
125 tags: 131 tags:
126 - Accounts 132 - Accounts
127 summary: Get the account by name 133 summary: Get an account
128 parameters: 134 parameters:
129 - $ref: '#/components/parameters/name' 135 - $ref: '#/components/parameters/name'
130 responses: 136 responses:
@@ -139,9 +145,20 @@ paths:
139 tags: 145 tags:
140 - Accounts 146 - Accounts
141 - Video 147 - Video
142 summary: 'Get videos for an account, provided the name of that account' 148 summary: 'List videos of an account'
143 parameters: 149 parameters:
144 - $ref: '#/components/parameters/name' 150 - $ref: '#/components/parameters/name'
151 - $ref: '#/components/parameters/categoryOneOf'
152 - $ref: '#/components/parameters/tagsOneOf'
153 - $ref: '#/components/parameters/tagsAllOf'
154 - $ref: '#/components/parameters/licenceOneOf'
155 - $ref: '#/components/parameters/languageOneOf'
156 - $ref: '#/components/parameters/nsfw'
157 - $ref: '#/components/parameters/filter'
158 - $ref: '#/components/parameters/skipCount'
159 - $ref: '#/components/parameters/start'
160 - $ref: '#/components/parameters/count'
161 - $ref: '#/components/parameters/videosSort'
145 responses: 162 responses:
146 '200': 163 '200':
147 description: successful operation 164 description: successful operation
@@ -187,7 +204,7 @@ paths:
187 get: 204 get:
188 tags: 205 tags:
189 - Accounts 206 - Accounts
190 summary: Get all accounts 207 summary: List accounts
191 parameters: 208 parameters:
192 - $ref: '#/components/parameters/start' 209 - $ref: '#/components/parameters/start'
193 - $ref: '#/components/parameters/count' 210 - $ref: '#/components/parameters/count'
@@ -205,7 +222,7 @@ paths:
205 get: 222 get:
206 tags: 223 tags:
207 - Config 224 - Config
208 summary: Get the public configuration of the server 225 summary: Get instance public configuration
209 responses: 226 responses:
210 '200': 227 '200':
211 description: successful operation 228 description: successful operation
@@ -215,7 +232,7 @@ paths:
215 $ref: '#/components/schemas/ServerConfig' 232 $ref: '#/components/schemas/ServerConfig'
216 /config/about: 233 /config/about:
217 get: 234 get:
218 summary: Get the instance about page content 235 summary: Get instance "About" information
219 tags: 236 tags:
220 - Config 237 - Config
221 responses: 238 responses:
@@ -227,7 +244,7 @@ paths:
227 $ref: '#/components/schemas/ServerConfigAbout' 244 $ref: '#/components/schemas/ServerConfigAbout'
228 /config/custom: 245 /config/custom:
229 get: 246 get:
230 summary: Get the runtime configuration of the server 247 summary: Get instance runtime configuration
231 tags: 248 tags:
232 - Config 249 - Config
233 security: 250 security:
@@ -241,7 +258,7 @@ paths:
241 schema: 258 schema:
242 $ref: '#/components/schemas/ServerConfigCustom' 259 $ref: '#/components/schemas/ServerConfigCustom'
243 put: 260 put:
244 summary: Set the runtime configuration of the server 261 summary: Set instance runtime configuration
245 tags: 262 tags:
246 - Config 263 - Config
247 security: 264 security:
@@ -251,7 +268,7 @@ paths:
251 '200': 268 '200':
252 description: successful operation 269 description: successful operation
253 delete: 270 delete:
254 summary: Delete the runtime configuration of the server 271 summary: Delete instance runtime configuration
255 tags: 272 tags:
256 - Config 273 - Config
257 security: 274 security:
@@ -262,7 +279,7 @@ paths:
262 description: successful operation 279 description: successful operation
263 /jobs/{state}: 280 /jobs/{state}:
264 get: 281 get:
265 summary: Get list of jobs 282 summary: List instance jobs
266 security: 283 security:
267 - OAuth2: 284 - OAuth2:
268 - admin 285 - admin
@@ -299,8 +316,8 @@ paths:
299 - OAuth2: 316 - OAuth2:
300 - admin 317 - admin
301 tags: 318 tags:
302 - Server Following 319 - Instance Follows
303 summary: Unfollow a server by hostname 320 summary: Unfollow a server
304 parameters: 321 parameters:
305 - name: host 322 - name: host
306 in: path 323 in: path
@@ -314,8 +331,8 @@ paths:
314 /server/followers: 331 /server/followers:
315 get: 332 get:
316 tags: 333 tags:
317 - Server Following 334 - Instance Follows
318 summary: Get followers of the server 335 summary: List instance followers
319 parameters: 336 parameters:
320 - $ref: '#/components/parameters/start' 337 - $ref: '#/components/parameters/start'
321 - $ref: '#/components/parameters/count' 338 - $ref: '#/components/parameters/count'
@@ -332,8 +349,8 @@ paths:
332 /server/following: 349 /server/following:
333 get: 350 get:
334 tags: 351 tags:
335 - Server Following 352 - Instance Follows
336 summary: Get servers followed by the server 353 summary: List instance followings
337 parameters: 354 parameters:
338 - $ref: '#/components/parameters/start' 355 - $ref: '#/components/parameters/start'
339 - $ref: '#/components/parameters/count' 356 - $ref: '#/components/parameters/count'
@@ -352,11 +369,11 @@ paths:
352 - OAuth2: 369 - OAuth2:
353 - admin 370 - admin
354 tags: 371 tags:
355 - Server Following 372 - Instance Follows
356 summary: Follow a server 373 summary: Follow a server
357 responses: 374 responses:
358 '204': 375 '204':
359 $ref: '#/paths/~1users~1me/put/responses/204' 376 description: successful operation
360 requestBody: 377 requestBody:
361 content: 378 content:
362 application/json: 379 application/json:
@@ -364,12 +381,12 @@ paths:
364 $ref: '#/components/schemas/Follow' 381 $ref: '#/components/schemas/Follow'
365 /users: 382 /users:
366 post: 383 post:
367 summary: Creates user 384 summary: Create a user
368 security: 385 security:
369 - OAuth2: 386 - OAuth2:
370 - admin 387 - admin
371 tags: 388 tags:
372 - User 389 - Users
373 responses: 390 responses:
374 '200': 391 '200':
375 description: successful operation 392 description: successful operation
@@ -385,11 +402,11 @@ paths:
385 description: User to create 402 description: User to create
386 required: true 403 required: true
387 get: 404 get:
388 summary: Get a list of users 405 summary: List users
389 security: 406 security:
390 - OAuth2: [] 407 - OAuth2: []
391 tags: 408 tags:
392 - User 409 - Users
393 parameters: 410 parameters:
394 - $ref: '#/components/parameters/start' 411 - $ref: '#/components/parameters/start'
395 - $ref: '#/components/parameters/count' 412 - $ref: '#/components/parameters/count'
@@ -405,23 +422,23 @@ paths:
405 $ref: '#/components/schemas/User' 422 $ref: '#/components/schemas/User'
406 '/users/{id}': 423 '/users/{id}':
407 delete: 424 delete:
408 summary: Delete a user by its id 425 summary: Delete a user
409 security: 426 security:
410 - OAuth2: 427 - OAuth2:
411 - admin 428 - admin
412 tags: 429 tags:
413 - User 430 - Users
414 parameters: 431 parameters:
415 - $ref: '#/components/parameters/id' 432 - $ref: '#/components/parameters/id'
416 responses: 433 responses:
417 '204': 434 '204':
418 $ref: '#/paths/~1users~1me/put/responses/204' 435 description: successful operation
419 get: 436 get:
420 summary: Get user by its id 437 summary: Get a user
421 security: 438 security:
422 - OAuth2: [] 439 - OAuth2: []
423 tags: 440 tags:
424 - User 441 - Users
425 parameters: 442 parameters:
426 - $ref: '#/components/parameters/id' 443 - $ref: '#/components/parameters/id'
427 responses: 444 responses:
@@ -432,16 +449,16 @@ paths:
432 schema: 449 schema:
433 $ref: '#/components/schemas/User' 450 $ref: '#/components/schemas/User'
434 put: 451 put:
435 summary: Update user profile by its id 452 summary: Update a user
436 security: 453 security:
437 - OAuth2: [] 454 - OAuth2: []
438 tags: 455 tags:
439 - User 456 - Users
440 parameters: 457 parameters:
441 - $ref: '#/components/parameters/id' 458 - $ref: '#/components/parameters/id'
442 responses: 459 responses:
443 '204': 460 '204':
444 $ref: '#/paths/~1users~1me/put/responses/204' 461 description: successful operation
445 requestBody: 462 requestBody:
446 content: 463 content:
447 application/json: 464 application/json:
@@ -452,10 +469,10 @@ paths:
452 post: 469 post:
453 summary: Register a user 470 summary: Register a user
454 tags: 471 tags:
455 - User 472 - Users
456 responses: 473 responses:
457 '204': 474 '204':
458 $ref: '#/paths/~1users~1me/put/responses/204' 475 description: successful operation
459 requestBody: 476 requestBody:
460 content: 477 content:
461 application/json: 478 application/json:
@@ -464,7 +481,7 @@ paths:
464 required: true 481 required: true
465 /users/me: 482 /users/me:
466 get: 483 get:
467 summary: Get current user information 484 summary: Get my user information
468 security: 485 security:
469 - OAuth2: 486 - OAuth2:
470 - user 487 - user
@@ -480,7 +497,7 @@ paths:
480 items: 497 items:
481 $ref: '#/components/schemas/User' 498 $ref: '#/components/schemas/User'
482 put: 499 put:
483 summary: Update current user information 500 summary: Update my user information
484 security: 501 security:
485 - OAuth2: 502 - OAuth2:
486 - user 503 - user
@@ -497,11 +514,12 @@ paths:
497 required: true 514 required: true
498 /users/me/videos/imports: 515 /users/me/videos/imports:
499 get: 516 get:
500 summary: Get video imports of current user 517 summary: Get video imports of my user
501 security: 518 security:
502 - OAuth2: 519 - OAuth2:
503 - user 520 - user
504 tags: 521 tags:
522 - Videos
505 - My User 523 - My User
506 parameters: 524 parameters:
507 - $ref: '#/components/parameters/start' 525 - $ref: '#/components/parameters/start'
@@ -516,7 +534,7 @@ paths:
516 $ref: '#/components/schemas/VideoImport' 534 $ref: '#/components/schemas/VideoImport'
517 /users/me/video-quota-used: 535 /users/me/video-quota-used:
518 get: 536 get:
519 summary: Get current user used quota 537 summary: Get my user used quota
520 security: 538 security:
521 - OAuth2: 539 - OAuth2:
522 - user 540 - user
@@ -531,11 +549,12 @@ paths:
531 type: number 549 type: number
532 '/users/me/videos/{videoId}/rating': 550 '/users/me/videos/{videoId}/rating':
533 get: 551 get:
534 summary: 'Get rating of video by its id, among those of the current user' 552 summary: Get rate of my user for a video
535 security: 553 security:
536 - OAuth2: [] 554 - OAuth2: []
537 tags: 555 tags:
538 - My User 556 - My User
557 - Video Rates
539 parameters: 558 parameters:
540 - name: videoId 559 - name: videoId
541 in: path 560 in: path
@@ -552,12 +571,13 @@ paths:
552 $ref: '#/components/schemas/GetMeVideoRating' 571 $ref: '#/components/schemas/GetMeVideoRating'
553 /users/me/videos: 572 /users/me/videos:
554 get: 573 get:
555 summary: Get videos of the current user 574 summary: Get videos of my user
556 security: 575 security:
557 - OAuth2: 576 - OAuth2:
558 - user 577 - user
559 tags: 578 tags:
560 - My User 579 - My User
580 - Videos
561 parameters: 581 parameters:
562 - $ref: '#/components/parameters/start' 582 - $ref: '#/components/parameters/start'
563 - $ref: '#/components/parameters/count' 583 - $ref: '#/components/parameters/count'
@@ -571,12 +591,12 @@ paths:
571 $ref: '#/components/schemas/VideoListResponse' 591 $ref: '#/components/schemas/VideoListResponse'
572 /users/me/subscriptions: 592 /users/me/subscriptions:
573 get: 593 get:
574 summary: Get subscriptions of the current user 594 summary: Get my user subscriptions
575 security: 595 security:
576 - OAuth2: 596 - OAuth2:
577 - user 597 - user
578 tags: 598 tags:
579 - My User 599 - My Subscriptions
580 parameters: 600 parameters:
581 - $ref: '#/components/parameters/start' 601 - $ref: '#/components/parameters/start'
582 - $ref: '#/components/parameters/count' 602 - $ref: '#/components/parameters/count'
@@ -585,23 +605,23 @@ paths:
585 '200': 605 '200':
586 description: successful operation 606 description: successful operation
587 post: 607 post:
588 summary: Add subscription to the current user 608 summary: Add subscription to my user
589 security: 609 security:
590 - OAuth2: 610 - OAuth2:
591 - user 611 - user
592 tags: 612 tags:
593 - My User 613 - My Subscriptions
594 responses: 614 responses:
595 '200': 615 '200':
596 description: successful operation 616 description: successful operation
597 /users/me/subscriptions/exist: 617 /users/me/subscriptions/exist:
598 get: 618 get:
599 summary: Get if subscriptions exist for the current user 619 summary: Get if subscriptions exist for my user
600 security: 620 security:
601 - OAuth2: 621 - OAuth2:
602 - user 622 - user
603 tags: 623 tags:
604 - My User 624 - My Subscriptions
605 parameters: 625 parameters:
606 - $ref: '#/components/parameters/subscriptionsUris' 626 - $ref: '#/components/parameters/subscriptionsUris'
607 responses: 627 responses:
@@ -613,16 +633,25 @@ paths:
613 type: object 633 type: object
614 /users/me/subscriptions/videos: 634 /users/me/subscriptions/videos:
615 get: 635 get:
616 summary: Get videos of subscriptions of the current user 636 summary: List videos of subscriptions of my user
617 security: 637 security:
618 - OAuth2: 638 - OAuth2:
619 - user 639 - user
620 tags: 640 tags:
621 - My User 641 - My Subscriptions
642 - Videos
622 parameters: 643 parameters:
644 - $ref: '#/components/parameters/categoryOneOf'
645 - $ref: '#/components/parameters/tagsOneOf'
646 - $ref: '#/components/parameters/tagsAllOf'
647 - $ref: '#/components/parameters/licenceOneOf'
648 - $ref: '#/components/parameters/languageOneOf'
649 - $ref: '#/components/parameters/nsfw'
650 - $ref: '#/components/parameters/filter'
651 - $ref: '#/components/parameters/skipCount'
623 - $ref: '#/components/parameters/start' 652 - $ref: '#/components/parameters/start'
624 - $ref: '#/components/parameters/count' 653 - $ref: '#/components/parameters/count'
625 - $ref: '#/components/parameters/sort' 654 - $ref: '#/components/parameters/videosSort'
626 responses: 655 responses:
627 '200': 656 '200':
628 description: successful operation 657 description: successful operation
@@ -632,12 +661,12 @@ paths:
632 $ref: '#/components/schemas/VideoListResponse' 661 $ref: '#/components/schemas/VideoListResponse'
633 '/users/me/subscriptions/{subscriptionHandle}': 662 '/users/me/subscriptions/{subscriptionHandle}':
634 get: 663 get:
635 summary: Get subscription of the current user for a given uri 664 summary: Get subscription of my user
636 security: 665 security:
637 - OAuth2: 666 - OAuth2:
638 - user 667 - user
639 tags: 668 tags:
640 - My User 669 - My Subscriptions
641 parameters: 670 parameters:
642 - $ref: '#/components/parameters/subscriptionHandle' 671 - $ref: '#/components/parameters/subscriptionHandle'
643 responses: 672 responses:
@@ -648,12 +677,12 @@ paths:
648 schema: 677 schema:
649 $ref: '#/components/schemas/VideoChannel' 678 $ref: '#/components/schemas/VideoChannel'
650 delete: 679 delete:
651 summary: Delete subscription of the current user for a given uri 680 summary: Delete subscription of my user
652 security: 681 security:
653 - OAuth2: 682 - OAuth2:
654 - user 683 - user
655 tags: 684 tags:
656 - My User 685 - My Subscriptions
657 parameters: 686 parameters:
658 - $ref: '#/components/parameters/subscriptionHandle' 687 - $ref: '#/components/parameters/subscriptionHandle'
659 responses: 688 responses:
@@ -661,7 +690,7 @@ paths:
661 description: successful operation 690 description: successful operation
662 /users/me/avatar/pick: 691 /users/me/avatar/pick:
663 post: 692 post:
664 summary: Update current user avatar 693 summary: Update my user avatar
665 security: 694 security:
666 - OAuth2: [] 695 - OAuth2: []
667 tags: 696 tags:
@@ -686,9 +715,68 @@ paths:
686 encoding: 715 encoding:
687 avatarfile: 716 avatarfile:
688 contentType: image/png, image/jpeg 717 contentType: image/png, image/jpeg
718 /videos/ownership:
719 get:
720 summary: List video ownership changes
721 tags:
722 - Video Ownership Change
723 security:
724 - OAuth2: []
725 responses:
726 '200':
727 description: successful operation
728 '/videos/ownership/{id}/accept':
729 post:
730 summary: Accept ownership change request
731 tags:
732 - Video Ownership Change
733 security:
734 - OAuth2: []
735 parameters:
736 - $ref: '#/components/parameters/idOrUUID'
737 responses:
738 '204':
739 description: successful operation
740 '/videos/ownership/{id}/refuse':
741 post:
742 summary: Refuse ownership change request
743 tags:
744 - Video Ownership Change
745 security:
746 - OAuth2: []
747 parameters:
748 - $ref: '#/components/parameters/idOrUUID'
749 responses:
750 '204':
751 description: successful operation
752 '/videos/{id}/give-ownership':
753 post:
754 summary: Request ownership change
755 tags:
756 - Video Ownership Change
757 security:
758 - OAuth2: []
759 parameters:
760 - $ref: '#/components/parameters/idOrUUID'
761 requestBody:
762 required: true
763 content:
764 application/x-www-form-urlencoded:
765 schema:
766 type: object
767 properties:
768 username:
769 type: string
770 required:
771 - username
772 responses:
773 '204':
774 description: successful operation
775 '400':
776 description: 'Changing video ownership to a remote account is not supported yet'
689 /videos: 777 /videos:
690 get: 778 get:
691 summary: Get list of videos 779 summary: List videos
692 tags: 780 tags:
693 - Video 781 - Video
694 parameters: 782 parameters:
@@ -699,6 +787,7 @@ paths:
699 - $ref: '#/components/parameters/languageOneOf' 787 - $ref: '#/components/parameters/languageOneOf'
700 - $ref: '#/components/parameters/nsfw' 788 - $ref: '#/components/parameters/nsfw'
701 - $ref: '#/components/parameters/filter' 789 - $ref: '#/components/parameters/filter'
790 - $ref: '#/components/parameters/skipCount'
702 - $ref: '#/components/parameters/start' 791 - $ref: '#/components/parameters/start'
703 - $ref: '#/components/parameters/count' 792 - $ref: '#/components/parameters/count'
704 - $ref: '#/components/parameters/videosSort' 793 - $ref: '#/components/parameters/videosSort'
@@ -711,7 +800,7 @@ paths:
711 $ref: '#/components/schemas/VideoListResponse' 800 $ref: '#/components/schemas/VideoListResponse'
712 /videos/categories: 801 /videos/categories:
713 get: 802 get:
714 summary: Get list of video categories known by the server 803 summary: List available video categories
715 tags: 804 tags:
716 - Video 805 - Video
717 responses: 806 responses:
@@ -725,7 +814,7 @@ paths:
725 type: string 814 type: string
726 /videos/licences: 815 /videos/licences:
727 get: 816 get:
728 summary: Get list of video licences known by the server 817 summary: List available video licences
729 tags: 818 tags:
730 - Video 819 - Video
731 responses: 820 responses:
@@ -739,7 +828,7 @@ paths:
739 type: string 828 type: string
740 /videos/languages: 829 /videos/languages:
741 get: 830 get:
742 summary: Get list of languages known by the server 831 summary: List available video languages
743 tags: 832 tags:
744 - Video 833 - Video
745 responses: 834 responses:
@@ -753,7 +842,7 @@ paths:
753 type: string 842 type: string
754 /videos/privacies: 843 /videos/privacies:
755 get: 844 get:
756 summary: Get list of privacy policies supported by the server 845 summary: List available video privacies
757 tags: 846 tags:
758 - Video 847 - Video
759 responses: 848 responses:
@@ -767,7 +856,7 @@ paths:
767 type: string 856 type: string
768 '/videos/{id}': 857 '/videos/{id}':
769 put: 858 put:
770 summary: Update metadata for a video by its id 859 summary: Update a video
771 security: 860 security:
772 - OAuth2: [] 861 - OAuth2: []
773 tags: 862 tags:
@@ -800,6 +889,8 @@ paths:
800 language: 889 language:
801 description: Video language 890 description: Video language
802 type: string 891 type: string
892 privacy:
893 $ref: '#/components/schemas/VideoPrivacySet'
803 description: 894 description:
804 description: Video description 895 description: Video description
805 type: string 896 type: string
@@ -839,7 +930,7 @@ paths:
839 previewfile: 930 previewfile:
840 contentType: image/jpeg 931 contentType: image/jpeg
841 get: 932 get:
842 summary: Get a video by its id 933 summary: Get a video
843 tags: 934 tags:
844 - Video 935 - Video
845 parameters: 936 parameters:
@@ -852,7 +943,7 @@ paths:
852 schema: 943 schema:
853 $ref: '#/components/schemas/VideoDetails' 944 $ref: '#/components/schemas/VideoDetails'
854 delete: 945 delete:
855 summary: Delete a video by its id 946 summary: Delete a video
856 security: 947 security:
857 - OAuth2: [] 948 - OAuth2: []
858 tags: 949 tags:
@@ -861,10 +952,10 @@ paths:
861 - $ref: '#/components/parameters/idOrUUID' 952 - $ref: '#/components/parameters/idOrUUID'
862 responses: 953 responses:
863 '204': 954 '204':
864 $ref: '#/paths/~1users~1me/put/responses/204' 955 description: successful operation
865 '/videos/{id}/description': 956 '/videos/{id}/description':
866 get: 957 get:
867 summary: Get a video description by its id 958 summary: Get complete video description
868 tags: 959 tags:
869 - Video 960 - Video
870 parameters: 961 parameters:
@@ -878,17 +969,17 @@ paths:
878 type: string 969 type: string
879 '/videos/{id}/views': 970 '/videos/{id}/views':
880 post: 971 post:
881 summary: Add a view to the video by its id 972 summary: Add a view to a video
882 tags: 973 tags:
883 - Video 974 - Video
884 parameters: 975 parameters:
885 - $ref: '#/components/parameters/idOrUUID' 976 - $ref: '#/components/parameters/idOrUUID'
886 responses: 977 responses:
887 '204': 978 '204':
888 $ref: '#/paths/~1users~1me/put/responses/204' 979 description: successful operation
889 '/videos/{id}/watching': 980 '/videos/{id}/watching':
890 put: 981 put:
891 summary: Set watching progress of a video by its id for a user 982 summary: Set watching progress of a video
892 tags: 983 tags:
893 - Video 984 - Video
894 security: 985 security:
@@ -903,69 +994,10 @@ paths:
903 required: true 994 required: true
904 responses: 995 responses:
905 '204': 996 '204':
906 $ref: '#/paths/~1users~1me/put/responses/204'
907 /videos/ownership:
908 get:
909 summary: Get list of video ownership changes requests
910 tags:
911 - Video
912 security:
913 - OAuth2: []
914 responses:
915 '200':
916 description: successful operation 997 description: successful operation
917 '/videos/ownership/{id}/accept':
918 post:
919 summary: Refuse ownership change request for video by its id
920 tags:
921 - Video
922 security:
923 - OAuth2: []
924 parameters:
925 - $ref: '#/components/parameters/idOrUUID'
926 responses:
927 '204':
928 $ref: '#/paths/~1users~1me/put/responses/204'
929 '/videos/ownership/{id}/refuse':
930 post:
931 summary: Accept ownership change request for video by its id
932 tags:
933 - Video
934 security:
935 - OAuth2: []
936 parameters:
937 - $ref: '#/components/parameters/idOrUUID'
938 responses:
939 '204':
940 $ref: '#/paths/~1users~1me/put/responses/204'
941 '/videos/{id}/give-ownership':
942 post:
943 summary: Request change of ownership for a video you own, by its id
944 tags:
945 - Video
946 security:
947 - OAuth2: []
948 parameters:
949 - $ref: '#/components/parameters/idOrUUID'
950 requestBody:
951 required: true
952 content:
953 application/x-www-form-urlencoded:
954 schema:
955 type: object
956 properties:
957 username:
958 type: string
959 required:
960 - username
961 responses:
962 '204':
963 $ref: '#/paths/~1users~1me/put/responses/204'
964 '400':
965 description: 'Changing video ownership to a remote account is not supported yet'
966 /videos/upload: 998 /videos/upload:
967 post: 999 post:
968 summary: Upload a video file with its metadata 1000 summary: Upload a video
969 security: 1001 security:
970 - OAuth2: [] 1002 - OAuth2: []
971 tags: 1003 tags:
@@ -977,6 +1009,12 @@ paths:
977 application/json: 1009 application/json:
978 schema: 1010 schema:
979 $ref: '#/components/schemas/VideoUploadResponse' 1011 $ref: '#/components/schemas/VideoUploadResponse'
1012 '403':
1013 description: 'The user video quota is exceeded with this video.'
1014 '408':
1015 description: 'Upload has timed out'
1016 '422':
1017 description: 'Invalid input file.'
980 requestBody: 1018 requestBody:
981 content: 1019 content:
982 multipart/form-data: 1020 multipart/form-data:
@@ -1081,7 +1119,8 @@ paths:
1081 "Authorization:Bearer $token" 1119 "Authorization:Bearer $token"
1082 /videos/imports: 1120 /videos/imports:
1083 post: 1121 post:
1084 summary: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator) 1122 summary: Import a video
1123 description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
1085 security: 1124 security:
1086 - OAuth2: [] 1125 - OAuth2: []
1087 tags: 1126 tags:
@@ -1172,11 +1211,13 @@ paths:
1172 contentType: image/jpeg 1211 contentType: image/jpeg
1173 /videos/abuse: 1212 /videos/abuse:
1174 get: 1213 get:
1175 summary: Get list of reported video abuses 1214 summary: List video abuses
1176 security: 1215 security:
1177 - OAuth2: [] 1216 - OAuth2:
1217 - admin
1218 - moderator
1178 tags: 1219 tags:
1179 - Video Abuse 1220 - Video Abuses
1180 parameters: 1221 parameters:
1181 - $ref: '#/components/parameters/start' 1222 - $ref: '#/components/parameters/start'
1182 - $ref: '#/components/parameters/count' 1223 - $ref: '#/components/parameters/count'
@@ -1192,19 +1233,70 @@ paths:
1192 $ref: '#/components/schemas/VideoAbuse' 1233 $ref: '#/components/schemas/VideoAbuse'
1193 '/videos/{id}/abuse': 1234 '/videos/{id}/abuse':
1194 post: 1235 post:
1195 summary: 'Report an abuse, on a video by its id' 1236 summary: Report an abuse
1196 security: 1237 security:
1197 - OAuth2: [] 1238 - OAuth2: []
1198 tags: 1239 tags:
1199 - Video Abuse 1240 - Video Abuses
1241 - Videos
1242 parameters:
1243 - $ref: '#/components/parameters/idOrUUID'
1244 requestBody:
1245 content:
1246 application/json:
1247 schema:
1248 type: object
1249 properties:
1250 reason:
1251 description: Reason why the user reports this video
1252 type: string
1253 responses:
1254 '204':
1255 description: successful operation
1256 '/videos/{id}/abuse/{abuseId}':
1257 put:
1258 summary: Update an abuse
1259 security:
1260 - OAuth2:
1261 - admin
1262 - moderator
1263 tags:
1264 - Video Abuses
1265 responses:
1266 '204':
1267 description: successful operation
1200 parameters: 1268 parameters:
1201 - $ref: '#/components/parameters/idOrUUID' 1269 - $ref: '#/components/parameters/idOrUUID'
1270 - $ref: '#/components/parameters/abuseId'
1271 requestBody:
1272 content:
1273 application/json:
1274 schema:
1275 type: object
1276 properties:
1277 state:
1278 $ref: '#/components/schemas/VideoAbuseStateSet'
1279 moderationComment:
1280 type: string
1281 description: 'Update the comment of the video abuse for other admin/moderators'
1282 delete:
1283 summary: Delete an abuse
1284 security:
1285 - OAuth2:
1286 - admin
1287 - moderator
1288 tags:
1289 - Video Abuses
1202 responses: 1290 responses:
1203 '204': 1291 '204':
1204 $ref: '#/paths/~1users~1me/put/responses/204' 1292 description: successful operation
1293 parameters:
1294 - $ref: '#/components/parameters/idOrUUID'
1295 - $ref: '#/components/parameters/abuseId'
1296
1205 '/videos/{id}/blacklist': 1297 '/videos/{id}/blacklist':
1206 post: 1298 post:
1207 summary: Put on blacklist a video by its id 1299 summary: Blacklist a video
1208 security: 1300 security:
1209 - OAuth2: 1301 - OAuth2:
1210 - admin 1302 - admin
@@ -1215,7 +1307,7 @@ paths:
1215 - $ref: '#/components/parameters/idOrUUID' 1307 - $ref: '#/components/parameters/idOrUUID'
1216 responses: 1308 responses:
1217 '204': 1309 '204':
1218 $ref: '#/paths/~1users~1me/put/responses/204' 1310 description: successful operation
1219 delete: 1311 delete:
1220 summary: Delete an entry of the blacklist of a video by its id 1312 summary: Delete an entry of the blacklist of a video by its id
1221 security: 1313 security:
@@ -1228,10 +1320,10 @@ paths:
1228 - $ref: '#/components/parameters/idOrUUID' 1320 - $ref: '#/components/parameters/idOrUUID'
1229 responses: 1321 responses:
1230 '204': 1322 '204':
1231 $ref: '#/paths/~1users~1me/put/responses/204' 1323 description: successful operation
1232 /videos/blacklist: 1324 /videos/blacklist:
1233 get: 1325 get:
1234 summary: Get list of videos on blacklist 1326 summary: List blacklisted videos
1235 security: 1327 security:
1236 - OAuth2: 1328 - OAuth2:
1237 - admin 1329 - admin
@@ -1253,7 +1345,7 @@ paths:
1253 $ref: '#/components/schemas/VideoBlacklist' 1345 $ref: '#/components/schemas/VideoBlacklist'
1254 /videos/{id}/captions: 1346 /videos/{id}/captions:
1255 get: 1347 get:
1256 summary: Get list of video's captions 1348 summary: List captions of a video
1257 tags: 1349 tags:
1258 - Video Caption 1350 - Video Caption
1259 parameters: 1351 parameters:
@@ -1295,7 +1387,7 @@ paths:
1295 contentType: text/vtt, application/x-subrip, text/plain 1387 contentType: text/vtt, application/x-subrip, text/plain
1296 responses: 1388 responses:
1297 '204': 1389 '204':
1298 $ref: '#/paths/~1users~1me/put/responses/204' 1390 description: successful operation
1299 delete: 1391 delete:
1300 summary: Delete a video caption 1392 summary: Delete a video caption
1301 tags: 1393 tags:
@@ -1305,12 +1397,12 @@ paths:
1305 - $ref: '#/components/parameters/captionLanguage' 1397 - $ref: '#/components/parameters/captionLanguage'
1306 responses: 1398 responses:
1307 '204': 1399 '204':
1308 $ref: '#/paths/~1users~1me/put/responses/204' 1400 description: successful operation
1309 /video-channels: 1401 /video-channels:
1310 get: 1402 get:
1311 summary: Get list of video channels 1403 summary: List video channels
1312 tags: 1404 tags:
1313 - Video Channel 1405 - Video Channels
1314 parameters: 1406 parameters:
1315 - $ref: '#/components/parameters/start' 1407 - $ref: '#/components/parameters/start'
1316 - $ref: '#/components/parameters/count' 1408 - $ref: '#/components/parameters/count'
@@ -1325,14 +1417,14 @@ paths:
1325 items: 1417 items:
1326 $ref: '#/components/schemas/VideoChannel' 1418 $ref: '#/components/schemas/VideoChannel'
1327 post: 1419 post:
1328 summary: Creates a video channel for the current user 1420 summary: Create a video channel
1329 security: 1421 security:
1330 - OAuth2: [] 1422 - OAuth2: []
1331 tags: 1423 tags:
1332 - Video Channel 1424 - Video Channels
1333 responses: 1425 responses:
1334 '204': 1426 '204':
1335 $ref: '#/paths/~1users~1me/put/responses/204' 1427 description: successful operation
1336 requestBody: 1428 requestBody:
1337 content: 1429 content:
1338 application/json: 1430 application/json:
@@ -1340,9 +1432,9 @@ paths:
1340 $ref: '#/components/schemas/VideoChannelCreate' 1432 $ref: '#/components/schemas/VideoChannelCreate'
1341 '/video-channels/{channelHandle}': 1433 '/video-channels/{channelHandle}':
1342 get: 1434 get:
1343 summary: Get a video channel by its id 1435 summary: Get a video channel
1344 tags: 1436 tags:
1345 - Video Channel 1437 - Video Channels
1346 parameters: 1438 parameters:
1347 - $ref: '#/components/parameters/channelHandle' 1439 - $ref: '#/components/parameters/channelHandle'
1348 responses: 1440 responses:
@@ -1353,40 +1445,51 @@ paths:
1353 schema: 1445 schema:
1354 $ref: '#/components/schemas/VideoChannel' 1446 $ref: '#/components/schemas/VideoChannel'
1355 put: 1447 put:
1356 summary: Update a video channel by its id 1448 summary: Update a video channel
1357 security: 1449 security:
1358 - OAuth2: [] 1450 - OAuth2: []
1359 tags: 1451 tags:
1360 - Video Channel 1452 - Video Channels
1361 parameters: 1453 parameters:
1362 - $ref: '#/components/parameters/channelHandle' 1454 - $ref: '#/components/parameters/channelHandle'
1363 responses: 1455 responses:
1364 '204': 1456 '204':
1365 $ref: '#/paths/~1users~1me/put/responses/204' 1457 description: successful operation
1366 requestBody: 1458 requestBody:
1367 content: 1459 content:
1368 application/json: 1460 application/json:
1369 schema: 1461 schema:
1370 $ref: '#/components/schemas/VideoChannelUpdate' 1462 $ref: '#/components/schemas/VideoChannelUpdate'
1371 delete: 1463 delete:
1372 summary: Delete a video channel by its id 1464 summary: Delete a video channel
1373 security: 1465 security:
1374 - OAuth2: [] 1466 - OAuth2: []
1375 tags: 1467 tags:
1376 - Video Channel 1468 - Video Channels
1377 parameters: 1469 parameters:
1378 - $ref: '#/components/parameters/channelHandle' 1470 - $ref: '#/components/parameters/channelHandle'
1379 responses: 1471 responses:
1380 '204': 1472 '204':
1381 $ref: '#/paths/~1users~1me/put/responses/204' 1473 description: successful operation
1382 '/video-channels/{channelHandle}/videos': 1474 '/video-channels/{channelHandle}/videos':
1383 get: 1475 get:
1384 summary: Get videos of a video channel by its id 1476 summary: List videos of a video channel
1385 tags: 1477 tags:
1386 - Video 1478 - Video
1387 - Video Channel 1479 - Video Channels
1388 parameters: 1480 parameters:
1389 - $ref: '#/components/parameters/channelHandle' 1481 - $ref: '#/components/parameters/channelHandle'
1482 - $ref: '#/components/parameters/categoryOneOf'
1483 - $ref: '#/components/parameters/tagsOneOf'
1484 - $ref: '#/components/parameters/tagsAllOf'
1485 - $ref: '#/components/parameters/licenceOneOf'
1486 - $ref: '#/components/parameters/languageOneOf'
1487 - $ref: '#/components/parameters/nsfw'
1488 - $ref: '#/components/parameters/filter'
1489 - $ref: '#/components/parameters/skipCount'
1490 - $ref: '#/components/parameters/start'
1491 - $ref: '#/components/parameters/count'
1492 - $ref: '#/components/parameters/videosSort'
1390 responses: 1493 responses:
1391 '200': 1494 '200':
1392 description: successful operation 1495 description: successful operation
@@ -1394,11 +1497,27 @@ paths:
1394 application/json: 1497 application/json:
1395 schema: 1498 schema:
1396 $ref: '#/components/schemas/VideoListResponse' 1499 $ref: '#/components/schemas/VideoListResponse'
1500
1501 /video-playlists/privacies:
1502 get:
1503 summary: List available playlist privacies
1504 tags:
1505 - Video Playlists
1506 responses:
1507 '200':
1508 description: successful operation
1509 content:
1510 application/json:
1511 schema:
1512 type: array
1513 items:
1514 type: string
1515
1397 /video-playlists: 1516 /video-playlists:
1398 get: 1517 get:
1399 summary: Get list of video playlists 1518 summary: List video playlists
1400 tags: 1519 tags:
1401 - Video Playlist 1520 - Video Playlists
1402 parameters: 1521 parameters:
1403 - $ref: '#/components/parameters/start' 1522 - $ref: '#/components/parameters/start'
1404 - $ref: '#/components/parameters/count' 1523 - $ref: '#/components/parameters/count'
@@ -1412,11 +1531,279 @@ paths:
1412 type: array 1531 type: array
1413 items: 1532 items:
1414 $ref: '#/components/schemas/VideoPlaylist' 1533 $ref: '#/components/schemas/VideoPlaylist'
1534 post:
1535 summary: Create a video playlist
1536 description: 'If the video playlist is set as public, the videoChannelId is mandatory.'
1537 security:
1538 - OAuth2: []
1539 tags:
1540 - Video Playlists
1541 responses:
1542 '200':
1543 description: successful operation
1544 content:
1545 application/json:
1546 schema:
1547 type: object
1548 properties:
1549 videoPlaylist:
1550 type: object
1551 properties:
1552 id:
1553 type: number
1554 uuid:
1555 type: string
1556 requestBody:
1557 content:
1558 multipart/form-data:
1559 schema:
1560 type: object
1561 properties:
1562 displayName:
1563 description: Video playlist display name
1564 type: string
1565 thumbnailfile:
1566 description: Video playlist thumbnail file
1567 type: string
1568 format: binary
1569 privacy:
1570 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
1571 description:
1572 description: Video playlist description
1573 type: string
1574 videoChannelId:
1575 description: Video channel in which the playlist will be published
1576 type: number
1577 required:
1578 - displayName
1579
1580 /video-playlists/{id}:
1581 get:
1582 summary: Get a video playlist
1583 tags:
1584 - Video Playlists
1585 parameters:
1586 - $ref: '#/components/parameters/idOrUUID'
1587 responses:
1588 '200':
1589 description: successful operation
1590 content:
1591 application/json:
1592 schema:
1593 $ref: '#/components/schemas/VideoPlaylist'
1594 put:
1595 summary: Update a video playlist
1596 description: 'If the video playlist is set as public, the playlist must have a assigned channel.'
1597 security:
1598 - OAuth2: []
1599 tags:
1600 - Video Playlists
1601 responses:
1602 '204':
1603 description: successful operation
1604 parameters:
1605 - $ref: '#/components/parameters/idOrUUID'
1606 requestBody:
1607 content:
1608 multipart/form-data:
1609 schema:
1610 type: object
1611 properties:
1612 displayName:
1613 description: Video playlist display name
1614 type: string
1615 thumbnailfile:
1616 description: Video playlist thumbnail file
1617 type: string
1618 format: binary
1619 privacy:
1620 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
1621 description:
1622 description: Video playlist description
1623 type: string
1624 videoChannelId:
1625 description: Video channel in which the playlist will be published
1626 type: number
1627 delete:
1628 summary: Delete a video playlist
1629 security:
1630 - OAuth2: []
1631 tags:
1632 - Video Playlists
1633 parameters:
1634 - $ref: '#/components/parameters/idOrUUID'
1635 responses:
1636 '204':
1637 description: successful operation
1638
1639 /video-playlists/{id}/videos:
1640 get:
1641 summary: 'List videos of a playlist'
1642 tags:
1643 - Videos
1644 - Video Playlists
1645 parameters:
1646 - $ref: '#/components/parameters/idOrUUID'
1647 responses:
1648 '200':
1649 description: successful operation
1650 content:
1651 application/json:
1652 schema:
1653 $ref: '#/components/schemas/VideoListResponse'
1654 post:
1655 summary: 'Add a video in a playlist'
1656 security:
1657 - OAuth2: []
1658 tags:
1659 - Videos
1660 - Video Playlists
1661 parameters:
1662 - $ref: '#/components/parameters/idOrUUID'
1663 responses:
1664 '200':
1665 description: successful operation
1666 content:
1667 application/json:
1668 schema:
1669 type: object
1670 properties:
1671 videoPlaylistElement:
1672 type: object
1673 properties:
1674 id:
1675 type: number
1676 requestBody:
1677 content:
1678 application/json:
1679 schema:
1680 type: object
1681 properties:
1682 videoId:
1683 type: number
1684 description: 'Video to add in the playlist'
1685 startTimestamp:
1686 type: number
1687 description: 'Start the video at this specific timestamp (in seconds)'
1688 stopTimestamp:
1689 type: number
1690 description: 'Stop the video at this specific timestamp (in seconds)'
1691 required:
1692 - videoId
1693
1694 /video-playlists/{id}/videos/reorder:
1695 post:
1696 summary: 'Reorder a playlist'
1697 security:
1698 - OAuth2: []
1699 tags:
1700 - Video Playlists
1701 parameters:
1702 - $ref: '#/components/parameters/idOrUUID'
1703 responses:
1704 '204':
1705 description: successful operation
1706 requestBody:
1707 content:
1708 application/json:
1709 schema:
1710 type: object
1711 properties:
1712 startPosition:
1713 type: number
1714 description: 'Start position of the element to reorder (starts from 1)'
1715 insertAfterPosition:
1716 type: number
1717 description: 'New position for the block to reorder (starts from 0, to add the block before the first element)'
1718 reorderLength:
1719 type: number
1720 description: 'How many element from startPosition to reorder (minimum length is 1)'
1721 required:
1722 - startPosition
1723 - insertAfterPosition
1724
1725 /video-playlists/{id}/videos/{playlistElementId}:
1726 put:
1727 summary: 'Update a playlist element'
1728 security:
1729 - OAuth2: []
1730 tags:
1731 - Video Playlists
1732 parameters:
1733 - $ref: '#/components/parameters/idOrUUID'
1734 - $ref: '#/components/parameters/playlistElementId'
1735 responses:
1736 '204':
1737 description: successful operation
1738 requestBody:
1739 content:
1740 application/json:
1741 schema:
1742 type: object
1743 properties:
1744 startTimestamp:
1745 type: number
1746 description: 'Start the video at this specific timestamp (in seconds)'
1747 stopTimestamp:
1748 type: number
1749 description: 'Stop the video at this specific timestamp (in seconds)'
1750 delete:
1751 summary: 'Delete an element from a playlist'
1752 security:
1753 - OAuth2: []
1754 tags:
1755 - Video Playlists
1756 parameters:
1757 - $ref: '#/components/parameters/idOrUUID'
1758 - $ref: '#/components/parameters/playlistElementId'
1759 responses:
1760 '204':
1761 description: successful operation
1762
1763 '/users/me/video-playlists/videos-exist':
1764 get:
1765 summary: 'Check video exists in my playlists'
1766 security:
1767 - OAuth2: []
1768 tags:
1769 - Video Playlists
1770 parameters:
1771 - name: videoIds
1772 in: query
1773 required: true
1774 description: The video ids to check
1775 schema:
1776 type: array
1777 items:
1778 type: number
1779 responses:
1780 '200':
1781 description: successful operation
1782 content:
1783 application/json:
1784 schema:
1785 type: object
1786 properties:
1787 videoId:
1788 type: array
1789 items:
1790 type: object
1791 properties:
1792 playlistElementId:
1793 type: number
1794 playlistId:
1795 type: number
1796 startTimestamp:
1797 type: number
1798 stopTimestamp:
1799 type: number
1800
1415 '/accounts/{name}/video-channels': 1801 '/accounts/{name}/video-channels':
1416 get: 1802 get:
1417 summary: Get video channels of an account by its name 1803 summary: List video channels of an account
1418 tags: 1804 tags:
1419 - Video Channel 1805 - Video Channels
1806 - Accounts
1420 parameters: 1807 parameters:
1421 - $ref: '#/components/parameters/name' 1808 - $ref: '#/components/parameters/name'
1422 responses: 1809 responses:
@@ -1430,11 +1817,11 @@ paths:
1430 $ref: '#/components/schemas/VideoChannel' 1817 $ref: '#/components/schemas/VideoChannel'
1431 '/accounts/{name}/ratings': 1818 '/accounts/{name}/ratings':
1432 get: 1819 get:
1433 summary: Get ratings of an account by its name 1820 summary: List ratings of an account
1434 security: 1821 security:
1435 - OAuth2: [] 1822 - OAuth2: []
1436 tags: 1823 tags:
1437 - User 1824 - Accounts
1438 parameters: 1825 parameters:
1439 - $ref: '#/components/parameters/name' 1826 - $ref: '#/components/parameters/name'
1440 - $ref: '#/components/parameters/start' 1827 - $ref: '#/components/parameters/start'
@@ -1460,9 +1847,9 @@ paths:
1460 $ref: '#/components/schemas/VideoRating' 1847 $ref: '#/components/schemas/VideoRating'
1461 '/videos/{id}/comment-threads': 1848 '/videos/{id}/comment-threads':
1462 get: 1849 get:
1463 summary: Get the comment threads of a video by its id 1850 summary: List threads of a video
1464 tags: 1851 tags:
1465 - Video Comment 1852 - Video Comments
1466 parameters: 1853 parameters:
1467 - $ref: '#/components/parameters/idOrUUID' 1854 - $ref: '#/components/parameters/idOrUUID'
1468 - $ref: '#/components/parameters/start' 1855 - $ref: '#/components/parameters/start'
@@ -1476,11 +1863,11 @@ paths:
1476 schema: 1863 schema:
1477 $ref: '#/components/schemas/CommentThreadResponse' 1864 $ref: '#/components/schemas/CommentThreadResponse'
1478 post: 1865 post:
1479 summary: 'Creates a comment thread, on a video by its id' 1866 summary: Create a thread
1480 security: 1867 security:
1481 - OAuth2: [] 1868 - OAuth2: []
1482 tags: 1869 tags:
1483 - Video Comment 1870 - Video Comments
1484 parameters: 1871 parameters:
1485 - $ref: '#/components/parameters/idOrUUID' 1872 - $ref: '#/components/parameters/idOrUUID'
1486 responses: 1873 responses:
@@ -1490,11 +1877,23 @@ paths:
1490 application/json: 1877 application/json:
1491 schema: 1878 schema:
1492 $ref: '#/components/schemas/CommentThreadPostResponse' 1879 $ref: '#/components/schemas/CommentThreadPostResponse'
1880 requestBody:
1881 content:
1882 application/json:
1883 schema:
1884 type: object
1885 properties:
1886 text:
1887 type: string
1888 description: 'Text comment'
1889 required:
1890 - text
1891
1493 '/videos/{id}/comment-threads/{threadId}': 1892 '/videos/{id}/comment-threads/{threadId}':
1494 get: 1893 get:
1495 summary: 'Get the comment thread by its id, of a video by its id' 1894 summary: Get a thread
1496 tags: 1895 tags:
1497 - Video Comment 1896 - Video Comments
1498 parameters: 1897 parameters:
1499 - $ref: '#/components/parameters/idOrUUID' 1898 - $ref: '#/components/parameters/idOrUUID'
1500 - $ref: '#/components/parameters/threadId' 1899 - $ref: '#/components/parameters/threadId'
@@ -1507,11 +1906,11 @@ paths:
1507 $ref: '#/components/schemas/VideoCommentThreadTree' 1906 $ref: '#/components/schemas/VideoCommentThreadTree'
1508 '/videos/{id}/comments/{commentId}': 1907 '/videos/{id}/comments/{commentId}':
1509 post: 1908 post:
1510 summary: 'Creates a comment in a comment thread by its id, of a video by its id' 1909 summary: Reply to a thread of a video
1511 security: 1910 security:
1512 - OAuth2: [] 1911 - OAuth2: []
1513 tags: 1912 tags:
1514 - Video Comment 1913 - Video Comments
1515 parameters: 1914 parameters:
1516 - $ref: '#/components/parameters/idOrUUID' 1915 - $ref: '#/components/parameters/idOrUUID'
1517 - $ref: '#/components/parameters/commentId' 1916 - $ref: '#/components/parameters/commentId'
@@ -1522,36 +1921,56 @@ paths:
1522 application/json: 1921 application/json:
1523 schema: 1922 schema:
1524 $ref: '#/components/schemas/CommentThreadPostResponse' 1923 $ref: '#/components/schemas/CommentThreadPostResponse'
1924 requestBody:
1925 content:
1926 application/json:
1927 schema:
1928 type: object
1929 properties:
1930 text:
1931 type: string
1932 description: 'Text comment'
1933 required:
1934 - text
1935
1525 delete: 1936 delete:
1526 summary: 'Delete a comment in a comment thread by its id, of a video by its id' 1937 summary: Delete a comment or a reply
1527 security: 1938 security:
1528 - OAuth2: [] 1939 - OAuth2: []
1529 tags: 1940 tags:
1530 - Video Comment 1941 - Video Comments
1531 parameters: 1942 parameters:
1532 - $ref: '#/components/parameters/idOrUUID' 1943 - $ref: '#/components/parameters/idOrUUID'
1533 - $ref: '#/components/parameters/commentId' 1944 - $ref: '#/components/parameters/commentId'
1534 responses: 1945 responses:
1535 '204': 1946 '204':
1536 $ref: '#/paths/~1users~1me/put/responses/204' 1947 description: successful operation
1537 '/videos/{id}/rate': 1948 '/videos/{id}/rate':
1538 put: 1949 put:
1539 summary: Vote for a video by its id 1950 summary: Like/dislike a video
1540 security: 1951 security:
1541 - OAuth2: [] 1952 - OAuth2: []
1542 tags: 1953 tags:
1543 - Video Rate 1954 - Video Rates
1544 parameters: 1955 parameters:
1545 - $ref: '#/components/parameters/idOrUUID' 1956 - $ref: '#/components/parameters/idOrUUID'
1546 responses: 1957 responses:
1547 '204': 1958 '204':
1548 $ref: '#/paths/~1users~1me/put/responses/204' 1959 description: successful operation
1549 /search/videos: 1960 /search/videos:
1550 get: 1961 get:
1551 tags: 1962 tags:
1552 - Search 1963 - Search
1553 summary: Get the videos corresponding to a given query 1964 summary: Search videos
1554 parameters: 1965 parameters:
1966 - $ref: '#/components/parameters/categoryOneOf'
1967 - $ref: '#/components/parameters/tagsOneOf'
1968 - $ref: '#/components/parameters/tagsAllOf'
1969 - $ref: '#/components/parameters/licenceOneOf'
1970 - $ref: '#/components/parameters/languageOneOf'
1971 - $ref: '#/components/parameters/nsfw'
1972 - $ref: '#/components/parameters/filter'
1973 - $ref: '#/components/parameters/skipCount'
1555 - $ref: '#/components/parameters/start' 1974 - $ref: '#/components/parameters/start'
1556 - $ref: '#/components/parameters/count' 1975 - $ref: '#/components/parameters/count'
1557 - $ref: '#/components/parameters/videosSearchSort' 1976 - $ref: '#/components/parameters/videosSearchSort'
@@ -1572,9 +1991,9 @@ servers:
1572 - url: 'https://peertube.cpy.re/api/v1' 1991 - url: 'https://peertube.cpy.re/api/v1'
1573 description: Live Test Server (live data - stable version) 1992 description: Live Test Server (live data - stable version)
1574 - url: 'https://peertube2.cpy.re/api/v1' 1993 - url: 'https://peertube2.cpy.re/api/v1'
1575 description: Live Test Server (live data - bleeding edge version) 1994 description: Live Test Server (live data - latest nighlty version)
1576 - url: 'https://peertube3.cpy.re/api/v1' 1995 - url: 'https://peertube3.cpy.re/api/v1'
1577 description: Live Test Server (live data - bleeding edge version) 1996 description: Live Test Server (live data - latest RC version)
1578components: 1997components:
1579 parameters: 1998 parameters:
1580 start: 1999 start:
@@ -1696,9 +2115,23 @@ components:
1696 name: id 2115 name: id
1697 in: path 2116 in: path
1698 required: true 2117 required: true
1699 description: The video id or uuid 2118 description: The object id or uuid
1700 schema: 2119 schema:
1701 type: string 2120 type: string
2121 playlistElementId:
2122 name: playlistElementId
2123 in: path
2124 required: true
2125 description: Playlist element id
2126 schema:
2127 type: number
2128 abuseId:
2129 name: abuseId
2130 in: path
2131 required: true
2132 description: Video abuse id
2133 schema:
2134 type: number
1702 captionLanguage: 2135 captionLanguage:
1703 name: captionLanguage 2136 name: captionLanguage
1704 in: path 2137 in: path
@@ -1738,7 +2171,7 @@ components:
1738 name: categoryOneOf 2171 name: categoryOneOf
1739 in: query 2172 in: query
1740 required: false 2173 required: false
1741 description: category id of the video 2174 description: category id of the video (see /videos/categories)
1742 schema: 2175 schema:
1743 oneOf: 2176 oneOf:
1744 - type: number 2177 - type: number
@@ -1777,7 +2210,7 @@ components:
1777 name: languageOneOf 2210 name: languageOneOf
1778 in: query 2211 in: query
1779 required: false 2212 required: false
1780 description: language id of the video 2213 description: language id of the video (see /videos/languages). Use _unknown to filter on videos that don't have a video language
1781 schema: 2214 schema:
1782 oneOf: 2215 oneOf:
1783 - type: string 2216 - type: string
@@ -1790,7 +2223,7 @@ components:
1790 name: licenceOneOf 2223 name: licenceOneOf
1791 in: query 2224 in: query
1792 required: false 2225 required: false
1793 description: licence id of the video 2226 description: licence id of the video (see /videos/licences)
1794 schema: 2227 schema:
1795 oneOf: 2228 oneOf:
1796 - type: number 2229 - type: number
@@ -1799,6 +2232,16 @@ components:
1799 type: number 2232 type: number
1800 style: form 2233 style: form
1801 explode: false 2234 explode: false
2235 skipCount:
2236 name: skipCount
2237 in: query
2238 required: false
2239 description: if you don't need the `total` in the response
2240 schema:
2241 type: string
2242 enum:
2243 - 'true'
2244 - 'false'
1802 nsfw: 2245 nsfw:
1803 name: nsfw 2246 name: nsfw
1804 in: query 2247 in: query
@@ -1867,23 +2310,64 @@ components:
1867 type: string 2310 type: string
1868 label: 2311 label:
1869 type: string 2312 type: string
2313
2314 VideoPlaylistPrivacySet:
2315 type: integer
2316 enum:
2317 - 1
2318 - 2
2319 - 3
2320 description: 'The video playlist privacy (Public = 1, Unlisted = 2, Private = 3)'
2321 VideoPlaylistPrivacyConstant:
2322 properties:
2323 id:
2324 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
2325 label:
2326 type: string
2327
2328 VideoPlaylistTypeSet:
2329 type: integer
2330 enum:
2331 - 1
2332 - 2
2333 description: 'The video playlist type (Regular = 1, Watch Later = 2)'
2334 VideoPlaylistTypeConstant:
2335 properties:
2336 id:
2337 $ref: '#/components/schemas/VideoPlaylistTypeSet'
2338 label:
2339 type: string
2340
1870 VideoPrivacySet: 2341 VideoPrivacySet:
1871 type: integer 2342 type: integer
1872 enum: 2343 enum:
1873 - 1 2344 - 1
1874 - 2 2345 - 2
1875 - 3 2346 - 3
1876 description: 'The video privacy (Public = 1, Unlisted = 2, Private = 3)' 2347 - 4
2348 description: 'The video privacy (Public = 1, Unlisted = 2, Private = 3, Internal = 4)'
1877 VideoPrivacyConstant: 2349 VideoPrivacyConstant:
1878 properties: 2350 properties:
1879 id: 2351 id:
1880 type: integer 2352 $ref: '#/components/schemas/VideoPrivacySet'
1881 enum:
1882 - 1
1883 - 2
1884 - 3
1885 label: 2353 label:
1886 type: string 2354 type: string
2355
2356 NSFWPolicy:
2357 type: string
2358 enum:
2359 - display
2360 - blur
2361 - do_not_list
2362
2363 UserRole:
2364 type: number
2365 enum:
2366 - 0
2367 - 1
2368 - 2
2369 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2370
1887 VideoStateConstant: 2371 VideoStateConstant:
1888 properties: 2372 properties:
1889 id: 2373 id:
@@ -1895,6 +2379,21 @@ components:
1895 description: 'The video state (Published = 1, to transcode = 2, to import = 3)' 2379 description: 'The video state (Published = 1, to transcode = 2, to import = 3)'
1896 label: 2380 label:
1897 type: string 2381 type: string
2382
2383 VideoAbuseStateSet:
2384 type: integer
2385 enum:
2386 - 1
2387 - 2
2388 - 3
2389 description: 'The video playlist privacy (Pending = 1, Rejected = 2, Accepted = 3)'
2390 VideoAbuseStateConstant:
2391 properties:
2392 id:
2393 $ref: '#/components/schemas/VideoAbuseStateSet'
2394 label:
2395 type: string
2396
1898 VideoResolutionConstant: 2397 VideoResolutionConstant:
1899 properties: 2398 properties:
1900 id: 2399 id:
@@ -1906,14 +2405,13 @@ components:
1906 properties: 2405 properties:
1907 privacy: 2406 privacy:
1908 $ref: '#/components/schemas/VideoPrivacySet' 2407 $ref: '#/components/schemas/VideoPrivacySet'
1909 description: Video privacy target
1910 updateAt: 2408 updateAt:
1911 type: string 2409 type: string
1912 format: date 2410 format: date
1913 description: When to update the video 2411 description: When to update the video
1914 required: 2412 required:
1915 - updateAt 2413 - updateAt
1916 VideoAccountSummary: 2414 AccountSummary:
1917 properties: 2415 properties:
1918 id: 2416 id:
1919 type: number 2417 type: number
@@ -1927,7 +2425,8 @@ components:
1927 type: string 2425 type: string
1928 avatar: 2426 avatar:
1929 nullable: true 2427 nullable: true
1930 $ref: '#/components/schemas/Avatar' 2428 allOf:
2429 - $ref: '#/components/schemas/Avatar'
1931 VideoChannelSummary: 2430 VideoChannelSummary:
1932 properties: 2431 properties:
1933 id: 2432 id:
@@ -1942,7 +2441,8 @@ components:
1942 type: string 2441 type: string
1943 avatar: 2442 avatar:
1944 nullable: true 2443 nullable: true
1945 $ref: '#/components/schemas/Avatar' 2444 allOf:
2445 - $ref: '#/components/schemas/Avatar'
1946 PlaylistElement: 2446 PlaylistElement:
1947 properties: 2447 properties:
1948 position: 2448 position:
@@ -1953,7 +2453,8 @@ components:
1953 type: number 2453 type: number
1954 video: 2454 video:
1955 nullable: true 2455 nullable: true
1956 $ref: '#/components/schemas/Video' 2456 allOf:
2457 - $ref: '#/components/schemas/Video'
1957 VideoFile: 2458 VideoFile:
1958 properties: 2459 properties:
1959 magnetUri: 2460 magnetUri:
@@ -2044,7 +2545,8 @@ components:
2044 $ref: '#/components/schemas/VideoStateConstant' 2545 $ref: '#/components/schemas/VideoStateConstant'
2045 scheduledUpdate: 2546 scheduledUpdate:
2046 nullable: true 2547 nullable: true
2047 $ref: '#/components/schemas/VideoScheduledUpdate' 2548 allOf:
2549 - $ref: '#/components/schemas/VideoScheduledUpdate'
2048 blacklisted: 2550 blacklisted:
2049 nullable: true 2551 nullable: true
2050 type: boolean 2552 type: boolean
@@ -2052,7 +2554,7 @@ components:
2052 nullable: true 2554 nullable: true
2053 type: string 2555 type: string
2054 account: 2556 account:
2055 $ref: '#/components/schemas/VideoAccountSummary' 2557 $ref: '#/components/schemas/AccountSummary'
2056 channel: 2558 channel:
2057 $ref: '#/components/schemas/VideoChannelSummary' 2559 $ref: '#/components/schemas/VideoChannelSummary'
2058 userHistory: 2560 userHistory:
@@ -2138,6 +2640,10 @@ components:
2138 type: string 2640 type: string
2139 reporterAccount: 2641 reporterAccount:
2140 $ref: '#/components/schemas/Account' 2642 $ref: '#/components/schemas/Account'
2643 state:
2644 $ref: '#/components/schemas/VideoAbuseStateConstant'
2645 moderationComment:
2646 type: string
2141 video: 2647 video:
2142 type: object 2648 type: object
2143 properties: 2649 properties:
@@ -2147,8 +2653,6 @@ components:
2147 type: string 2653 type: string
2148 uuid: 2654 uuid:
2149 type: string 2655 type: string
2150 url:
2151 type: string
2152 createdAt: 2656 createdAt:
2153 type: string 2657 type: string
2154 VideoBlacklist: 2658 VideoBlacklist:
@@ -2213,32 +2717,13 @@ components:
2213 thumbnailPath: 2717 thumbnailPath:
2214 type: string 2718 type: string
2215 privacy: 2719 privacy:
2216 type: object 2720 $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
2217 properties:
2218 id:
2219 type: number
2220 label:
2221 type: string
2222 type: 2721 type:
2223 type: object 2722 $ref: '#/components/schemas/VideoPlaylistTypeConstant'
2224 properties:
2225 id:
2226 type: number
2227 label:
2228 type: string
2229 ownerAccount: 2723 ownerAccount:
2230 type: object 2724 $ref: '#/components/schemas/AccountSummary'
2231 properties: 2725 videoChannel:
2232 id: 2726 $ref: '#/components/schemas/VideoChannelSummary'
2233 type: number
2234 name:
2235 type: string
2236 displayName:
2237 type: string
2238 url:
2239 type: string
2240 host:
2241 type: string
2242 VideoComment: 2727 VideoComment:
2243 properties: 2728 properties:
2244 id: 2729 id:
@@ -2323,17 +2808,20 @@ components:
2323 type: string 2808 type: string
2324 email: 2809 email:
2325 type: string 2810 type: string
2326 displayNSFW: 2811 theme:
2812 type: string
2813 description: 'Theme enabled by this user'
2814 emailVerified:
2815 type: boolean
2816 description: 'Is email verified?'
2817 nsfwPolicy:
2818 $ref: '#/components/schemas/NSFWPolicy'
2819 webtorrentEnabled:
2327 type: boolean 2820 type: boolean
2328 autoPlayVideo: 2821 autoPlayVideo:
2329 type: boolean 2822 type: boolean
2330 role: 2823 role:
2331 type: integer 2824 $ref: '#/components/schemas/UserRole'
2332 enum:
2333 - 0
2334 - 1
2335 - 2
2336 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2337 roleLabel: 2825 roleLabel:
2338 type: string 2826 type: string
2339 enum: 2827 enum:
@@ -2344,6 +2832,24 @@ components:
2344 type: number 2832 type: number
2345 videoQuotaDaily: 2833 videoQuotaDaily:
2346 type: number 2834 type: number
2835 videosCount:
2836 type: number
2837 videoAbusesCount:
2838 type: number
2839 videoAbusesAcceptedCount:
2840 type: number
2841 videoAbusesCreatedCount:
2842 type: number
2843 videoCommentsCount:
2844 type: number
2845 noInstanceConfigWarningModal:
2846 type: boolean
2847 noWelcomeModal:
2848 type: boolean
2849 blocked:
2850 type: boolean
2851 blockedReason:
2852 type: string
2347 createdAt: 2853 createdAt:
2348 type: string 2854 type: string
2349 account: 2855 account:
@@ -2378,6 +2884,16 @@ components:
2378 type: string 2884 type: string
2379 css: 2885 css:
2380 type: string 2886 type: string
2887 search:
2888 type: object
2889 properties:
2890 remoteUri:
2891 type: object
2892 properties:
2893 users:
2894 type: boolean
2895 anonymous:
2896 type: boolean
2381 plugin: 2897 plugin:
2382 type: object 2898 type: object
2383 properties: 2899 properties:
@@ -2423,6 +2939,11 @@ components:
2423 properties: 2939 properties:
2424 enabled: 2940 enabled:
2425 type: boolean 2941 type: boolean
2942 webtorrent:
2943 type: object
2944 properties:
2945 enabled:
2946 type: boolean
2426 enabledResolutions: 2947 enabledResolutions:
2427 type: array 2948 type: array
2428 items: 2949 items:
@@ -2526,6 +3047,17 @@ components:
2526 properties: 3047 properties:
2527 enabled: 3048 enabled:
2528 type: boolean 3049 type: boolean
3050 followings:
3051 type: object
3052 properties:
3053 instance:
3054 type: object
3055 properties:
3056 autoFollowIndex:
3057 type: object
3058 properties:
3059 indexUrl:
3060 type: string
2529 ServerConfigAbout: 3061 ServerConfigAbout:
2530 properties: 3062 properties:
2531 instance: 3063 instance:
@@ -2772,7 +3304,7 @@ components:
2772 description: 'The user username ' 3304 description: 'The user username '
2773 password: 3305 password:
2774 type: string 3306 type: string
2775 description: 'The user password ' 3307 description: 'The user password. If the smtp server is configured, you can leave empty and an email will be sent '
2776 email: 3308 email:
2777 type: string 3309 type: string
2778 description: 'The user email ' 3310 description: 'The user email '
@@ -2783,12 +3315,7 @@ components:
2783 type: string 3315 type: string
2784 description: 'The user daily video quota ' 3316 description: 'The user daily video quota '
2785 role: 3317 role:
2786 type: integer 3318 $ref: '#/components/schemas/UserRole'
2787 enum:
2788 - 0
2789 - 1
2790 - 2
2791 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2792 required: 3319 required:
2793 - username 3320 - username
2794 - password 3321 - password
@@ -2811,12 +3338,7 @@ components:
2811 type: string 3338 type: string
2812 description: 'The updated daily video quota of the user ' 3339 description: 'The updated daily video quota of the user '
2813 role: 3340 role:
2814 type: integer 3341 $ref: '#/components/schemas/UserRole'
2815 enum:
2816 - 0
2817 - 1
2818 - 2
2819 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2820 required: 3342 required:
2821 - id 3343 - id
2822 - email 3344 - email
diff --git a/support/doc/api/quickstart.md b/support/doc/api/quickstart.md
index 2222be741..677745969 100644
--- a/support/doc/api/quickstart.md
+++ b/support/doc/api/quickstart.md
@@ -52,3 +52,13 @@ $ curl -H 'Authorization: Bearer 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0' https
52```bash 52```bash
53$ curl https://peertube.example.com/api/v1/videos 53$ curl https://peertube.example.com/api/v1/videos
54``` 54```
55
56## Libraries
57
58[Convenience libraries](https://framagit.org/framasoft/peertube/clients) are generated automatically from the [OpenAPI specification](https://github.com/Chocobozzz/PeerTube/blob/develop/support/doc/api/openapi.yaml) for the following languages:
59
60- [python](https://framagit.org/framasoft/peertube/clients/python)
61- [go](https://framagit.org/framasoft/peertube/clients/go)
62- [kotlin](https://framagit.org/framasoft/peertube/clients/kotlin)
63
64Other [languages supported by the OpenAPI generator](https://openapi-generator.tech/docs/generators/#client-generators) can be added to the generation, provided they make a common enough use case.
diff --git a/support/doc/docker.md b/support/doc/docker.md
index b251329d0..c599af0f9 100644
--- a/support/doc/docker.md
+++ b/support/doc/docker.md
@@ -14,43 +14,95 @@ PeerTube needs a PostgreSQL and a Redis instance to work correctly. If you want
14to quickly set up a full environment, either for trying the service or in 14to quickly set up a full environment, either for trying the service or in
15production, you can use a `docker-compose` setup. 15production, you can use a `docker-compose` setup.
16 16
17#### Go to your peertube workdir
17```shell 18```shell
18$ cd /your/peertube/directory 19cd /your/peertube/directory
19$ mkdir ./docker-volume && mkdir ./docker-volume/traefik 20```
20$ curl "https://raw.githubusercontent.com/chocobozzz/PeerTube/master/support/docker/production/config/traefik.toml" > ./docker-volume/traefik/traefik.toml 21
21$ touch ./docker-volume/traefik/acme.json && chmod 600 ./docker-volume/traefik/acme.json 22#### Create the reverse proxy configuration directory
22$ curl -s "https://raw.githubusercontent.com/chocobozzz/PeerTube/master/support/docker/production/docker-compose.yml" -o docker-compose.yml "https://raw.githubusercontent.com/Chocobozzz/PeerTube/master/support/docker/production/.env" -o .env 23
24```shell
25mkdir -p ./docker-volume/traefik
23``` 26```
24View the source of the files you're about to download: [docker-compose.yml](https://github.com/Chocobozzz/PeerTube/blob/develop/support/docker/production/docker-compose.yml) and the [traefik.toml](https://github.com/Chocobozzz/PeerTube/blob/develop/support/docker/production/config/traefik.toml) and the [.env](https://github.com/Chocobozzz/PeerTube/blob/develop/support/docker/production/.env)
25 27
26Update the reverse proxy configuration: 28#### Get the latest reverse proxy configuration
27 29
28```shell 30```shell
29$ vim ./docker-volume/traefik/traefik.toml 31curl https://raw.githubusercontent.com/chocobozzz/PeerTube/master/support/docker/production/config/traefik.toml > ./docker-volume/traefik/traefik.toml
30``` 32```
31 33
32Tweak the `docker-compose.yml` file there according to your needs: 34View the source of the file you're about to download: [traefik.toml](https://github.com/Chocobozzz/PeerTube/blob/master/support/docker/production/config/traefik.toml)
33 35
36#### Create Let's Encrypt ACME certificates as JSON file
37
38```shell
39touch ./docker-volume/traefik/acme.json
40```
41Needs to have file mode 600:
34```shell 42```shell
35$ vim ./docker-compose.yml 43chmod 600 ./docker-volume/traefik/acme.json
36``` 44```
37 45
38Then tweak the `.env` file to change the environment variables: 46#### Get the latest Compose file
47
48```shell
49curl https://raw.githubusercontent.com/chocobozzz/PeerTube/master/support/docker/production/docker-compose.yml > docker-compose.yml
50```
51
52View the source of the file you're about to download: [docker-compose.yml](https://github.com/Chocobozzz/PeerTube/blob/master/support/docker/production/docker-compose.yml)
53
54
55#### Get the latest env_file
56
57```shell
58curl https://raw.githubusercontent.com/Chocobozzz/PeerTube/master/support/docker/production/.env > .env
59```
60
61View the source of the file you're about to download: [.env](https://github.com/Chocobozzz/PeerTube/blob/master/support/docker/production/.env)
62
63#### Update the reverse proxy configuration
39 64
40```shell 65```shell
41$ vim ./.env 66vim ./docker-volume/traefik/traefik.toml
42``` 67```
43If you did not download the .env file above, here you can look at the variables that can be set: 68
44https://github.com/Chocobozzz/PeerTube/blob/develop/support/docker/production/.env 69~~You must replace `<MY EMAIL ADDRESS>` and `<MY DOMAIN>` to enable Let's Encrypt SSL Certificates creation.~~ Now included in `.env` file with `TRAEFIK_ACME_EMAIL` and `TRAEFIK_ACME_DOMAINS` variables used through traefik service command value of `docker-compose.yml` file.
70
71More at: https://docs.traefik.io/v1.7
72
73#### Tweak the `docker-compose.yml` file there according to your needs
74
75```shell
76vim ./docker-compose.yml
77```
78
79#### Then tweak the `.env` file to change the environment variables
80
81```shell
82vim ./.env
83```
84In the downloaded example [.env](https://github.com/Chocobozzz/PeerTube/blob/master/support/docker/production/.env), you must replace:
85- `<MY POSTGRES USERNAME>`
86- `<MY POSTGRES PASSWORD>`
87- `<MY POSTGRES DB>`
88- `<MY DOMAIN>` without 'https://'
89- `<MY EMAIL ADDRESS>`
45 90
46Other environment variables are used in 91Other environment variables are used in
47`support/docker/production/config/custom-environment-variables.yaml` and can be 92[/support/docker/production/config/custom-environment-variables.yaml](https://github.com/Chocobozzz/PeerTube/blob/master/support/docker/production/config/custom-environment-variables.yaml) and can be
48intuited from usage. 93intuited from usage.
49 94
50You can use the regular `up` command to set it up: 95#### Testing local Docker setup
96
97To test locally your Docker setup, you must add your domain (`<MY DOMAIN>`) in `/etc/hosts`:
98```
99127.0.0.1 localhost mydomain.tld
100```
101
102#### You can use the regular `up` command to set it up
51 103
52```shell 104```shell
53$ docker-compose up 105docker-compose up
54``` 106```
55### Obtaining Your Automatically Generated Admin Credentials 107### Obtaining Your Automatically Generated Admin Credentials
56Now that you've installed your PeerTube instance you'll want to grep your peertube container's logs for the `root` password. 108Now that you've installed your PeerTube instance you'll want to grep your peertube container's logs for the `root` password.
@@ -62,6 +114,17 @@ peertube_1 | [example.com:443] 2019-11-16 04:26:06.082 info: Username: root
62peertube_1 | [example.com:443] 2019-11-16 04:26:06.083 info: User password: abcdefghijklmnop 114peertube_1 | [example.com:443] 2019-11-16 04:26:06.083 info: User password: abcdefghijklmnop
63``` 115```
64 116
117### Obtaining Your Automatically Generated DKIM DNS TXT Record
118[DKIM](https://en.wikipedia.org/wiki/DomainKeys_Identified_Mail) signature sending and RSA keys generation are enabled by the default Postfix image `mwader/postfix-relay` with [OpenDKIM](http://www.opendkim.org/).
119Run `cat ./docker-volume/opendkim/keys/*/*.txt` to display your DKIM DNS TXT Record containing the public key to configure to your domain :
120```BASH
121user@s:~/peertube|master⚡ ⇒ cat ./docker-volume/opendkim/keys/*/*.txt
122
123peertube._domainkey.mydomain.tld. IN TXT ( "v=DKIM1; h=sha256; k=rsa; "
124 "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Dx7wLGPFVaxVQ4TGym/eF89aQ8oMxS9v5BCc26Hij91t2Ci8Fl12DHNVqZoIPGm+9tTIoDVDFEFrlPhMOZl8i4jU9pcFjjaIISaV2+qTa8uV1j3MyByogG8pu4o5Ill7zaySYFsYB++cHJ9pjbFSC42dddCYMfuVgrBsLNrvEi3dLDMjJF5l92Uu8YeswFe26PuHX3Avr261n"
125 "j5joTnYwat4387VEUyGUnZ0aZxCERi+ndXv2/wMJ0tizq+a9+EgqIb+7lkUc2XciQPNuTujM25GhrQBEKznvHyPA6fHsFheymOuB763QpkmnQQLCxyLygAY9mE/5RY+5Q6J9oDOQIDAQAB" ) ; ----- DKIM key peertube for mydomain.tld
126```
127
65### What now? 128### What now?
66 129
67See the production guide ["What now" section](/support/doc/production.md#what-now). 130See the production guide ["What now" section](/support/doc/production.md#what-now).
@@ -88,5 +151,5 @@ $ docker build . -f ./support/docker/production/Dockerfile.buster
88 151
89## Development 152## Development
90 153
91We don't have a Docker image for development. See [the CONTRIBUTING guide](https://github.com/Chocobozzz/PeerTube/blob/develop/.github/CONTRIBUTING.md#develop) 154We don't have a Docker image for development. See [the CONTRIBUTING guide](https://github.com/Chocobozzz/PeerTube/blob/master/.github/CONTRIBUTING.md#develop)
92for more information on how you can hack PeerTube! 155for more information on how you can hack PeerTube!
diff --git a/support/doc/plugins/guide.md b/support/doc/plugins/guide.md
index 8e720e94b..41d70c372 100644
--- a/support/doc/plugins/guide.md
+++ b/support/doc/plugins/guide.md
@@ -12,8 +12,13 @@
12 - [Settings](#settings) 12 - [Settings](#settings)
13 - [Storage](#storage) 13 - [Storage](#storage)
14 - [Update video constants](#update-video-constants) 14 - [Update video constants](#update-video-constants)
15 - [Add custom routes](#add-custom-routes)
16 - [Add external auth methods](#add-external-auth-methods)
15 - [Client helpers (themes & plugins)](#client-helpers-themes--plugins) 17 - [Client helpers (themes & plugins)](#client-helpers-themes--plugins)
16 - [Plugin static route](#plugin-static-route) 18 - [Plugin static route](#plugin-static-route)
19 - [Notifier](#notifier)
20 - [Markdown Renderer](#markdown-renderer)
21 - [Custom Modal](#custom-modal)
17 - [Translate](#translate) 22 - [Translate](#translate)
18 - [Get public settings](#get-public-settings) 23 - [Get public settings](#get-public-settings)
19 - [Publishing](#publishing) 24 - [Publishing](#publishing)
@@ -44,7 +49,7 @@ Themes are exactly the same as plugins, except that:
44### Hooks 49### Hooks
45 50
46A plugin registers functions in JavaScript to execute when PeerTube (server and client) fires events. There are 3 types of hooks: 51A plugin registers functions in JavaScript to execute when PeerTube (server and client) fires events. There are 3 types of hooks:
47 * `filter`: used to filter functions parameters or return values. 52 * `filter`: used to filter functions parameters or return values.
48 For example to replace words in video comments, or change the videos list behaviour 53 For example to replace words in video comments, or change the videos list behaviour
49 * `action`: used to do something after a certain trigger. For example to send a hook every time a video is published 54 * `action`: used to do something after a certain trigger. For example to send a hook every time a video is published
50 * `static`: same than `action` but PeerTube waits their execution 55 * `static`: same than `action` but PeerTube waits their execution
@@ -66,12 +71,24 @@ Example:
66```js 71```js
67async function register ({ 72async function register ({
68 registerHook, 73 registerHook,
74
69 registerSetting, 75 registerSetting,
70 settingsManager, 76 settingsManager,
77
71 storageManager, 78 storageManager,
79
72 videoCategoryManager, 80 videoCategoryManager,
73 videoLicenceManager, 81 videoLicenceManager,
74 videoLanguageManager 82 videoLanguageManager,
83
84 peertubeHelpers,
85
86 getRouter,
87
88 registerExternalAuth,
89 unregisterExternalAuth,
90 registerIdAndPassAuth,
91 unregisterIdAndPassAuth
75}) { 92}) {
76 registerHook({ 93 registerHook({
77 target: 'action:application.listening', 94 target: 'action:application.listening',
@@ -114,8 +131,8 @@ function register ({ registerHook, peertubeHelpers }) {
114 131
115### Static files 132### Static files
116 133
117Plugins can declare static directories that PeerTube will serve (images for example) 134Plugins can declare static directories that PeerTube will serve (images for example)
118from `/plugins/{plugin-name}/{plugin-version}/static/` 135from `/plugins/{plugin-name}/{plugin-version}/static/`
119or `/themes/{theme-name}/{theme-version}/static/` routes. 136or `/themes/{theme-name}/{theme-version}/static/` routes.
120 137
121### CSS 138### CSS
@@ -146,10 +163,18 @@ registerSetting({
146 name: 'admin-name', 163 name: 'admin-name',
147 label: 'Admin name', 164 label: 'Admin name',
148 type: 'input', 165 type: 'input',
166 // type: input | input-checkbox | input-textarea | markdown-text | markdown-enhanced
149 default: 'my super name' 167 default: 'my super name'
150}) 168})
151 169
152const adminName = await settingsManager.getSetting('admin-name') 170const adminName = await settingsManager.getSetting('admin-name')
171
172const result = await settingsManager.getSettings([ 'admin-name', 'admin-password' ])
173result['admin-name]
174
175settingsManager.onSettingsChange(settings => {
176 settings['admin-name])
177})
153``` 178```
154 179
155#### Storage 180#### Storage
@@ -176,11 +201,109 @@ videoCategoryManager.deleteCategory(1) // Music
176 201
177videoLicenceManager.addLicence(42, 'Best licence') 202videoLicenceManager.addLicence(42, 'Best licence')
178videoLicenceManager.deleteLicence(7) // Public domain 203videoLicenceManager.deleteLicence(7) // Public domain
204
205videoPrivacyManager.deletePrivacy(2) // Remove Unlisted video privacy
206playlistPrivacyManager.deletePlaylistPrivacy(3) // Remove Private video playlist privacy
207```
208
209#### Add custom routes
210
211You can create custom routes using an [express Router](https://expressjs.com/en/4x/api.html#router) for your plugin:
212
213```js
214const router = getRouter()
215router.get('/ping', (req, res) => res.json({ message: 'pong' }))
216```
217
218The `ping` route can be accessed using:
219 * `/plugins/:pluginName/:pluginVersion/router/ping`
220 * Or `/plugins/:pluginName/router/ping`
221
222
223#### Add external auth methods
224
225If you want to add a classic username/email and password auth method (like [LDAP](https://framagit.org/framasoft/peertube/official-plugins/-/tree/master/peertube-plugin-auth-ldap) for example):
226
227```js
228registerIdAndPassAuth({
229 authName: 'my-auth-method',
230
231 // PeerTube will try all id and pass plugins in the weight DESC order
232 // Exposing this value in the plugin settings could be interesting
233 getWeight: () => 60,
234
235 // Optional function called by PeerTube when the user clicked on the logout button
236 onLogout: user => {
237 console.log('User %s logged out.', user.username')
238 },
239
240 // Optional function called by PeerTube when the access token or refresh token are generated/refreshed
241 hookTokenValidity: ({ token, type }) => {
242 if (type === 'access') return { valid: true }
243 if (type === 'refresh') return { valid: false }
244 },
245
246 // Used by PeerTube when the user tries to authenticate
247 login: ({ id, password }) => {
248 if (id === 'user' && password === 'super password') {
249 return {
250 username: 'user'
251 email: 'user@example.com'
252 role: 2
253 displayName: 'User display name'
254 }
255 }
256
257 // Auth failed
258 return null
259 }
260})
261
262// Unregister this auth method
263unregisterIdAndPassAuth('my-auth-method')
264```
265
266You can also add an external auth method (like [OpenID](https://framagit.org/framasoft/peertube/official-plugins/-/tree/master/peertube-plugin-auth-openid-connect), [SAML2](https://framagit.org/framasoft/peertube/official-plugins/-/tree/master/peertube-plugin-auth-saml2) etc):
267
268```js
269// result contains the userAuthenticated auth method you can call to authenticate a user
270const result = registerExternalAuth({
271 authName: 'my-auth-method',
272
273 // Will be displayed in a button next to the login form
274 authDisplayName: () => 'Auth method'
275
276 // If the user click on the auth button, PeerTube will forward the request in this function
277 onAuthRequest: (req, res) => {
278 res.redirect('https://external-auth.example.com/auth')
279 },
280
281 // Same than registerIdAndPassAuth option
282 // onLogout: ...
283
284 // Same than registerIdAndPassAuth option
285 // hookTokenValidity: ...
286})
287
288router.use('/external-auth-callback', (req, res) => {
289 // Forward the request to PeerTube
290 result.userAuthenticated({
291 req,
292 res,
293 username: 'user'
294 email: 'user@example.com'
295 role: 2
296 displayName: 'User display name'
297 })
298})
299
300// Unregister this external auth method
301unregisterExternalAuth('my-auth-method)
179``` 302```
180 303
181### Client helpers (themes & plugins) 304### Client helpers (themes & plugins)
182 305
183### Plugin static route 306#### Plugin static route
184 307
185To get your plugin static route: 308To get your plugin static route:
186 309
@@ -189,6 +312,48 @@ const baseStaticUrl = peertubeHelpers.getBaseStaticRoute()
189const imageUrl = baseStaticUrl + '/images/chocobo.png' 312const imageUrl = baseStaticUrl + '/images/chocobo.png'
190``` 313```
191 314
315#### Notifier
316
317To notify the user with the PeerTube ToastModule:
318
319```js
320const { notifier } = peertubeHelpers
321notifier.success('Success message content.')
322notifier.error('Error message content.')
323```
324
325#### Markdown Renderer
326
327To render a formatted markdown text to HTML:
328
329```js
330const { markdownRenderer } = peertubeHelpers
331
332await markdownRenderer.textMarkdownToHTML('**My Bold Text**')
333// return <strong>My Bold Text</strong>
334
335await markdownRenderer.enhancedMarkdownToHTML('![alt-img](http://.../my-image.jpg)')
336// return <img alt=alt-img src=http://.../my-image.jpg />
337```
338
339#### Custom Modal
340
341To show a custom modal:
342
343```js
344 peertubeHelpers.showModal({
345 title: 'My custom modal title',
346 content: '<p>My custom modal content</p>',
347 // Optionals parameters :
348 // show close icon
349 close: true,
350 // show cancel button and call action() after hiding modal
351 cancel: { value: 'cancel', action: () => {} },
352 // show confirm button and call action() after hiding modal
353 confirm: { value: 'confirm', action: () => {} },
354 })
355```
356
192#### Translate 357#### Translate
193 358
194You can translate some strings of your plugin (PeerTube will use your `translations` object of your `package.json` file): 359You can translate some strings of your plugin (PeerTube will use your `translations` object of your `package.json` file):
@@ -209,10 +374,10 @@ peertubeHelpers.getSettings()
209 console.error('Matomo settings are not set.') 374 console.error('Matomo settings are not set.')
210 return 375 return
211 } 376 }
212 377
213 // ... 378 // ...
214 }) 379 })
215``` 380```
216 381
217 382
218### Publishing 383### Publishing
@@ -275,9 +440,9 @@ Update the `package.json` fields:
275 * `author` 440 * `author`
276 * `bugs` 441 * `bugs`
277 * `engine.peertube` (the PeerTube version compatibility, must be `>=x.y.z` and nothing else) 442 * `engine.peertube` (the PeerTube version compatibility, must be `>=x.y.z` and nothing else)
278 443
279**Caution:** Don't update or remove other keys, or PeerTube will not be able to index/install your plugin. 444**Caution:** Don't update or remove other keys, or PeerTube will not be able to index/install your plugin.
280If you don't need static directories, use an empty `object`: 445If you don't need static directories, use an empty `object`:
281 446
282```json 447```json
283{ 448{
@@ -302,7 +467,7 @@ And if you don't need CSS or client script files, use an empty `array`:
302 467
303Now you can register hooks or settings, write CSS and add static directories to your plugin or your theme :) 468Now you can register hooks or settings, write CSS and add static directories to your plugin or your theme :)
304 469
305**Caution:** It's up to you to check the code you write will be compatible with the PeerTube NodeJS version, 470**Caution:** It's up to you to check the code you write will be compatible with the PeerTube NodeJS version,
306and will be supported by web browsers. 471and will be supported by web browsers.
307If you want to write modern JavaScript, please use a transpiler like [Babel](https://babeljs.io/). 472If you want to write modern JavaScript, please use a transpiler like [Babel](https://babeljs.io/).
308 473
@@ -336,27 +501,27 @@ Translation files are just objects, with the english sentence as the key and the
336### Test your plugin/theme 501### Test your plugin/theme
337 502
338You'll need to have a local PeerTube instance: 503You'll need to have a local PeerTube instance:
339 * Follow the [dev prerequisites](https://github.com/Chocobozzz/PeerTube/blob/develop/.github/CONTRIBUTING.md#prerequisites) 504 * Follow the [dev prerequisites](https://github.com/Chocobozzz/PeerTube/blob/develop/.github/CONTRIBUTING.md#prerequisites)
340 (to clone the repository, install dependencies and prepare the database) 505 (to clone the repository, install dependencies and prepare the database)
341 * Build PeerTube (`--light` to only build the english language): 506 * Build PeerTube (`--light` to only build the english language):
342 507
343``` 508```
344$ npm run build -- --light 509$ npm run build -- --light
345``` 510```
346 511
347 * Build the CLI: 512 * Build the CLI:
348 513
349``` 514```
350$ npm run setup:cli 515$ npm run setup:cli
351``` 516```
352 517
353 * Run PeerTube (you can access to your instance on http://localhost:9000): 518 * Run PeerTube (you can access to your instance on http://localhost:9000):
354 519
355``` 520```
356$ NODE_ENV=test npm start 521$ NODE_ENV=test npm start
357``` 522```
358 523
359 * Register the instance via the CLI: 524 * Register the instance via the CLI:
360 525
361``` 526```
362$ node ./dist/server/tools/peertube.js auth add -u 'http://localhost:9000' -U 'root' --password 'test' 527$ node ./dist/server/tools/peertube.js auth add -u 'http://localhost:9000' -U 'root' --password 'test'
@@ -405,10 +570,10 @@ registerHook({
405}) 570})
406``` 571```
407 * Don't try to require parent PeerTube modules, only use `peertubeHelpers`. If you need another helper or a specific hook, please [create an issue](https://github.com/Chocobozzz/PeerTube/issues/new) 572 * Don't try to require parent PeerTube modules, only use `peertubeHelpers`. If you need another helper or a specific hook, please [create an issue](https://github.com/Chocobozzz/PeerTube/issues/new)
408 * Don't use PeerTube dependencies. Use your own :) 573 * Don't use PeerTube dependencies. Use your own :)
409 574
410If your plugin is broken with a new PeerTube release, update your code and the `peertubeEngine` field of your `package.json` field. 575If your plugin is broken with a new PeerTube release, update your code and the `peertubeEngine` field of your `package.json` field.
411This way, older PeerTube versions will still use your old plugin, and new PeerTube versions will use your updated plugin. 576This way, older PeerTube versions will still use your old plugin, and new PeerTube versions will use your updated plugin.
412 577
413### Spam/moderation plugin 578### Spam/moderation plugin
414 579
@@ -419,7 +584,7 @@ If you want to create an antispam/moderation plugin, you could use the following
419 * `filter:api.video-threads.list.result`: to change/hide the text of threads 584 * `filter:api.video-threads.list.result`: to change/hide the text of threads
420 * `filter:api.video-thread-comments.list.result`: to change/hide the text of replies 585 * `filter:api.video-thread-comments.list.result`: to change/hide the text of replies
421 * `filter:video.auto-blacklist.result`: to automatically blacklist local or remote videos 586 * `filter:video.auto-blacklist.result`: to automatically blacklist local or remote videos
422 587
423### Other plugin examples 588### Other plugin examples
424 589
425You can take a look to "official" PeerTube plugins if you want to take inspiration from them: https://framagit.org/framasoft/peertube/official-plugins 590You can take a look to "official" PeerTube plugins if you want to take inspiration from them: https://framagit.org/framasoft/peertube/official-plugins
diff --git a/support/doc/production.md b/support/doc/production.md
index 8f061f868..6febaba5d 100644
--- a/support/doc/production.md
+++ b/support/doc/production.md
@@ -39,7 +39,7 @@ Create the production database and a peertube user inside PostgreSQL:
39 39
40``` 40```
41$ sudo -u postgres createuser -P peertube 41$ sudo -u postgres createuser -P peertube
42$ sudo -u postgres createdb -O peertube peertube_prod 42$ sudo -u postgres createdb -O peertube -E UTF8 -T template0 peertube_prod
43``` 43```
44 44
45Then enable extensions PeerTube needs: 45Then enable extensions PeerTube needs:
diff --git a/support/doc/tools.md b/support/doc/tools.md
index d5427b5b7..1f1e52c36 100644
--- a/support/doc/tools.md
+++ b/support/doc/tools.md
@@ -12,6 +12,7 @@
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 - [peertube-plugins.js](#peertube-pluginsjs)
15 - [peertube-redundancy.js](#peertube-redundancyjs)
15- [Server tools](#server-tools) 16- [Server tools](#server-tools)
16 - [parse-log](#parse-log) 17 - [parse-log](#parse-log)
17 - [create-transcoding-job.js](#create-transcoding-jobjs) 18 - [create-transcoding-job.js](#create-transcoding-jobjs)
@@ -77,7 +78,8 @@ You can access it as `peertube` via an alias in your `.bashrc` like `alias peert
77 import-videos|import import a video from a streaming platform 78 import-videos|import import a video from a streaming platform
78 watch|w watch a video in the terminal ✩°。⋆ 79 watch|w watch a video in the terminal ✩°。⋆
79 repl initiate a REPL to access internals 80 repl initiate a REPL to access internals
80 plugins|p [action] manag instance plugins 81 plugins|p [action] manage instance plugins
82 redundancy|r [action] manage video redundancies
81 help [cmd] display help for [cmd] 83 help [cmd] display help for [cmd]
82``` 84```
83 85
@@ -200,6 +202,34 @@ $ 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 202$ node dist/server/tools/peertube-plugins.js install --npm-name peertube-theme-example
201``` 203```
202 204
205#### peertube-redundancy.js
206
207Manage (list/add/remove) video redundancies:
208
209To list your videos that are duplicated by remote instances:
210
211```
212$ node dist/server/tools/peertube.js redundancy list-remote-redundancies
213```
214
215To list remote videos that your instance duplicated:
216
217```
218$ node dist/server/tools/peertube.js redundancy list-my-redundancies
219```
220
221To duplicate a specific video in your redundancy system:
222
223```
224$ node dist/server/tools/peertube.js redundancy add --video 823
225```
226
227To remove a video redundancy:
228
229```
230$ node dist/server/tools/peertube.js redundancy remove --video 823
231```
232
203## Server tools 233## Server tools
204 234
205These scripts should be run on the server, in `peertube-latest` directory. 235These scripts should be run on the server, in `peertube-latest` directory.
diff --git a/support/doc/translation.md b/support/doc/translation.md
index 1a3e59f9f..ade290ae1 100644
--- a/support/doc/translation.md
+++ b/support/doc/translation.md
@@ -49,4 +49,4 @@ For example:
49 49
50should be in french 50should be in french
51 51
52```{VAR_PLURAL, plural, =0 {Aucune vidéos} =1 {1 vidéo} other {<x id="INTERPOLATION" equiv-text="{{ playlist.videosLength }}"/> vidéos} }``` 52```{VAR_PLURAL, plural, =0 {Aucune vidéo} =1 {1 vidéo} other {<x id="INTERPOLATION" equiv-text="{{ playlist.videosLength }}"/> vidéos} }```
diff --git a/support/docker/production/.env b/support/docker/production/.env
index 95ca42d69..4743b68db 100644
--- a/support/docker/production/.env
+++ b/support/docker/production/.env
@@ -1,10 +1,11 @@
1POSTGRES_USER=peertube 1POSTGRES_USER=<MY POSTGRES USERNAME>
2POSTGRES_PASSWORD=peertube 2POSTGRES_PASSWORD=<MY POSTGRES PASSWORD>
3POSTGRES_DB=peertube 3POSTGRES_DB=<MY POSTGRES DB>
4PEERTUBE_DB_USERNAME=$(POSTGRES_USER) 4PEERTUBE_DB_USERNAME=<MY POSTGRES USERNAME>
5PEERTUBE_DB_PASSWORD=$(POSTGRES_PASSWORD) 5PEERTUBE_DB_PASSWORD=<MY POSTGRES PASSWORD>
6# PEERTUBE_DB_HOSTNAME is the Postgres service name in docker-compose.yml
6PEERTUBE_DB_HOSTNAME=postgres 7PEERTUBE_DB_HOSTNAME=postgres
7PEERTUBE_WEBSERVER_HOSTNAME=domain.tld 8PEERTUBE_WEBSERVER_HOSTNAME=<MY DOMAIN>
8PEERTUBE_WEBSERVER_PORT=443 9PEERTUBE_WEBSERVER_PORT=443
9PEERTUBE_WEBSERVER_HTTPS=true 10PEERTUBE_WEBSERVER_HTTPS=true
10# If you need more than one IP as trust_proxy 11# If you need more than one IP as trust_proxy
@@ -14,11 +15,18 @@ PEERTUBE_TRUST_PROXY=["127.0.0.1", "loopback", "172.18.0.0/16"]
14#PEERTUBE_SMTP_PASSWORD= 15#PEERTUBE_SMTP_PASSWORD=
15PEERTUBE_SMTP_HOSTNAME=postfix 16PEERTUBE_SMTP_HOSTNAME=postfix
16PEERTUBE_SMTP_PORT=25 17PEERTUBE_SMTP_PORT=25
17PEERTUBE_SMTP_FROM=noreply@domain.tld 18PEERTUBE_SMTP_FROM=noreply@<MY DOMAIN>
18PEERTUBE_SMTP_TLS=false 19PEERTUBE_SMTP_TLS=false
19PEERTUBE_SMTP_DISABLE_STARTTLS=false 20PEERTUBE_SMTP_DISABLE_STARTTLS=false
20PEERTUBE_ADMIN_EMAIL=admin@domain.tld 21PEERTUBE_ADMIN_EMAIL=<MY EMAIL ADDRESS>
21POSTFIX_myhostname=${PEERTUBE_WEBSERVER_HOSTNAME} 22POSTFIX_myhostname=<MY DOMAIN>
23# If you need to generate a list of sub/DOMAIN keys
24# pass them as a whitespace separated string <DOMAIN>=<selector>
25OPENDKIM_DOMAINS=<MY DOMAIN>=peertube
26TRAEFIK_ACME_EMAIL=<MY EMAIL ADDRESS>
27# If you need to obtain ACME certificates for more than one DOMAIN
28# pass them as a comma separated string
29TRAEFIK_ACME_DOMAINS=<MY DOMAIN>
22# /!\ Prefer to use the PeerTube admin interface to set the following configurations /!\ 30# /!\ Prefer to use the PeerTube admin interface to set the following configurations /!\
23#PEERTUBE_SIGNUP_ENABLED=true 31#PEERTUBE_SIGNUP_ENABLED=true
24#PEERTUBE_TRANSCODING_ENABLED=true 32#PEERTUBE_TRANSCODING_ENABLED=true
diff --git a/support/docker/production/config/production.yaml b/support/docker/production/config/production.yaml
index 2ac3c8f44..58b41a493 100644
--- a/support/docker/production/config/production.yaml
+++ b/support/docker/production/config/production.yaml
@@ -45,6 +45,7 @@ storage:
45 tmp: '../data/tmp/' 45 tmp: '../data/tmp/'
46 avatars: '../data/avatars/' 46 avatars: '../data/avatars/'
47 videos: '../data/videos/' 47 videos: '../data/videos/'
48 streaming_playlists: '../data/streaming-playlists'
48 redundancy: '../data/redundancy/' 49 redundancy: '../data/redundancy/'
49 logs: '../data/logs/' 50 logs: '../data/logs/'
50 previews: '../data/previews/' 51 previews: '../data/previews/'
diff --git a/support/docker/production/config/traefik.toml b/support/docker/production/config/traefik.toml
index 6abced3db..1d7d207fd 100644
--- a/support/docker/production/config/traefik.toml
+++ b/support/docker/production/config/traefik.toml
@@ -37,12 +37,6 @@ defaultEntryPoints = ["http", "https"]
37# Enable ACME (Let's Encrypt): automatic SSL. 37# Enable ACME (Let's Encrypt): automatic SSL.
38[acme] 38[acme]
39 39
40# Email address used for registration.
41#
42# Required
43#
44email = "<MY EMAIL ADDRESS>"
45
46# File or key used for certificates storage. 40# File or key used for certificates storage.
47# 41#
48# Required 42# Required
@@ -57,11 +51,6 @@ storage = "/etc/acme.json"
57# 51#
58entryPoint = "https" 52entryPoint = "https"
59 53
60# Domains list.
61#
62[[acme.domains]]
63 main = "<MY DOMAIN>"
64
65# Use a HTTP-01 acme challenge rather than TLS-SNI-01 challenge 54# Use a HTTP-01 acme challenge rather than TLS-SNI-01 challenge
66# 55#
67# Optional but recommend 56# Optional but recommend
diff --git a/support/docker/production/docker-compose.yml b/support/docker/production/docker-compose.yml
index b81a8745b..e937c8b9c 100644
--- a/support/docker/production/docker-compose.yml
+++ b/support/docker/production/docker-compose.yml
@@ -5,7 +5,10 @@ services:
5 reverse-proxy: 5 reverse-proxy:
6 image: traefik:v1.7 6 image: traefik:v1.7
7 network_mode: "host" 7 network_mode: "host"
8 command: --docker # Tells Træfik to listen to docker 8 command:
9 - "--docker" # Tells Træfik to listen to docker
10 - "--acme.email=${TRAEFIK_ACME_EMAIL}" # Let's Encrypt ACME email
11 - "--acme.domains=${TRAEFIK_ACME_DOMAINS}" # Let's Encrypt ACME domain list
9 ports: 12 ports:
10 - "80:80" # The HTTP port 13 - "80:80" # The HTTP port
11 - "443:443" # The HTTPS port 14 - "443:443" # The HTTPS port
@@ -67,6 +70,8 @@ services:
67 image: mwader/postfix-relay 70 image: mwader/postfix-relay
68 env_file: 71 env_file:
69 - .env 72 - .env
73 volumes:
74 - ./docker-volume/opendkim/keys:/etc/opendkim/keys
70 labels: 75 labels:
71 traefik.enable: "false" 76 traefik.enable: "false"
72 restart: "always" 77 restart: "always"
diff --git a/support/nginx/peertube b/support/nginx/peertube
index 50d3a919f..a17868c5a 100644
--- a/support/nginx/peertube
+++ b/support/nginx/peertube
@@ -33,6 +33,8 @@ server {
33 ssl_session_tickets off; # Requires nginx >= 1.5.9 33 ssl_session_tickets off; # Requires nginx >= 1.5.9
34 ssl_stapling on; # Requires nginx >= 1.3.7 34 ssl_stapling on; # Requires nginx >= 1.3.7
35 ssl_stapling_verify on; # Requires nginx => 1.3.7 35 ssl_stapling_verify on; # Requires nginx => 1.3.7
36 # HSTS (https://hstspreload.org), requires to be copied in 'location' sections that have add_header directives
37 #add_header Strict-Transport-Security "max-age=63072000; includeSubDomains";
36 38
37 # Configure with your resolvers 39 # Configure with your resolvers
38 # resolver $DNS-IP-1 $DNS-IP-2 valid=300s; 40 # resolver $DNS-IP-1 $DNS-IP-2 valid=300s;
@@ -49,12 +51,6 @@ server {
49 # See https://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_temp_path 51 # See https://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_temp_path
50 # client_body_temp_path /var/www/peertube/storage/nginx/; 52 # client_body_temp_path /var/www/peertube/storage/nginx/;
51 53
52 # Enable HSTS
53 # Tells browsers to stick with HTTPS and never visit the insecure HTTP
54 # version. Once a browser sees this header, it will only visit the site over
55 # HTTPS for the next 2 years: (read more on hstspreload.org)
56 #add_header Strict-Transport-Security "max-age=63072000; includeSubDomains";
57
58 access_log /var/log/nginx/peertube.example.com.access.log; 54 access_log /var/log/nginx/peertube.example.com.access.log;
59 error_log /var/log/nginx/peertube.example.com.error.log; 55 error_log /var/log/nginx/peertube.example.com.error.log;
60 56
@@ -156,6 +152,14 @@ server {
156 152
157 root /var/www/peertube/storage; 153 root /var/www/peertube/storage;
158 154
155 # Use this in tandem with fuse-mounting i.e. https://docs.joinpeertube.org/#/admin-remote-storage
156 # to serve files directly from a public bucket without proxying.
157 # Assumes you have buckets named after the storage subdirectories, i.e. 'videos', 'redundancy', etc.
158 #set $cdn <your S3-compatiable bucket public url mounted via fuse>;
159 #rewrite ^/static/webseed/(.*)$ $cdn/videos/$1 redirect;
160 #rewrite ^/static/redundancy/(.*)$ $cdn/redundancy/$1 redirect;
161 #rewrite ^/static/streaming-playlists/(.*)$ $cdn/streaming-playlists/$1 redirect;
162
159 rewrite ^/static/webseed/(.*)$ /videos/$1 break; 163 rewrite ^/static/webseed/(.*)$ /videos/$1 break;
160 rewrite ^/static/redundancy/(.*)$ /redundancy/$1 break; 164 rewrite ^/static/redundancy/(.*)$ /redundancy/$1 break;
161 rewrite ^/static/streaming-playlists/(.*)$ /streaming-playlists/$1 break; 165 rewrite ^/static/streaming-playlists/(.*)$ /streaming-playlists/$1 break;
diff --git a/support/openapi/go/README.mustache b/support/openapi/go/README.mustache
new file mode 100644
index 000000000..d0fc0fa33
--- /dev/null
+++ b/support/openapi/go/README.mustache
@@ -0,0 +1,121 @@
1# Go API client for {{appName}}
2
3This Python package is automatically generated from [PeerTube's REST API](https://docs.joinpeertube.org/api-rest-reference.html),
4using the [OpenAPI Generator](https://openapi-generator.tech) project:
5
6- API version: {{appVersion}}
7- Package version: {{packageVersion}}
8{{^hideGenerationTimestamp}}
9- Build date: {{generatedDate}}
10{{/hideGenerationTimestamp}}
11- Build package: {{generatorClass}}
12
13{{#infoUrl}}
14For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
15{{/infoUrl}}
16
17## Installation
18
19Install the following dependencies:
20
21```shell
22go get github.com/stretchr/testify/assert
23go get golang.org/x/oauth2
24go get golang.org/x/net/context
25go get github.com/antihax/optional
26```
27
28Put the package under your project folder and add the following in import:
29
30```golang
31import "./{{packageName}}"
32```
33
34## Documentation for API Endpoints
35
36All URIs are relative to *{{basePath}}*
37
38Class | Method | HTTP request | Description
39------------ | ------------- | ------------- | -------------
40{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
41{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
42
43## Documentation For Models
44
45{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md)
46{{/model}}{{/models}}
47
48## Documentation For Authorization
49
50{{^authMethods}} Endpoints do not require authorization.
51{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}}
52{{#authMethods}}
53
54## {{{name}}}
55
56{{#isApiKey}}- **Type**: API key
57
58Example
59
60```golang
61auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
62 Key: "APIKEY",
63 Prefix: "Bearer", // Omit if not necessary.
64})
65r, err := client.Service.Operation(auth, args)
66```
67
68{{/isApiKey}}
69{{#isBasic}}- **Type**: HTTP basic authentication
70
71Example
72
73```golang
74auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
75 UserName: "username",
76 Password: "password",
77})
78r, err := client.Service.Operation(auth, args)
79```
80
81{{/isBasic}}
82{{#isOAuth}}
83
84- **Type**: OAuth
85- **Flow**: {{{flow}}}
86- **Authorization URL**: {{{authorizationUrl}}}
87- **Scopes**: {{^scopes}}N/A{{/scopes}}
88{{#scopes}} - **{{{scope}}}**: {{{description}}}
89{{/scopes}}
90
91Example
92
93```golang
94auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING")
95r, err := client.Service.Operation(auth, args)
96```
97
98Or via OAuth2 module to automatically refresh tokens and perform user authentication.
99
100```golang
101import "golang.org/x/oauth2"
102
103/* Perform OAuth2 round trip request and obtain a token */
104
105tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
106auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
107r, err := client.Service.Operation(auth, args)
108```
109
110{{/isOAuth}}
111{{/authMethods}}
112
113## License
114
115Copyright (C) 2015-2020 PeerTube Contributors
116
117This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
118
119This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
120
121You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses.
diff --git a/support/openapi/go/def.yaml b/support/openapi/go/def.yaml
new file mode 100644
index 000000000..7136da912
--- /dev/null
+++ b/support/openapi/go/def.yaml
@@ -0,0 +1,3 @@
1# https://openapi-generator.tech/docs/generators/go
2
3packageName: peertube
diff --git a/support/openapi/kotlin/README.mustache b/support/openapi/kotlin/README.mustache
new file mode 100644
index 000000000..ac7fbdea9
--- /dev/null
+++ b/support/openapi/kotlin/README.mustache
@@ -0,0 +1,97 @@
1# Kotlin API client for {{appName}}
2
3## Requires
4
5{{#jvm}}
6* Kotlin 1.3.41
7* Gradle 4.9
8{{/jvm}}
9{{#multiplatform}}
10* Kotlin 1.3.50
11{{/multiplatform}}
12
13## Build
14
15{{#jvm}}
16First, create the gradle wrapper script:
17
18```
19gradle wrapper
20```
21
22Then, run:
23
24{{/jvm}}
25```
26./gradlew check assemble
27```
28
29This runs all tests and packages the library.
30
31## Features/Implementation Notes
32
33{{#generateApiDocs}}
34<a name="documentation-for-api-endpoints"></a>
35## Documentation for API Endpoints
36
37All URIs are relative to *{{{basePath}}}*. Change it when instanciating `ApiClient(basePath)`.
38
39Class | Method | HTTP request | Description
40------------ | ------------- | ------------- | -------------
41{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}}
42{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
43{{/generateApiDocs}}
44
45{{#generateModelDocs}}
46<a name="documentation-for-models"></a>
47## Documentation for Models
48
49{{#modelPackage}}
50{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md)
51{{/model}}{{/models}}
52{{/modelPackage}}
53{{^modelPackage}}
54No model defined in this package
55{{/modelPackage}}
56{{/generateModelDocs}}
57
58<a name="documentation-for-authorization"></a>{{! TODO: optional documentation for authorization? }}
59## Documentation for Authorization
60
61{{^authMethods}}
62All endpoints do not require authorization.
63{{/authMethods}}
64{{#authMethods}}
65{{#last}}
66Authentication schemes defined for the API:
67{{/last}}
68{{/authMethods}}
69{{#authMethods}}
70<a name="{{name}}"></a>
71### {{name}}
72
73{{#isApiKey}}- **Type**: API key
74- **API key parameter name**: {{keyParamName}}
75- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
76{{/isApiKey}}
77{{#isBasic}}- **Type**: HTTP basic authentication
78{{/isBasic}}
79{{#isOAuth}}- **Type**: OAuth
80- **Flow**: {{flow}}
81- **Authorization URL**: {{authorizationUrl}}
82- **Scopes**: {{^scopes}}N/A{{/scopes}}
83{{#scopes}} - {{scope}}: {{description}}
84{{/scopes}}
85{{/isOAuth}}
86
87{{/authMethods}}
88
89## License
90
91Copyright (C) 2015-2020 PeerTube Contributors
92
93This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
94
95This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
96
97You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses.
diff --git a/support/openapi/kotlin/def.yaml b/support/openapi/kotlin/def.yaml
new file mode 100644
index 000000000..7a01ae6e5
--- /dev/null
+++ b/support/openapi/kotlin/def.yaml
@@ -0,0 +1,6 @@
1# https://openapi-generator.tech/docs/generators/kotlin
2
3artifactId: peertube-api
4groupId: org.peertube
5packageName: org.peertube.client
6
diff --git a/support/openapi/python/README.mustache b/support/openapi/python/README.mustache
new file mode 100644
index 000000000..93dcd5ab6
--- /dev/null
+++ b/support/openapi/python/README.mustache
@@ -0,0 +1,47 @@
1# Python API client for {{appName}}
2
3This Python package is automatically generated from [PeerTube's REST API](https://docs.joinpeertube.org/api-rest-reference.html),
4using the [OpenAPI Generator](https://openapi-generator.tech) project:
5
6- API version: {{appVersion}}
7- Package version: {{packageVersion}}
8{{^hideGenerationTimestamp}}
9- Build date: {{generatedDate}}
10{{/hideGenerationTimestamp}}
11- Build package: {{generatorClass}}
12
13{{#infoUrl}}
14For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
15{{/infoUrl}}
16
17## Requirements.
18
19Python 2.7 and 3.4+
20
21## Installation & Usage
22
23```sh
24pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git
25```
26(you may need to run `pip` with root permission: `sudo pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git`)
27
28Then import the package:
29```python
30import {{{packageName}}}
31```
32
33## Getting Started
34
35Please follow the [installation procedure](#installation--usage) and then run the following:
36
37{{> common_README }}
38
39## License
40
41Copyright (C) 2015-2020 PeerTube Contributors
42
43This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
44
45This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
46
47You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses.
diff --git a/support/openapi/python/def.yaml b/support/openapi/python/def.yaml
new file mode 100644
index 000000000..819a466eb
--- /dev/null
+++ b/support/openapi/python/def.yaml
@@ -0,0 +1,5 @@
1# https://openapi-generator.tech/docs/generators/python
2
3packageName: peertube
4projectName: peertube
5