aboutsummaryrefslogtreecommitdiffhomepage
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/doc/api/openapi.yaml188
-rw-r--r--support/doc/api/quickstart.md12
-rw-r--r--support/doc/docker.md1
-rw-r--r--support/doc/production.md5
-rw-r--r--support/doc/redundancy.md52
-rw-r--r--support/doc/tools.md98
-rw-r--r--support/doc/user/decentralized.pngbin22099 -> 0 bytes
-rw-r--r--support/doc/user/decentralized.xml1
-rw-r--r--support/doc/user/redundancy.pngbin29641 -> 0 bytes
-rw-r--r--support/doc/user/redundancy.xml1
-rw-r--r--support/doc/user/watch-p2p.pngbin16838 -> 0 bytes
-rw-r--r--support/doc/user/watch-p2p.xml1
-rw-r--r--support/doc/user/watch-video.pngbin21543 -> 0 bytes
-rw-r--r--support/doc/user/watch-video.xml1
-rw-r--r--support/docker/production/.env2
-rw-r--r--support/docker/production/Dockerfile.stretch31
-rw-r--r--support/docker/production/config/production.yaml2
-rw-r--r--support/docker/production/config/traefik.toml3
-rw-r--r--support/docker/production/docker-compose.yml16
-rw-r--r--support/nginx/peertube21
-rw-r--r--support/systemd/peertube.service14
21 files changed, 289 insertions, 160 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml
index aa6be7e87..cb6ba9af5 100644
--- a/support/doc/api/openapi.yaml
+++ b/support/doc/api/openapi.yaml
@@ -1,7 +1,7 @@
1openapi: 3.0.0 1openapi: 3.0.0
2info: 2info:
3 title: PeerTube 3 title: PeerTube
4 version: 1.1.0-alpha.2 4 version: 1.1.0
5 contact: 5 contact:
6 name: PeerTube Community 6 name: PeerTube Community
7 url: 'https://joinpeertube.org' 7 url: 'https://joinpeertube.org'
@@ -433,7 +433,7 @@ paths:
433 parameters: 433 parameters:
434 - $ref: '#/components/parameters/start' 434 - $ref: '#/components/parameters/start'
435 - $ref: '#/components/parameters/count' 435 - $ref: '#/components/parameters/count'
436 - $ref: '#/components/parameters/sort' 436 - $ref: '#/components/parameters/usersSort'
437 responses: 437 responses:
438 '200': 438 '200':
439 description: successful operation 439 description: successful operation
@@ -622,15 +622,16 @@ paths:
622 tags: 622 tags:
623 - Video 623 - Video
624 parameters: 624 parameters:
625 - name: category 625 - $ref: '#/components/parameters/categoryOneOf'
626 in: query 626 - $ref: '#/components/parameters/tagsOneOf'
627 required: false 627 - $ref: '#/components/parameters/tagsAllOf'
628 description: category id of the video 628 - $ref: '#/components/parameters/licenceOneOf'
629 schema: 629 - $ref: '#/components/parameters/languageOneOf'
630 type: number 630 - $ref: '#/components/parameters/nsfw'
631 - $ref: '#/components/parameters/filter'
631 - $ref: '#/components/parameters/start' 632 - $ref: '#/components/parameters/start'
632 - $ref: '#/components/parameters/count' 633 - $ref: '#/components/parameters/count'
633 - $ref: '#/components/parameters/sort' 634 - $ref: '#/components/parameters/videosSort'
634 responses: 635 responses:
635 '200': 636 '200':
636 description: successful operation 637 description: successful operation
@@ -1002,7 +1003,7 @@ paths:
1002 parameters: 1003 parameters:
1003 - $ref: '#/components/parameters/start' 1004 - $ref: '#/components/parameters/start'
1004 - $ref: '#/components/parameters/count' 1005 - $ref: '#/components/parameters/count'
1005 - $ref: '#/components/parameters/sort' 1006 - $ref: '#/components/parameters/abusesSort'
1006 responses: 1007 responses:
1007 '200': 1008 '200':
1008 description: successful operation 1009 description: successful operation
@@ -1063,7 +1064,7 @@ paths:
1063 parameters: 1064 parameters:
1064 - $ref: '#/components/parameters/start' 1065 - $ref: '#/components/parameters/start'
1065 - $ref: '#/components/parameters/count' 1066 - $ref: '#/components/parameters/count'
1066 - $ref: '#/components/parameters/sort' 1067 - $ref: '#/components/parameters/blacklistsSort'
1067 responses: 1068 responses:
1068 '200': 1069 '200':
1069 description: successful operation 1070 description: successful operation
@@ -1271,7 +1272,7 @@ paths:
1271 parameters: 1272 parameters:
1272 - $ref: '#/components/parameters/start' 1273 - $ref: '#/components/parameters/start'
1273 - $ref: '#/components/parameters/count' 1274 - $ref: '#/components/parameters/count'
1274 - $ref: '#/components/parameters/sort' 1275 - $ref: '#/components/parameters/videosSearchSort'
1275 - name: search 1276 - name: search
1276 in: query 1277 in: query
1277 required: true 1278 required: true
@@ -1317,6 +1318,74 @@ components:
1317 description: Sort column (-createdAt for example) 1318 description: Sort column (-createdAt for example)
1318 schema: 1319 schema:
1319 type: string 1320 type: string
1321 videosSort:
1322 name: sort
1323 in: query
1324 required: false
1325 description: Sort videos by criteria
1326 schema:
1327 type: string
1328 enum:
1329 - -name
1330 - -duration
1331 - -createdAt
1332 - -publishedAt
1333 - -views
1334 - -likes
1335 - -trending
1336 videosSearchSort:
1337 name: sort
1338 in: query
1339 required: false
1340 description: Sort videos by criteria
1341 schema:
1342 type: string
1343 enum:
1344 - -name
1345 - -duration
1346 - -createdAt
1347 - -publishedAt
1348 - -views
1349 - -likes
1350 - -match
1351 blacklistsSort:
1352 name: sort
1353 in: query
1354 required: false
1355 description: Sort blacklists by criteria
1356 schema:
1357 type: string
1358 enum:
1359 - -id
1360 - -name
1361 - -duration
1362 - -views
1363 - -likes
1364 - -dislikes
1365 - -uuid
1366 - -createdAt
1367 usersSort:
1368 name: sort
1369 in: query
1370 required: false
1371 description: Sort users by criteria
1372 schema:
1373 type: string
1374 enum:
1375 - -id
1376 - -username
1377 - -createdAt
1378 abusesSort:
1379 name: sort
1380 in: query
1381 required: false
1382 description: Sort abuses by criteria
1383 schema:
1384 type: string
1385 enum:
1386 - -id
1387 - -createdAt
1388 - -state
1320 name: 1389 name:
1321 name: name 1390 name: name
1322 in: path 1391 in: path
@@ -1354,6 +1423,94 @@ components:
1354 description: The comment id 1423 description: The comment id
1355 schema: 1424 schema:
1356 type: number 1425 type: number
1426 categoryOneOf:
1427 name: categoryOneOf
1428 in: query
1429 required: false
1430 description: category id of the video
1431 schema:
1432 oneOf:
1433 - type: number
1434 - type: array
1435 items:
1436 type: number
1437 style: form
1438 explode: false
1439 tagsOneOf:
1440 name: tagsOneOf
1441 in: query
1442 required: false
1443 description: tag(s) of the video
1444 schema:
1445 oneOf:
1446 - type: string
1447 - type: array
1448 items:
1449 type: string
1450 style: form
1451 explode: false
1452 tagsAllOf:
1453 name: tagsAllOf
1454 in: query
1455 required: false
1456 description: tag(s) of the video, where all should be present in the video
1457 schema:
1458 oneOf:
1459 - type: string
1460 - type: array
1461 items:
1462 type: string
1463 style: form
1464 explode: false
1465 languageOneOf:
1466 name: languageOneOf
1467 in: query
1468 required: false
1469 description: language id of the video
1470 schema:
1471 oneOf:
1472 - type: string
1473 - type: array
1474 items:
1475 type: string
1476 style: form
1477 explode: false
1478 licenceOneOf:
1479 name: licenceOneOf
1480 in: query
1481 required: false
1482 description: licence id of the video
1483 schema:
1484 oneOf:
1485 - type: number
1486 - type: array
1487 items:
1488 type: number
1489 style: form
1490 explode: false
1491 nsfw:
1492 name: nsfw
1493 in: query
1494 required: false
1495 description: whether to include nsfw videos, if any
1496 schema:
1497 type: string
1498 enum:
1499 - 'true'
1500 - 'false'
1501 filter:
1502 name: filter
1503 in: query
1504 required: false
1505 description: >
1506 Special filters (local for instance) which might require special rights:
1507 * `local` - only videos local to the instance
1508 * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
1509 schema:
1510 type: string
1511 enum:
1512 - local
1513 - all-local
1357 requestBodies: 1514 requestBodies:
1358 VideoChannelInput: 1515 VideoChannelInput:
1359 content: 1516 content:
@@ -1741,7 +1898,12 @@ components:
1741 type: string 1898 type: string
1742 description: 'The user videoQuota ' 1899 description: 'The user videoQuota '
1743 role: 1900 role:
1744 type: string 1901 type: integer
1902 format: int32
1903 enum:
1904 - 0
1905 - 1
1906 - 2
1745 description: 'The user role ' 1907 description: 'The user role '
1746 required: 1908 required:
1747 - username 1909 - username
diff --git a/support/doc/api/quickstart.md b/support/doc/api/quickstart.md
index 6c19b59ee..00874a1c9 100644
--- a/support/doc/api/quickstart.md
+++ b/support/doc/api/quickstart.md
@@ -6,13 +6,13 @@
6 6
7Some endpoints need authentication. We use OAuth 2.0 so first fetch the client tokens: 7Some endpoints need authentication. We use OAuth 2.0 so first fetch the client tokens:
8 8
9``` 9```bash
10$ curl https://peertube.example.com/api/v1/oauth-clients/local 10$ curl https://peertube.example.com/api/v1/oauth-clients/local
11``` 11```
12 12
13Response example: 13Response example:
14 14
15``` 15```json
16{ 16{
17 "client_id": "v1ikx5hnfop4mdpnci8nsqh93c45rldf", 17 "client_id": "v1ikx5hnfop4mdpnci8nsqh93c45rldf",
18 "client_secret": "AjWiOapPltI6EnsWQwlFarRtLh4u8tDt" 18 "client_secret": "AjWiOapPltI6EnsWQwlFarRtLh4u8tDt"
@@ -23,7 +23,7 @@ Response example:
23 23
24Now you can fetch the user token: 24Now you can fetch the user token:
25 25
26``` 26```bash
27$ curl -X POST \ 27$ curl -X POST \
28 -d "client_id=v1ikx5hnfop4mdpnci8nsqh93c45rldf&client_secret=AjWiOapPltI6EnsWQwlFarRtLh4u8tDt&grant_type=password&response_type=code&username=your_user&password=your_password" \ 28 -d "client_id=v1ikx5hnfop4mdpnci8nsqh93c45rldf&client_secret=AjWiOapPltI6EnsWQwlFarRtLh4u8tDt&grant_type=password&response_type=code&username=your_user&password=your_password" \
29 https://peertube.example.com/api/v1/users/token 29 https://peertube.example.com/api/v1/users/token
@@ -31,7 +31,7 @@ $ curl -X POST \
31 31
32Response example: 32Response example:
33 33
34``` 34```json
35{ 35{
36 "access_token": "90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0", 36 "access_token": "90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0",
37 "token_type": "Bearer", 37 "token_type": "Bearer",
@@ -42,13 +42,13 @@ Response example:
42 42
43Just use the `access_token` in the `Authorization` header: 43Just use the `access_token` in the `Authorization` header:
44 44
45``` 45```bash
46$ curl -H 'Authorization: Bearer 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0' https://peertube.example.com/api/v1/jobs/completed 46$ curl -H 'Authorization: Bearer 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0' https://peertube.example.com/api/v1/jobs/completed
47``` 47```
48 48
49 49
50### List videos 50### List videos
51 51
52``` 52```bash
53$ curl https://peertube.example.com/api/v1/videos 53$ curl https://peertube.example.com/api/v1/videos
54``` 54```
diff --git a/support/doc/docker.md b/support/doc/docker.md
index cab336344..c20746486 100644
--- a/support/doc/docker.md
+++ b/support/doc/docker.md
@@ -63,7 +63,6 @@ Pull the latest images and rerun PeerTube:
63 63
64```shell 64```shell
65$ cd /your/peertube/directory 65$ cd /your/peertube/directory
66$ docker-compose down
67$ docker-compose pull 66$ docker-compose pull
68$ docker-compose up -d 67$ docker-compose up -d
69``` 68```
diff --git a/support/doc/production.md b/support/doc/production.md
index 35c7de3b5..16efe17c4 100644
--- a/support/doc/production.md
+++ b/support/doc/production.md
@@ -185,9 +185,8 @@ $ sudo journalctl -feu peertube
185On FreeBSD, copy the startup script and update rc.conf: 185On FreeBSD, copy the startup script and update rc.conf:
186 186
187``` 187```
188$ sudo cp /var/www/peertube/peertube-latest/support/freebsd/peertube /usr/local/etc/rc.d/ 188$ sudo install -m 0555 /var/www/peertube/peertube-latest/support/freebsd/peertube /usr/local/etc/rc.d/
189$ sudo chmod +x /usr/local/etc/rc.d/peertube 189$ sudo sysrc peertube_enable="YES"
190$ sudo echo peertube_enable="YES" >> /etc/rc.conf
191``` 190```
192 191
193Run: 192Run:
diff --git a/support/doc/redundancy.md b/support/doc/redundancy.md
deleted file mode 100644
index 00442fd85..000000000
--- a/support/doc/redundancy.md
+++ /dev/null
@@ -1,52 +0,0 @@
1# Redundancy
2
3A PeerTube instance can cache other PeerTube videos to improve bandwidth of popular videos or small instances.
4
5## How it works
6
7The instance administrator can choose between multiple redundancy strategies (cache trending videos or recently uploaded videos etc), set their maximum size and the minimum duplication lifetime.
8Then, they choose the instances they want to cache in `Manage follows -> Following` admin table.
9
10<p align="center">
11
12<img src="user/redundancy.png" alt="Redundancy" />
13
14</p>
15
16Videos are kept in the cache for at least `min_lifetime`, and then evicted when the cache is full.
17
18When PeerTube chooses a video to duplicate, it imports all the resolution files (to avoid consistency issues) using their magnet URI and put them in the `storage.videos` directory.
19Then it sends a `Create -> CacheFile` ActivityPub message to other federated instances. This new instance is injected as [WebSeed](https://github.com/Chocobozzz/PeerTube/blob/develop/FAQ.md#what-is-webseed) in the magnet URI by instances that received this ActivityPub message.
20
21## Stats
22
23See the `/api/v1/server/stats` endpoint. For example:
24
25```
26{
27 ...
28 "videosRedundancy": [
29 {
30 "totalUsed": 0,
31 "totalVideos": 0,
32 "totalVideoFiles": 0,
33 "strategy": "most-views",
34 "totalSize": 104857600
35 },
36 {
37 "totalUsed": 0,
38 "totalVideos": 0,
39 "totalVideoFiles": 0,
40 "strategy": "trending",
41 "totalSize": 104857600
42 },
43 {
44 "totalUsed": 0,
45 "totalVideos": 0,
46 "totalVideoFiles": 0,
47 "strategy": "recently-added",
48 "totalSize": 104857600
49 }
50 ]
51}
52```
diff --git a/support/doc/tools.md b/support/doc/tools.md
index 1c7739525..4f806a9db 100644
--- a/support/doc/tools.md
+++ b/support/doc/tools.md
@@ -4,13 +4,13 @@
4<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> 4<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
5**Table of Contents** 5**Table of Contents**
6 6
7- [CLI wrapper](#cli-wrapper)
8- [Remote Tools](#remote-tools) 7- [Remote Tools](#remote-tools)
9 - [Dependencies](#dependencies) 8 - [Dependencies](#dependencies)
10 - [Installation](#installation) 9 - [Installation](#installation)
11 - [peertube-import-videos.js](#peertube-import-videosjs) 10 - [CLI wrapper](#cli-wrapper)
12 - [peertube-upload.js](#peertube-uploadjs) 11 - [peertube-import-videos.js](#peertube-import-videosjs)
13 - [peertube-watch.js](#peertube-watchjs) 12 - [peertube-upload.js](#peertube-uploadjs)
13 - [peertube-watch.js](#peertube-watchjs)
14- [Server tools](#server-tools) 14- [Server tools](#server-tools)
15 - [parse-log](#parse-log) 15 - [parse-log](#parse-log)
16 - [create-transcoding-job.js](#create-transcoding-jobjs) 16 - [create-transcoding-job.js](#create-transcoding-jobjs)
@@ -26,9 +26,40 @@
26 26
27<!-- END doctoc generated TOC please keep comment here to allow auto update --> 27<!-- END doctoc generated TOC please keep comment here to allow auto update -->
28 28
29## CLI wrapper 29## Remote Tools
30
31You need at least 512MB RAM to run the script.
32Scripts can be launched directly from a PeerTube server, or from a separate server, even a desktop PC.
33You need to follow all the following steps even if you are on a PeerTube server (including cloning the git repository in a different directory than your production installation because the scripts utilize non-production dependencies).
34
35### Dependencies
36
37Install the [PeerTube dependencies](dependencies.md).
38
39### Installation
40
41Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server):
42
43```
44$ git clone https://github.com/Chocobozzz/PeerTube.git
45$ CLONE="$(pwd)/PeerTube"
46```
47
48Run ``yarn install --pure-lockfile``
49```
50$ cd ${CLONE}
51$ yarn install --pure-lockfile
52```
53
54Build server tools:
55```
56$ cd ${CLONE}
57$ npm run build:server
58```
59
60### CLI wrapper
30 61
31The wrapper provides a convenient interface to most scripts, and requires the [same dependencies](#dependencies). You can access it as `peertube` via an alias in your `.bashrc` like `alias peertube="node ${PEERTUBE_PATH}/dist/server/tools/peertube.js"`: 62The wrapper provides a convenient interface to the following scripts. You can access it as `peertube` via an alias in your `.bashrc` like `alias peertube="node /your/peertube/directory/dist/server/tools/peertube.js"`:
32 63
33``` 64```
34 Usage: peertube [command] [options] 65 Usage: peertube [command] [options]
@@ -51,12 +82,12 @@ The wrapper provides a convenient interface to most scripts, and requires the [s
51The wrapper can keep track of instances you have an account on. We limit to one account per instance for now. 82The wrapper can keep track of instances you have an account on. We limit to one account per instance for now.
52 83
53```bash 84```bash
54$ peertube auth add -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD" 85$ peertube auth add -u 'PEERTUBE_URL' -U 'PEERTUBE_USER' --password 'PEERTUBE_PASSWORD'
55$ peertube auth list 86$ peertube auth list
56┌──────────────────────────────┬──────────────────────────────┐ 87┌──────────────────────────────┬──────────────────────────────┐
57│ instance │ login │ 88│ instance │ login │
58├──────────────────────────────┼──────────────────────────────┤ 89├──────────────────────────────┼──────────────────────────────┤
59"PEERTUBE_URL""PEERTUBE_USER" 90'PEERTUBE_URL''PEERTUBE_USER'
60└──────────────────────────────┴──────────────────────────────┘ 91└──────────────────────────────┴──────────────────────────────┘
61``` 92```
62 93
@@ -72,53 +103,22 @@ And now that your video is online, you can watch it from the confort of your ter
72$ peertube watch https://peertube.cpy.re/videos/watch/e8a1af4e-414a-4d58-bfe6-2146eed06d10 103$ peertube watch https://peertube.cpy.re/videos/watch/e8a1af4e-414a-4d58-bfe6-2146eed06d10
73``` 104```
74 105
75## Remote Tools 106#### peertube-import-videos.js
76
77You need at least 512MB RAM to run the script.
78Scripts can be launched directly from a PeerTube server, or from a separate server, even a desktop PC.
79You need to follow all the following steps even if you are on a PeerTube server (including cloning the git repository in a different directory than your production installation because the scripts utilize non-production dependencies).
80
81### Dependencies
82
83Install the [PeerTube dependencies](dependencies.md).
84
85### Installation
86
87Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server):
88
89```
90$ git clone https://github.com/Chocobozzz/PeerTube.git
91$ CLONE="$(pwd)/PeerTube"
92```
93
94Run ``yarn install``
95```
96$ cd ${CLONE}
97$ yarn install
98```
99
100Build server tools:
101```
102$ cd ${CLONE}
103$ npm run build:server
104```
105
106### peertube-import-videos.js
107 107
108You can use this script to import videos from all [supported sites of youtube-dl](https://rg3.github.io/youtube-dl/supportedsites.html) into PeerTube. 108You can use this script to import videos from all [supported sites of youtube-dl](https://rg3.github.io/youtube-dl/supportedsites.html) into PeerTube.
109Be sure you own the videos or have the author's authorization to do so. 109Be sure you own the videos or have the author's authorization to do so.
110 110
111```sh 111```sh
112$ node dist/server/tools/peertube-import-videos.js \ 112$ node dist/server/tools/peertube-import-videos.js \
113 -u "PEERTUBE_URL" \ 113 -u 'PEERTUBE_URL' \
114 -U "PEERTUBE_USER" \ 114 -U 'PEERTUBE_USER' \
115 --password "PEERTUBE_PASSWORD" \ 115 --password 'PEERTUBE_PASSWORD' \
116 -t "TARGET_URL" 116 -t 'TARGET_URL'
117``` 117```
118 118
119* `PEERTUBE_URL` : the full URL of your PeerTube server where you want to import, eg: https://peertube.cpy.re 119* `PEERTUBE_URL` : the full URL of your PeerTube server where you want to import, eg: https://peertube.cpy.re
120* `PEERTUBE_USER` : your PeerTube account where videos will be uploaded 120* `PEERTUBE_USER` : your PeerTube account where videos will be uploaded
121* `PEERTUBE_PASSWORD` : password of your PeerTube account (if omitted, you will be prompted for it) 121* `PEERTUBE_PASSWORD` : password of your PeerTube account (if `PEERTUBE_PASSWORD` is omitted, you will be prompted for it)
122* `TARGET_URL` : the target url you want to import. Examples: 122* `TARGET_URL` : the target url you want to import. Examples:
123 * YouTube: 123 * YouTube:
124 * Channel: https://www.youtube.com/channel/ChannelId 124 * Channel: https://www.youtube.com/channel/ChannelId
@@ -133,7 +133,7 @@ Already downloaded videos will not be uploaded twice, so you can run and re-run
133Videos will be publicly available after transcoding (you can see them before that in your account on the web interface). 133Videos will be publicly available after transcoding (you can see them before that in your account on the web interface).
134 134
135 135
136### peertube-upload.js 136#### peertube-upload.js
137 137
138You can use this script to import videos directly from the CLI. 138You can use this script to import videos directly from the CLI.
139 139
@@ -144,7 +144,7 @@ $ cd ${CLONE}
144$ node dist/server/tools/peertube-upload.js --help 144$ node dist/server/tools/peertube-upload.js --help
145``` 145```
146 146
147### peertube-watch.js 147#### peertube-watch.js
148 148
149You can use this script to play videos directly from the CLI. 149You can use this script to play videos directly from the CLI.
150 150
@@ -198,10 +198,10 @@ $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production
198### prune-storage.js 198### prune-storage.js
199 199
200Some transcoded videos or shutdown at a bad time can leave some unused files on your storage. 200Some transcoded videos or shutdown at a bad time can leave some unused files on your storage.
201To delete them (a confirmation will be demanded first): 201Stop PeerTube and delete these files (a confirmation will be demanded first):
202 202
203``` 203```
204$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run prune-storage 204$ sudo systemctl stop peertube && sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run prune-storage
205``` 205```
206 206
207### optimize-old-videos.js 207### optimize-old-videos.js
diff --git a/support/doc/user/decentralized.png b/support/doc/user/decentralized.png
deleted file mode 100644
index 8c23e2832..000000000
--- a/support/doc/user/decentralized.png
+++ /dev/null
Binary files differ
diff --git a/support/doc/user/decentralized.xml b/support/doc/user/decentralized.xml
deleted file mode 100644
index 952b9f4e7..000000000
--- a/support/doc/user/decentralized.xml
+++ /dev/null
@@ -1 +0,0 @@
1<mxfile userAgent="Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0" version="9.1.8" editor="www.draw.io" type="device"><diagram id="2f5eda5b-dbab-6be5-4dc5-833b4d942388" name="Page-1">7Vptb9owEP41kdYPQ4lNAv24vm37sGkaq7p9NMlBooaYOaZAf/3sxM6rw2gVKFuL1Co+n8/O85zvzgYLXy42HxlZhl9oALGF7GBj4SsLoRGyxX8p2OaC4VAJ5iwKcpFTCibRIyihVltFAaQ1RU5pzKNlXejTJAGf12SEMbquq81oXJ91SebQEkx8Ereld1HAw1w6du1S/gmieahndmzVMyX+/ZzRVaLmsxCeZZ+8e0G0LaWfhiSg64oIX1v4klHK86fF5hJiCa2GLR9309FbrJtBwvcZMM4HPJB4BXrF2br4VmORvQ1IfdvCF+sw4jBZEl/2rgX5QhbyRSxajnhMOaP3cEljyrLR2M4+RY9GU+rOojiuaM5m4Pm+lNOEmyyQOJonQuaLdwPRedF+WfX+D8A4bCoi9fIfgS6As61Q0b2eGqIdVRO5Lml3NVlhlXJPCYlytXlhu4RbPCjEzeiPTgf9gMB49tLoj/cEH6MewMct8CfAxNqFbBcNzuFoSGgCR2bAdeoMOAb/d0wU9OH+w24G8KthANkvyIDXYuA2lfj3iv0YTbHn7RWEXBgHwyMTgJspwDsiAbrg2ZUCIAk+yJqm9M+UE8a1zI9Jmkb+8zYA2gG2gJRtf6rMkzV+ycbAlc1NxH/WWr+KmcXabqJYr0SsXrXsXXyldMV8qMUFYWgOSkuhAkGtbmtzWs0cBsq0jEFMePRQr/ZMPKoZvtFIrLczb3m44Qr526hR1fKrYQg1wq87bhjKMWgZEtyTbUVtKRXS7gWjxoKxUysLxUNusfTZAtP93FjvulN2Y+cpbvwMt8Vvbtuz27qjw7ot6i5ANL//fwHSzH+mKvxw+a9dA+4KHEfIdXkk0GHC6QwSO8PCiWz4od1R2jx1wzcN4eF+G/45e7Jdk1rIiwUwF0H0IB7nPEM+F021AA+0SEwwLdXsiXCfVNqLAqBynmRG2UKgSpO0MsRguyJ695UswEJi8fYPyjK6kX37/fNgMDiz5N4w2+nvLF9kzBMLHkPPqzmGc94OHucHih3G65OGW6But1CBPuWUgXQQkgSyCZC5Cw+h4jTv7mA6ET1nr4JTXOcU43E7IbjDA5FqupFskOp0kZofXu3VMqYkY5GIvwTWJZP/P3toVGfPdKPpOAfakth0nH0L3v+IqxwzeGPTiTEnQkJQw977vaK6432afVn0QZbo3nJTdmriLoh/DzKUF6zm9l4PrZ7e3Tp+6xxdoXVkulXvg9b2rXo/tN4wofXG698i+8F4NZ3TnsYrcky8XoGEiAm8HiHIsjVfU3ZfpAjWDOyvkPgiCOsTepv3Iib3HqddA/F/vdk7idN5x/Xi7gvqgKRhcckjG98IF0QmmUReC2lGG0d8A8UvdupHzsCtR4pnn/tbpvo7+Ytm+TuHXL38LQm+/gM=</diagram></mxfile> \ No newline at end of file
diff --git a/support/doc/user/redundancy.png b/support/doc/user/redundancy.png
deleted file mode 100644
index 0184fb78e..000000000
--- a/support/doc/user/redundancy.png
+++ /dev/null
Binary files differ
diff --git a/support/doc/user/redundancy.xml b/support/doc/user/redundancy.xml
deleted file mode 100644
index c501b63d5..000000000
--- a/support/doc/user/redundancy.xml
+++ /dev/null
@@ -1 +0,0 @@
1<mxfile userAgent="Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0" version="9.1.8" editor="www.draw.io" type="device"><diagram id="2f5eda5b-dbab-6be5-4dc5-833b4d942388" name="Page-1">7Vpbc5s4FP41zLQP8YAE2HmM3aa7D7vTadpp+yiDMJpg5AU5tvfXrwQSFyG8xMWJJ25m2jFHQpfzHX3nIiy4WO8/ZWgT/0VDnFjADvcW/GABMJva/H8hOJQC15WCVUbCUuTUggfyL5ZC1W1LQpy3OjJKE0Y2bWFA0xQHrCVDWUZ37W4RTdqzbtAKdwQPAUq60u8kZLHclmfX8j8wWcVqZseWLUsUPK4yuk3lfBaAUfFXNq+RGkv2z2MU0l1DBD9acJFRyspf6/0CJ0K1Sm3le/c9rdW6M5yyIS/MyheeULLFasXFuthB6aLYDRb9bQvOdzFh+GGDAtG64+BzWczWCX9y+M+cZfQRL2hCs+JtaBd/VYvSpugbkSRp9Iwi7AeBkNOUmUZACVmlXBbwvWHeOO9uVu7/CWcM7xsiuflPmK4xyw68i2r15SvKUBWQuxp2T4EVNyH3pRBJU1tVY9fq5j+kxs3an16O9kOEZ9Fra382UPkQjKB82FH+A8742rnsGAzO+WBIaYpfGAHPaSPgGOzfMUEwhvm7/QjAq0EA2K+IgN9B4Fsu9D+q7mdgCX1/EAl5eBa6LwwA1F2A/4IAqIDnmAvAaXgnYpraPnOGMqZkQYLynASnHQBwRNlcpdnhh/Q8xcNP8TDxxOOesB+tp59yZr7aeyL2W7zWi09Ot1mAWzzAN7XCspfUAg5bcVoXw6anMECkZBlOECNP7ejOhJuc4TMlfL29fsqHGvTlbuRbzXBLGwhodOvNtIFKHXQG4lijQ6PbRnTI+xcMtAVDpxUG8h/liLWNVjodZrbqlF2y2TrPMdtibdJwTzRj+NuMRzZjb3peMwb9AYjC9+0HILr/M0Xh5/N/3RjwGJG8gK+bAK/JG06LNUCTNgYTg3/pxOA6fssEXB3aocSgDwTdYcRwytntxq4W8BOumHlInvjPFSvwKUVLJYATJeITLOtudnXyc25vuRiYhJiKCdOIZmuuXprmjXcNkzRE7/5Ga2wBvgv7K80K6wD2ty9/TiaT98IUxMARTRK6I+mqmFTMXo2/zPSx9RnHKxNUzvnSeMmdcS/dYiaVFjaZyYXnYSZjcUYzJjDAmHBhTCzGDZN69x0vH3jL+2vA0YUaJ8DZy/kXY4FTQ9HpQ7HMhe3tJqGoQBHxfyne1Ui+ffTArW1m9AZ6tybPdPvr4EFTllEiJVTQ0r3/z5aqhpu8uFC4E2Gcv9nXjQrbOQoeOcs3YC/Hux5y9R0NVt/vwDo1wKpnDCfB2q28jgPrfcZ7/ca1FckZqolnw9UUyz8PV+CYcP2CQw4USoPD0fjo2rDWqRl0oa586Nh+FXonRd9un6u9N8TCwiKuNvgFbWyNtwImvzvKzdiAe8lude98Gfm0k5GHKI+rUox4+IwY131aSETxxlxs/BqT1Dq51tfM36ULu5T8XbOW0/N3qBXcvGH5+7MLexp1qe9Dxirswf6wv0EkCxSItGxgSi9ztoGcxM85ax+KDHM/h5ZFB2FnUke8tze3vA8mIhF8QQKU3MmGNQlD8f48QUuczKtvTTSi6lpwdaJ1Aqo+oZELs5qfoZiIyZ44vj9tgXfjjGLE0NfS/Zsq/1eD0CjK8a8WjuDtZbFbt974Kuz21qgMaFTW+WBnrKs297xUpoY/I5U9u9p4YeSmDvQFk9sN1IcFZ6A296Rr2ZGpreeW9zgtDaC8QXEZeJtk5qo6ZlWF08xnvHsV938yO1sd5DpPT3DEuln7De8b0l0qiqeWrJgWpXBaKDvZWGV5fDgLnbqKlDISCdTLKjzNyIp7SpVoCmuISRCLQUNVrF+XuuUMUhKrLSmz9wboClJSCNoOVd3dNlPS6W3/YXpGSsof62+gSyOuvzOHH/8D</diagram></mxfile> \ No newline at end of file
diff --git a/support/doc/user/watch-p2p.png b/support/doc/user/watch-p2p.png
deleted file mode 100644
index 873309434..000000000
--- a/support/doc/user/watch-p2p.png
+++ /dev/null
Binary files differ
diff --git a/support/doc/user/watch-p2p.xml b/support/doc/user/watch-p2p.xml
deleted file mode 100644
index 7f2cdb627..000000000
--- a/support/doc/user/watch-p2p.xml
+++ /dev/null
@@ -1 +0,0 @@
1<mxfile userAgent="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0" version="9.1.0" editor="www.draw.io" type="device"><diagram id="cb5ce52d-ab91-b6cb-bd1a-da918a399df8" name="Page-1">7VpLc5swEP41nmkO7YAEmB5jN2kvncnU6aQ5yrA2TDByhfzqr68EEpiHiRNjx23sQ5BWK2l3v88rsXEPD2frr4zMg+/Uh6iHDH/dw196CJkWssRDSjaZpG+bmWDKQl8pFYJR+AeU0FDSRehDUlLklEY8nJeFHo1j8HhJRhijq7LahEblXedkCjXByCNRXfoQ+jzIpK5tFPJvEE4DvbNpqJEx8Z6mjC5itV8P4Un6yYZnRK+l9JOA+HS1JcI3PTxklPKsNVsPIZKx1WHL5t3uGM3tZhDzfSYonJYkWoC2OLWLb3QsUm9A6hs9PFgFIYfRnHhydCXQF7KAzyLRM0Uz4Yw+wZBGlKWzsZF+8hEdTak7CaNoS3MyAcfzpJzGvGkFEoXTWMg84RuIwYGyHRiH9U7/zTyqgq1AZ8DZRqjoCY6aoohqaSBXBey2BivYgjxHkCiqTfO1i3CLhop4c/Tt84m+T8CdvHX0Rfj3i77pdBB9txb9n4nwDBm4BQXzFSi4aIwdZy8UbHB968Qo2KjyHbDrKJhNKHQBgmnWUBgBW6Y4mB3jsOe3IaYxnBgCXP0iOKeEoCkNORFXMSgh4PxeUD3wMUnP7WuJlDNfF4OiNZXPgTgMQZyEajFhR7ZeNtplqlOQnR2ujr7QbDTOTg3XfgOsuAtYnSPBesuE1gXX564Nx8IV1TOmOrfabg//4blVTZonPbf0Va2OQten1pmjkDv8JijscYMWmepavhJKvyOSJKGXxpIwXhe/4vaAWuItQsg2v2Ti+yQsVf1HtQGsQ56N2ar3qFJk5gL4tXfUCibCTbpgHpQZKTybQv5i2ozd9v26ARotYxARHi7LZjThpXa4o2F6sOTX+3KWdKrpLzNfzdp+S60shCrp1nYrC2U+1xYSAJPNltpcKiS7DUaVjIJdo9Uu/LlVXzQyCwou5xjsR++mI/ws6X18dusy0IXdpeT4QkL1/xVC9Y/OKPdCqAPTpe2+LF1a9pHTZb2ic6bs3pPcZqfpMovGhd17stuqlMVsq53dqOJgRf9wdn++sLuF3e5bkttCFezNsyd3K1mfTfVdk1sngwu5m+4ll8x90L3k+cx9ZHLXK3YvrsTipkrsA+FeAIkMjSzHGgmAL3s8ANkjM/lYhj5Q8fzwAOORUOghYbAhOj/uh1l7EPJ7yiQpr7RdY1aUc99tlRdbFb42lbaayrxdlLYwPhJpRiWSVNlx9Y7xzkv2+v1EL3GKUiY+/N81yNyZJKRxBdo7EO5iN+lRLP7cobv3zKRKYdB065kjZ82BTBLd4vdC2elU/CgL3/wF</diagram></mxfile> \ No newline at end of file
diff --git a/support/doc/user/watch-video.png b/support/doc/user/watch-video.png
deleted file mode 100644
index 8744c793c..000000000
--- a/support/doc/user/watch-video.png
+++ /dev/null
Binary files differ
diff --git a/support/doc/user/watch-video.xml b/support/doc/user/watch-video.xml
deleted file mode 100644
index e2b46aa8b..000000000
--- a/support/doc/user/watch-video.xml
+++ /dev/null
@@ -1 +0,0 @@
1<mxfile userAgent="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0" version="9.1.0" editor="www.draw.io" type="device"><diagram id="067b0f1f-1608-c9cb-8da6-67e6cbc055e3" name="Page-1">7Vpbc5s6EP41PNYDEmD8mKRN25l2pnPcTk4fZVgDE4xcgWP7/PojgYSRgNTxJUnr+CERq+t+37IX2Ra+WWw+MrJMvtIIMgvZ0cbC7y2EHBe5/J+QbGvJ2HNqQczSSA7aCabpfyCFtpSu0ggKbWBJaVamS10Y0jyHsNRkhDG61ofNaabvuiQxdATTkGRd6V0alUktDTx7J/8EaZyonR1b9sxIeB8zusrlfhbC8+pTdy+IWkuOLxIS0XVLhD9Y+IZRWtatxeYGMoGtgq2edzvQ25ybQV7uMwHVEx5ItgJ14upc5VZhUWkDYrxt4et1kpYwXZJQ9K45+1yWlIuMPzm8WZSM3sMNzSirZmO7+jQ9Ck0xdp5mWWvkfA5+GAo5zcu+FUiWxjmXhVw34J3X8uzAStgM6u80qHJrBbqAkm35EDXBl1OkobqKyPWOdk+RlbQp96WQSFOLm7V3cPOGRLwfffx60I8IBPOXRj/YE3yMTgC+2wF/Coyrw2WP0eCcj4ac5vDMDHiOzoDTY/9OHwWnMH9vmAF8MQwg+wUZ8DsM/CgE/ifFPkAz7Pt7OSEPgsh9ZgKwGQL8ZyRg/PsIAHl0JVIaoXZGiiINKygJK7viA14B9AjcHEG2/VfGnurhp3gYeeJxk5ZV12isHn/KrWsVIDJyrIKuWAjaq8+1iEHCOdmbuHZ46OFFyRhkpEwf9EP0kSV3+EZTvvFgcPKxwXetj5zVzrGMhZDhY73AWKhGobMQp5dsW8OWYkAxfGA0sbV9sKPlfrxRr7gzzAbTvWw1+DNs1XnMVtEBtuq+2erJbdVz9X1ObauT4dRCMfz3pxZmZOvLr88W2VQp/we6i8N8gvfmE/SFDnht1U5PNpqzJT4yYigDcYajib2f5fivP5pgI5FwTX+wr+Xgia97efd8ltMt5y3kZxyY6xlvxKLhjJSIr9ZI+aSr4t4St4QiPBCxSBoBtZo7upPcxkj///qChGOQ3VN/BueKEd36UzEkINCw93+tqOp4V1Q3xlcimvvLza5TcXpNwnvuJ1p01+spxv9+Wn2DVlGBm7SO+67WTkFrX1V7ClpvGR/1xuvvXtez8XpoBXi+6DzWorN90L1EB3w9YE+6Adt/2bxOt4Aj8jp9oXPmdd16rBOd0VB0/p6AwJ+yiiZk//jns1i6qAK0TxbiPa7mjUajRnAxDsE1zKHJsZ4hfqsM6dU6hHa67rS8gUzdB0rNSnybZuqIXIXW02FepCftdy/aizz1xsg3vidxx55hqsfdGKG+0tNwUXjART0xt3H7cpvOZrV76+x2R8owgaJVpZQJd2txwlt3MJsCDKdHtThKH44/5nHKwmIGkXDEHP+84HoIQ8j5n0/fv37x2rqRuAGGmWcY0I+LKxUvJyl0A73OdgPciQFOnzM5SRDofo37VCNBTp+RVJYuK/JiCWE65965MY2LrQDMr3lQN943vB7JNX/c/RSp9qm733vhD/8D</diagram></mxfile> \ No newline at end of file
diff --git a/support/docker/production/.env b/support/docker/production/.env
index 4a649d655..f27def3b4 100644
--- a/support/docker/production/.env
+++ b/support/docker/production/.env
@@ -9,7 +9,7 @@ PEERTUBE_TRUST_PROXY=["127.0.0.1"]
9#PEERTUBE_TRUST_PROXY=["127.0.0.1", "loopback", "192.168.1.0/24"] 9#PEERTUBE_TRUST_PROXY=["127.0.0.1", "loopback", "192.168.1.0/24"]
10PEERTUBE_SMTP_USERNAME= 10PEERTUBE_SMTP_USERNAME=
11PEERTUBE_SMTP_PASSWORD= 11PEERTUBE_SMTP_PASSWORD=
12PEERTUBE_SMTP_HOSTNAME= 12PEERTUBE_SMTP_HOSTNAME=postfix
13PEERTUBE_SMTP_PORT=25 13PEERTUBE_SMTP_PORT=25
14PEERTUBE_SMTP_FROM=noreply@domain.tld 14PEERTUBE_SMTP_FROM=noreply@domain.tld
15PEERTUBE_SMTP_TLS=true 15PEERTUBE_SMTP_TLS=true
diff --git a/support/docker/production/Dockerfile.stretch b/support/docker/production/Dockerfile.stretch
index 911d064f6..81468bb4f 100644
--- a/support/docker/production/Dockerfile.stretch
+++ b/support/docker/production/Dockerfile.stretch
@@ -20,32 +20,11 @@ RUN groupadd -r peertube \
20 && useradd -r -g peertube -m peertube 20 && useradd -r -g peertube -m peertube
21 21
22# grab gosu for easy step-down from root 22# grab gosu for easy step-down from root
23# https://github.com/tianon/gosu/releases 23RUN set -eux; \
24ENV GOSU_VERSION 1.10 24 apt-get update; \
25RUN set -ex; \ 25 apt-get install -y gosu; \
26 \ 26 rm -rf /var/lib/apt/lists/*; \
27 fetchDeps='ca-certificates wget'; \ 27 gosu nobody true
28 apt-get update; \
29 apt-get install -y --no-install-recommends $fetchDeps; \
30 rm -rf /var/lib/apt/lists/*; \
31 \
32 dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
33 wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
34 wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
35 export GNUPGHOME="$(mktemp -d)"; \
36 for server in $(shuf -e ha.pool.sks-keyservers.net \
37 hkp://p80.pool.sks-keyservers.net:80 \
38 keyserver.ubuntu.com \
39 hkp://keyserver.ubuntu.com:80 \
40 pgp.mit.edu) ; do \
41 gpg --keyserver "$server" --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && break || : ; \
42 done; \
43 gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
44 rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
45 chmod +x /usr/local/bin/gosu; \
46 gosu nobody true; \
47 \
48 apt-get purge -y --auto-remove wget
49 28
50# Install PeerTube 29# Install PeerTube
51WORKDIR /app 30WORKDIR /app
diff --git a/support/docker/production/config/production.yaml b/support/docker/production/config/production.yaml
index 4970bbcca..846c838e8 100644
--- a/support/docker/production/config/production.yaml
+++ b/support/docker/production/config/production.yaml
@@ -32,8 +32,10 @@ redis:
32 32
33# From the project root directory 33# From the project root directory
34storage: 34storage:
35 tmp: '../data/tmp/'
35 avatars: '../data/avatars/' 36 avatars: '../data/avatars/'
36 videos: '../data/videos/' 37 videos: '../data/videos/'
38 redundancy: '../data/redundancy/'
37 logs: '../data/logs/' 39 logs: '../data/logs/'
38 previews: '../data/previews/' 40 previews: '../data/previews/'
39 thumbnails: '../data/thumbnails/' 41 thumbnails: '../data/thumbnails/'
diff --git a/support/docker/production/config/traefik.toml b/support/docker/production/config/traefik.toml
index 882c95548..6abced3db 100644
--- a/support/docker/production/config/traefik.toml
+++ b/support/docker/production/config/traefik.toml
@@ -1,9 +1,12 @@
1# Uncomment this line in order to enable debugging through logs 1# Uncomment this line in order to enable debugging through logs
2# debug = true 2# debug = true
3defaultEntryPoints = ["http", "https"] 3defaultEntryPoints = ["http", "https"]
4
4[entryPoints] 5[entryPoints]
5 [entryPoints.http] 6 [entryPoints.http]
6 address = ":80" 7 address = ":80"
8 [entryPoints.http.redirect]
9 entryPoint = "https"
7 [entryPoints.https] 10 [entryPoints.https]
8 address = ":443" 11 address = ":443"
9 [entryPoints.https.tls] 12 [entryPoints.https.tls]
diff --git a/support/docker/production/docker-compose.yml b/support/docker/production/docker-compose.yml
index 220c19fba..1b0a28ffb 100644
--- a/support/docker/production/docker-compose.yml
+++ b/support/docker/production/docker-compose.yml
@@ -4,16 +4,19 @@ services:
4 4
5 reverse-proxy: 5 reverse-proxy:
6 image: traefik 6 image: traefik
7 command: --api --docker # Enables the web UI and tells Træfik to listen to docker 7 command: --docker # Tells Træfik to listen to docker
8 ports: 8 ports:
9 - "80:80" # The HTTP port 9 - "80:80" # The HTTP port
10 - "443:443" # The HTTPS port 10 - "443:443" # The HTTPS port
11 - "8080:8080" # The Web UI (enabled by --api)
12 volumes: 11 volumes:
13 - /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events 12 - /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
14 - ./docker-volume/traefik/acme.json:/etc/acme.json 13 - ./docker-volume/traefik/acme.json:/etc/acme.json
15 - ./docker-volume/traefik/traefik.toml:/traefik.toml 14 - ./docker-volume/traefik/traefik.toml:/traefik.toml
16 restart: "always" 15 restart: "always"
16 # If you want to use the Traefik dashboard, you should expose it on a
17 # subdomain with HTTPS and authentification:
18 # https://medium.com/@xavier.priour/secure-traefik-dashboard-with-https-and-password-in-docker-5b657e2aa15f
19 # https://github.com/containous/traefik/issues/880#issuecomment-310301168
17 20
18 peertube: 21 peertube:
19 # If you don't want to use the official image and build one from sources 22 # If you don't want to use the official image and build one from sources
@@ -38,6 +41,7 @@ services:
38 depends_on: 41 depends_on:
39 - postgres 42 - postgres
40 - redis 43 - redis
44 - postfix
41 restart: "always" 45 restart: "always"
42 46
43 postgres: 47 postgres:
@@ -59,3 +63,11 @@ services:
59 restart: "always" 63 restart: "always"
60 labels: 64 labels:
61 traefik.enable: "false" 65 traefik.enable: "false"
66
67 postfix:
68 image: mwader/postfix-relay
69 environment:
70 - POSTFIX_myhostname=${PEERTUBE_WEBSERVER_HOSTNAME}
71 labels:
72 traefik.enable: "false"
73 restart: "always"
diff --git a/support/nginx/peertube b/support/nginx/peertube
index b00031133..914ca3741 100644
--- a/support/nginx/peertube
+++ b/support/nginx/peertube
@@ -96,8 +96,18 @@ server {
96 proxy_set_header Host $host; 96 proxy_set_header Host $host;
97 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 97 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
98 98
99 # Hard limit, PeerTube does not support videos > 8GB 99 # This is the maximum upload size, which roughly matches the maximum size of a video file
100 # you can send via the API or the web interface. By default this is 8GB, but administrators
101 # can increase or decrease the limit. Currently there's no way to communicate this limit
102 # to users automatically, so you may want to leave a note in your instance 'about' page if
103 # you change this.
104 #
105 # Note that temporary space is needed equal to the total size of all concurrent uploads.
106 # This data gets stored in /var/lib/nginx by default, so you may want to put this directory
107 # on a dedicated filesystem.
108 #
100 client_max_body_size 8G; 109 client_max_body_size 8G;
110
101 proxy_connect_timeout 600; 111 proxy_connect_timeout 600;
102 proxy_send_timeout 600; 112 proxy_send_timeout 600;
103 proxy_read_timeout 600; 113 proxy_read_timeout 600;
@@ -105,7 +115,7 @@ server {
105 } 115 }
106 116
107 # Bypass PeerTube for performance reasons. Could be removed 117 # Bypass PeerTube for performance reasons. Could be removed
108 location /static/webseed { 118 location ~ ^/static/(webseed|redundancy)/ {
109 # Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client 119 # Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client
110 limit_rate 800k; 120 limit_rate 800k;
111 121
@@ -128,7 +138,12 @@ server {
128 access_log off; 138 access_log off;
129 } 139 }
130 140
131 alias /var/www/peertube/storage/videos; 141 root /var/www/peertube/storage;
142
143 rewrite ^/static/webseed/(.*)$ /videos/$1 break;
144 rewrite ^/static/redundancy/(.*)$ /redundancy/$1 break;
145
146 try_files $uri /;
132 } 147 }
133 148
134 # Websocket tracker 149 # Websocket tracker
diff --git a/support/systemd/peertube.service b/support/systemd/peertube.service
index 88856385c..c1bdcf760 100644
--- a/support/systemd/peertube.service
+++ b/support/systemd/peertube.service
@@ -15,5 +15,19 @@ StandardError=syslog
15SyslogIdentifier=peertube 15SyslogIdentifier=peertube
16Restart=always 16Restart=always
17 17
18; Some security directives.
19; Use private /tmp and /var/tmp folders inside a new file system namespace,
20; which are discarded after the process stops.
21PrivateTmp=true
22; Mount /usr, /boot, and /etc as read-only for processes invoked by this service.
23ProtectSystem=full
24; Sets up a new /dev mount for the process and only adds API pseudo devices
25; like /dev/null, /dev/zero or /dev/random but not physical devices. Disabled
26; by default because it may not work on devices like the Raspberry Pi.
27PrivateDevices=false
28; Ensures that the service process and all its children can never gain new
29; privileges through execve().
30NoNewPrivileges=true
31
18[Install] 32[Install]
19WantedBy=multi-user.target 33WantedBy=multi-user.target