1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Implement remote runner jobs in server

Move ffmpeg functions to @shared
This commit is contained in:
Chocobozzz 2023-04-21 14:55:10 +02:00 committed by Chocobozzz
parent 6bcb854cde
commit 0c9668f779
168 changed files with 6907 additions and 2803 deletions

View file

@ -15,6 +15,10 @@ function isSafePath (p: string) {
})
}
function isSafeFilename (filename: string, extension: string) {
return typeof filename === 'string' && !!filename.match(new RegExp(`^[a-z0-9-]+\\.${extension}$`))
}
function isSafePeerTubeFilenameWithoutExtension (filename: string) {
return filename.match(/^[a-z0-9-]+$/)
}
@ -177,5 +181,6 @@ export {
toIntArray,
isFileValid,
isSafePeerTubeFilenameWithoutExtension,
isSafeFilename,
checkMimetypeRegex
}