diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/benchmark.ts | 5 | ||||
-rwxr-xr-x | scripts/build/server.sh | 6 | ||||
-rwxr-xr-x | scripts/ci.sh | 2 | ||||
-rw-r--r-- | scripts/client-build-stats.ts | 3 | ||||
-rw-r--r-- | scripts/create-import-video-file-job.ts | 7 | ||||
-rw-r--r-- | scripts/create-move-video-storage-job.ts | 11 | ||||
-rwxr-xr-x | scripts/create-transcoding-job.ts | 13 | ||||
-rwxr-xr-x | scripts/dev/cli.sh | 3 | ||||
-rwxr-xr-x | scripts/dev/server.sh | 11 | ||||
-rwxr-xr-x | scripts/generate-code-contributors.ts | 3 | ||||
-rwxr-xr-x | scripts/i18n/create-custom-files.ts | 8 | ||||
-rw-r--r-- | scripts/migrations/peertube-2.1.ts | 15 | ||||
-rw-r--r-- | scripts/migrations/peertube-4.0.ts | 11 | ||||
-rwxr-xr-x | scripts/nightly.sh | 2 | ||||
-rwxr-xr-x | scripts/parse-log.ts | 7 | ||||
-rwxr-xr-x | scripts/plugin/install.ts | 7 | ||||
-rwxr-xr-x | scripts/plugin/uninstall.ts | 5 | ||||
-rw-r--r-- | scripts/print-transcode-command.ts | 5 | ||||
-rwxr-xr-x | scripts/prune-storage.ts | 27 | ||||
-rw-r--r-- | scripts/regenerate-thumbnails.ts | 5 | ||||
-rwxr-xr-x | scripts/release.sh | 2 | ||||
-rwxr-xr-x | scripts/reset-password.ts | 5 | ||||
-rwxr-xr-x | scripts/setup/cli.sh | 6 | ||||
-rwxr-xr-x | scripts/update-host.ts | 19 |
24 files changed, 68 insertions, 120 deletions
diff --git a/scripts/benchmark.ts b/scripts/benchmark.ts index 011519fe3..3c3c666a1 100644 --- a/scripts/benchmark.ts +++ b/scripts/benchmark.ts | |||
@@ -1,10 +1,7 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import autocannon, { printResult } from 'autocannon' | 1 | import autocannon, { printResult } from 'autocannon' |
5 | import { writeJson } from 'fs-extra' | 2 | import { writeJson } from 'fs-extra' |
6 | import { createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' | ||
7 | import { Video, VideoPrivacy } from '@shared/models' | 3 | import { Video, VideoPrivacy } from '@shared/models' |
4 | import { createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' | ||
8 | 5 | ||
9 | let server: PeerTubeServer | 6 | let server: PeerTubeServer |
10 | let video: Video | 7 | let video: Video |
diff --git a/scripts/build/server.sh b/scripts/build/server.sh index 865bdd095..a2dfc3dd9 100755 --- a/scripts/build/server.sh +++ b/scripts/build/server.sh | |||
@@ -5,9 +5,7 @@ set -eu | |||
5 | rm -rf ./dist | 5 | rm -rf ./dist |
6 | 6 | ||
7 | npm run tsc -- -b --verbose | 7 | npm run tsc -- -b --verbose |
8 | cp "./tsconfig.base.json" "./tsconfig.json" "./dist/" | 8 | npm run resolve-tspaths:server |
9 | cp "./scripts/tsconfig.json" "./dist/scripts/" | 9 | |
10 | cp "./server/tsconfig.json" "./dist/server/" | ||
11 | cp "./shared/tsconfig.json" "./dist/shared/" | ||
12 | cp -r "./server/static" "./server/assets" "./dist/server" | 10 | cp -r "./server/static" "./server/assets" "./dist/server" |
13 | cp -r "./server/lib/emails" "./dist/server/lib" | 11 | cp -r "./server/lib/emails" "./dist/server/lib" |
diff --git a/scripts/ci.sh b/scripts/ci.sh index b0b76ca99..2bacf2a2e 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh | |||
@@ -23,7 +23,7 @@ runTest () { | |||
23 | joblog="$jobname-ci.log" | 23 | joblog="$jobname-ci.log" |
24 | 24 | ||
25 | parallel -j $jobs --retries $retries \ | 25 | parallel -j $jobs --retries $retries \ |
26 | "echo Trying {} >> $joblog; npm run mocha -- -c --timeout 30000 --exit --require ./dist/server/tests/register.js --bail {}" \ | 26 | "echo Trying {} >> $joblog; npm run mocha -- -c --timeout 30000 --exit --bail {}" \ |
27 | ::: $files | 27 | ::: $files |
28 | 28 | ||
29 | cat "$joblog" | uniq -c | 29 | cat "$joblog" | uniq -c |
diff --git a/scripts/client-build-stats.ts b/scripts/client-build-stats.ts index 91844dfcd..d5ecd5fea 100644 --- a/scripts/client-build-stats.ts +++ b/scripts/client-build-stats.ts | |||
@@ -1,6 +1,3 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import { readdir, stat } from 'fs-extra' | 1 | import { readdir, stat } from 'fs-extra' |
5 | import { join } from 'path' | 2 | import { join } from 'path' |
6 | import { root } from '@shared/core-utils' | 3 | import { root } from '@shared/core-utils' |
diff --git a/scripts/create-import-video-file-job.ts b/scripts/create-import-video-file-job.ts index 071d36df4..97e9c7933 100644 --- a/scripts/create-import-video-file-job.ts +++ b/scripts/create-import-video-file-job.ts | |||
@@ -1,12 +1,9 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import { program } from 'commander' | 1 | import { program } from 'commander' |
5 | import { resolve } from 'path' | 2 | import { resolve } from 'path' |
6 | import { VideoModel } from '../server/models/video/video' | 3 | import { isUUIDValid, toCompleteUUID } from '@server/helpers/custom-validators/misc' |
7 | import { initDatabaseModels } from '../server/initializers/database' | 4 | import { initDatabaseModels } from '../server/initializers/database' |
8 | import { JobQueue } from '../server/lib/job-queue' | 5 | import { JobQueue } from '../server/lib/job-queue' |
9 | import { isUUIDValid, toCompleteUUID } from '@server/helpers/custom-validators/misc' | 6 | import { VideoModel } from '../server/models/video/video' |
10 | 7 | ||
11 | program | 8 | program |
12 | .option('-v, --video [videoUUID]', 'Video UUID') | 9 | .option('-v, --video [videoUUID]', 'Video UUID') |
diff --git a/scripts/create-move-video-storage-job.ts b/scripts/create-move-video-storage-job.ts index 90c84b1d7..7465c1ce0 100644 --- a/scripts/create-move-video-storage-job.ts +++ b/scripts/create-move-video-storage-job.ts | |||
@@ -1,13 +1,10 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import { program } from 'commander' | 1 | import { program } from 'commander' |
5 | import { VideoModel } from '@server/models/video/video' | 2 | import { CONFIG } from '@server/initializers/config' |
6 | import { initDatabaseModels } from '@server/initializers/database' | 3 | import { initDatabaseModels } from '@server/initializers/database' |
7 | import { VideoState, VideoStorage } from '@shared/models' | ||
8 | import { moveToExternalStorageState } from '@server/lib/video-state' | ||
9 | import { JobQueue } from '@server/lib/job-queue' | 4 | import { JobQueue } from '@server/lib/job-queue' |
10 | import { CONFIG } from '@server/initializers/config' | 5 | import { moveToExternalStorageState } from '@server/lib/video-state' |
6 | import { VideoModel } from '@server/models/video/video' | ||
7 | import { VideoState, VideoStorage } from '@shared/models' | ||
11 | 8 | ||
12 | program | 9 | program |
13 | .description('Move videos to another storage.') | 10 | .description('Move videos to another storage.') |
diff --git a/scripts/create-transcoding-job.ts b/scripts/create-transcoding-job.ts index 244c38fcd..d462fbf33 100755 --- a/scripts/create-transcoding-job.ts +++ b/scripts/create-transcoding-job.ts | |||
@@ -1,15 +1,12 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import { program } from 'commander' | 1 | import { program } from 'commander' |
5 | import { VideoModel } from '../server/models/video/video' | 2 | import { isUUIDValid, toCompleteUUID } from '@server/helpers/custom-validators/misc' |
6 | import { initDatabaseModels } from '../server/initializers/database' | ||
7 | import { JobQueue } from '../server/lib/job-queue' | ||
8 | import { computeLowerResolutionsToTranscode } from '@server/helpers/ffprobe-utils' | 3 | import { computeLowerResolutionsToTranscode } from '@server/helpers/ffprobe-utils' |
9 | import { VideoState, VideoTranscodingPayload } from '@shared/models' | ||
10 | import { CONFIG } from '@server/initializers/config' | 4 | import { CONFIG } from '@server/initializers/config' |
11 | import { isUUIDValid, toCompleteUUID } from '@server/helpers/custom-validators/misc' | ||
12 | import { addTranscodingJob } from '@server/lib/video' | 5 | import { addTranscodingJob } from '@server/lib/video' |
6 | import { VideoState, VideoTranscodingPayload } from '@shared/models' | ||
7 | import { initDatabaseModels } from '../server/initializers/database' | ||
8 | import { JobQueue } from '../server/lib/job-queue' | ||
9 | import { VideoModel } from '../server/models/video/video' | ||
13 | 10 | ||
14 | program | 11 | program |
15 | .option('-v, --video [videoUUID]', 'Video UUID') | 12 | .option('-v, --video [videoUUID]', 'Video UUID') |
diff --git a/scripts/dev/cli.sh b/scripts/dev/cli.sh index 4bf4808b8..327792a19 100755 --- a/scripts/dev/cli.sh +++ b/scripts/dev/cli.sh | |||
@@ -12,4 +12,5 @@ rm -rf ./dist/server/tools/ | |||
12 | mkdir -p "./dist/server/tools" | 12 | mkdir -p "./dist/server/tools" |
13 | cp -r "./server/tools/node_modules" "./dist/server/tools" | 13 | cp -r "./server/tools/node_modules" "./dist/server/tools" |
14 | 14 | ||
15 | npm run tsc -- --watch --sourceMap --project ./server/tools/tsconfig.json | 15 | cd ./server/tools |
16 | ../../node_modules/.bin/tsc-watch --build --verbose --onSuccess 'sh -c "cd ../../ && npm run resolve-tspaths:all"' | ||
diff --git a/scripts/dev/server.sh b/scripts/dev/server.sh index 468af0a56..9dae43a63 100755 --- a/scripts/dev/server.sh +++ b/scripts/dev/server.sh | |||
@@ -14,15 +14,12 @@ mkdir -p "./client/dist" | |||
14 | rm -rf "./client/dist/locale" | 14 | rm -rf "./client/dist/locale" |
15 | cp -r "./client/src/locale" "./client/dist/locale" | 15 | cp -r "./client/src/locale" "./client/dist/locale" |
16 | 16 | ||
17 | rm -rf "./dist" | 17 | mkdir -p "./dist/server/lib" |
18 | |||
19 | mkdir "./dist" | ||
20 | cp "./tsconfig.json" "./dist" | ||
21 | 18 | ||
22 | npm run tsc -- -b -v --incremental | 19 | npm run tsc -- -b -v --incremental |
20 | npm run resolve-tspaths:server | ||
21 | |||
23 | cp -r ./server/static ./server/assets ./dist/server | 22 | cp -r ./server/static ./server/assets ./dist/server |
24 | cp -r "./server/lib/emails" "./dist/server/lib" | 23 | cp -r "./server/lib/emails" "./dist/server/lib" |
25 | 24 | ||
26 | NODE_ENV=test node node_modules/.bin/concurrently -k \ | 25 | ./node_modules/.bin/tsc-watch --build --preserveWatchOutput --verbose --onSuccess 'sh -c "npm run resolve-tspaths:server && NODE_ENV=test node dist/server"' |
27 | "node_modules/.bin/nodemon --enable-source-maps --delay 1 --watch ./dist dist/server" \ | ||
28 | "node_modules/.bin/tsc -b -w --preserveWatchOutput" | ||
diff --git a/scripts/generate-code-contributors.ts b/scripts/generate-code-contributors.ts index 449407c44..5357daf04 100755 --- a/scripts/generate-code-contributors.ts +++ b/scripts/generate-code-contributors.ts | |||
@@ -1,6 +1,3 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import { CLICommand } from '@shared/server-commands' | 1 | import { CLICommand } from '@shared/server-commands' |
5 | 2 | ||
6 | run() | 3 | run() |
diff --git a/scripts/i18n/create-custom-files.ts b/scripts/i18n/create-custom-files.ts index d9328b125..7556866e6 100755 --- a/scripts/i18n/create-custom-files.ts +++ b/scripts/i18n/create-custom-files.ts | |||
@@ -1,9 +1,7 @@ | |||
1 | import { registerTSPaths } from '../../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import { writeJSON } from 'fs-extra' | 1 | import { writeJSON } from 'fs-extra' |
5 | import { values } from 'lodash' | 2 | import { values } from 'lodash' |
6 | import { join } from 'path' | 3 | import { join } from 'path' |
4 | import { root } from '@shared/core-utils' | ||
7 | import { | 5 | import { |
8 | buildLanguages, | 6 | buildLanguages, |
9 | VIDEO_CATEGORIES, | 7 | VIDEO_CATEGORIES, |
@@ -16,7 +14,7 @@ import { | |||
16 | } from '../../server/initializers/constants' | 14 | } from '../../server/initializers/constants' |
17 | import { I18N_LOCALES } from '../../shared/core-utils/i18n' | 15 | import { I18N_LOCALES } from '../../shared/core-utils/i18n' |
18 | 16 | ||
19 | const videojs = require(join(__dirname, '../../../client/src/locale/videojs.en-US.json')) | 17 | const videojs = require(join(root(), 'client', 'src', 'locale', 'videojs.en-US.json')) |
20 | const playerKeys = { | 18 | const playerKeys = { |
21 | 'Quality': 'Quality', | 19 | 'Quality': 'Quality', |
22 | 'Auto': 'Auto', | 20 | 'Auto': 'Auto', |
@@ -100,7 +98,7 @@ writeAll().catch(err => { | |||
100 | }) | 98 | }) |
101 | 99 | ||
102 | async function writeAll () { | 100 | async function writeAll () { |
103 | const localePath = join(__dirname, '../../../client/src/locale') | 101 | const localePath = join(root(), 'client', 'src', 'locale') |
104 | 102 | ||
105 | await writeJSON(join(localePath, 'player.en-US.json'), playerKeys, { spaces: 4 }) | 103 | await writeJSON(join(localePath, 'player.en-US.json'), playerKeys, { spaces: 4 }) |
106 | await writeJSON(join(localePath, 'server.en-US.json'), serverKeys, { spaces: 4 }) | 104 | await writeJSON(join(localePath, 'server.en-US.json'), serverKeys, { spaces: 4 }) |
diff --git a/scripts/migrations/peertube-2.1.ts b/scripts/migrations/peertube-2.1.ts index 4bbc203c1..2e316d996 100644 --- a/scripts/migrations/peertube-2.1.ts +++ b/scripts/migrations/peertube-2.1.ts | |||
@@ -1,15 +1,12 @@ | |||
1 | import { registerTSPaths } from '../../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import { initDatabaseModels, sequelizeTypescript } from '../../server/initializers/database' | ||
5 | import * as Sequelize from 'sequelize' | ||
6 | import { join } from 'path' | ||
7 | import { HLS_STREAMING_PLAYLIST_DIRECTORY, STATIC_PATHS, WEBSERVER } from '@server/initializers/constants' | ||
8 | import { pathExists, stat, writeFile } from 'fs-extra' | 1 | import { pathExists, stat, writeFile } from 'fs-extra' |
9 | import { createTorrentPromise } from '@server/helpers/webtorrent' | ||
10 | import { CONFIG } from '@server/initializers/config' | ||
11 | import parseTorrent from 'parse-torrent' | 2 | import parseTorrent from 'parse-torrent' |
3 | import { join } from 'path' | ||
4 | import * as Sequelize from 'sequelize' | ||
12 | import { logger } from '@server/helpers/logger' | 5 | import { logger } from '@server/helpers/logger' |
6 | import { createTorrentPromise } from '@server/helpers/webtorrent' | ||
7 | import { CONFIG } from '@server/initializers/config' | ||
8 | import { HLS_STREAMING_PLAYLIST_DIRECTORY, STATIC_PATHS, WEBSERVER } from '@server/initializers/constants' | ||
9 | import { initDatabaseModels, sequelizeTypescript } from '../../server/initializers/database' | ||
13 | 10 | ||
14 | run() | 11 | run() |
15 | .then(() => process.exit(0)) | 12 | .then(() => process.exit(0)) |
diff --git a/scripts/migrations/peertube-4.0.ts b/scripts/migrations/peertube-4.0.ts index abf431888..64cf45474 100644 --- a/scripts/migrations/peertube-4.0.ts +++ b/scripts/migrations/peertube-4.0.ts | |||
@@ -1,16 +1,13 @@ | |||
1 | import { registerTSPaths } from '../../server/helpers/register-ts-paths' | 1 | import Bluebird from 'bluebird' |
2 | registerTSPaths() | 2 | import { move, readFile, writeFile } from 'fs-extra' |
3 | |||
4 | import { join } from 'path' | 3 | import { join } from 'path' |
4 | import { federateVideoIfNeeded } from '@server/lib/activitypub/videos' | ||
5 | import { JobQueue } from '@server/lib/job-queue' | 5 | import { JobQueue } from '@server/lib/job-queue' |
6 | import { initDatabaseModels } from '../../server/initializers/database' | ||
7 | import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getHlsResolutionPlaylistFilename } from '@server/lib/paths' | 6 | import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getHlsResolutionPlaylistFilename } from '@server/lib/paths' |
8 | import { VideoPathManager } from '@server/lib/video-path-manager' | 7 | import { VideoPathManager } from '@server/lib/video-path-manager' |
9 | import { VideoModel } from '@server/models/video/video' | 8 | import { VideoModel } from '@server/models/video/video' |
10 | import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' | 9 | import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' |
11 | import { move, readFile, writeFile } from 'fs-extra' | 10 | import { initDatabaseModels } from '../../server/initializers/database' |
12 | import Bluebird from 'bluebird' | ||
13 | import { federateVideoIfNeeded } from '@server/lib/activitypub/videos' | ||
14 | 11 | ||
15 | run() | 12 | run() |
16 | .then(() => process.exit(0)) | 13 | .then(() => process.exit(0)) |
diff --git a/scripts/nightly.sh b/scripts/nightly.sh index 5ad603929..572277f9d 100755 --- a/scripts/nightly.sh +++ b/scripts/nightly.sh | |||
@@ -32,7 +32,7 @@ sed -i 's/"version": "\([^"]\+\)"/"version": "\1-'"$nightly_version"'"/' ./packa | |||
32 | "$directory_name/client/package.json" "$directory_name/config" \ | 32 | "$directory_name/client/package.json" "$directory_name/config" \ |
33 | "$directory_name/dist" "$directory_name/package.json" \ | 33 | "$directory_name/dist" "$directory_name/package.json" \ |
34 | "$directory_name/scripts" "$directory_name/support" \ | 34 | "$directory_name/scripts" "$directory_name/support" \ |
35 | "$directory_name/tsconfig.json" "$directory_name/yarn.lock") | 35 | "$directory_name/yarn.lock") |
36 | 36 | ||
37 | # temporary setup | 37 | # temporary setup |
38 | cd .. | 38 | cd .. |
diff --git a/scripts/parse-log.ts b/scripts/parse-log.ts index 6cd3a1860..d3c93cee5 100755 --- a/scripts/parse-log.ts +++ b/scripts/parse-log.ts | |||
@@ -1,15 +1,12 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import { program } from 'commander' | 1 | import { program } from 'commander' |
5 | import { createReadStream, readdir } from 'fs-extra' | 2 | import { createReadStream, readdir } from 'fs-extra' |
6 | import { join } from 'path' | 3 | import { join } from 'path' |
7 | import { createInterface } from 'readline' | 4 | import { createInterface } from 'readline' |
5 | import { format as sqlFormat } from 'sql-formatter' | ||
6 | import { inspect } from 'util' | ||
8 | import * as winston from 'winston' | 7 | import * as winston from 'winston' |
9 | import { labelFormatter, mtimeSortFilesDesc } from '../server/helpers/logger' | 8 | import { labelFormatter, mtimeSortFilesDesc } from '../server/helpers/logger' |
10 | import { CONFIG } from '../server/initializers/config' | 9 | import { CONFIG } from '../server/initializers/config' |
11 | import { inspect } from 'util' | ||
12 | import { format as sqlFormat } from 'sql-formatter' | ||
13 | 10 | ||
14 | program | 11 | program |
15 | .option('-l, --level [level]', 'Level log (debug/info/warn/error)') | 12 | .option('-l, --level [level]', 'Level log (debug/info/warn/error)') |
diff --git a/scripts/plugin/install.ts b/scripts/plugin/install.ts index de045c2d2..0795d7c93 100755 --- a/scripts/plugin/install.ts +++ b/scripts/plugin/install.ts | |||
@@ -1,10 +1,7 @@ | |||
1 | import { registerTSPaths } from '../../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import { initDatabaseModels } from '../../server/initializers/database' | ||
5 | import { program } from 'commander' | 1 | import { program } from 'commander' |
6 | import { PluginManager } from '../../server/lib/plugins/plugin-manager' | ||
7 | import { isAbsolute } from 'path' | 2 | import { isAbsolute } from 'path' |
3 | import { initDatabaseModels } from '../../server/initializers/database' | ||
4 | import { PluginManager } from '../../server/lib/plugins/plugin-manager' | ||
8 | 5 | ||
9 | program | 6 | program |
10 | .option('-n, --npm-name [npmName]', 'Plugin to install') | 7 | .option('-n, --npm-name [npmName]', 'Plugin to install') |
diff --git a/scripts/plugin/uninstall.ts b/scripts/plugin/uninstall.ts index 1e14cc18f..152b651dd 100755 --- a/scripts/plugin/uninstall.ts +++ b/scripts/plugin/uninstall.ts | |||
@@ -1,8 +1,5 @@ | |||
1 | import { registerTSPaths } from '../../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import { initDatabaseModels } from '../../server/initializers/database' | ||
5 | import { program } from 'commander' | 1 | import { program } from 'commander' |
2 | import { initDatabaseModels } from '../../server/initializers/database' | ||
6 | import { PluginManager } from '../../server/lib/plugins/plugin-manager' | 3 | import { PluginManager } from '../../server/lib/plugins/plugin-manager' |
7 | 4 | ||
8 | program | 5 | program |
diff --git a/scripts/print-transcode-command.ts b/scripts/print-transcode-command.ts index 352145252..21667f544 100644 --- a/scripts/print-transcode-command.ts +++ b/scripts/print-transcode-command.ts | |||
@@ -1,10 +1,7 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import { program } from 'commander' | 1 | import { program } from 'commander' |
5 | import ffmpeg from 'fluent-ffmpeg' | 2 | import ffmpeg from 'fluent-ffmpeg' |
6 | import { buildx264VODCommand, runCommand, TranscodeOptions } from '@server/helpers/ffmpeg-utils' | ||
7 | import { exit } from 'process' | 3 | import { exit } from 'process' |
4 | import { buildx264VODCommand, runCommand, TranscodeOptions } from '@server/helpers/ffmpeg-utils' | ||
8 | import { VideoTranscodingProfilesManager } from '@server/lib/transcoding/video-transcoding-profiles' | 5 | import { VideoTranscodingProfilesManager } from '@server/lib/transcoding/video-transcoding-profiles' |
9 | 6 | ||
10 | program | 7 | program |
diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index 12d78fdc6..bb1e8e024 100755 --- a/scripts/prune-storage.ts +++ b/scripts/prune-storage.ts | |||
@@ -1,22 +1,19 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import { start, get } from 'prompt' | ||
5 | import { join, basename } from 'path' | ||
6 | import { CONFIG } from '../server/initializers/config' | ||
7 | import { VideoModel } from '../server/models/video/video' | ||
8 | import { initDatabaseModels } from '../server/initializers/database' | ||
9 | import { readdir, remove, stat } from 'fs-extra' | ||
10 | import { VideoRedundancyModel } from '../server/models/redundancy/video-redundancy' | ||
11 | import { map } from 'bluebird' | 1 | import { map } from 'bluebird' |
12 | import { getUUIDFromFilename } from '../server/helpers/utils' | 2 | import { readdir, remove, stat } from 'fs-extra' |
13 | import { ThumbnailModel } from '../server/models/video/thumbnail' | ||
14 | import { ActorImageModel } from '../server/models/actor/actor-image' | ||
15 | import { uniq, values } from 'lodash' | 3 | import { uniq, values } from 'lodash' |
16 | import { ThumbnailType } from '@shared/models' | 4 | import { basename, join } from 'path' |
17 | import { VideoFileModel } from '@server/models/video/video-file' | 5 | import { get, start } from 'prompt' |
18 | import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants' | 6 | import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants' |
7 | import { VideoFileModel } from '@server/models/video/video-file' | ||
19 | import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' | 8 | import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' |
9 | import { ThumbnailType } from '@shared/models' | ||
10 | import { getUUIDFromFilename } from '../server/helpers/utils' | ||
11 | import { CONFIG } from '../server/initializers/config' | ||
12 | import { initDatabaseModels } from '../server/initializers/database' | ||
13 | import { ActorImageModel } from '../server/models/actor/actor-image' | ||
14 | import { VideoRedundancyModel } from '../server/models/redundancy/video-redundancy' | ||
15 | import { ThumbnailModel } from '../server/models/video/thumbnail' | ||
16 | import { VideoModel } from '../server/models/video/video' | ||
20 | 17 | ||
21 | run() | 18 | run() |
22 | .then(() => process.exit(0)) | 19 | .then(() => process.exit(0)) |
diff --git a/scripts/regenerate-thumbnails.ts b/scripts/regenerate-thumbnails.ts index 50d06f6fd..a377baa61 100644 --- a/scripts/regenerate-thumbnails.ts +++ b/scripts/regenerate-thumbnails.ts | |||
@@ -1,13 +1,10 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import { map } from 'bluebird' | 1 | import { map } from 'bluebird' |
5 | import { program } from 'commander' | 2 | import { program } from 'commander' |
6 | import { pathExists, remove } from 'fs-extra' | 3 | import { pathExists, remove } from 'fs-extra' |
7 | import { generateImageFilename, processImage } from '@server/helpers/image-utils' | 4 | import { generateImageFilename, processImage } from '@server/helpers/image-utils' |
8 | import { THUMBNAILS_SIZE } from '@server/initializers/constants' | 5 | import { THUMBNAILS_SIZE } from '@server/initializers/constants' |
9 | import { VideoModel } from '@server/models/video/video' | ||
10 | import { initDatabaseModels } from '@server/initializers/database' | 6 | import { initDatabaseModels } from '@server/initializers/database' |
7 | import { VideoModel } from '@server/models/video/video' | ||
11 | 8 | ||
12 | program | 9 | program |
13 | .description('Regenerate local thumbnails using preview files') | 10 | .description('Regenerate local thumbnails using preview files') |
diff --git a/scripts/release.sh b/scripts/release.sh index 409a52977..313087a29 100755 --- a/scripts/release.sh +++ b/scripts/release.sh | |||
@@ -76,7 +76,7 @@ rm -f "./client/dist/embed-stats.json" | |||
76 | "$directory_name/client/package.json" "$directory_name/config" \ | 76 | "$directory_name/client/package.json" "$directory_name/config" \ |
77 | "$directory_name/dist" "$directory_name/package.json" \ | 77 | "$directory_name/dist" "$directory_name/package.json" \ |
78 | "$directory_name/scripts" "$directory_name/support" \ | 78 | "$directory_name/scripts" "$directory_name/support" \ |
79 | "$directory_name/tsconfig.json" "$directory_name/yarn.lock") | 79 | "$directory_name/yarn.lock") |
80 | 80 | ||
81 | # temporary setup | 81 | # temporary setup |
82 | cd .. | 82 | cd .. |
diff --git a/scripts/reset-password.ts b/scripts/reset-password.ts index 4c45396d4..b2e5639fb 100755 --- a/scripts/reset-password.ts +++ b/scripts/reset-password.ts | |||
@@ -1,10 +1,7 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import { program } from 'commander' | 1 | import { program } from 'commander' |
2 | import { isUserPasswordValid } from '../server/helpers/custom-validators/users' | ||
5 | import { initDatabaseModels } from '../server/initializers/database' | 3 | import { initDatabaseModels } from '../server/initializers/database' |
6 | import { UserModel } from '../server/models/user/user' | 4 | import { UserModel } from '../server/models/user/user' |
7 | import { isUserPasswordValid } from '../server/helpers/custom-validators/users' | ||
8 | 5 | ||
9 | program | 6 | program |
10 | .option('-u, --user [user]', 'User') | 7 | .option('-u, --user [user]', 'User') |
diff --git a/scripts/setup/cli.sh b/scripts/setup/cli.sh index d0ad2ec5f..f84260f23 100755 --- a/scripts/setup/cli.sh +++ b/scripts/setup/cli.sh | |||
@@ -9,8 +9,10 @@ rm -rf ./dist/server/tools/ | |||
9 | ( | 9 | ( |
10 | cd ./server/tools | 10 | cd ./server/tools |
11 | yarn install --pure-lockfile | 11 | yarn install --pure-lockfile |
12 | ../../node_modules/.bin/tsc --build --verbose | ||
12 | ) | 13 | ) |
13 | 14 | ||
14 | npm run tsc -- --build --verbose ./server/tools/tsconfig.json | ||
15 | cp -r "./server/tools/node_modules" "./dist/server/tools" | 15 | cp -r "./server/tools/node_modules" "./dist/server/tools" |
16 | cp "./tsconfig.json" "./dist" | 16 | |
17 | npm run resolve-tspaths:cli | ||
18 | npm run resolve-tspaths:server | ||
diff --git a/scripts/update-host.ts b/scripts/update-host.ts index 66c0137d9..bb54290a4 100755 --- a/scripts/update-host.ts +++ b/scripts/update-host.ts | |||
@@ -1,10 +1,7 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | 1 | import { updateTorrentMetadata } from '@server/helpers/webtorrent' |
2 | registerTSPaths() | 2 | import { getServerActor } from '@server/models/application/application' |
3 | |||
4 | import { WEBSERVER } from '../server/initializers/constants' | 3 | import { WEBSERVER } from '../server/initializers/constants' |
5 | import { ActorFollowModel } from '../server/models/actor/actor-follow' | 4 | import { initDatabaseModels } from '../server/initializers/database' |
6 | import { VideoModel } from '../server/models/video/video' | ||
7 | import { ActorModel } from '../server/models/actor/actor' | ||
8 | import { | 5 | import { |
9 | getLocalAccountActivityPubUrl, | 6 | getLocalAccountActivityPubUrl, |
10 | getLocalVideoActivityPubUrl, | 7 | getLocalVideoActivityPubUrl, |
@@ -12,13 +9,13 @@ import { | |||
12 | getLocalVideoChannelActivityPubUrl, | 9 | getLocalVideoChannelActivityPubUrl, |
13 | getLocalVideoCommentActivityPubUrl | 10 | getLocalVideoCommentActivityPubUrl |
14 | } from '../server/lib/activitypub/url' | 11 | } from '../server/lib/activitypub/url' |
15 | import { VideoShareModel } from '../server/models/video/video-share' | ||
16 | import { VideoCommentModel } from '../server/models/video/video-comment' | ||
17 | import { AccountModel } from '../server/models/account/account' | 12 | import { AccountModel } from '../server/models/account/account' |
13 | import { ActorModel } from '../server/models/actor/actor' | ||
14 | import { ActorFollowModel } from '../server/models/actor/actor-follow' | ||
15 | import { VideoModel } from '../server/models/video/video' | ||
18 | import { VideoChannelModel } from '../server/models/video/video-channel' | 16 | import { VideoChannelModel } from '../server/models/video/video-channel' |
19 | import { initDatabaseModels } from '../server/initializers/database' | 17 | import { VideoCommentModel } from '../server/models/video/video-comment' |
20 | import { updateTorrentMetadata } from '@server/helpers/webtorrent' | 18 | import { VideoShareModel } from '../server/models/video/video-share' |
21 | import { getServerActor } from '@server/models/application/application' | ||
22 | 19 | ||
23 | run() | 20 | run() |
24 | .then(() => process.exit(0)) | 21 | .then(() => process.exit(0)) |