Commit Graph

801 Commits

Author SHA1 Message Date
Chocobozzz
731a32e334
More robust youtube-dl thumbnail import 2021-10-11 09:37:26 +02:00
Chocobozzz
790c2837dd
Fix silent 500 after resumable upload 2021-09-09 09:35:30 +02:00
Chocobozzz
3419e0e1fe
Migrate to webdriverio 2021-09-01 15:06:46 +02:00
Chocobozzz
e3c9ea7226
Add peertube import test 2021-08-27 16:21:19 +02:00
Chocobozzz
41fb13c330
esModuleInterop to true 2021-08-27 15:12:22 +02:00
Chocobozzz
8f58172565
Allow accounts to skip account setup modal 2021-08-27 10:15:55 +02:00
Chocobozzz
7b6cf83e33
Fix redundancy remove on host redundancy update 2021-08-26 10:01:42 +02:00
Chocobozzz
98ab5dc810
Remove useless async 2021-08-26 10:01:42 +02:00
Jelle Besseling
0305db28c9
Add support for saving video files to object storage (#4290)
* Add support for saving video files to object storage

* Add support for custom url generation on s3 stored files

Uses two config keys to support url generation that doesn't directly go
to (compatible s3). Can be used to generate urls to any cache server or
CDN.

* Upload files to s3 concurrently and delete originals afterwards

* Only publish after move to object storage is complete

* Use base url instead of url template

* Fix mistyped config field

* Add rudenmentary way to download before transcode

* Implement Chocobozzz suggestions

https://github.com/Chocobozzz/PeerTube/pull/4290#issuecomment-891670478

The remarks in question:
    Try to use objectStorage prefix instead of s3 prefix for your function/variables/config names
    Prefer to use a tree for the config: s3.streaming_playlists_bucket -> object_storage.streaming_playlists.bucket
    Use uppercase for config: S3.STREAMING_PLAYLISTS_BUCKETINFO.bucket -> OBJECT_STORAGE.STREAMING_PLAYLISTS.BUCKET (maybe BUCKET_NAME instead of BUCKET)
    I suggest to rename moveJobsRunning to pendingMovingJobs (or better, create a dedicated videoJobInfo table with a pendingMove & videoId columns so we could also use this table to track pending transcoding jobs)
    https://github.com/Chocobozzz/PeerTube/pull/4290/files#diff-3e26d41ca4bda1de8e1747af70ca2af642abcc1e9e0bfb94239ff2165acfbde5R19 uses a string instead of an integer
    I think we should store the origin object storage URL in fileUrl, without base_url injection. Instead, inject the base_url at "runtime" so admins can easily change this configuration without running a script to update DB URLs

* Import correct function

* Support multipart upload

* Remove import of node 15.0 module stream/promises

* Extend maximum upload job length

Using the same value as for redundancy downloading seems logical

* Use dynamic part size for really large uploads

Also adds very small part size for local testing

* Fix decreasePendingMove query

* Resolve various PR comments

* Move to object storage after optimize

* Make upload size configurable and increase default

* Prune webtorrent files that are stored in object storage

* Move files after transcoding jobs

* Fix federation

* Add video path manager

* Support move to external storage job in client

* Fix live object storage tests

Co-authored-by: Chocobozzz <me@florianbigard.com>
2021-08-17 08:26:20 +02:00
Chocobozzz
679c12e69c
Improve target bitrate calculation 2021-08-06 14:13:26 +02:00
Chocobozzz
d688602710
Refactor search query options 2021-07-29 11:54:38 +02:00
Chocobozzz
b033851fb5
Search channels against handles and not names 2021-07-29 10:27:24 +02:00
Chocobozzz
fbd67e7f38
Add ability to search by uuids/actor names 2021-07-28 16:40:21 +02:00
Chocobozzz
fa47956ecf
Filter host for channels and playlists search 2021-07-28 10:32:40 +02:00
Chocobozzz
15a7eafb89
Refactor video links builders 2021-07-26 15:04:37 +02:00
Chocobozzz
764b1a14fc Use random names for VOD HLS playlists 2021-07-26 11:29:31 +02:00
Chocobozzz
83903cb65d Generate random uuid for video files 2021-07-26 11:29:31 +02:00
Chocobozzz
20bafcb61b
Move apicache in peertube
Allow us to upgrade to node 16
2021-07-22 11:48:24 +02:00
Chocobozzz
d1aed10353
Add overviews filter hook tests 2021-07-21 16:13:20 +02:00
Michael Williams
64f9b91de9
Add new filter hooks to /overviews/videos
This change adds new filter hooks `filter:api.overviews.videos.list.params` and `filter:api.overviews.videos.list.params` to /overviews/videos.

The motivation is to make a plugin to [use `originallyPublishedAt` in all places where `publishedAt` is used](https://github.com/ahdinosaur/peertube-plugin-originally-published-at).
2021-07-21 16:01:34 +02:00
Chocobozzz
4d029ef8ec
Add ability for instances to follow any actor 2021-07-21 13:35:31 +02:00
Chocobozzz
4c7e60bc17
Reorganize imports 2021-07-20 15:27:19 +02:00
Chocobozzz
c0e8b12e7f
Refactor requests 2021-07-20 15:27:18 +02:00
Chocobozzz
7926c5f9b3
Introduce user command 2021-07-20 15:27:18 +02:00
Chocobozzz
12edc1495a
Introduce comments command 2021-07-20 15:27:18 +02:00
Chocobozzz
e6346d59e6
Introduce playlist command 2021-07-20 15:27:18 +02:00
Chocobozzz
883a901908
Introduce debug command 2021-07-20 15:27:17 +02:00
Chocobozzz
d4a8e7a65f Support short uuid for GET video/playlist 2021-06-29 14:56:35 +02:00
kontrollanten
e2e0b645cd
Add video-playlist-element.created hook (#4196)
* add playlists.videos.list.params/results hooks

closes #4192

* Revert "add playlists.videos.list.params/results hooks"

This reverts commit ebd822ca0b.

* add video-playlist-element.created hook

closes #4192

* test: add playlist-element.created

* Fix tests

Co-authored-by: Chocobozzz <me@florianbigard.com>
2021-06-28 09:22:15 +02:00
Chocobozzz
37a44fc915 Add ability to search playlists 2021-06-25 14:44:01 +02:00
Chocobozzz
8ebf2a5d5d
Refactor live manager 2021-06-17 08:47:03 +02:00
Chocobozzz
eae0365b5c
Fix missing transactions 2021-06-15 10:40:06 +02:00
Chocobozzz
ca4b4b2e55
Fetch directly all video attributes for get API 2021-06-11 09:57:19 +02:00
Chocobozzz
1d43c3a613
Use separate queries for video files 2021-06-11 09:31:59 +02:00
Chocobozzz
ea54cd04c1
Fix video upload with a capitalized ext 2021-06-08 10:01:50 +02:00
Rigel Kent
c756bae079
add video upload types, add doc middleware to more routes 2021-06-06 10:21:06 +02:00
Chocobozzz
91f8f8db97
createThumbnail -> updateThumbnail 2021-06-04 15:45:44 +02:00
Rigel Kent
1333ab1f2d
add operationId doc middleware to so API endpoints 2021-06-04 09:21:46 +02:00
Rigel Kent
1c627fd8d2
refactor docMiddleware to support operationId-only form 2021-06-04 09:21:46 +02:00
Chocobozzz
10363c74c1
Move middleware utils in middlewares
helpers modules should not import models
2021-06-03 18:03:36 +02:00
Chocobozzz
136d7efde7
Refactor AP actors 2021-06-03 16:40:32 +02:00
Chocobozzz
e030bfb59d
Refactor server errors handler 2021-06-02 18:15:41 +02:00
Chocobozzz
304a84d59c
Refactor getOrCreateAPVideo 2021-06-02 16:57:53 +02:00
Rigel Kent
3866ea02d4 correct error codes and backward compat 2021-06-02 16:57:07 +02:00
Rigel Kent
76148b27f7 refactor API errors to standard error format 2021-06-02 16:57:07 +02:00
Poslovitch
1f256e7d3c
Implemented configurable minimum signup age
Implements https://github.com/Chocobozzz/PeerTube/issues/3612

Fixed lint and removed debug

Fixed another lint error

Apply suggestions from code review

Co-authored-by: Chocobozzz <chocobozzz@cpy.re>

Add tests for min signup age config
2021-05-28 13:56:05 +02:00
Chocobozzz
012580d98f
Cleanup
We must not expose private actor objects to clients
Just make 2 GET requests on channel/accounts instead
2021-05-28 10:22:50 +02:00
Chocobozzz
8f608a4cb2
Merge branch 'develop' into shorter-URLs-channels-accounts 2021-05-27 16:12:41 +02:00
Chocobozzz
2539932e16
Instance homepage support (#4007)
* Prepare homepage parsers

* Add ability to update instance hompage

* Add ability to set homepage as landing page

* Add homepage preview in admin

* Dynamically update left menu for homepage

* Inject home content in homepage

* Add videos list and channel miniature custom markup

* Remove unused elements in markup service
2021-05-27 15:59:55 +02:00
Chocobozzz
c158a5faab
Refactor a little bit controllers 2021-05-12 16:57:31 +02:00
Chocobozzz
16c016e8b1
Stricter models typing 2021-05-12 14:12:14 +02:00
Chocobozzz
32985a0a77
Error if importing a torrent with multiple files 2021-05-11 14:56:30 +02:00
Chocobozzz
428ccb8b7a
Reorganize plugin models 2021-05-11 13:33:11 +02:00
Chocobozzz
2b02c520e6
Cleanup shared models 2021-05-11 11:32:31 +02:00
Chocobozzz
7d9ba5c089
Cleanup models directory organization 2021-05-11 11:32:31 +02:00
Chocobozzz
1bcb03a100
Use a class for youtube-dl 2021-05-11 11:32:31 +02:00
kontrollanten
f6d6e7f861
Resumable video uploads (#3933)
* WIP: resumable video uploads

relates to #324

* fix review comments

* video upload: error handling

* fix audio upload

* fixes after self review

* Update server/controllers/api/videos/index.ts

Co-authored-by: Rigel Kent <par@rigelk.eu>

* Update server/middlewares/validators/videos/videos.ts

Co-authored-by: Rigel Kent <par@rigelk.eu>

* Update server/controllers/api/videos/index.ts

Co-authored-by: Rigel Kent <par@rigelk.eu>

* update after code review

* refactor upload route

- restore multipart upload route
- move resumable to dedicated upload-resumable route
- move checks to middleware
- do not leak internal fs structure in response

* fix yarn.lock upon rebase

* factorize addVideo for reuse in both endpoints

* add resumable upload API to openapi spec

* add initial test and test helper for resumable upload

* typings for videoAddResumable middleware

* avoid including aws and google packages via node-uploadx, by only including uploadx/core

* rename ex-isAudioBg to more explicit name mentioning it is a preview file for audio

* add video-upload-tmp-folder-cleaner job

* stronger typing of video upload middleware

* reduce dependency to @uploadx/core

* add audio upload test

* refactor resumable uploads cleanup from job to scheduler

* refactor resumable uploads scheduler to compare to last execution time

* make resumable upload validator to always cleanup on failure

* move legacy upload request building outside of uploadVideo test helper

* filter upload-resumable middlewares down to POST, PUT, DELETE

also begin to type metadata

* merge add duration functions

* stronger typings and documentation for uploadx behaviour, move init validator up

* refactor(client/video-edit): options > uploadxOptions

* refactor(client/video-edit): remove obsolete else

* scheduler/remove-dangling-resum: rename tag

* refactor(server/video): add UploadVideoFiles type

* refactor(mw/validators): restructure eslint disable

* refactor(mw/validators/videos): rename import

* refactor(client/vid-upload): rename html elem id

* refactor(sched/remove-dangl): move fn to method

* refactor(mw/async): add method typing

* refactor(mw/vali/video): double quote > single

* refactor(server/upload-resum): express use > all

* proper http methud enum server/middlewares/async.ts

* properly type http methods

* factorize common video upload validation steps

* add check for maximum partially uploaded file size

* fix audioBg use

* fix extname(filename) in addVideo

* document parameters for uploadx's resumable protocol

* clear META files in scheduler

* last audio refactor before cramming preview in the initial POST form data

* refactor as mulitpart/form-data initial post request

this allows preview/thumbnail uploads alongside the initial request,
and cleans up the upload form

* Add more tests for resumable uploads

* Refactor remove dangling resumable uploads

* Prepare changelog

* Add more resumable upload tests

* Remove user quota check for resumable uploads

* Fix upload error handler

* Update nginx template for upload-resumable

* Cleanup comment

* Remove unused express methods

* Prefer to use got instead of raw http

* Don't retry on error 500

Co-authored-by: Rigel Kent <par@rigelk.eu>
Co-authored-by: Rigel Kent <sendmemail@rigelk.eu>
Co-authored-by: Chocobozzz <me@florianbigard.com>
2021-05-10 11:13:41 +02:00
Chocobozzz
e024fd6a74
Update channel updatedAt when uploading a video 2021-05-10 09:38:11 +02:00
Kimsible
1e37d32f4b Add server API actors route 2021-05-05 11:47:03 +02:00
Chocobozzz
1fd61899ea
Add ability to filter my videos by live 2021-05-03 16:42:15 +02:00
Chocobozzz
8280d0c227
Ensure to install supported plugins 2021-04-12 10:10:48 +02:00
Chocobozzz
22820226e5
Add server plugin helpers 2021-04-09 15:17:43 +02:00
Chocobozzz
cdeddff142 Add ability to update the banner 2021-04-08 10:07:53 +02:00
Chocobozzz
213e30ef90 Add banner tests 2021-04-08 10:07:53 +02:00
Chocobozzz
2cb03dc1f4 Add banners support 2021-04-08 10:07:53 +02:00
Chocobozzz
f479685678 Agnostic actor image storage 2021-04-08 10:07:53 +02:00
Chocobozzz
74a4d53110
Add server hooks for search endpoint 2021-03-24 18:18:41 +01:00
Chocobozzz
97aeb3cc46
Fix external on logout hook 2021-03-24 18:18:41 +01:00
Chocobozzz
f43db2f46e
Refactor auth flow
Reimplement some node-oauth2-server methods to remove hacky code needed by our external
login workflow
2021-03-24 18:18:41 +01:00
Chocobozzz
32a18cbf33
Add new plugin/peertube version notifs 2021-03-24 18:18:41 +01:00
Chocobozzz
e5abb482c3
Fix index search 2021-03-24 18:18:40 +01:00
Chocobozzz
b329abc2f0
Fix request body limit 2021-03-24 18:18:40 +01:00
Chocobozzz
18b24b2dc5
Add jobs tag to logger 2021-03-24 18:18:40 +01:00
Chocobozzz
db4b15f21f
Use got instead of request 2021-03-24 18:18:40 +01:00
Chocobozzz
452b3bea08
Introduce tags to the logger
That could help to filter unneeded logs and/or select particular
components
2021-03-24 18:18:40 +01:00
Chocobozzz
6c9c3b7b14
Fix emptying video tags 2021-03-03 11:03:30 +01:00
Chocobozzz
8795d6f254
Fix broken local actors
Some channels can't federate because they don't have public/private
keys, maybe because the generation failed for various reasons
2021-02-26 14:22:25 +01:00
Chocobozzz
d61893f723 Async torrent creation 2021-02-25 15:01:07 +01:00
Chocobozzz
300cb723eb
Fix tests 2021-02-19 11:27:38 +01:00
Chocobozzz
2a021e6cb6
Fix thread replies API response 2021-02-19 10:52:31 +01:00
Chocobozzz
285981f4dd
Optimize rate endpoint 2021-02-19 10:26:58 +01:00
Chocobozzz
9d6b9d10ef
Fix video comments display with deleted comments 2021-02-19 10:06:52 +01:00
Chocobozzz
fae6e4da8f Try to speed up server tests 2021-02-19 09:36:50 +01:00
Chocobozzz
8efc27bf14 Cleanup 2021-02-18 13:38:09 +01:00
Chocobozzz
b3d5cb92b1 Add ability to update torrents cache in client 2021-02-18 13:38:09 +01:00
Chocobozzz
90a8bd305d Dissociate video file names and video uuid 2021-02-18 13:38:09 +01:00
Chocobozzz
a35a22797c Remove previous thumbnail if needed 2021-02-16 10:36:44 +01:00
Chocobozzz
6302d599cd Generate a name for caption files 2021-02-16 10:36:44 +01:00
Chocobozzz
e3b4c084cd
Guess if we need to generate the thumbnail for imports 2021-02-12 09:37:01 +01:00
Chocobozzz
9129b7694d Allow to specify transcoding and import jobs concurrency 2021-02-08 15:38:45 +01:00
Chocobozzz
6d989edc66
Add ability to update plugin auth 2021-02-01 15:39:13 +01:00
Chocobozzz
1896bca09e
Support transcoding options/encoders by plugins 2021-01-28 15:55:39 +01:00
Rigel Kent
ba5d4a849c move from trending routes to alg param 2021-01-28 15:55:34 +01:00
Rigel Kent
3da68f0a78 add default trending page choice, revert comments count for hot strategy 2021-01-28 15:55:34 +01:00
Chocobozzz
e08ff02a9f
Allow webp image uploads 2021-01-26 10:29:57 +01:00
Chocobozzz
77d7e851dc Add priority to transcoding jobs
(1 = highest priority)

100 for new resolutions
10 for original file optimization

Add a malus for transcoding jobs depending on how many uploads the user did in the
last 7 days
2021-01-25 14:38:52 +01:00
Chocobozzz
3b01f4c0ac
Support progress for ffmpeg tasks 2021-01-21 14:42:43 +01:00
Chocobozzz
a4d2ca0715
Add user video list hooks 2021-01-20 15:28:34 +01:00
Chocobozzz
805b8619c1
Fix (again) youtube import 2021-01-19 16:36:21 +01:00
Rigel Kent
370240824e
Allow users/visitors to search through an account's videos (#3589)
* WIP: account search

* add search to account view

* add tests for account search
2021-01-19 13:43:33 +01:00