diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/clean/client/index.sh (renamed from scripts/clean/client/dist.sh) | 0 | ||||
-rwxr-xr-x | scripts/clean/server/dist.sh | 5 | ||||
-rw-r--r-- | scripts/danger/clean/cleaner.ts | 34 | ||||
-rwxr-xr-x | scripts/danger/clean/dev.sh | 10 | ||||
-rwxr-xr-x | scripts/danger/clean/modules.sh | 9 | ||||
-rwxr-xr-x | scripts/danger/clean/prod.sh | 10 | ||||
-rwxr-xr-x | scripts/help.sh | 5 | ||||
-rwxr-xr-x | scripts/i18n/create-custom-files.ts | 17 | ||||
-rwxr-xr-x | scripts/play.sh | 15 | ||||
-rwxr-xr-x | scripts/prune-storage.ts | 2 |
10 files changed, 18 insertions, 89 deletions
diff --git a/scripts/clean/client/dist.sh b/scripts/clean/client/index.sh index 19b89de77..19b89de77 100755 --- a/scripts/clean/client/dist.sh +++ b/scripts/clean/client/index.sh | |||
diff --git a/scripts/clean/server/dist.sh b/scripts/clean/server/dist.sh deleted file mode 100755 index 50722cb44..000000000 --- a/scripts/clean/server/dist.sh +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -eu | ||
4 | |||
5 | rm -rf dist/ | ||
diff --git a/scripts/danger/clean/cleaner.ts b/scripts/danger/clean/cleaner.ts deleted file mode 100644 index 69e8a63a0..000000000 --- a/scripts/danger/clean/cleaner.ts +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | import { registerTSPaths } from '../../../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import * as Promise from 'bluebird' | ||
5 | import * as rimraf from 'rimraf' | ||
6 | import { initDatabaseModels, sequelizeTypescript } from '../../../server/initializers/database' | ||
7 | import { CONFIG } from '../../../server/initializers/config' | ||
8 | |||
9 | initDatabaseModels(true) | ||
10 | .then(() => { | ||
11 | return sequelizeTypescript.drop() | ||
12 | }) | ||
13 | .then(() => { | ||
14 | console.info('Tables of %s deleted.', CONFIG.DATABASE.DBNAME) | ||
15 | |||
16 | const STORAGE = CONFIG.STORAGE | ||
17 | return Promise.mapSeries(Object.keys(STORAGE), storage => { | ||
18 | const storageDir = STORAGE[storage] | ||
19 | |||
20 | return new Promise((res, rej) => { | ||
21 | rimraf(storageDir, err => { | ||
22 | if (err) return rej(err) | ||
23 | |||
24 | console.info('%s deleted.', storageDir) | ||
25 | return res() | ||
26 | }) | ||
27 | }) | ||
28 | }) | ||
29 | .then(() => process.exit(0)) | ||
30 | }) | ||
31 | .catch(err => { | ||
32 | console.error(err) | ||
33 | process.exit(-1) | ||
34 | }) | ||
diff --git a/scripts/danger/clean/dev.sh b/scripts/danger/clean/dev.sh deleted file mode 100755 index 14b45e13b..000000000 --- a/scripts/danger/clean/dev.sh +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | set -eu | ||
4 | |||
5 | read -p "This will remove all directories and SQL tables. Are you sure? (y/*) " -n 1 -r | ||
6 | echo | ||
7 | |||
8 | if [[ "$REPLY" =~ ^[Yy]$ ]]; then | ||
9 | NODE_ENV=test npm run ts-node -- --type-check "scripts/danger/clean/cleaner" | ||
10 | fi | ||
diff --git a/scripts/danger/clean/modules.sh b/scripts/danger/clean/modules.sh deleted file mode 100755 index f59d6b675..000000000 --- a/scripts/danger/clean/modules.sh +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | set -eu | ||
4 | |||
5 | read -p "This will remove all node server and client modules. Are you sure? " -n 1 -r | ||
6 | |||
7 | if [[ "$REPLY" =~ ^[Yy]$ ]]; then | ||
8 | rm -rf node_modules client/node_modules | ||
9 | fi | ||
diff --git a/scripts/danger/clean/prod.sh b/scripts/danger/clean/prod.sh deleted file mode 100755 index 0675600c4..000000000 --- a/scripts/danger/clean/prod.sh +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | set -eu | ||
4 | |||
5 | read -p "This will remove all directories and SQL tables. Are you sure? (y/*) " -n 1 -r | ||
6 | echo | ||
7 | |||
8 | if [[ "$REPLY" =~ ^[Yy]$ ]]; then | ||
9 | NODE_ENV=production npm run ts-node -- --type-check "./scripts/danger/clean/cleaner" | ||
10 | fi | ||
diff --git a/scripts/help.sh b/scripts/help.sh index bc38bdb40..da127092d 100755 --- a/scripts/help.sh +++ b/scripts/help.sh | |||
@@ -9,11 +9,6 @@ printf " build:server -> Build the server for production\n" | |||
9 | printf " build:client -> Build the client for production\n" | 9 | printf " build:client -> Build the client for production\n" |
10 | printf " clean:client -> Clean the client build files (dist directory)\n" | 10 | printf " clean:client -> Clean the client build files (dist directory)\n" |
11 | printf " clean:server:test -> Clean logs, uploads, database... of the test instances\n" | 11 | printf " clean:server:test -> Clean logs, uploads, database... of the test instances\n" |
12 | printf " watch:client -> Watch and compile on the fly the client files\n" | ||
13 | printf " danger:clean:dev -> /!\ Clean certificates, logs, uploads, thumbnails, torrents and database specified in the development environment\n" | ||
14 | printf " danger:clean:prod -> /!\ Clean certificates, logs, uploads, thumbnails, torrents and database specified by the production environment\n" | ||
15 | printf " danger:clean:modules -> /!\ Clean node and typescript modules\n" | ||
16 | printf " play -> Run 3 fresh nodes so that you can test the communication between them\n" | ||
17 | printf " reset-password -- -u [user] -> Reset the password of user [user]\n" | 12 | printf " reset-password -- -u [user] -> Reset the password of user [user]\n" |
18 | printf " create-transcoding-job -- -v [video UUID] \n" | 13 | printf " create-transcoding-job -- -v [video UUID] \n" |
19 | printf " -> Create a transcoding job for a particular video\n" | 14 | printf " -> Create a transcoding job for a particular video\n" |
diff --git a/scripts/i18n/create-custom-files.ts b/scripts/i18n/create-custom-files.ts index d4d5b44f0..b26e92d93 100755 --- a/scripts/i18n/create-custom-files.ts +++ b/scripts/i18n/create-custom-files.ts | |||
@@ -36,7 +36,22 @@ const playerKeys = { | |||
36 | 'From servers: ': 'From servers: ', | 36 | 'From servers: ': 'From servers: ', |
37 | 'From peers: ': 'From peers: ', | 37 | 'From peers: ': 'From peers: ', |
38 | 'Normal mode': 'Normal mode', | 38 | 'Normal mode': 'Normal mode', |
39 | 'Theater mode': 'Theater mode' | 39 | 'Stats for nerds': 'Stats for nerds', |
40 | 'Theater mode': 'Theater mode', | ||
41 | 'Video UUID': 'Video UUID', | ||
42 | 'Viewport / Frames': 'Viewport / Frames', | ||
43 | 'Resolution': 'Resolution', | ||
44 | 'Volume': 'Volume', | ||
45 | 'Codecs': 'Codecs', | ||
46 | 'Color': 'Color', | ||
47 | 'Connection Speed': 'Connection Speed', | ||
48 | 'Network Activity': 'Network Activity', | ||
49 | 'Total Transfered': 'Total Transfered', | ||
50 | 'Download Breakdown': 'Download Breakdown', | ||
51 | 'Buffer Progress': 'Buffer Progress', | ||
52 | 'Buffer State': 'Buffer State', | ||
53 | 'Live Latency': 'Live Latency', | ||
54 | 'Player mode': 'Player mode' | ||
40 | } | 55 | } |
41 | Object.assign(playerKeys, videojs) | 56 | Object.assign(playerKeys, videojs) |
42 | 57 | ||
diff --git a/scripts/play.sh b/scripts/play.sh deleted file mode 100755 index 69725da93..000000000 --- a/scripts/play.sh +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -eu | ||
4 | |||
5 | if [ ! -f "dist/server.js" ]; then | ||
6 | echo "Missing server file (server.js)." | ||
7 | exit -1 | ||
8 | fi | ||
9 | |||
10 | max=${1:-3} | ||
11 | |||
12 | for i in $(seq 1 "$max"); do | ||
13 | NODE_ENV=test NODE_APP_INSTANCE=$i node dist/server.js & | ||
14 | sleep 1 | ||
15 | done | ||
diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index bdfb335c6..32314b0b7 100755 --- a/scripts/prune-storage.ts +++ b/scripts/prune-storage.ts | |||
@@ -34,6 +34,8 @@ async function run () { | |||
34 | 34 | ||
35 | let toDelete: string[] = [] | 35 | let toDelete: string[] = [] |
36 | 36 | ||
37 | console.log('Detecting files to remove, it could take a while...') | ||
38 | |||
37 | toDelete = toDelete.concat( | 39 | toDelete = toDelete.concat( |
38 | await pruneDirectory(CONFIG.STORAGE.VIDEOS_DIR, doesVideoExist(true)), | 40 | await pruneDirectory(CONFIG.STORAGE.VIDEOS_DIR, doesVideoExist(true)), |
39 | await pruneDirectory(CONFIG.STORAGE.TORRENTS_DIR, doesVideoExist(true)), | 41 | await pruneDirectory(CONFIG.STORAGE.TORRENTS_DIR, doesVideoExist(true)), |