From d639c3bf14bd490ab99b41b2feee5a3b91267436 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 4 Dec 2018 10:07:43 +0100 Subject: Improve tools doc --- support/doc/tools.md | 80 ++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'support') diff --git a/support/doc/tools.md b/support/doc/tools.md index 1c7739525..5a1f212b1 100644 --- a/support/doc/tools.md +++ b/support/doc/tools.md @@ -4,13 +4,13 @@ **Table of Contents** -- [CLI wrapper](#cli-wrapper) - [Remote Tools](#remote-tools) - [Dependencies](#dependencies) - [Installation](#installation) - - [peertube-import-videos.js](#peertube-import-videosjs) - - [peertube-upload.js](#peertube-uploadjs) - - [peertube-watch.js](#peertube-watchjs) + - [CLI wrapper](#cli-wrapper) + - [peertube-import-videos.js](#peertube-import-videosjs) + - [peertube-upload.js](#peertube-uploadjs) + - [peertube-watch.js](#peertube-watchjs) - [Server tools](#server-tools) - [parse-log](#parse-log) - [create-transcoding-job.js](#create-transcoding-jobjs) @@ -26,9 +26,40 @@ -## CLI wrapper +## Remote Tools + +You need at least 512MB RAM to run the script. +Scripts can be launched directly from a PeerTube server, or from a separate server, even a desktop PC. +You 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). + +### Dependencies + +Install the [PeerTube dependencies](dependencies.md). + +### Installation + +Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server): + +``` +$ git clone https://github.com/Chocobozzz/PeerTube.git +$ CLONE="$(pwd)/PeerTube" +``` + +Run ``yarn install --pure-lockfile`` +``` +$ cd ${CLONE} +$ yarn install --pure-lockfile +``` + +Build server tools: +``` +$ cd ${CLONE} +$ npm run build:server +``` + +### CLI wrapper -The 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"`: +The 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"`: ``` Usage: peertube [command] [options] @@ -72,38 +103,7 @@ And now that your video is online, you can watch it from the confort of your ter $ peertube watch https://peertube.cpy.re/videos/watch/e8a1af4e-414a-4d58-bfe6-2146eed06d10 ``` -## Remote Tools - -You need at least 512MB RAM to run the script. -Scripts can be launched directly from a PeerTube server, or from a separate server, even a desktop PC. -You 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). - -### Dependencies - -Install the [PeerTube dependencies](dependencies.md). - -### Installation - -Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server): - -``` -$ git clone https://github.com/Chocobozzz/PeerTube.git -$ CLONE="$(pwd)/PeerTube" -``` - -Run ``yarn install`` -``` -$ cd ${CLONE} -$ yarn install -``` - -Build server tools: -``` -$ cd ${CLONE} -$ npm run build:server -``` - -### peertube-import-videos.js +#### peertube-import-videos.js You can use this script to import videos from all [supported sites of youtube-dl](https://rg3.github.io/youtube-dl/supportedsites.html) into PeerTube. Be sure you own the videos or have the author's authorization to do so. @@ -133,7 +133,7 @@ Already downloaded videos will not be uploaded twice, so you can run and re-run Videos will be publicly available after transcoding (you can see them before that in your account on the web interface). -### peertube-upload.js +#### peertube-upload.js You can use this script to import videos directly from the CLI. @@ -144,7 +144,7 @@ $ cd ${CLONE} $ node dist/server/tools/peertube-upload.js --help ``` -### peertube-watch.js +#### peertube-watch.js You can use this script to play videos directly from the CLI. -- cgit v1.2.3 From 2beb98952a4c5939f33ea2dc77f0bd053bffbb5a Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Tue, 4 Dec 2018 13:50:50 +0100 Subject: change type of languageOneOf query parameter --- support/doc/api/openapi.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'support') diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index 9848c93ee..cb6ba9af5 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml @@ -1434,6 +1434,8 @@ components: - type: array items: type: number + style: form + explode: false tagsOneOf: name: tagsOneOf in: query @@ -1445,6 +1447,8 @@ components: - type: array items: type: string + style: form + explode: false tagsAllOf: name: tagsAllOf in: query @@ -1456,6 +1460,8 @@ components: - type: array items: type: string + style: form + explode: false languageOneOf: name: languageOneOf in: query @@ -1463,10 +1469,12 @@ components: description: language id of the video schema: oneOf: - - type: number + - type: string - type: array items: - type: number + type: string + style: form + explode: false licenceOneOf: name: licenceOneOf in: query @@ -1478,6 +1486,8 @@ components: - type: array items: type: number + style: form + explode: false nsfw: name: nsfw in: query -- cgit v1.2.3 From 6040f87d143a5fa01db79867ece8197c3ce7be47 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 4 Dec 2018 16:02:49 +0100 Subject: Add tmp and redundancy directories --- support/docker/production/config/production.yaml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'support') 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: # From the project root directory storage: + tmp: '../data/tmp/' avatars: '../data/avatars/' videos: '../data/videos/' + redundancy: '../data/redundancy/' logs: '../data/logs/' previews: '../data/previews/' thumbnails: '../data/thumbnails/' -- cgit v1.2.3 From b9fffa297f49a84df8ffd0d7b842599bc88a8e3e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 4 Dec 2018 17:08:55 +0100 Subject: Create redundancy endpoint --- support/nginx/peertube | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'support') diff --git a/support/nginx/peertube b/support/nginx/peertube index b00031133..e0b006088 100644 --- a/support/nginx/peertube +++ b/support/nginx/peertube @@ -105,7 +105,7 @@ server { } # Bypass PeerTube for performance reasons. Could be removed - location /static/webseed { + location ~ ^/static/(webseed|redundancy)/ { # Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client limit_rate 800k; @@ -128,7 +128,12 @@ server { access_log off; } - alias /var/www/peertube/storage/videos; + root /var/www/peertube/storage; + + rewrite ^/static/webseed/(.*)$ /videos/$1 break; + rewrite ^/static/redundancy/(.*)$ /redundancy/$1 break; + + try_files $uri /; } # Websocket tracker -- cgit v1.2.3 From 9024bece9a51d3bc666ba94f272aaec186e3c278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathana=C3=ABl=20J?= Date: Tue, 4 Dec 2018 14:23:28 +0100 Subject: Use `'` instead of `'` for passwords in the documentation (see #1453) --- support/doc/tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'support') diff --git a/support/doc/tools.md b/support/doc/tools.md index 5a1f212b1..98048ec41 100644 --- a/support/doc/tools.md +++ b/support/doc/tools.md @@ -82,7 +82,7 @@ The wrapper provides a convenient interface to the following scripts. You can ac The wrapper can keep track of instances you have an account on. We limit to one account per instance for now. ```bash -$ peertube auth add -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD" +$ peertube auth add -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password 'PEERTUBE_PASSWORD' $ peertube auth list ┌──────────────────────────────┬──────────────────────────────┐ │ instance │ login │ @@ -112,7 +112,7 @@ Be sure you own the videos or have the author's authorization to do so. $ node dist/server/tools/peertube-import-videos.js \ -u "PEERTUBE_URL" \ -U "PEERTUBE_USER" \ - --password "PEERTUBE_PASSWORD" \ + --password 'PEERTUBE_PASSWORD' \ -t "TARGET_URL" ``` -- cgit v1.2.3 From 5b036b8ef2f15c30afe6cddfe9bcfc5816b08bba Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 4 Dec 2018 17:19:44 +0100 Subject: Better tools.md doc --- support/doc/tools.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'support') diff --git a/support/doc/tools.md b/support/doc/tools.md index 98048ec41..69d68464a 100644 --- a/support/doc/tools.md +++ b/support/doc/tools.md @@ -82,12 +82,12 @@ The wrapper provides a convenient interface to the following scripts. You can ac The wrapper can keep track of instances you have an account on. We limit to one account per instance for now. ```bash -$ peertube auth add -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password 'PEERTUBE_PASSWORD' +$ peertube auth add -u 'PEERTUBE_URL' -U 'PEERTUBE_USER' --password 'PEERTUBE_PASSWORD' $ peertube auth list ┌──────────────────────────────┬──────────────────────────────┐ │ instance │ login │ ├──────────────────────────────┼──────────────────────────────┤ -│ "PEERTUBE_URL" │ "PEERTUBE_USER" │ +│ 'PEERTUBE_URL' │ 'PEERTUBE_USER' │ └──────────────────────────────┴──────────────────────────────┘ ``` @@ -110,15 +110,15 @@ Be sure you own the videos or have the author's authorization to do so. ```sh $ node dist/server/tools/peertube-import-videos.js \ - -u "PEERTUBE_URL" \ - -U "PEERTUBE_USER" \ + -u 'PEERTUBE_URL' \ + -U 'PEERTUBE_USER' \ --password 'PEERTUBE_PASSWORD' \ - -t "TARGET_URL" + -t 'TARGET_URL' ``` * `PEERTUBE_URL` : the full URL of your PeerTube server where you want to import, eg: https://peertube.cpy.re * `PEERTUBE_USER` : your PeerTube account where videos will be uploaded -* `PEERTUBE_PASSWORD` : password of your PeerTube account (if omitted, you will be prompted for it) +* `PEERTUBE_PASSWORD` : password of your PeerTube account (if `PEERTUBE_PASSWORD` is omitted, you will be prompted for it) * `TARGET_URL` : the target url you want to import. Examples: * YouTube: * Channel: https://www.youtube.com/channel/ChannelId -- cgit v1.2.3 From 7089e7b4e570710acac408bf95c688932a491707 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 5 Dec 2018 17:44:36 +0100 Subject: Improve information regarding prune storage script --- support/doc/tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'support') diff --git a/support/doc/tools.md b/support/doc/tools.md index 69d68464a..4f806a9db 100644 --- a/support/doc/tools.md +++ b/support/doc/tools.md @@ -198,10 +198,10 @@ $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production ### prune-storage.js Some transcoded videos or shutdown at a bad time can leave some unused files on your storage. -To delete them (a confirmation will be demanded first): +Stop PeerTube and delete these files (a confirmation will be demanded first): ``` -$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run prune-storage +$ sudo systemctl stop peertube && sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run prune-storage ``` ### optimize-old-videos.js -- cgit v1.2.3 From 3114c2c2cc1009ac88f043f97927b300710ef29e Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Wed, 5 Dec 2018 19:39:48 +0100 Subject: hardening systemd unit --- support/systemd/peertube.service | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'support') 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 SyslogIdentifier=peertube Restart=always +; Some security directives. +; Use private /tmp and /var/tmp folders inside a new file system namespace, +; which are discarded after the process stops. +PrivateTmp=true +; Mount /usr, /boot, and /etc as read-only for processes invoked by this service. +ProtectSystem=full +; Sets up a new /dev mount for the process and only adds API pseudo devices +; like /dev/null, /dev/zero or /dev/random but not physical devices. Disabled +; by default because it may not work on devices like the Raspberry Pi. +PrivateDevices=false +; Ensures that the service process and all its children can never gain new +; privileges through execve(). +NoNewPrivileges=true + [Install] WantedBy=multi-user.target -- cgit v1.2.3 From 4b49385892b25aea5aa9e605fbcb66074bcb49b0 Mon Sep 17 00:00:00 2001 From: Micah Elizabeth Scott Date: Fri, 7 Dec 2018 05:58:17 -0800 Subject: Remove hard-coded 8GB upload limit in client (#1293) * Remove hard-coded 8GB upload limit in client Ideally we'd know what the specific server's configured upload limit is before starting, but this 8GB limit is not useful if an administrator has changed the nginx post limit on the server. * Better docs for admins about client_max_body_size Seems like some admins already tweak this value up or down to allow for different maximum video upload sizes. The current codebase has no other server-side limits that I'm aware of, and I've been routinely uploading quite large videos to my instance. This patch replaces the somewhat incorrect (or outdated?) 'hard limit' comment with some advice about allocating enough space for nginx and communicating the limit with your users. Of course it would be better if this configuration could be unified with PeerTube's config somehow. I'm not sure whether the best option there is to turn off nginx's buffering here and let PeerTube handle the entire upload (can we do this only for the video upload API endpoint?) or whether we want PeerTube to generate nginx configs in a more automated way layer. In any case, this patch is intended as an incremental improvement. --- support/nginx/peertube | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'support') diff --git a/support/nginx/peertube b/support/nginx/peertube index e0b006088..914ca3741 100644 --- a/support/nginx/peertube +++ b/support/nginx/peertube @@ -96,8 +96,18 @@ server { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # Hard limit, PeerTube does not support videos > 8GB + # This is the maximum upload size, which roughly matches the maximum size of a video file + # you can send via the API or the web interface. By default this is 8GB, but administrators + # can increase or decrease the limit. Currently there's no way to communicate this limit + # to users automatically, so you may want to leave a note in your instance 'about' page if + # you change this. + # + # Note that temporary space is needed equal to the total size of all concurrent uploads. + # This data gets stored in /var/lib/nginx by default, so you may want to put this directory + # on a dedicated filesystem. + # client_max_body_size 8G; + proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; -- cgit v1.2.3 From f50ab1c2890509b4ccd57c826a060af9e97f6260 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Sat, 8 Dec 2018 18:48:00 +0100 Subject: (doc) fix syntax in openapi spec for watching progress --- support/doc/api/openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'support') diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index cb6ba9af5..86c781f31 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml @@ -820,7 +820,7 @@ paths: $ref: '#/paths/~1users~1me/put/responses/204' '/videos/{id}/watching': put: - summary: Indicate progress of in watching the video by its id for a user + summary: Set watching progress of a video by its id for a user tags: - Video security: -- cgit v1.2.3 From 2cf9a4626fa30cbdcbf51f0c4e44a51ba15d759f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Niel?= Date: Mon, 10 Dec 2018 10:51:28 +0100 Subject: Update FreeBSD startup script (#1474) --- support/freebsd/peertube | 2 ++ 1 file changed, 2 insertions(+) (limited to 'support') diff --git a/support/freebsd/peertube b/support/freebsd/peertube index 78fdf5848..f28660f2c 100755 --- a/support/freebsd/peertube +++ b/support/freebsd/peertube @@ -16,12 +16,14 @@ load_rc_config $name : ${peertube_enable:=NO} +sig_stop=HUP peertube_chdir="/var/www/peertube/peertube-latest" peertube_env="HOME=/var/www/peertube \ NODE_ENV=production \ NODE_CONFIG_DIR=/var/www/peertube/config \ USER=peertube" peertube_user=peertube +procname="node:" command="/usr/local/bin/npm" command_args="start >> /var/log/peertube/${name}.log 2>&1 &" -- cgit v1.2.3 From 5e755fff9d70a7fd3c4f85bb524f1b774dd85b25 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Thu, 13 Dec 2018 09:49:45 +0100 Subject: add Content Security Policy (#1252) * add Content Security Policy * remove reflect-metadata on production builds to get rid of unsafe-eval * fix baseCSP usage * add SRI to CSP * add blob: to media-src * remove SRI * CSP set to reportOnly * adding data: to connect-src CSP * remove block-all-mixed-content * add report-uri support --- support/docker/production/config/custom-environment-variables.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'support') diff --git a/support/docker/production/config/custom-environment-variables.yaml b/support/docker/production/config/custom-environment-variables.yaml index cfc30632c..550f1ad80 100644 --- a/support/docker/production/config/custom-environment-variables.yaml +++ b/support/docker/production/config/custom-environment-variables.yaml @@ -101,9 +101,11 @@ transcoding: 1080: __name: "PEERTUBE_TRANSCODING_1080P" __format: "json" - instance: name: "PEERTUBE_INSTANCE_NAME" description: "PEERTUBE_INSTANCE_DESCRIPTION" terms: "PEERTUBE_INSTANCE_TERMS" + +services: + csp-logger: "PEERTUBE_SERVICES_CSPLOGGER" -- cgit v1.2.3 From 7f3d712d5e5031b5d60c40468634a1a6d99c8c93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Niel?= Date: Thu, 13 Dec 2018 20:53:36 +0100 Subject: (fix) FreeBSD startup script (#1484) This PR fixes #1477 introduced by #1474 --- support/freebsd/peertube | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'support') diff --git a/support/freebsd/peertube b/support/freebsd/peertube index f28660f2c..5d14c58ae 100755 --- a/support/freebsd/peertube +++ b/support/freebsd/peertube @@ -16,16 +16,15 @@ load_rc_config $name : ${peertube_enable:=NO} -sig_stop=HUP +sig_stop=-KILL peertube_chdir="/var/www/peertube/peertube-latest" peertube_env="HOME=/var/www/peertube \ NODE_ENV=production \ NODE_CONFIG_DIR=/var/www/peertube/config \ USER=peertube" peertube_user=peertube -procname="node:" -command="/usr/local/bin/npm" -command_args="start >> /var/log/peertube/${name}.log 2>&1 &" +command="/usr/local/bin/node" +command_args="dist/server >> /var/log/peertube/${name}.log 2>&1 &" run_rc_command "$1" -- cgit v1.2.3 From a46934c825d5dea4154fb100abf26ec3bc28d5a4 Mon Sep 17 00:00:00 2001 From: Michael Koppmann Date: Sat, 15 Dec 2018 16:04:23 +0000 Subject: more systemd service hardening (#1488) --- support/systemd/peertube.service | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'support') diff --git a/support/systemd/peertube.service b/support/systemd/peertube.service index c1bdcf760..fba644788 100644 --- a/support/systemd/peertube.service +++ b/support/systemd/peertube.service @@ -28,6 +28,11 @@ PrivateDevices=false ; Ensures that the service process and all its children can never gain new ; privileges through execve(). NoNewPrivileges=true +; This makes /home, /root, and /run/user inaccessible and empty for processes invoked +; by this unit. Make sure that you do not depend on data inside these folders. +ProtectHome=true +; Drops the sys admin capability from the daemon. +CapabilityBoundingSet=~CAP_SYS_ADMIN [Install] WantedBy=multi-user.target -- cgit v1.2.3 From e76d578414d2f2f853bbb1d4bbe180da05aa4eab Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Thu, 3 Jan 2019 17:34:24 +0100 Subject: (doc) update API spec to include user subscription routes --- support/doc/api/openapi.yaml | 109 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 105 insertions(+), 4 deletions(-) (limited to 'support') diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index 86c781f31..feab909dd 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml @@ -492,7 +492,8 @@ paths: get: summary: Get current user information security: - - OAuth2: [] + - OAuth2: + - user tags: - User responses: @@ -507,7 +508,8 @@ paths: put: summary: Update current user information security: - - OAuth2: [] + - OAuth2: + - user tags: - User responses: @@ -523,7 +525,8 @@ paths: get: summary: Get current user used quota security: - - OAuth2: [] + - OAuth2: + - user tags: - User responses: @@ -558,7 +561,71 @@ paths: get: summary: Get videos of the current user security: - - OAuth2: [] + - OAuth2: + - user + tags: + - User + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Video' + /users/me/subscriptions: + get: + summary: Get subscriptions of the current user + security: + - OAuth2: + - user + tags: + - User + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + responses: + '200': + description: successful operation + post: + summary: Add subscription to the current user + security: + - OAuth2: + - user + tags: + - User + responses: + '200': + description: successful operation + /users/me/subscriptions/exist: + get: + summary: Get if subscriptions exist for the current user + security: + - OAuth2: + - user + tags: + - User + parameters: + - $ref: '#/components/parameters/subscriptionsUris' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + /users/me/subscriptions/videos: + get: + summary: Get videos of subscriptions of the current user + security: + - OAuth2: + - user tags: - User parameters: @@ -574,6 +641,31 @@ paths: type: array items: $ref: '#/components/schemas/Video' + '/users/me/subscriptions/{uri}': + get: + summary: Get subscription of the current user for a given uri + security: + - OAuth2: + - user + tags: + - User + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VideoChannel' + delete: + summary: Delete subscription of the current user for a given uri + security: + - OAuth2: + - user + tags: + - User + responses: + '200': + description: successful operation /users/register: post: summary: Register a user @@ -1511,6 +1603,15 @@ components: enum: - local - all-local + subscriptionsUris: + name: uris + in: query + required: true + description: list of uris to check if each is part of the user subscriptions + schema: + type: array + items: + type: string requestBodies: VideoChannelInput: content: -- cgit v1.2.3 From 1fd12c7cfa636d046d9f77293ad1d958763f67da Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 9 Jan 2019 14:10:25 +0100 Subject: Fix video tags update/upload in openapi --- support/doc/api/openapi.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'support') diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index feab909dd..535dfdd4c 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml @@ -23,7 +23,7 @@ info: # Authentication When you sign up for an account, you are given the possibility to generate - sessions, and authenticate using this session token. One session token can + sessions, and authenticate using this session token. One session token can currently be used at a time. # Errors @@ -61,7 +61,7 @@ tags: description: > Managing servers which the instance interacts with is crucial to the concept of federation in PeerTube and external video indexation. The PeerTube - server then deals with inter-server ActivityPub operations and propagates + server then deals with inter-server ActivityPub operations and propagates information across its social graph by posting activities to actors' inbox endpoints. - name: Video Abuse @@ -843,7 +843,9 @@ paths: type: string tags: description: Video tags - type: string + type: array + items: + type: string commentsEnabled: description: Enable or disable comments for this video type: string @@ -1050,7 +1052,9 @@ paths: type: string tags: description: Video tags - type: string + type: array + items: + type: string commentsEnabled: description: Enable or disable comments for this video type: string -- cgit v1.2.3 From a4101923e699e49ceb9ff36e971c75417fafc9f0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 9 Jan 2019 15:14:29 +0100 Subject: Implement contact form on server side --- support/docker/production/.env | 1 + support/docker/production/config/custom-environment-variables.yaml | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'support') diff --git a/support/docker/production/.env b/support/docker/production/.env index f27def3b4..802d6b2ca 100644 --- a/support/docker/production/.env +++ b/support/docker/production/.env @@ -18,3 +18,4 @@ PEERTUBE_ADMIN_EMAIL=admin@domain.tld # /!\ Prefer to use the PeerTube admin interface to set the following configurations /!\ #PEERTUBE_SIGNUP_ENABLED=true #PEERTUBE_TRANSCODING_ENABLED=true +#PEERTUBE_CONTACT_FORM_ENABLED=true diff --git a/support/docker/production/config/custom-environment-variables.yaml b/support/docker/production/config/custom-environment-variables.yaml index 550f1ad80..8604939aa 100644 --- a/support/docker/production/config/custom-environment-variables.yaml +++ b/support/docker/production/config/custom-environment-variables.yaml @@ -50,6 +50,11 @@ user: admin: email: "PEERTUBE_ADMIN_EMAIL" +contact_form: + enabled: + __name: "PEERTUBE_CONTACT_FORM_ENABLED" + __format: "json" + signup: enabled: __name: "PEERTUBE_SIGNUP_ENABLED" -- cgit v1.2.3 From e902e03f0fd2eded99d635b1f9d2c59f417c4721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?victor=20h=C3=A9ry?= Date: Sun, 13 Jan 2019 14:21:58 +0100 Subject: Patch docker entrypoint to speed up the chown at startup --- support/docker/production/docker-entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'support') diff --git a/support/docker/production/docker-entrypoint.sh b/support/docker/production/docker-entrypoint.sh index 6dbbfddf6..7dd626b9f 100755 --- a/support/docker/production/docker-entrypoint.sh +++ b/support/docker/production/docker-entrypoint.sh @@ -9,7 +9,7 @@ fi # Always copy default and custom env configuration file, in cases where new keys were added cp /app/config/default.yaml /config cp /app/support/docker/production/config/custom-environment-variables.yaml /config -chown -R peertube:peertube /config +find /config ! -user peertube -exec chown peertube:peertube {} \; # first arg is `-f` or `--some-option` # or first arg is `something.conf` @@ -19,7 +19,7 @@ fi # allow the container to be started with `--user` if [ "$1" = 'npm' -a "$(id -u)" = '0' ]; then - chown -R peertube:peertube /data + find /data ! -user peertube -exec chown peertube:peertube {} \; exec gosu peertube "$0" "$@" fi -- cgit v1.2.3 From bb8f7872f5a473c47a688b0c282ff34cd78a9835 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 14 Jan 2019 11:01:40 +0100 Subject: Fix peertube CLI documentation --- support/doc/tools.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'support') diff --git a/support/doc/tools.md b/support/doc/tools.md index 4f806a9db..1a9ba7d2b 100644 --- a/support/doc/tools.md +++ b/support/doc/tools.md @@ -59,7 +59,8 @@ $ npm run build:server ### CLI wrapper -The 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"`: +The wrapper provides a convenient interface to the following scripts. +You can access it as `peertube` via an alias in your `.bashrc` like `alias peertube="cd /your/peertube/directory/ && node ./dist/server/tools/peertube.js"` (you have to keep the `cd` command): ``` Usage: peertube [command] [options] -- cgit v1.2.3 From cfeae291c00812bb99e88bdec785792ae5d5934e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 17 Jan 2019 16:15:20 +0100 Subject: Bumped to version v1.2.0-rc.1 --- support/doc/api/openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'support') diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index 535dfdd4c..cca555806 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: PeerTube - version: 1.1.0 + version: 1.2.0-rc.1 contact: name: PeerTube Community url: 'https://joinpeertube.org' -- cgit v1.2.3 From 4a57b65cc5a3cea50c30c0e93eee7490845a170d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 29 Jan 2019 09:10:24 +0100 Subject: Support socket.io in nginx template --- support/nginx/peertube | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'support') diff --git a/support/nginx/peertube b/support/nginx/peertube index 914ca3741..54ffdcc32 100644 --- a/support/nginx/peertube +++ b/support/nginx/peertube @@ -158,4 +158,16 @@ server { proxy_set_header Host $host; proxy_pass http://localhost:9000; } + + location /socket.io { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $host; + + proxy_pass http://localhost:9000; + + # enable WebSockets + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } } -- cgit v1.2.3 From f5305c04aae14467d6f957b713c5a902275cbb89 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 6 Feb 2019 11:57:57 +0100 Subject: Bumped to version v1.2.0 --- support/doc/api/openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'support') diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index cca555806..f2bb945f9 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: PeerTube - version: 1.2.0-rc.1 + version: 1.2.0 contact: name: PeerTube Community url: 'https://joinpeertube.org' -- cgit v1.2.3