diff options
Diffstat (limited to 'support')
-rw-r--r-- | support/doc/api/openapi.yaml | 148 | ||||
-rw-r--r-- | support/doc/dependencies.md | 4 | ||||
-rw-r--r-- | support/doc/development/localization.md | 7 | ||||
-rw-r--r-- | support/doc/development/release.md | 20 | ||||
-rw-r--r-- | support/doc/docker.md | 3 | ||||
-rw-r--r-- | support/doc/production.md | 1 | ||||
-rw-r--r-- | support/doc/tools.md | 11 | ||||
-rw-r--r-- | support/doc/translation.md | 17 | ||||
-rw-r--r-- | support/docker/gitpod/Dockerfile | 11 | ||||
-rw-r--r-- | support/docker/gitpod/setup_postgres.sql | 6 | ||||
-rw-r--r-- | support/docker/production/.env | 6 | ||||
-rw-r--r-- | support/docker/production/Dockerfile.stretch | 7 | ||||
-rw-r--r-- | support/docker/production/config/custom-environment-variables.yaml | 3 | ||||
-rw-r--r-- | support/docker/production/config/production.yaml | 14 | ||||
-rw-r--r-- | support/docker/production/docker-compose.yml | 3 | ||||
-rw-r--r-- | support/nginx/peertube | 2 |
16 files changed, 238 insertions, 25 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index ea419029c..7b67b5c64 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml | |||
@@ -1,7 +1,7 @@ | |||
1 | openapi: 3.0.0 | 1 | openapi: 3.0.0 |
2 | info: | 2 | info: |
3 | title: PeerTube | 3 | title: PeerTube |
4 | version: 1.2.1 | 4 | version: 1.3.0-rc.1 |
5 | contact: | 5 | contact: |
6 | name: PeerTube Community | 6 | name: PeerTube Community |
7 | url: 'https://joinpeertube.org' | 7 | url: 'https://joinpeertube.org' |
@@ -842,7 +842,7 @@ paths: | |||
842 | description: Video name | 842 | description: Video name |
843 | type: string | 843 | type: string |
844 | tags: | 844 | tags: |
845 | description: Video tags | 845 | description: Video tags (maximum 5 tags each between 2 and 30 characters) |
846 | type: array | 846 | type: array |
847 | items: | 847 | items: |
848 | type: string | 848 | type: string |
@@ -1089,6 +1089,83 @@ paths: | |||
1089 | channelId=$CHANNEL_ID \ | 1089 | channelId=$CHANNEL_ID \ |
1090 | name=$NAME \ | 1090 | name=$NAME \ |
1091 | "Authorization:Bearer $token" | 1091 | "Authorization:Bearer $token" |
1092 | /videos/imports: | ||
1093 | post: | ||
1094 | summary: Import a torrent or magnetURI or HTTP ressource (if enabled by the instance administrator) | ||
1095 | security: | ||
1096 | - OAuth2: [] | ||
1097 | tags: | ||
1098 | - Video | ||
1099 | responses: | ||
1100 | '200': | ||
1101 | description: successful operation | ||
1102 | content: | ||
1103 | application/json: | ||
1104 | schema: | ||
1105 | $ref: '#/components/schemas/VideoUploadResponse' | ||
1106 | requestBody: | ||
1107 | content: | ||
1108 | multipart/form-data: | ||
1109 | schema: | ||
1110 | type: object | ||
1111 | properties: | ||
1112 | torrentfile: | ||
1113 | description: Torrent File | ||
1114 | type: string | ||
1115 | format: binary | ||
1116 | targetUrl: | ||
1117 | description: HTTP target URL | ||
1118 | type: string | ||
1119 | magnetUri: | ||
1120 | description: Magnet URI | ||
1121 | type: string | ||
1122 | channelId: | ||
1123 | description: Channel id that will contain this video | ||
1124 | type: number | ||
1125 | thumbnailfile: | ||
1126 | description: Video thumbnail file | ||
1127 | type: string | ||
1128 | previewfile: | ||
1129 | description: Video preview file | ||
1130 | type: string | ||
1131 | privacy: | ||
1132 | $ref: '#/components/schemas/VideoPrivacy' | ||
1133 | category: | ||
1134 | description: Video category | ||
1135 | type: string | ||
1136 | licence: | ||
1137 | description: Video licence | ||
1138 | type: string | ||
1139 | language: | ||
1140 | description: Video language | ||
1141 | type: string | ||
1142 | description: | ||
1143 | description: Video description | ||
1144 | type: string | ||
1145 | waitTranscoding: | ||
1146 | description: Whether or not we wait transcoding before publish the video | ||
1147 | type: string | ||
1148 | support: | ||
1149 | description: Text describing how to support the video uploader | ||
1150 | type: string | ||
1151 | nsfw: | ||
1152 | description: Whether or not this video contains sensitive content | ||
1153 | type: string | ||
1154 | name: | ||
1155 | description: Video name | ||
1156 | type: string | ||
1157 | tags: | ||
1158 | description: Video tags | ||
1159 | type: array | ||
1160 | items: | ||
1161 | type: string | ||
1162 | commentsEnabled: | ||
1163 | description: Enable or disable comments for this video | ||
1164 | type: string | ||
1165 | scheduleUpdate: *ref_0 | ||
1166 | required: | ||
1167 | - channelId | ||
1168 | - name | ||
1092 | /videos/abuse: | 1169 | /videos/abuse: |
1093 | get: | 1170 | get: |
1094 | summary: Get list of reported video abuses | 1171 | summary: Get list of reported video abuses |
@@ -1199,13 +1276,13 @@ paths: | |||
1199 | $ref: '#/paths/~1users~1me/put/responses/204' | 1276 | $ref: '#/paths/~1users~1me/put/responses/204' |
1200 | requestBody: | 1277 | requestBody: |
1201 | $ref: '#/components/requestBodies/VideoChannelInput' | 1278 | $ref: '#/components/requestBodies/VideoChannelInput' |
1202 | '/video-channels/{id}': | 1279 | '/video-channels/{channelHandle}': |
1203 | get: | 1280 | get: |
1204 | summary: Get a video channel by its id | 1281 | summary: Get a video channel by its id |
1205 | tags: | 1282 | tags: |
1206 | - Video Channel | 1283 | - Video Channel |
1207 | parameters: | 1284 | parameters: |
1208 | - $ref: '#/components/parameters/id3' | 1285 | - $ref: '#/components/parameters/channelHandle' |
1209 | responses: | 1286 | responses: |
1210 | '200': | 1287 | '200': |
1211 | description: successful operation | 1288 | description: successful operation |
@@ -1220,7 +1297,7 @@ paths: | |||
1220 | tags: | 1297 | tags: |
1221 | - Video Channel | 1298 | - Video Channel |
1222 | parameters: | 1299 | parameters: |
1223 | - $ref: '#/components/parameters/id3' | 1300 | - $ref: '#/components/parameters/channelHandle' |
1224 | responses: | 1301 | responses: |
1225 | '204': | 1302 | '204': |
1226 | $ref: '#/paths/~1users~1me/put/responses/204' | 1303 | $ref: '#/paths/~1users~1me/put/responses/204' |
@@ -1233,17 +1310,17 @@ paths: | |||
1233 | tags: | 1310 | tags: |
1234 | - Video Channel | 1311 | - Video Channel |
1235 | parameters: | 1312 | parameters: |
1236 | - $ref: '#/components/parameters/id3' | 1313 | - $ref: '#/components/parameters/channelHandle' |
1237 | responses: | 1314 | responses: |
1238 | '204': | 1315 | '204': |
1239 | $ref: '#/paths/~1users~1me/put/responses/204' | 1316 | $ref: '#/paths/~1users~1me/put/responses/204' |
1240 | '/video-channels/{id}/videos': | 1317 | '/video-channels/{channelHandle}/videos': |
1241 | get: | 1318 | get: |
1242 | summary: Get videos of a video channel by its id | 1319 | summary: Get videos of a video channel by its id |
1243 | tags: | 1320 | tags: |
1244 | - Video Channel | 1321 | - Video Channel |
1245 | parameters: | 1322 | parameters: |
1246 | - $ref: '#/components/parameters/id3' | 1323 | - $ref: '#/components/parameters/channelHandle' |
1247 | responses: | 1324 | responses: |
1248 | '200': | 1325 | '200': |
1249 | description: successful operation | 1326 | description: successful operation |
@@ -1267,6 +1344,35 @@ paths: | |||
1267 | type: array | 1344 | type: array |
1268 | items: | 1345 | items: |
1269 | $ref: '#/components/schemas/VideoChannel' | 1346 | $ref: '#/components/schemas/VideoChannel' |
1347 | '/accounts/{name}/ratings': | ||
1348 | get: | ||
1349 | summary: Get ratings of an account by its name | ||
1350 | security: | ||
1351 | - OAuth2: [] | ||
1352 | tags: | ||
1353 | - User | ||
1354 | parameters: | ||
1355 | - $ref: '#/components/parameters/start' | ||
1356 | - $ref: '#/components/parameters/count' | ||
1357 | - $ref: '#/components/parameters/sort' | ||
1358 | - name: rating | ||
1359 | in: query | ||
1360 | required: false | ||
1361 | description: Optionaly filter which ratings to retrieve | ||
1362 | schema: | ||
1363 | type: string | ||
1364 | enum: | ||
1365 | - like | ||
1366 | - dislike | ||
1367 | responses: | ||
1368 | '200': | ||
1369 | description: successful operation | ||
1370 | content: | ||
1371 | application/json: | ||
1372 | schema: | ||
1373 | type: array | ||
1374 | items: | ||
1375 | $ref: '#/components/schemas/VideoRating' | ||
1270 | '/videos/{id}/comment-threads': | 1376 | '/videos/{id}/comment-threads': |
1271 | get: | 1377 | get: |
1272 | summary: Get the comment threads of a video by its id | 1378 | summary: Get the comment threads of a video by its id |
@@ -1505,11 +1611,11 @@ components: | |||
1505 | description: The video id or uuid | 1611 | description: The video id or uuid |
1506 | schema: | 1612 | schema: |
1507 | type: string | 1613 | type: string |
1508 | id3: | 1614 | channelHandle: |
1509 | name: id | 1615 | name: channelHandle |
1510 | in: path | 1616 | in: path |
1511 | required: true | 1617 | required: true |
1512 | description: The video channel id or uuid | 1618 | description: "The video channel handle (example: 'my_username@example.com' or 'my_username')" |
1513 | schema: | 1619 | schema: |
1514 | type: string | 1620 | type: string |
1515 | commentId: | 1621 | commentId: |
@@ -1867,6 +1973,8 @@ components: | |||
1867 | - Administrator | 1973 | - Administrator |
1868 | videoQuota: | 1974 | videoQuota: |
1869 | type: number | 1975 | type: number |
1976 | videoQuotaDaily: | ||
1977 | type: number | ||
1870 | createdAt: | 1978 | createdAt: |
1871 | type: string | 1979 | type: string |
1872 | account: | 1980 | account: |
@@ -2002,6 +2110,9 @@ components: | |||
2002 | videoQuota: | 2110 | videoQuota: |
2003 | type: string | 2111 | type: string |
2004 | description: 'The user videoQuota ' | 2112 | description: 'The user videoQuota ' |
2113 | videoQuotaDaily: | ||
2114 | type: string | ||
2115 | description: 'The user daily video quota ' | ||
2005 | role: | 2116 | role: |
2006 | type: integer | 2117 | type: integer |
2007 | format: int32 | 2118 | format: int32 |
@@ -2015,6 +2126,7 @@ components: | |||
2015 | - password | 2126 | - password |
2016 | 2127 | ||
2017 | - videoQuota | 2128 | - videoQuota |
2129 | - videoQuotaDaily | ||
2018 | - role | 2130 | - role |
2019 | UpdateUser: | 2131 | UpdateUser: |
2020 | properties: | 2132 | properties: |
@@ -2027,6 +2139,9 @@ components: | |||
2027 | videoQuota: | 2139 | videoQuota: |
2028 | type: string | 2140 | type: string |
2029 | description: 'The updated videoQuota of the user ' | 2141 | description: 'The updated videoQuota of the user ' |
2142 | videoQuotaDaily: | ||
2143 | type: string | ||
2144 | description: 'The updated daily video quota of the user ' | ||
2030 | role: | 2145 | role: |
2031 | type: string | 2146 | type: string |
2032 | description: 'The updated role of the user ' | 2147 | description: 'The updated role of the user ' |
@@ -2034,6 +2149,7 @@ components: | |||
2034 | - id | 2149 | - id |
2035 | 2150 | ||
2036 | - videoQuota | 2151 | - videoQuota |
2152 | - videoQuotaDaily | ||
2037 | - role | 2153 | - role |
2038 | UpdateMe: | 2154 | UpdateMe: |
2039 | properties: | 2155 | properties: |
@@ -2065,6 +2181,16 @@ components: | |||
2065 | required: | 2181 | required: |
2066 | - id | 2182 | - id |
2067 | - rating | 2183 | - rating |
2184 | VideoRating: | ||
2185 | properties: | ||
2186 | video: | ||
2187 | $ref: '#/components/schemas/Video' | ||
2188 | rating: | ||
2189 | type: number | ||
2190 | description: 'Rating of the video' | ||
2191 | required: | ||
2192 | - video | ||
2193 | - rating | ||
2068 | RegisterUser: | 2194 | RegisterUser: |
2069 | properties: | 2195 | properties: |
2070 | username: | 2196 | username: |
diff --git a/support/doc/dependencies.md b/support/doc/dependencies.md index d98d71020..77cec3ba3 100644 --- a/support/doc/dependencies.md +++ b/support/doc/dependencies.md | |||
@@ -28,13 +28,13 @@ | |||
28 | [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions) | 28 | [https://certbot.eff.org/all-instructions](https://certbot.eff.org/all-instructions) |
29 | 4. Install NodeJS 8.x (current LTS): | 29 | 4. Install NodeJS 8.x (current LTS): |
30 | [https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions) | 30 | [https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions) |
31 | 5. Install yarn, and be sure to have a recent version (>= 1.5.1, the latest release): | 31 | 5. Install yarn, and be sure to have [a recent version](https://github.com/yarnpkg/yarn/releases/latest): |
32 | [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab) | 32 | [https://yarnpkg.com/en/docs/install#linux-tab](https://yarnpkg.com/en/docs/install#linux-tab) |
33 | 6. Run: | 33 | 6. Run: |
34 | 34 | ||
35 | ``` | 35 | ``` |
36 | $ sudo apt update | 36 | $ sudo apt update |
37 | $ sudo apt install nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git | 37 | $ sudo apt install nginx ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git python-dev |
38 | $ ffmpeg -version # Should be >= 3.x | 38 | $ ffmpeg -version # Should be >= 3.x |
39 | $ g++ -v # Should be >= 5.x | 39 | $ g++ -v # Should be >= 5.x |
40 | ``` | 40 | ``` |
diff --git a/support/doc/development/localization.md b/support/doc/development/localization.md index 97e9e2c51..1664532fe 100644 --- a/support/doc/development/localization.md +++ b/support/doc/development/localization.md | |||
@@ -31,3 +31,10 @@ Then, `iso639` files will be merged in `server` files (so we have only one JSON | |||
31 | ``` | 31 | ``` |
32 | $ zanata-cli pull | 32 | $ zanata-cli pull |
33 | ``` | 33 | ``` |
34 | |||
35 | ## Support a new language | ||
36 | |||
37 | * Add it to [/shared/models/i18n/i18n.ts](/shared/models/i18n/i18n.ts) | ||
38 | * Add it to [/scripts/build/client.sh](/scripts/build/client.sh) | ||
39 | * Pull using zanata (that will execute hooks to correctly generate files of this new language) | ||
40 | * Build the application and check the new language correctly works | ||
diff --git a/support/doc/development/release.md b/support/doc/development/release.md new file mode 100644 index 000000000..352a1f0d3 --- /dev/null +++ b/support/doc/development/release.md | |||
@@ -0,0 +1,20 @@ | |||
1 | # Release | ||
2 | |||
3 | * Fix remaining important bugs | ||
4 | * Update [/CHANGELOG.md](/CHANGELOG.md) | ||
5 | * Check migrations: | ||
6 | * `npm run clean:server:test` | ||
7 | * `git checkout master && rm -r ./node_modules && yarn install --pure-lockfile && npm run build:server` | ||
8 | * `NODE_APP_INSTANCE=6 NODE_ENV=test npm run start` and quit after initialization | ||
9 | * `git checkout develop && rm -r ./node_modules && yarn install --pure-lockfile && npm run build:server` | ||
10 | * `NODE_APP_INSTANCE=6 NODE_ENV=test npm run start` and check migrations does not fail | ||
11 | * Run `rm -r node_modules && rm -r client/node_modules && yarn install --pure-lockfile && npm run build` to see if all the supported languages compile correctly | ||
12 | * Update https://peertube2.cpy.re and check it works correctly | ||
13 | * Check Travis tests are green | ||
14 | * Run E2E tests: `BROWSERSTACK_USER=my_user BROWSERSTACK_KEY=my_key npm run e2e` | ||
15 | * Release: `GITHUB_TOKEN=my_token npm run release -- 1.x.x` | ||
16 | * Create a dedicated branch: `git checkout -b release/1.x.x && git push origin release/1.x.x` | ||
17 | * Check the release is okay: https://github.com/Chocobozzz/PeerTube/releases | ||
18 | * Update https://peertube3.cpy.re and check it works correctly | ||
19 | * Update all other instances and check it works correctly | ||
20 | * Communicate on Mastodon & peertube-admin mailing list | ||
diff --git a/support/doc/docker.md b/support/doc/docker.md index c20746486..7b2d867a0 100644 --- a/support/doc/docker.md +++ b/support/doc/docker.md | |||
@@ -59,6 +59,8 @@ See the production guide ["What now" section](/support/doc/production.md#what-no | |||
59 | 59 | ||
60 | ### Upgrade | 60 | ### Upgrade |
61 | 61 | ||
62 | **Important:** Before upgrading, check you have all the `storage` fields in your [production.yaml file](/support/docker/production/config/production.yaml). | ||
63 | |||
62 | Pull the latest images and rerun PeerTube: | 64 | Pull the latest images and rerun PeerTube: |
63 | 65 | ||
64 | ```shell | 66 | ```shell |
@@ -67,7 +69,6 @@ $ docker-compose pull | |||
67 | $ docker-compose up -d | 69 | $ docker-compose up -d |
68 | ``` | 70 | ``` |
69 | 71 | ||
70 | |||
71 | ## Build your own Docker image | 72 | ## Build your own Docker image |
72 | 73 | ||
73 | ```shell | 74 | ```shell |
diff --git a/support/doc/production.md b/support/doc/production.md index 16efe17c4..2eba6e6a3 100644 --- a/support/doc/production.md +++ b/support/doc/production.md | |||
@@ -210,6 +210,7 @@ Now your instance is up you can: | |||
210 | 210 | ||
211 | * Subscribe to the mailing list for PeerTube administrators: https://framalistes.org/sympa/subscribe/peertube-admin | 211 | * Subscribe to the mailing list for PeerTube administrators: https://framalistes.org/sympa/subscribe/peertube-admin |
212 | * Add you instance to the public PeerTube instances index if you want to: https://instances.peertu.be/ | 212 | * Add you instance to the public PeerTube instances index if you want to: https://instances.peertu.be/ |
213 | * Check [available CLI tools](/support/doc/tools.md) | ||
213 | 214 | ||
214 | ## Upgrade | 215 | ## Upgrade |
215 | 216 | ||
diff --git a/support/doc/tools.md b/support/doc/tools.md index 1a9ba7d2b..086cd5cff 100644 --- a/support/doc/tools.md +++ b/support/doc/tools.md | |||
@@ -18,6 +18,7 @@ | |||
18 | - [prune-storage.js](#prune-storagejs) | 18 | - [prune-storage.js](#prune-storagejs) |
19 | - [optimize-old-videos.js](#optimize-old-videosjs) | 19 | - [optimize-old-videos.js](#optimize-old-videosjs) |
20 | - [update-host.js](#update-hostjs) | 20 | - [update-host.js](#update-hostjs) |
21 | - [reset-password.js](#reset-passwordjs) | ||
21 | - [REPL (Read Eval Print Loop)](#repl-read-eval-print-loop) | 22 | - [REPL (Read Eval Print Loop)](#repl-read-eval-print-loop) |
22 | - [.help](#help) | 23 | - [.help](#help) |
23 | - [Lodash example](#lodash-example) | 24 | - [Lodash example](#lodash-example) |
@@ -119,7 +120,7 @@ $ node dist/server/tools/peertube-import-videos.js \ | |||
119 | 120 | ||
120 | * `PEERTUBE_URL` : the full URL of your PeerTube server where you want to import, eg: https://peertube.cpy.re | 121 | * `PEERTUBE_URL` : the full URL of your PeerTube server where you want to import, eg: https://peertube.cpy.re |
121 | * `PEERTUBE_USER` : your PeerTube account where videos will be uploaded | 122 | * `PEERTUBE_USER` : your PeerTube account where videos will be uploaded |
122 | * `PEERTUBE_PASSWORD` : password of your PeerTube account (if `PEERTUBE_PASSWORD` is omitted, you will be prompted for it) | 123 | * `PEERTUBE_PASSWORD` : password of your PeerTube account (if `--password PEERTUBE_PASSWORD` is omitted, you will be prompted for it) |
123 | * `TARGET_URL` : the target url you want to import. Examples: | 124 | * `TARGET_URL` : the target url you want to import. Examples: |
124 | * YouTube: | 125 | * YouTube: |
125 | * Channel: https://www.youtube.com/channel/ChannelId | 126 | * Channel: https://www.youtube.com/channel/ChannelId |
@@ -227,6 +228,14 @@ to run: | |||
227 | $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run update-host | 228 | $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run update-host |
228 | ``` | 229 | ``` |
229 | 230 | ||
231 | ### reset-password.js | ||
232 | |||
233 | To reset a user password from CLI, run: | ||
234 | |||
235 | ``` | ||
236 | $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u target_username | ||
237 | ``` | ||
238 | |||
230 | ### REPL ([Read Eval Print Loop](https://nodejs.org/docs/latest-v8.x/api/repl.html)) | 239 | ### REPL ([Read Eval Print Loop](https://nodejs.org/docs/latest-v8.x/api/repl.html)) |
231 | 240 | ||
232 | If you want to interact with the application libraries and objects even when PeerTube is not running, there is a REPL for that. | 241 | If you want to interact with the application libraries and objects even when PeerTube is not running, there is a REPL for that. |
diff --git a/support/doc/translation.md b/support/doc/translation.md index 5267c3899..58b52f5f8 100644 --- a/support/doc/translation.md +++ b/support/doc/translation.md | |||
@@ -26,10 +26,25 @@ There are 4 files: | |||
26 | 26 | ||
27 | ## Tips | 27 | ## Tips |
28 | 28 | ||
29 | ### Special tags | ||
30 | |||
29 | You must not translate special tags like `<x id="INTERPOLATION" ... />`. | 31 | You must not translate special tags like `<x id="INTERPOLATION" ... />`. |
30 | 32 | ||
31 | For example: | 33 | For example: |
32 | ```<x id="INTERPOLATION" equiv-text="{{ video.publishedAt | myFromNow }}"/> - <x id="INTERPOLATION_1" equiv-text="{{ video.views | myNumberFormatter }}"/> views``` | 34 | ```<x id="INTERPOLATION" equiv-text="{{ video.publishedAt | myFromNow }}"/> - <x id="INTERPOLATION_1" equiv-text="{{ video.views | myNumberFormatter }}"/> views``` |
33 | 35 | ||
34 | should be in french | 36 | should be in french |
35 | ```<x id="INTERPOLATION" equiv-text="{{ video.publishedAt | myFromNow }}"/> - <x id="INTERPOLATION_1" equiv-text="{{ video.views | myNumberFormatter }}"/> vues``` \ No newline at end of file | 37 | ```<x id="INTERPOLATION" equiv-text="{{ video.publishedAt | myFromNow }}"/> - <x id="INTERPOLATION_1" equiv-text="{{ video.views | myNumberFormatter }}"/> vues``` |
38 | |||
39 | |||
40 | ### Singular/plural | ||
41 | |||
42 | For singular/plural translations, you must translate values inside `{` and `}`. | ||
43 | |||
44 | For example: | ||
45 | |||
46 | ```{VAR_PLURAL, plural, =0 {No videos} =1 {1 video} other {<x id="INTERPOLATION" equiv-text="{{ playlist.videosLength }}"/> videos} }``` | ||
47 | |||
48 | should be in french | ||
49 | |||
50 | ```{VAR_PLURAL, plural, =0 {Aucune vidéos} =1 {1 vidéo} other {<x id="INTERPOLATION" equiv-text="{{ playlist.videosLength }}"/> vidéos} }``` | ||
diff --git a/support/docker/gitpod/Dockerfile b/support/docker/gitpod/Dockerfile new file mode 100644 index 000000000..435370dc4 --- /dev/null +++ b/support/docker/gitpod/Dockerfile | |||
@@ -0,0 +1,11 @@ | |||
1 | FROM gitpod/workspace-postgres | ||
2 | |||
3 | # Install PeerTube's dependencies. | ||
4 | RUN sudo apt-get update -q && sudo apt-get install -qy \ | ||
5 | ffmpeg \ | ||
6 | openssl \ | ||
7 | redis-server | ||
8 | |||
9 | # Set up PostgreSQL. | ||
10 | COPY --chown=gitpod:gitpod setup_postgres.sql /tmp/ | ||
11 | RUN pg_start && psql -h localhost -d postgres --file=/tmp/setup_postgres.sql | ||
diff --git a/support/docker/gitpod/setup_postgres.sql b/support/docker/gitpod/setup_postgres.sql new file mode 100644 index 000000000..0937f9d19 --- /dev/null +++ b/support/docker/gitpod/setup_postgres.sql | |||
@@ -0,0 +1,6 @@ | |||
1 | create database peertube_dev; | ||
2 | create user peertube password 'peertube'; | ||
3 | grant all privileges on database peertube_dev to peertube; | ||
4 | \c peertube_dev | ||
5 | CREATE EXTENSION pg_trgm; | ||
6 | CREATE EXTENSION unaccent; | ||
diff --git a/support/docker/production/.env b/support/docker/production/.env index 802d6b2ca..7b9092642 100644 --- a/support/docker/production/.env +++ b/support/docker/production/.env | |||
@@ -7,12 +7,12 @@ PEERTUBE_WEBSERVER_HTTPS=true | |||
7 | # pass them as a comma separated array: | 7 | # pass them as a comma separated array: |
8 | PEERTUBE_TRUST_PROXY=["127.0.0.1"] | 8 | 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"] |
10 | PEERTUBE_SMTP_USERNAME= | 10 | #PEERTUBE_SMTP_USERNAME= |
11 | PEERTUBE_SMTP_PASSWORD= | 11 | #PEERTUBE_SMTP_PASSWORD= |
12 | PEERTUBE_SMTP_HOSTNAME=postfix | 12 | PEERTUBE_SMTP_HOSTNAME=postfix |
13 | PEERTUBE_SMTP_PORT=25 | 13 | PEERTUBE_SMTP_PORT=25 |
14 | PEERTUBE_SMTP_FROM=noreply@domain.tld | 14 | PEERTUBE_SMTP_FROM=noreply@domain.tld |
15 | PEERTUBE_SMTP_TLS=true | 15 | PEERTUBE_SMTP_TLS=false |
16 | PEERTUBE_SMTP_DISABLE_STARTTLS=false | 16 | PEERTUBE_SMTP_DISABLE_STARTTLS=false |
17 | PEERTUBE_ADMIN_EMAIL=admin@domain.tld | 17 | PEERTUBE_ADMIN_EMAIL=admin@domain.tld |
18 | # /!\ Prefer to use the PeerTube admin interface to set the following configurations /!\ | 18 | # /!\ Prefer to use the PeerTube admin interface to set the following configurations /!\ |
diff --git a/support/docker/production/Dockerfile.stretch b/support/docker/production/Dockerfile.stretch index 81468bb4f..5025341f1 100644 --- a/support/docker/production/Dockerfile.stretch +++ b/support/docker/production/Dockerfile.stretch | |||
@@ -1,5 +1,10 @@ | |||
1 | FROM node:8-stretch | 1 | FROM node:8-stretch |
2 | 2 | ||
3 | # Allow to pass extra options to the npm run build | ||
4 | # eg: --light --light-fr to not build all client languages | ||
5 | # (speed up build time if i18n is not required) | ||
6 | ARG NPM_RUN_BUILD_OPTS | ||
7 | |||
3 | RUN set -ex; \ | 8 | RUN set -ex; \ |
4 | if ! command -v gpg > /dev/null; then \ | 9 | if ! command -v gpg > /dev/null; then \ |
5 | apt-get update; \ | 10 | apt-get update; \ |
@@ -34,7 +39,7 @@ RUN chown -R peertube:peertube /app | |||
34 | USER peertube | 39 | USER peertube |
35 | 40 | ||
36 | RUN yarn install --pure-lockfile \ | 41 | RUN yarn install --pure-lockfile \ |
37 | && npm run build \ | 42 | && npm run build -- $NPM_RUN_BUILD_OPTS \ |
38 | && rm -r ./node_modules ./client/node_modules \ | 43 | && rm -r ./node_modules ./client/node_modules \ |
39 | && yarn install --pure-lockfile --production \ | 44 | && yarn install --pure-lockfile --production \ |
40 | && yarn cache clean | 45 | && yarn cache clean |
diff --git a/support/docker/production/config/custom-environment-variables.yaml b/support/docker/production/config/custom-environment-variables.yaml index 8604939aa..bd4ac1215 100644 --- a/support/docker/production/config/custom-environment-variables.yaml +++ b/support/docker/production/config/custom-environment-variables.yaml | |||
@@ -111,6 +111,3 @@ instance: | |||
111 | name: "PEERTUBE_INSTANCE_NAME" | 111 | name: "PEERTUBE_INSTANCE_NAME" |
112 | description: "PEERTUBE_INSTANCE_DESCRIPTION" | 112 | description: "PEERTUBE_INSTANCE_DESCRIPTION" |
113 | terms: "PEERTUBE_INSTANCE_TERMS" | 113 | terms: "PEERTUBE_INSTANCE_TERMS" |
114 | |||
115 | services: | ||
116 | csp-logger: "PEERTUBE_SERVICES_CSPLOGGER" | ||
diff --git a/support/docker/production/config/production.yaml b/support/docker/production/config/production.yaml index 846c838e8..ae6bf3982 100644 --- a/support/docker/production/config/production.yaml +++ b/support/docker/production/config/production.yaml | |||
@@ -8,6 +8,16 @@ webserver: | |||
8 | hostname: undefined | 8 | hostname: undefined |
9 | port: 443 | 9 | port: 443 |
10 | 10 | ||
11 | rates_limit: | ||
12 | login: | ||
13 | # 15 attempts in 5 min | ||
14 | window: 5 minutes | ||
15 | max: 15 | ||
16 | ask_send_email: | ||
17 | # 3 attempts in 5 min | ||
18 | window: 5 minutes | ||
19 | max: 3 | ||
20 | |||
11 | # Proxies to trust to get real client IP | 21 | # Proxies to trust to get real client IP |
12 | # If you run PeerTube just behind a local proxy (nginx), keep 'loopback' | 22 | # If you run PeerTube just behind a local proxy (nginx), keep 'loopback' |
13 | # If you run PeerTube behind a remote proxy, add the proxy IP address (or subnet) | 23 | # If you run PeerTube behind a remote proxy, add the proxy IP address (or subnet) |
@@ -46,5 +56,9 @@ storage: | |||
46 | log: | 56 | log: |
47 | level: 'info' # debug/info/warning/error | 57 | level: 'info' # debug/info/warning/error |
48 | 58 | ||
59 | tracker: | ||
60 | enabled: true | ||
61 | reject_too_many_announces: false # false because we have issues with traefik and ws ip/port forwarding | ||
62 | |||
49 | admin: | 63 | admin: |
50 | email: null | 64 | email: null |
diff --git a/support/docker/production/docker-compose.yml b/support/docker/production/docker-compose.yml index 1b0a28ffb..df21a14d4 100644 --- a/support/docker/production/docker-compose.yml +++ b/support/docker/production/docker-compose.yml | |||
@@ -4,6 +4,7 @@ services: | |||
4 | 4 | ||
5 | reverse-proxy: | 5 | reverse-proxy: |
6 | image: traefik | 6 | image: traefik |
7 | network_mode: "host" | ||
7 | command: --docker # Tells Træfik to listen to docker | 8 | command: --docker # Tells Træfik to listen to docker |
8 | ports: | 9 | ports: |
9 | - "80:80" # The HTTP port | 10 | - "80:80" # The HTTP port |
@@ -13,7 +14,7 @@ services: | |||
13 | - ./docker-volume/traefik/acme.json:/etc/acme.json | 14 | - ./docker-volume/traefik/acme.json:/etc/acme.json |
14 | - ./docker-volume/traefik/traefik.toml:/traefik.toml | 15 | - ./docker-volume/traefik/traefik.toml:/traefik.toml |
15 | restart: "always" | 16 | restart: "always" |
16 | # If you want to use the Traefik dashboard, you should expose it on a | 17 | # If you want to use the Traefik dashboard, you should expose it on a |
17 | # subdomain with HTTPS and authentification: | 18 | # subdomain with HTTPS and authentification: |
18 | # https://medium.com/@xavier.priour/secure-traefik-dashboard-with-https-and-password-in-docker-5b657e2aa15f | 19 | # 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 | 20 | # https://github.com/containous/traefik/issues/880#issuecomment-310301168 |
diff --git a/support/nginx/peertube b/support/nginx/peertube index 54ffdcc32..fee0f5d1c 100644 --- a/support/nginx/peertube +++ b/support/nginx/peertube | |||
@@ -41,7 +41,7 @@ server { | |||
41 | # It might be nice to compress JSON, but leaving that out to protect against potential | 41 | # It might be nice to compress JSON, but leaving that out to protect against potential |
42 | # compression+encryption information leak attacks like BREACH. | 42 | # compression+encryption information leak attacks like BREACH. |
43 | gzip on; | 43 | gzip on; |
44 | gzip_types text/css text/html application/javascript; | 44 | gzip_types text/css application/javascript; |
45 | gzip_vary on; | 45 | gzip_vary on; |
46 | 46 | ||
47 | # Enable HSTS | 47 | # Enable HSTS |