diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build/client.sh | 7 | ||||
-rwxr-xr-x | scripts/ci.sh | 53 | ||||
-rw-r--r-- | scripts/create-import-video-file-job.ts | 6 | ||||
-rwxr-xr-x | scripts/create-transcoding-job.ts | 2 | ||||
-rwxr-xr-x | scripts/dev/client.sh | 8 | ||||
-rwxr-xr-x | scripts/dev/index.sh | 2 | ||||
-rwxr-xr-x | scripts/generate-code-contributors.ts | 1 | ||||
-rw-r--r-- | scripts/optimize-old-videos.ts | 2 | ||||
-rwxr-xr-x | scripts/parse-log.ts | 7 | ||||
-rwxr-xr-x | scripts/plugin/install.ts | 2 | ||||
-rwxr-xr-x | scripts/plugin/uninstall.ts | 2 | ||||
-rw-r--r-- | scripts/print-transcode-command.ts | 4 | ||||
-rwxr-xr-x | scripts/prune-storage.ts | 4 | ||||
-rw-r--r-- | scripts/regenerate-thumbnails.ts | 2 | ||||
-rwxr-xr-x | scripts/reset-password.ts | 4 | ||||
-rwxr-xr-x | scripts/test.sh | 4 | ||||
-rwxr-xr-x | scripts/update-host.ts | 4 | ||||
-rwxr-xr-x | scripts/upgrade.sh | 2 |
18 files changed, 68 insertions, 48 deletions
diff --git a/scripts/build/client.sh b/scripts/build/client.sh index aec138653..5ecbff28d 100755 --- a/scripts/build/client.sh +++ b/scripts/build/client.sh | |||
@@ -40,7 +40,7 @@ languages=( | |||
40 | 40 | ||
41 | cd client | 41 | cd client |
42 | 42 | ||
43 | rm -rf ./dist ./compiled | 43 | rm -rf ./dist |
44 | 44 | ||
45 | # Don't build other languages if --light arg is provided | 45 | # Don't build other languages if --light arg is provided |
46 | if [ -z ${1+x} ] || ([ "$1" != "--light" ] && [ "$1" != "--analyze-bundle" ]); then | 46 | if [ -z ${1+x} ] || ([ "$1" != "--light" ] && [ "$1" != "--analyze-bundle" ]); then |
@@ -49,7 +49,7 @@ if [ -z ${1+x} ] || ([ "$1" != "--light" ] && [ "$1" != "--analyze-bundle" ]); t | |||
49 | additionalParams="--sourceMap=true" | 49 | additionalParams="--sourceMap=true" |
50 | fi | 50 | fi |
51 | 51 | ||
52 | npm run ng build -- --prod --output-path "dist/build" $additionalParams | 52 | node --max_old_space_size=8192 node_modules/.bin/ng build --configuration production --output-path "dist/build" $additionalParams |
53 | 53 | ||
54 | for key in "${!languages[@]}"; do | 54 | for key in "${!languages[@]}"; do |
55 | lang=${languages[$key]} | 55 | lang=${languages[$key]} |
@@ -72,7 +72,8 @@ else | |||
72 | export ANALYZE_BUNDLE=true | 72 | export ANALYZE_BUNDLE=true |
73 | fi | 73 | fi |
74 | 74 | ||
75 | npm run ng build -- --localize=false --output-path "dist/$defaultLanguage/" --deploy-url "/client/$defaultLanguage/" --prod --stats-json $additionalParams | 75 | node --max_old_space_size=8192 node_modules/.bin/ng build --localize=false --output-path "dist/$defaultLanguage/" \ |
76 | --deploy-url "/client/$defaultLanguage/" --configuration production --stats-json $additionalParams | ||
76 | fi | 77 | fi |
77 | 78 | ||
78 | cp "./dist/$defaultLanguage/manifest.webmanifest" "./dist/manifest.webmanifest" | 79 | cp "./dist/$defaultLanguage/manifest.webmanifest" "./dist/manifest.webmanifest" |
diff --git a/scripts/ci.sh b/scripts/ci.sh index f4a200a00..07e37e0ee 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh | |||
@@ -25,7 +25,7 @@ runTest () { | |||
25 | joblog="$jobname-ci.log" | 25 | joblog="$jobname-ci.log" |
26 | 26 | ||
27 | parallel -j $jobs --retries $retries \ | 27 | parallel -j $jobs --retries $retries \ |
28 | "echo Trying {} >> $joblog; npm run mocha -- -c --timeout 30000 --exit --require ts-node/register --require tsconfig-paths/register --bail {}" \ | 28 | "echo Trying {} >> $joblog; npm run mocha -- -c --timeout 30000 --exit --require ./dist/server/tests/register.js --bail {}" \ |
29 | ::: $files | 29 | ::: $files |
30 | 30 | ||
31 | cat "$joblog" | uniq -c | 31 | cat "$joblog" | uniq -c |
@@ -33,63 +33,72 @@ runTest () { | |||
33 | } | 33 | } |
34 | 34 | ||
35 | findTestFiles () { | 35 | findTestFiles () { |
36 | find $1 -type f -name "*.ts" | grep -v "/index.ts" | xargs echo | 36 | exception="-not -name index.js" |
37 | |||
38 | if [ ! -z ${2+x} ]; then | ||
39 | exception="$exception -not -name $2" | ||
40 | fi | ||
41 | |||
42 | find $1 -type f -name "*.js" $exception | xargs echo | ||
37 | } | 43 | } |
38 | 44 | ||
39 | if [ "$1" = "misc" ]; then | 45 | if [ "$1" = "client" ]; then |
40 | npm run build | 46 | npm run build |
41 | 47 | ||
42 | feedsFiles=$(findTestFiles server/tests/feeds) | 48 | feedsFiles=$(findTestFiles ./dist/server/tests/feeds) |
43 | helperFiles=$(findTestFiles server/tests/helpers) | 49 | helperFiles=$(findTestFiles ./dist/server/tests/helpers) |
44 | pluginsFiles=$(findTestFiles server/tests/plugins) | 50 | miscFiles="./dist/server/tests/client.js ./dist/server/tests/misc-endpoints.js" |
45 | miscFiles="server/tests/client.ts server/tests/misc-endpoints.ts" | 51 | # Not in plugin task, it needs an index.html |
52 | pluginFiles="./dist/server/tests/plugins/html-injection.js" | ||
46 | 53 | ||
47 | MOCHA_PARALLEL=true TS_NODE_FILES=true runTest "$1" 2 $feedsFiles $helperFiles $pluginsFiles $miscFiles | 54 | MOCHA_PARALLEL=true runTest "$1" 2 $feedsFiles $helperFiles $miscFiles $pluginFiles |
48 | elif [ "$1" = "cli" ]; then | 55 | elif [ "$1" = "cli-plugin" ]; then |
49 | npm run build:server | 56 | npm run build:server |
50 | npm run setup:cli | 57 | npm run setup:cli |
51 | 58 | ||
52 | cliFiles=$(findTestFiles server/tests/cli) | 59 | pluginsFiles=$(findTestFiles ./dist/server/tests/plugins html-injection.js) |
60 | cliFiles=$(findTestFiles ./dist/server/tests/cli) | ||
53 | 61 | ||
62 | MOCHA_PARALLEL=true runTest "$1" 2 $pluginsFiles | ||
54 | runTest "$1" 1 $cliFiles | 63 | runTest "$1" 1 $cliFiles |
55 | elif [ "$1" = "api-1" ]; then | 64 | elif [ "$1" = "api-1" ]; then |
56 | npm run build:server | 65 | npm run build:server |
57 | 66 | ||
58 | checkParamFiles=$(findTestFiles server/tests/api/check-params) | 67 | checkParamFiles=$(findTestFiles ./dist/server/tests/api/check-params) |
59 | notificationsFiles=$(findTestFiles server/tests/api/notifications) | 68 | notificationsFiles=$(findTestFiles ./dist/server/tests/api/notifications) |
60 | searchFiles=$(findTestFiles server/tests/api/search) | 69 | searchFiles=$(findTestFiles ./dist/server/tests/api/search) |
61 | 70 | ||
62 | MOCHA_PARALLEL=true runTest "$1" 3 $notificationsFiles $searchFiles $checkParamFiles | 71 | MOCHA_PARALLEL=true runTest "$1" 3 $notificationsFiles $searchFiles $checkParamFiles |
63 | elif [ "$1" = "api-2" ]; then | 72 | elif [ "$1" = "api-2" ]; then |
64 | npm run build:server | 73 | npm run build:server |
65 | 74 | ||
66 | serverFiles=$(findTestFiles server/tests/api/server) | 75 | liveFiles=$(findTestFiles ./dist/server/tests/api/live) |
67 | usersFiles=$(findTestFiles server/tests/api/users) | 76 | serverFiles=$(findTestFiles ./dist/server/tests/api/server) |
68 | liveFiles=$(findTestFiles server/tests/api/live) | 77 | usersFiles=$(findTestFiles ./dist/server/tests/api/users) |
69 | 78 | ||
70 | MOCHA_PARALLEL=true runTest "$1" 3 $serverFiles $usersFiles $liveFiles | 79 | MOCHA_PARALLEL=true runTest "$1" 3 $serverFiles $usersFiles $liveFiles |
71 | elif [ "$1" = "api-3" ]; then | 80 | elif [ "$1" = "api-3" ]; then |
72 | npm run build:server | 81 | npm run build:server |
73 | 82 | ||
74 | videosFiles=$(findTestFiles server/tests/api/videos) | 83 | videosFiles=$(findTestFiles ./dist/server/tests/api/videos) |
75 | 84 | ||
76 | MOCHA_PARALLEL=true runTest "$1" 3 $videosFiles | 85 | MOCHA_PARALLEL=true runTest "$1" 3 $videosFiles |
77 | elif [ "$1" = "api-4" ]; then | 86 | elif [ "$1" = "api-4" ]; then |
78 | npm run build:server | 87 | npm run build:server |
79 | 88 | ||
80 | moderationFiles=$(findTestFiles server/tests/api/moderation) | 89 | moderationFiles=$(findTestFiles ./dist/server/tests/api/moderation) |
81 | redundancyFiles=$(findTestFiles server/tests/api/redundancy) | 90 | redundancyFiles=$(findTestFiles ./dist/server/tests/api/redundancy) |
82 | activitypubFiles=$(findTestFiles server/tests/api/activitypub) | 91 | activitypubFiles=$(findTestFiles ./dist/server/tests/api/activitypub) |
83 | 92 | ||
84 | MOCHA_PARALLEL=true TS_NODE_FILES=true runTest "$1" 2 $moderationFiles $redundancyFiles $activitypubFiles | 93 | MOCHA_PARALLEL=true TS_NODE_FILES=true runTest "$1" 2 $moderationFiles $redundancyFiles $activitypubFiles |
85 | elif [ "$1" = "external-plugins" ]; then | 94 | elif [ "$1" = "external-plugins" ]; then |
86 | npm run build:server | 95 | npm run build:server |
87 | 96 | ||
88 | externalPluginsFiles=$(findTestFiles server/tests/external-plugins) | 97 | externalPluginsFiles=$(findTestFiles ./dist/server/tests/external-plugins) |
89 | 98 | ||
90 | runTest "$1" 1 $externalPluginsFiles | 99 | runTest "$1" 1 $externalPluginsFiles |
91 | elif [ "$1" = "lint" ]; then | 100 | elif [ "$1" = "lint" ]; then |
92 | npm run eslint -- --ext .ts "server/**/*.ts" "shared/**/*.ts" "scripts/**/*.ts" | 101 | npm run eslint -- --ext .ts "./server/**/*.ts" "shared/**/*.ts" "scripts/**/*.ts" |
93 | npm run swagger-cli -- validate support/doc/api/openapi.yaml | 102 | npm run swagger-cli -- validate support/doc/api/openapi.yaml |
94 | 103 | ||
95 | ( cd client | 104 | ( cd client |
diff --git a/scripts/create-import-video-file-job.ts b/scripts/create-import-video-file-job.ts index 5d38af066..a3a35bc10 100644 --- a/scripts/create-import-video-file-job.ts +++ b/scripts/create-import-video-file-job.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | 1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' |
2 | registerTSPaths() | 2 | registerTSPaths() |
3 | 3 | ||
4 | import * as program from 'commander' | 4 | import { program } from 'commander' |
5 | import { resolve } from 'path' | 5 | import { resolve } from 'path' |
6 | import { VideoModel } from '../server/models/video/video' | 6 | import { VideoModel } from '../server/models/video/video' |
7 | import { initDatabaseModels } from '../server/initializers/database' | 7 | import { initDatabaseModels } from '../server/initializers/database' |
@@ -36,7 +36,7 @@ async function run () { | |||
36 | return | 36 | return |
37 | } | 37 | } |
38 | 38 | ||
39 | const video = await VideoModel.loadByUUID(options.video) | 39 | const video = await VideoModel.load(options.video) |
40 | if (!video) throw new Error('Video not found.') | 40 | if (!video) throw new Error('Video not found.') |
41 | if (video.isOwned() === false) throw new Error('Cannot import files of a non owned video.') | 41 | if (video.isOwned() === false) throw new Error('Cannot import files of a non owned video.') |
42 | 42 | ||
@@ -45,7 +45,7 @@ async function run () { | |||
45 | filePath: resolve(options.import) | 45 | filePath: resolve(options.import) |
46 | } | 46 | } |
47 | 47 | ||
48 | await JobQueue.Instance.init() | 48 | JobQueue.Instance.init() |
49 | await JobQueue.Instance.createJobWithPromise({ type: 'video-file-import', payload: dataInput }) | 49 | await JobQueue.Instance.createJobWithPromise({ type: 'video-file-import', payload: dataInput }) |
50 | console.log('Import job for video %s created.', video.uuid) | 50 | console.log('Import job for video %s created.', video.uuid) |
51 | } | 51 | } |
diff --git a/scripts/create-transcoding-job.ts b/scripts/create-transcoding-job.ts index 56a5f4938..65e65b616 100755 --- a/scripts/create-transcoding-job.ts +++ b/scripts/create-transcoding-job.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | 1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' |
2 | registerTSPaths() | 2 | registerTSPaths() |
3 | 3 | ||
4 | import * as program from 'commander' | 4 | import { program } from 'commander' |
5 | import { VideoModel } from '../server/models/video/video' | 5 | import { VideoModel } from '../server/models/video/video' |
6 | import { initDatabaseModels } from '../server/initializers/database' | 6 | import { initDatabaseModels } from '../server/initializers/database' |
7 | import { JobQueue } from '../server/lib/job-queue' | 7 | import { JobQueue } from '../server/lib/job-queue' |
diff --git a/scripts/dev/client.sh b/scripts/dev/client.sh index e9cade800..1846f9a7d 100755 --- a/scripts/dev/client.sh +++ b/scripts/dev/client.sh | |||
@@ -2,7 +2,13 @@ | |||
2 | 2 | ||
3 | set -eu | 3 | set -eu |
4 | 4 | ||
5 | clientCommand="cd client && node node_modules/.bin/ng serve --proxy-config proxy.config.json --hmr --configuration hmr --host 0.0.0.0 --disable-host-check --port 3000" | 5 | clientConfiguration="hmr" |
6 | |||
7 | if [ ! -z ${2+x} ] && [ "$2" = "--ar-locale" ]; then | ||
8 | clientConfiguration="ar-locale" | ||
9 | fi | ||
10 | |||
11 | clientCommand="cd client && node --max_old_space_size=4096 node_modules/.bin/ng serve --proxy-config proxy.config.json --hmr --configuration $clientConfiguration --host 0.0.0.0 --disable-host-check --port 3000" | ||
6 | serverCommand="npm run build:server && NODE_ENV=test node dist/server" | 12 | serverCommand="npm run build:server && NODE_ENV=test node dist/server" |
7 | 13 | ||
8 | if [ ! -z ${1+x} ] && [ "$1" = "--skip-server" ]; then | 14 | if [ ! -z ${1+x} ] && [ "$1" = "--skip-server" ]; then |
diff --git a/scripts/dev/index.sh b/scripts/dev/index.sh index 56addb7fe..beb88606f 100755 --- a/scripts/dev/index.sh +++ b/scripts/dev/index.sh | |||
@@ -3,5 +3,5 @@ | |||
3 | set -eu | 3 | set -eu |
4 | 4 | ||
5 | NODE_ENV=test npm run concurrently -- -k \ | 5 | NODE_ENV=test npm run concurrently -- -k \ |
6 | "sh scripts/dev/client.sh --skip-server" \ | 6 | "sh scripts/dev/client.sh --skip-server ${1:-}" \ |
7 | "sh scripts/dev/server.sh --skip-client" | 7 | "sh scripts/dev/server.sh --skip-client" |
diff --git a/scripts/generate-code-contributors.ts b/scripts/generate-code-contributors.ts index a077f77a9..db5af3f91 100755 --- a/scripts/generate-code-contributors.ts +++ b/scripts/generate-code-contributors.ts | |||
@@ -37,6 +37,7 @@ async function run () { | |||
37 | console.log(' * `video-language` by Rigel Kent (CC-BY)') | 37 | console.log(' * `video-language` by Rigel Kent (CC-BY)') |
38 | console.log(' * `peertube-x` by Solen DP (CC-BY)') | 38 | console.log(' * `peertube-x` by Solen DP (CC-BY)') |
39 | console.log(' * `flame` by Freepik (Flaticon License)') | 39 | console.log(' * `flame` by Freepik (Flaticon License)') |
40 | console.log(' * `local` by Larea (CC-BY)') | ||
40 | } | 41 | } |
41 | 42 | ||
42 | { | 43 | { |
diff --git a/scripts/optimize-old-videos.ts b/scripts/optimize-old-videos.ts index 01d30244f..9692d76ba 100644 --- a/scripts/optimize-old-videos.ts +++ b/scripts/optimize-old-videos.ts | |||
@@ -5,7 +5,7 @@ import { VIDEO_TRANSCODING_FPS } from '../server/initializers/constants' | |||
5 | import { getDurationFromVideoFile, getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '../server/helpers/ffprobe-utils' | 5 | import { getDurationFromVideoFile, getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '../server/helpers/ffprobe-utils' |
6 | import { getMaxBitrate } from '../shared/models/videos' | 6 | import { getMaxBitrate } from '../shared/models/videos' |
7 | import { VideoModel } from '../server/models/video/video' | 7 | import { VideoModel } from '../server/models/video/video' |
8 | import { optimizeOriginalVideofile } from '../server/lib/video-transcoding' | 8 | import { optimizeOriginalVideofile } from '../server/lib/transcoding/video-transcoding' |
9 | import { initDatabaseModels } from '../server/initializers/database' | 9 | import { initDatabaseModels } from '../server/initializers/database' |
10 | import { basename, dirname } from 'path' | 10 | import { basename, dirname } from 'path' |
11 | import { copy, move, remove } from 'fs-extra' | 11 | import { copy, move, remove } from 'fs-extra' |
diff --git a/scripts/parse-log.ts b/scripts/parse-log.ts index 5f4480c88..c16503589 100755 --- a/scripts/parse-log.ts +++ b/scripts/parse-log.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | 1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' |
2 | registerTSPaths() | 2 | registerTSPaths() |
3 | 3 | ||
4 | import * as program from 'commander' | 4 | import { program } from 'commander' |
5 | import { createReadStream, readdir } from 'fs-extra' | 5 | import { createReadStream, readdir } from 'fs-extra' |
6 | import { join } from 'path' | 6 | import { join } from 'path' |
7 | import { createInterface } from 'readline' | 7 | import { createInterface } from 'readline' |
@@ -85,6 +85,8 @@ function run () { | |||
85 | const files = await getFiles() | 85 | const files = await getFiles() |
86 | 86 | ||
87 | for (const file of files) { | 87 | for (const file of files) { |
88 | if (file === 'peertube-audit.log') continue | ||
89 | |||
88 | console.log('Opening %s.', file) | 90 | console.log('Opening %s.', file) |
89 | 91 | ||
90 | const stream = createReadStream(file) | 92 | const stream = createReadStream(file) |
@@ -140,7 +142,8 @@ function toTimeFormat (time: string) { | |||
140 | 142 | ||
141 | if (isNaN(timestamp) === true) return 'Unknown date' | 143 | if (isNaN(timestamp) === true) return 'Unknown date' |
142 | 144 | ||
143 | return new Date(timestamp).toISOString() | 145 | const d = new Date(timestamp) |
146 | return d.toLocaleString() + `.${d.getMilliseconds()}` | ||
144 | } | 147 | } |
145 | 148 | ||
146 | function containsTags (loggerTags: string[], optionsTags: string[]) { | 149 | function containsTags (loggerTags: string[], optionsTags: string[]) { |
diff --git a/scripts/plugin/install.ts b/scripts/plugin/install.ts index 2ea8a658b..de045c2d2 100755 --- a/scripts/plugin/install.ts +++ b/scripts/plugin/install.ts | |||
@@ -2,7 +2,7 @@ import { registerTSPaths } from '../../server/helpers/register-ts-paths' | |||
2 | registerTSPaths() | 2 | registerTSPaths() |
3 | 3 | ||
4 | import { initDatabaseModels } from '../../server/initializers/database' | 4 | import { initDatabaseModels } from '../../server/initializers/database' |
5 | import * as program from 'commander' | 5 | import { program } from 'commander' |
6 | import { PluginManager } from '../../server/lib/plugins/plugin-manager' | 6 | import { PluginManager } from '../../server/lib/plugins/plugin-manager' |
7 | import { isAbsolute } from 'path' | 7 | import { isAbsolute } from 'path' |
8 | 8 | ||
diff --git a/scripts/plugin/uninstall.ts b/scripts/plugin/uninstall.ts index 8710b1750..1e14cc18f 100755 --- a/scripts/plugin/uninstall.ts +++ b/scripts/plugin/uninstall.ts | |||
@@ -2,7 +2,7 @@ import { registerTSPaths } from '../../server/helpers/register-ts-paths' | |||
2 | registerTSPaths() | 2 | registerTSPaths() |
3 | 3 | ||
4 | import { initDatabaseModels } from '../../server/initializers/database' | 4 | import { initDatabaseModels } from '../../server/initializers/database' |
5 | import * as program from 'commander' | 5 | import { program } from 'commander' |
6 | import { PluginManager } from '../../server/lib/plugins/plugin-manager' | 6 | import { PluginManager } from '../../server/lib/plugins/plugin-manager' |
7 | 7 | ||
8 | program | 8 | program |
diff --git a/scripts/print-transcode-command.ts b/scripts/print-transcode-command.ts index f6c96790e..d83363215 100644 --- a/scripts/print-transcode-command.ts +++ b/scripts/print-transcode-command.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | 1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' |
2 | registerTSPaths() | 2 | registerTSPaths() |
3 | 3 | ||
4 | import * as program from 'commander' | 4 | import { program } from 'commander' |
5 | import * as ffmpeg from 'fluent-ffmpeg' | 5 | import * as ffmpeg from 'fluent-ffmpeg' |
6 | import { buildx264VODCommand, runCommand, TranscodeOptions } from '@server/helpers/ffmpeg-utils' | 6 | import { buildx264VODCommand, runCommand, TranscodeOptions } from '@server/helpers/ffmpeg-utils' |
7 | import { exit } from 'process' | 7 | import { exit } from 'process' |
8 | import { VideoTranscodingProfilesManager } from '@server/lib/video-transcoding-profiles' | 8 | import { VideoTranscodingProfilesManager } from '@server/lib/transcoding/video-transcoding-profiles' |
9 | 9 | ||
10 | program | 10 | program |
11 | .arguments('<path>') | 11 | .arguments('<path>') |
diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index 32314b0b7..58d24816e 100755 --- a/scripts/prune-storage.ts +++ b/scripts/prune-storage.ts | |||
@@ -11,7 +11,7 @@ import { VideoRedundancyModel } from '../server/models/redundancy/video-redundan | |||
11 | import * as Bluebird from 'bluebird' | 11 | import * as Bluebird from 'bluebird' |
12 | import { getUUIDFromFilename } from '../server/helpers/utils' | 12 | import { getUUIDFromFilename } from '../server/helpers/utils' |
13 | import { ThumbnailModel } from '../server/models/video/thumbnail' | 13 | import { ThumbnailModel } from '../server/models/video/thumbnail' |
14 | import { ActorImageModel } from '../server/models/account/actor-image' | 14 | import { ActorImageModel } from '../server/models/actor/actor-image' |
15 | import { uniq, values } from 'lodash' | 15 | import { uniq, values } from 'lodash' |
16 | import { ThumbnailType } from '@shared/models' | 16 | import { ThumbnailType } from '@shared/models' |
17 | 17 | ||
@@ -89,7 +89,7 @@ async function pruneDirectory (directory: string, existFun: ExistFun) { | |||
89 | function doesVideoExist (keepOnlyOwned: boolean) { | 89 | function doesVideoExist (keepOnlyOwned: boolean) { |
90 | return async (file: string) => { | 90 | return async (file: string) => { |
91 | const uuid = getUUIDFromFilename(file) | 91 | const uuid = getUUIDFromFilename(file) |
92 | const video = await VideoModel.loadByUUID(uuid) | 92 | const video = await VideoModel.load(uuid) |
93 | 93 | ||
94 | return video && (keepOnlyOwned === false || video.isOwned()) | 94 | return video && (keepOnlyOwned === false || video.isOwned()) |
95 | } | 95 | } |
diff --git a/scripts/regenerate-thumbnails.ts b/scripts/regenerate-thumbnails.ts index b95343c0b..078f3830b 100644 --- a/scripts/regenerate-thumbnails.ts +++ b/scripts/regenerate-thumbnails.ts | |||
@@ -2,7 +2,7 @@ import { registerTSPaths } from '../server/helpers/register-ts-paths' | |||
2 | registerTSPaths() | 2 | registerTSPaths() |
3 | 3 | ||
4 | import * as Bluebird from 'bluebird' | 4 | import * as Bluebird from 'bluebird' |
5 | import * as program from 'commander' | 5 | import { program } from 'commander' |
6 | import { pathExists, remove } from 'fs-extra' | 6 | import { pathExists, remove } from 'fs-extra' |
7 | import { generateImageFilename, processImage } from '@server/helpers/image-utils' | 7 | import { generateImageFilename, processImage } from '@server/helpers/image-utils' |
8 | import { THUMBNAILS_SIZE } from '@server/initializers/constants' | 8 | import { THUMBNAILS_SIZE } from '@server/initializers/constants' |
diff --git a/scripts/reset-password.ts b/scripts/reset-password.ts index 7e7de6b8a..4c45396d4 100755 --- a/scripts/reset-password.ts +++ b/scripts/reset-password.ts | |||
@@ -1,9 +1,9 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | 1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' |
2 | registerTSPaths() | 2 | registerTSPaths() |
3 | 3 | ||
4 | import * as program from 'commander' | 4 | import { program } from 'commander' |
5 | import { initDatabaseModels } from '../server/initializers/database' | 5 | import { initDatabaseModels } from '../server/initializers/database' |
6 | import { UserModel } from '../server/models/account/user' | 6 | import { UserModel } from '../server/models/user/user' |
7 | import { isUserPasswordValid } from '../server/helpers/custom-validators/users' | 7 | import { isUserPasswordValid } from '../server/helpers/custom-validators/users' |
8 | 8 | ||
9 | program | 9 | program |
diff --git a/scripts/test.sh b/scripts/test.sh index 32034531d..01b259fe2 100755 --- a/scripts/test.sh +++ b/scripts/test.sh | |||
@@ -7,8 +7,8 @@ npm run setup:cli | |||
7 | 7 | ||
8 | npm run ci -- lint | 8 | npm run ci -- lint |
9 | 9 | ||
10 | npm run ci -- misc | 10 | npm run ci -- client |
11 | npm run ci -- cli | 11 | npm run ci -- cli-plugin |
12 | npm run ci -- api-1 | 12 | npm run ci -- api-1 |
13 | npm run ci -- api-2 | 13 | npm run ci -- api-2 |
14 | npm run ci -- api-3 | 14 | npm run ci -- api-3 |
diff --git a/scripts/update-host.ts b/scripts/update-host.ts index e497be4e2..592684225 100755 --- a/scripts/update-host.ts +++ b/scripts/update-host.ts | |||
@@ -2,9 +2,9 @@ import { registerTSPaths } from '../server/helpers/register-ts-paths' | |||
2 | registerTSPaths() | 2 | registerTSPaths() |
3 | 3 | ||
4 | import { WEBSERVER } from '../server/initializers/constants' | 4 | import { WEBSERVER } from '../server/initializers/constants' |
5 | import { ActorFollowModel } from '../server/models/activitypub/actor-follow' | 5 | import { ActorFollowModel } from '../server/models/actor/actor-follow' |
6 | import { VideoModel } from '../server/models/video/video' | 6 | import { VideoModel } from '../server/models/video/video' |
7 | import { ActorModel } from '../server/models/activitypub/actor' | 7 | import { ActorModel } from '../server/models/actor/actor' |
8 | import { | 8 | import { |
9 | getLocalAccountActivityPubUrl, | 9 | getLocalAccountActivityPubUrl, |
10 | getLocalVideoActivityPubUrl, | 10 | getLocalVideoActivityPubUrl, |
diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index 12629ad65..aa7804bd1 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | set -eu | 3 | set -eu |
4 | 4 | ||
5 | PEERTUBE_PATH=${1:-/var/www/peertube/} | 5 | PEERTUBE_PATH=${1:-/var/www/peertube} |
6 | 6 | ||
7 | if [ ! -e "$PEERTUBE_PATH" ]; then | 7 | if [ ! -e "$PEERTUBE_PATH" ]; then |
8 | echo "Error - path \"$PEERTUBE_PATH\" wasn't found" | 8 | echo "Error - path \"$PEERTUBE_PATH\" wasn't found" |