ActivityPub-federated video streaming platform using P2P directly in your web browser
Merge branch 'release/v8.1.x' into develop
Chocobozzz969b978d33f3
diff --cc CHANGELOG.mdindex 0f19ac0fbc,0156551da7..1b00d3e0c8--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -1,127 -1,21 +1,143 @@@# Changelog+ ## v8.1.6++ ### IMPORTANT NOTES++ * Follow v8.1.0 IMPORTANT NOTES if you upgrade from PeerTube <= v8.0.2++ ### SECURITY++ * Fix SQL injection coming from actor inbox URL when updating actor follow scores+ * Reject JSON-LD objects with special properties+ * Restricts role assignment to administrators only+ * Prevent external auth token replay+ * Prevent SSRF on import and channel sync+ * Stricter rate limit to ask password reset+++## v8.2.0-rc.1++### IMPORTANT NOTES++ * Remove NodeJS 20 support. Please upgrade to NodeJS 22 (>= 22.12) before upgrading PeerTube+ * The public access of `/api/v1/accounts` API endpoint is deprecated for privacy reasons and will be behind an admin/moderator auth access in PeerTube v9, planned for the end of 2027+ * iOS versions < 15.4 are not supported anymore++### NGINX++ * Fix an important NGINX I/O issue when users download a video: https://github.com/Chocobozzz/PeerTube/commit/5fa456e6e76af682d9f03be779d98b0779c4fbd3+ Please upgrade your NGINX configuration++### Sysadmin++ * [prune-storage script](https://docs.joinpeertube.org/maintain/tools#prune-filesystem-object-storage) can now be run without stopping PeerTube+ * Add video `pivacy` tag for `peertube_videos_total` OTEL metric++### Configuration++*This section is not exhaustive*++ * Add `download.max_total_bytes_per_second` and `download.max_bytes_per_ip_per_second` configuration keys to throttle video downloads.+ These new keys help prevent instability when botnets download the entire PeerTube catalog+ * Add ability to provide cookies to `yt-dlp` [#7510](https://github.com/Chocobozzz/PeerTube/pull/7510).+ See the documentation for more information: https://docs.joinpeertube.org/maintain/configuration#use-cookies-for-youtube-imports-when-needed+ * Increase the default refresh token lifetime `oauth2.token_lifetime.refresh_token` to `4 weeks` (instead of `2 weeks`)+ * Allow admins to configure the default state of the *Automatically publish a replay when your live ends* option [#7414](https://github.com/Chocobozzz/PeerTube/pull/7414)++### Docker++ * The entire PeerTube configuration can be set using environment variables.+ Keep in mind that environment variable configuration keys override web admin configuration++### Plugins/Themes/Embed API++ * Add server plugin hooks (https://docs.joinpeertube.org/api/plugins):+ * `filter:api.user.signup.requires-approval.result`+ * `filter:notifier.notification.enabled.result`+ * Add a server plugin helper:+ * `storageManager.deleteData(key: string)`++### Features++ * :tada: Add ability to transfer a video channel to another user of the same instance :tada:+ * :tada: Add live DVR allowing users to seek within and pause the live [#7396](https://github.com/Chocobozzz/PeerTube/pull/7396) :tada:+ * :tada: Add ability to remove segments of a video in Studio :tada:+ * Support Romanian and Korean languages in web client+ * Improve video ownership change UX:+ * Better table UI in *My Videos* -> *More* -> *Ownership changes*. It also lists ownership change requests for users' videos+ * The video management page now includes a section to transfer ownership of a video and cancel a pending request+ * Add notifications when video ownership is requested/accepted/rejected+ * Add bulk actions to accept/reject an ownership change request+ * Player:+ * Restore playback rates and manual video resolution choice between sessions in the same web browser+ * Add ability to flip the video horizontally [#7478](https://github.com/Chocobozzz/PeerTube/pull/7478)+ * Redesign loading spinner+ * Support podcast feed for playlists+ * Add video download stats for video makers [#7437](https://github.com/Chocobozzz/PeerTube/pull/7437)+ * Improve global UX:+ * Introduce a new table filter component that is simpler to use+ * Default runner job route is the page that lists runner jobs+ * Clicking on a type/state tag automatically filters data for local/runner job states and types, follow states, registration states, and user roles+ * Add video tag information and filter when listing my videos+ * Add ability to bulk accept/reject registration requests+ * Add ability to filter users by role in users overview+ * Improve comments UI on mobile+ * Display subscribe button when subscription state is loaded+ * Add `g p` hotkeys to go to *My playlists* page+ * Improve videos overview for admins:+ * Add ability to filter videos by state+ * Add a mute badge if the video owner is muted by the instance+ * Add ability to filter out videos from muted accounts+ * Improve video blocks overview for admins:+ * Add video privacy column+ * Add bulk actions to unblock, switch to manual block or delete the selected videos+ * Add a mute badge if the video owner is muted by the instance+ * Improve abuses overview for admins:+ * Add bulk action to update internal note, mark as accepted/rejected, delete report, mute reporter/reportee, block/unblock the video, delete the video/comment+ * Add a mute badge if the reporter/reportee is muted by the instance+ * Improve comments overview for admins and users:+ * Clicking on account name filters comments+ * Add a mute badge if the account that commented the video is muted by the instance+ * Add ability to filter out comments from muted accounts+ * Performance:+ * Reduce SQL joins when loading a video from the database+ * Faster video SQL query to retrieve my videos+ * Faster video comments SQL queries for users that list comments on their videos+ * Faster video redundancies SQL queries+ * Reduce number of rows returned by video SQL queries+ * Reduce number of rows returned by comments SQL queries+ * Faster loading of *My channels* page+ * Add `/about` endpoint caching in the client to reduce unnecessary API calls+ * Process ActivityPub `View` and `Download` activities in parallel+ * Forward ActivityPub `View` using parallel broadcast+ * Support ActivityPub `indexable` field for actors+ * Expose runner and runner job queue OpenTelemetry metrics [#7469](https://github.com/Chocobozzz/PeerTube/pull/7469)+ * Prevent stale follows by periodically re-sending `Follow` ActivityPub requests to remote instances+ * Improve follows reliability algorithm to reject followers that have been consistently down for ~7 days++### Bug fixes++ * Fix plugin settings to display default values when not configured in the DB [#7484](https://github.com/Chocobozzz/PeerTube/pull/7484)+ * Fix actor host link in miniature instance dropdown if search index is disabled+ * Fix missing stream error handling in web video object storage proxy [#7535](https://github.com/Chocobozzz/PeerTube/pull/7535)+ * Fix caption filename overflow+ * Fix setting a thumbnail from a video that is stored in object storage+ * Fix instance redundancies pagination+ * Filter out non-text languages for captions+ * Increase lazy static files cache time (thumbnails, captions, actor avatars/banners, etc.) to 1 year+ * Correctly log uncaught exceptions or unhandled promise rejections in file logger+ * Prevent page scrolling when applying filters while browsing instance/account/channel videos+ * Fix infinite scroll when listing my followers+ * Handle errors when updating a video playlist+ * Fix download filename if the video contains non-Latin characters+ * Fix font colors in emails by only injecting custom admin colors when the default theme is `light-beige` or `dark-brown`, to prevent accessibility issues+ * Fix broken audio stream P2P for lives+ * Fix broke HLS transcoding on concurrent video privacy change+ * Don't unpause the player when clicking on a transcription segment+ * Fix table page navigation on registration action++## v8.1.5### IMPORTANT NOTESdiff --cc package.jsonindex 6ef94fe527,5cd0319e44..30b686c49e--- a/package.json+++ b/package.json@@@ -183,9 -183,9 +183,9 @@@"piscina": "^5.1.4","prompts": "^2.4.2","proxy-addr": "^2.0.7",- "pug": "^3.0.3",+ "pug": "^3.0.4","reflect-metadata": "^0.2.2",- "sanitize-html": "~2.17.3",+ "sanitize-html": "~2.17.4","sequelize": "~6.37.8","sequelize-typescript": "^2.1.6","sharp": "^0.34.5",diff --cc pnpm-lock.yamlindex 3a60a73346,fa89cdf8af..5a43fca848--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@@ -312,14 -315,14 +312,14 @@@ importersspecifier: ^0.2.2version: 0.2.2sanitize-html:- specifier: ~2.17.3- version: 2.17.3+ specifier: ~2.17.4+ version: 2.17.4sequelize:specifier: ~6.37.8- version: 6.37.8([email protected])+ version: 6.37.8([email protected])sequelize-typescript:specifier: ^2.1.6- version: 2.1.6(@types/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))+ version: 2.1.6(@types/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))sharp:specifier: ^0.34.5version: 0.34.5@@@ -4982,9 -4349,10 +4982,10 @@@ packages'@webtorrent/[email protected]':resolution: {integrity: sha512-GWZQKroPES4z91Ijx6zsOsb7+USOxjy66s8AoTWg0HiBBdfnbtf9aeh3Uav0MgYn4BL8Q7tVSUpd0gGpngKGEQ==}- '@xmldom/[email protected]':- resolution: {integrity: sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==}+ '@xmldom/[email protected]':+ resolution: {integrity: sha512-KRYzxepc14G/CEpEGc3Yn+JKaAeT63smlDr+vjB8jRfgTBBI9wRj/nkQEO+ucV8p8I9bfKLWp37uHgFrbntPvw==}engines: {node: '>=10.0.0'}+ deprecated: this version has critical issues, please update to the latest version'@yarnpkg/[email protected]':resolution: {integrity: sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==}@@@ -5400,9 -4762,10 +5401,10 @@@resolution: {integrity: sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==}engines: {node: '>= 0.8'}- resolution: {integrity: sha512-VoMINM2rqJwJgfdHq6RiUudKt2BV+FY5ZFezP/ypmwayk68+NzzAQy4XXLlqsGD4MCzq3DrmNFD/uUmBJuGoXw==}+ resolution: {integrity: sha512-bopVNp6ugyA150DDuZfPFdt1KZ5a94ZDiwX4hMgZDzF+GttD80lEy8kj98kbyhLXnPvhtIo93mdnLIjpCAeeOw==}engines: {node: '>=10.0.0'}+ deprecated: Security vulnerability fixed in 5.2.1, please upgraderesolution: {integrity: sha512-cU8v/EGSrnH+HnxV2z0J7/blxH8gq7Xh2JFT6Aroax7UohdmiJJlxApMxtKfuI7z68NvvVcmR78k2LbT6efhRg==}@@@ -8165,9 -7413,9 +8170,12 @@@resolution: {integrity: sha512-t+KLJFkHPQk8lfN6WBOiGkiUXoub+gnb2XTYI2P3aiISL+94xgZ1vgz1SXN/N4hthuOoLXarXfBZPUruyjQtfA==}+ resolution: {integrity: sha512-4VVDnbOpLXy/s8rdRCSXb+zfMeFR0WlJWpET1iA9CQdlZDfwyLjUuGQzXU4VeOoey6AicSAluWan7Etga6Kcmg==}++ resolution: {integrity: sha512-mU6WRz5EusL9ZZuiZ5SO4Y6C0P9PAUR9iwdb6bzj4KDihm28DiHFw+/yk9DBH4f+Pv1wuzQ4e2jV3oQ7mkIqvw==}+resolution: {integrity: sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==}engines: {node: '>= 0.6.3'}@@@ -10163,15 -9234,15 +10171,15 @@@resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}- resolution: {integrity: sha512-Kn4srCAo2+wZyvCNKCSyB2g8RQ8IkX/gQs2uqoSRNu5t9I2qvUyAVvRDiFUVAiX3N3PNuwStY0eNr+ooBHVWEg==}+ resolution: {integrity: sha512-2HW7v2ol/uAM7sX4hbD8Z59OGWmAPrvjL8E71UWlBcj6m+kcF6ilQBLny+cIgY214QJeJT5tQuxKKqX0SQqjGQ==}- resolution: {integrity: sha512-t6N46NlPuXiY3rlmG6/+1nwebOBOaLFOOVqNQOC2cJhghOD4hh2kHNQQTorCsbY9S1Kir2la1/XLBwOJfui0xg==}+ resolution: {integrity: sha512-qPIRG8Uhjo6/OKyAKixTnwMliTz+t9K6Duk0mx5z+K7n0Ts38NSJz2sjDnc7cA/8V9Lb3q09H38dZ1CLwD+ssw==}cpu: ['!arm', '!arm64', '!riscv64', '!x64']- resolution: {integrity: sha512-aiZ6iqiHsUsaDx0EFbbmmA0QgxicSxVVN3lnJJ0f1RStY0DthUkquGT5RJ4TPdaZ6ebeJWkboV4bra+CP766eA==}+ resolution: {integrity: sha512-fNHhdnP23yqqieCbAdym4N47AleSwjbNt6OYIYx4DdACGdtERjQB4iOX/TaKsW034MupfF7SjnAAK8w7Ptldtg==}engines: {node: '>=14.0.0'}cpu: [arm64]os: [android]@@@ -20293,11 -18575,10 +20303,15 @@@ snapshotsoptional: true+ dependencies:+ picocolors: 1.1.1+ shell-quote: 1.8.3++ dependencies:+ dayjs: 1.11.20+dependencies:readable-stream: 2.3.8@@@ -22707,70 -20751,71 +22721,71 @@@escape-string-regexp: 4.0.0htmlparser2: 10.1.0is-plain-object: 5.0.0+ launder: 1.7.1parse-srcset: 1.0.2- postcss: 8.5.6+ postcss: 8.5.14dependencies:- sass: 1.97.3+ sass: 1.99.0optional: trueoptional: trueoptional: trueoptional: trueoptional: trueoptional: trueoptional: trueoptional: trueoptional: trueoptional: trueoptional: trueoptional: trueoptional: trueoptional: trueoptional: truedependencies:- sass: 1.97.3+ sass: 1.99.0optional: trueoptional: trueoptional: truedependencies:- '@bufbuild/protobuf': 2.11.0+ '@bufbuild/protobuf': 2.12.0colorjs.io: 0.5.2immutable: 5.1.5rxjs: 7.8.2diff --cc server/core/lib/job-queue/handlers/video-import.tsindex c70b620b4f,db79d42036..1ee774783b--- a/server/core/lib/job-queue/handlers/video-import.ts+++ b/server/core/lib/job-queue/handlers/video-import.ts@@@ -91,11 -92,22 +91,15 @@@ exportasync function processTorrentImport (job: Job, videoImport: MVideoImportDefault, payload: VideoImportTorrentPayload) {logger.info('Processing torrent video import in job %s.', job.id)- return processFile(- () => downloadWebTorrentVideo({ torrentPath: payload.torrentPath, uri: videoImport.magnetUri }, JOB_TTL['video-import']),- const target = {- torrentName: videoImport.torrentName- ? getSecureTorrentName(videoImport.torrentName)- : undefined,- uri: videoImport.magnetUri- }-+ const user = await UserModel.loadById(videoImport.userId)++ return processFile({- downloader: () => downloadWebTorrentVideo(target, JOB_TTL['video-import']),++ downloader: () => downloadWebTorrentVideo({ torrentPath: payload.torrentPath, uri: videoImport.magnetUri }, JOB_TTL['video-import']),videoImport,- { type: payload.type, generateTranscription: payload.generateTranscription, videoImportId: payload.videoImportId }- )+ type: payload.type,+ generateTranscription: payload.generateTranscription,+ user+ })}async function processYoutubeDLImport (job: Job, videoImport: MVideoImportDefault, payload: VideoImportYoutubeDLPayload) {@@@ -146,8 -167,6 +159,7 @@@ async function processFile (options:// Get information about this videoconst stats = await stat(tmpVideoPath)- const user = await UserModel.loadByVideoId(videoImport.videoId)+ if (!user) throw new Error('Video does not exist anymore')const isAble = await isUserQuotaValid({ channelUserId: user.id, uploadSize: stats.size })if (isAble === false) {