diff options
Diffstat (limited to 'support/doc')
-rw-r--r-- | support/doc/api/openapi.yaml | 37 | ||||
-rw-r--r-- | support/doc/api/quickstart.md | 10 | ||||
-rw-r--r-- | support/doc/docker.md | 89 | ||||
-rw-r--r-- | support/doc/production.md | 2 | ||||
-rw-r--r-- | support/doc/tools.md | 32 |
5 files changed, 148 insertions, 22 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index f1cfb81a4..42430ba40 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml | |||
@@ -13,6 +13,7 @@ info: | |||
13 | altText: PeerTube Project Homepage | 13 | altText: PeerTube Project Homepage |
14 | description: | | 14 | description: | |
15 | # Introduction | 15 | # Introduction |
16 | |||
16 | The PeerTube API is built on HTTP(S). Our API is RESTful. It has predictable | 17 | The PeerTube API is built on HTTP(S). Our API is RESTful. It has predictable |
17 | resource URLs. It returns HTTP response codes to indicate errors. It also | 18 | resource URLs. It returns HTTP response codes to indicate errors. It also |
18 | accepts and returns JSON in the HTTP body. You can use your favorite | 19 | accepts and returns JSON in the HTTP body. You can use your favorite |
@@ -22,11 +23,13 @@ info: | |||
22 | which generates a client SDK in the language of your choice. | 23 | which generates a client SDK in the language of your choice. |
23 | 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. |
@@ -977,6 +980,12 @@ paths: | |||
977 | application/json: | 980 | application/json: |
978 | schema: | 981 | schema: |
979 | $ref: '#/components/schemas/VideoUploadResponse' | 982 | $ref: '#/components/schemas/VideoUploadResponse' |
983 | '403': | ||
984 | description: 'The user video quota is exceeded with this video.' | ||
985 | '408': | ||
986 | description: 'Upload has timed out' | ||
987 | '422': | ||
988 | description: 'Invalid input file.' | ||
980 | requestBody: | 989 | requestBody: |
981 | content: | 990 | content: |
982 | multipart/form-data: | 991 | multipart/form-data: |
@@ -2378,6 +2387,16 @@ components: | |||
2378 | type: string | 2387 | type: string |
2379 | css: | 2388 | css: |
2380 | type: string | 2389 | type: string |
2390 | search: | ||
2391 | type: object | ||
2392 | properties: | ||
2393 | remoteUri: | ||
2394 | type: object | ||
2395 | properties: | ||
2396 | users: | ||
2397 | type: boolean | ||
2398 | anonymous: | ||
2399 | type: boolean | ||
2381 | plugin: | 2400 | plugin: |
2382 | type: object | 2401 | type: object |
2383 | properties: | 2402 | properties: |
@@ -2423,6 +2442,11 @@ components: | |||
2423 | properties: | 2442 | properties: |
2424 | enabled: | 2443 | enabled: |
2425 | type: boolean | 2444 | type: boolean |
2445 | webtorrent: | ||
2446 | type: object | ||
2447 | properties: | ||
2448 | enabled: | ||
2449 | type: boolean | ||
2426 | enabledResolutions: | 2450 | enabledResolutions: |
2427 | type: array | 2451 | type: array |
2428 | items: | 2452 | items: |
@@ -2526,6 +2550,17 @@ components: | |||
2526 | properties: | 2550 | properties: |
2527 | enabled: | 2551 | enabled: |
2528 | type: boolean | 2552 | type: boolean |
2553 | followings: | ||
2554 | type: object | ||
2555 | properties: | ||
2556 | instance: | ||
2557 | type: object | ||
2558 | properties: | ||
2559 | autoFollowIndex: | ||
2560 | type: object | ||
2561 | properties: | ||
2562 | indexUrl: | ||
2563 | type: string | ||
2529 | ServerConfigAbout: | 2564 | ServerConfigAbout: |
2530 | properties: | 2565 | properties: |
2531 | instance: | 2566 | instance: |
@@ -2772,7 +2807,7 @@ components: | |||
2772 | description: 'The user username ' | 2807 | description: 'The user username ' |
2773 | password: | 2808 | password: |
2774 | type: string | 2809 | type: string |
2775 | description: 'The user password ' | 2810 | description: 'The user password. If the smtp server is configured, you can leave empty and an email will be sent ' |
2776 | email: | 2811 | email: |
2777 | type: string | 2812 | type: string |
2778 | description: 'The user email ' | 2813 | description: 'The user 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 | |||
64 | Other [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 d7059d285..2ee922b87 100644 --- a/support/doc/docker.md +++ b/support/doc/docker.md | |||
@@ -14,44 +14,95 @@ PeerTube needs a PostgreSQL and a Redis instance to work correctly. If you want | |||
14 | to quickly set up a full environment, either for trying the service or in | 14 | to quickly set up a full environment, either for trying the service or in |
15 | production, you can use a `docker-compose` setup. | 15 | production, you can use a `docker-compose` setup. |
16 | 16 | ||
17 | #### Go to your peertube workdir | ||
17 | ```shell | 18 | ```shell |
18 | $ cd /your/peertube/directory | 19 | cd /your/peertube/directory |
19 | $ mkdir ./docker-volume && mkdir ./docker-volume/traefik | ||
20 | $ curl "https://raw.githubusercontent.com/chocobozzz/PeerTube/master/support/docker/production/config/traefik.toml" > ./docker-volume/traefik/traefik.toml | ||
21 | $ touch ./docker-volume/traefik/acme.json && chmod 600 ./docker-volume/traefik/acme.json | ||
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 | ``` | 20 | ``` |
24 | View 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] | ||
25 | (https://github.com/Chocobozzz/PeerTube/blob/develop/support/docker/production/.env) | ||
26 | 21 | ||
27 | Update the reverse proxy configuration: | 22 | #### Create the reverse proxy configuration directory |
28 | 23 | ||
29 | ```shell | 24 | ```shell |
30 | $ vim ./docker-volume/traefik/traefik.toml | 25 | mkdir -p ./docker-volume/traefik |
31 | ``` | 26 | ``` |
32 | 27 | ||
33 | Tweak the `docker-compose.yml` file there according to your needs: | 28 | #### Get the latest reverse proxy configuration |
34 | 29 | ||
35 | ```shell | 30 | ```shell |
36 | $ vim ./docker-compose.yml | 31 | curl https://raw.github.com/chocobozzz/PeerTube/master/support/docker/production/config/traefik.toml > ./docker-volume/traefik/traefik.toml |
37 | ``` | 32 | ``` |
38 | 33 | ||
39 | Then tweak the `.env` file to change the environment variables: | 34 | View 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) |
35 | |||
36 | #### Create Let's Encrypt ACME certificates as JSON file | ||
40 | 37 | ||
41 | ```shell | 38 | ```shell |
42 | $ vim ./.env | 39 | touch ./docker-volume/traefik/acme.json |
43 | ``` | 40 | ``` |
44 | If you did not download the .env file above, here you can look at the variables that can be set: | 41 | Needs to have file mode 600: |
45 | https://github.com/Chocobozzz/PeerTube/blob/develop/support/docker/production/.env | 42 | ```shell |
43 | chmod 600 ./docker-volume/traefik/acme.json | ||
44 | ``` | ||
45 | |||
46 | #### Get the latest Compose file | ||
47 | |||
48 | ```shell | ||
49 | curl https://raw.github.com/chocobozzz/PeerTube/master/support/docker/production/docker-compose.yml > docker-compose.yml | ||
50 | ``` | ||
51 | |||
52 | View 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 | ||
58 | curl https://raw.github.com/Chocobozzz/PeerTube/master/support/docker/production/.env > .env | ||
59 | ``` | ||
60 | |||
61 | View 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 | ||
64 | |||
65 | ```shell | ||
66 | vim ./docker-volume/traefik/traefik.toml | ||
67 | ``` | ||
68 | |||
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 | |||
71 | More at: https://docs.traefik.io/v1.7 | ||
72 | |||
73 | #### Tweak the `docker-compose.yml` file there according to your needs | ||
74 | |||
75 | ```shell | ||
76 | vim ./docker-compose.yml | ||
77 | ``` | ||
78 | |||
79 | #### Then tweak the `.env` file to change the environment variables | ||
80 | |||
81 | ```shell | ||
82 | vim ./.env | ||
83 | ``` | ||
84 | In 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>` | ||
46 | 90 | ||
47 | Other environment variables are used in | 91 | Other environment variables are used in |
48 | `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 |
49 | intuited from usage. | 93 | intuited from usage. |
50 | 94 | ||
51 | You can use the regular `up` command to set it up: | 95 | #### Testing local Docker setup |
96 | |||
97 | To test locally your Docker setup, you must add your domain (`<MY DOMAIN>`) in `/etc/hosts`: | ||
98 | ``` | ||
99 | 127.0.0.1 localhost mydomain.tld | ||
100 | ``` | ||
101 | |||
102 | #### You can use the regular `up` command to set it up | ||
52 | 103 | ||
53 | ```shell | 104 | ```shell |
54 | $ docker-compose up | 105 | docker-compose up |
55 | ``` | 106 | ``` |
56 | ### Obtaining Your Automatically Generated Admin Credentials | 107 | ### Obtaining Your Automatically Generated Admin Credentials |
57 | Now that you've installed your PeerTube instance you'll want to grep your peertube container's logs for the `root` password. | 108 | Now that you've installed your PeerTube instance you'll want to grep your peertube container's logs for the `root` password. |
@@ -89,5 +140,5 @@ $ docker build . -f ./support/docker/production/Dockerfile.buster | |||
89 | 140 | ||
90 | ## Development | 141 | ## Development |
91 | 142 | ||
92 | We don't have a Docker image for development. See [the CONTRIBUTING guide](https://github.com/Chocobozzz/PeerTube/blob/develop/.github/CONTRIBUTING.md#develop) | 143 | We don't have a Docker image for development. See [the CONTRIBUTING guide](https://github.com/Chocobozzz/PeerTube/blob/master/.github/CONTRIBUTING.md#develop) |
93 | for more information on how you can hack PeerTube! | 144 | for more information on how you can hack PeerTube! |
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 | ||
45 | Then enable extensions PeerTube needs: | 45 | Then 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 | |||
207 | Manage (list/add/remove) video redundancies: | ||
208 | |||
209 | To list your videos that are duplicated by remote instances: | ||
210 | |||
211 | ``` | ||
212 | $ node dist/server/tools/peertube.js redundancy list-remote-redundancies | ||
213 | ``` | ||
214 | |||
215 | To list remote videos that your instance duplicated: | ||
216 | |||
217 | ``` | ||
218 | $ node dist/server/tools/peertube.js redundancy list-my-redundancies | ||
219 | ``` | ||
220 | |||
221 | To duplicate a specific video in your redundancy system: | ||
222 | |||
223 | ``` | ||
224 | $ node dist/server/tools/peertube.js redundancy add --video 823 | ||
225 | ``` | ||
226 | |||
227 | To 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 | ||
205 | These scripts should be run on the server, in `peertube-latest` directory. | 235 | These scripts should be run on the server, in `peertube-latest` directory. |