diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build/client.sh | 4 | ||||
-rwxr-xr-x | scripts/clean/server/test.sh | 9 | ||||
-rwxr-xr-x | scripts/create-transcoding-job.ts | 2 | ||||
-rw-r--r-- | scripts/danger/clean/cleaner.ts | 3 | ||||
-rwxr-xr-x | scripts/dev/server.sh | 2 | ||||
-rwxr-xr-x | scripts/e2e/index.sh | 1 | ||||
-rwxr-xr-x | scripts/e2e/local.sh | 2 | ||||
-rwxr-xr-x | scripts/generate-code-contributors.ts | 10 | ||||
-rwxr-xr-x | scripts/i18n/create-custom-files.ts | 10 | ||||
-rwxr-xr-x | scripts/i18n/pull-hook.sh | 9 | ||||
-rw-r--r-- | scripts/optimize-old-videos.ts | 9 | ||||
-rwxr-xr-x | scripts/parse-log.ts | 60 | ||||
-rwxr-xr-x | scripts/prune-storage.ts | 2 | ||||
-rwxr-xr-x | scripts/travis.sh | 4 | ||||
-rwxr-xr-x | scripts/update-host.ts | 22 | ||||
-rwxr-xr-x | scripts/upgrade.sh | 4 | ||||
-rwxr-xr-x | scripts/watch/client.sh | 2 |
17 files changed, 93 insertions, 62 deletions
diff --git a/scripts/build/client.sh b/scripts/build/client.sh index be3eef802..d409d0594 100755 --- a/scripts/build/client.sh +++ b/scripts/build/client.sh | |||
@@ -41,7 +41,7 @@ if [ -z ${1+x} ] || [ "$1" != "--light" ]; then | |||
41 | languages=("fr_FR") | 41 | languages=("fr_FR") |
42 | else | 42 | else |
43 | # Supported languages | 43 | # Supported languages |
44 | languages=("pl_PL" "it_IT" "ru_RU" "fr_FR" "pt_BR" "sv_SE" "eu_ES" "ca_ES" "cs_CZ" "eo" "zh_Hant_TW" "de_DE" "es_ES" "oc" "zh_Hans_CN") | 44 | languages=("nl_NL" "es_ES" "oc" "pt_BR" "pt_PT" "sv_SE" "pl_PL" "ru_RU" "zh_Hans_CN" "zh_Hant_TW" "fr_FR" "ja_JP" "eu_ES" "ca_ES" "cs_CZ" "eo" "de_DE" "it_IT") |
45 | fi | 45 | fi |
46 | 46 | ||
47 | for lang in "${languages[@]}"; do | 47 | for lang in "${languages[@]}"; do |
@@ -51,7 +51,7 @@ if [ -z ${1+x} ] || [ "$1" != "--light" ]; then | |||
51 | npm run ng build -- --prod --i18n-file "./src/locale/target/angular_$lang.xml" --i18n-format xlf --i18n-locale "$lang" \ | 51 | npm run ng build -- --prod --i18n-file "./src/locale/target/angular_$lang.xml" --i18n-format xlf --i18n-locale "$lang" \ |
52 | --output-path "dist/$lang/" --deploy-url "/client/$lang/" | 52 | --output-path "dist/$lang/" --deploy-url "/client/$lang/" |
53 | 53 | ||
54 | # Do no duplicate assets | 54 | # Do not duplicate assets |
55 | rm -r "./dist/$lang/assets" | 55 | rm -r "./dist/$lang/assets" |
56 | 56 | ||
57 | # TODO: remove when the project will use runtime translations | 57 | # TODO: remove when the project will use runtime translations |
diff --git a/scripts/clean/server/test.sh b/scripts/clean/server/test.sh index b897c30ba..5694ac922 100755 --- a/scripts/clean/server/test.sh +++ b/scripts/clean/server/test.sh | |||
@@ -21,7 +21,14 @@ dropRedis () { | |||
21 | redis-cli KEYS "redis-localhost:900$1*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL | 21 | redis-cli KEYS "redis-localhost:900$1*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL |
22 | } | 22 | } |
23 | 23 | ||
24 | for i in $(seq 1 6); do | 24 | seq=$(seq 1 6) |
25 | |||
26 | if [ ! -z ${1+x} ]; then | ||
27 | seq=$1 | ||
28 | fi | ||
29 | |||
30 | |||
31 | for i in $seq; do | ||
25 | recreateDB "$i" & | 32 | recreateDB "$i" & |
26 | dropRedis "$i" & | 33 | dropRedis "$i" & |
27 | removeFiles "$i" & | 34 | removeFiles "$i" & |
diff --git a/scripts/create-transcoding-job.ts b/scripts/create-transcoding-job.ts index 7e5b687bb..4a677eacb 100755 --- a/scripts/create-transcoding-job.ts +++ b/scripts/create-transcoding-job.ts | |||
@@ -42,6 +42,6 @@ async function run () { | |||
42 | } | 42 | } |
43 | 43 | ||
44 | await JobQueue.Instance.init() | 44 | await JobQueue.Instance.init() |
45 | await JobQueue.Instance.createJob({ type: 'video-file', payload: dataInput }) | 45 | await JobQueue.Instance.createJob({ type: 'video-transcoding', payload: dataInput }) |
46 | console.log('Transcoding job for video %s created.', video.uuid) | 46 | console.log('Transcoding job for video %s created.', video.uuid) |
47 | } | 47 | } |
diff --git a/scripts/danger/clean/cleaner.ts b/scripts/danger/clean/cleaner.ts index 009f8f7a0..d575af283 100644 --- a/scripts/danger/clean/cleaner.ts +++ b/scripts/danger/clean/cleaner.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import * as Promise from 'bluebird' | 1 | import * as Promise from 'bluebird' |
2 | import * as rimraf from 'rimraf' | 2 | import * as rimraf from 'rimraf' |
3 | import { CONFIG, initDatabaseModels, sequelizeTypescript } from '../../../server/initializers' | 3 | import { initDatabaseModels, sequelizeTypescript } from '../../../server/initializers' |
4 | import { CONFIG } from '../../../server/initializers/config' | ||
4 | 5 | ||
5 | initDatabaseModels(true) | 6 | initDatabaseModels(true) |
6 | .then(() => { | 7 | .then(() => { |
diff --git a/scripts/dev/server.sh b/scripts/dev/server.sh index 9b8fddac6..b4675c57f 100755 --- a/scripts/dev/server.sh +++ b/scripts/dev/server.sh | |||
@@ -4,7 +4,7 @@ set -eu | |||
4 | 4 | ||
5 | if [ ! -f "./client/dist/en_US/index.html" ]; then | 5 | if [ ! -f "./client/dist/en_US/index.html" ]; then |
6 | echo "client/dist/en_US/index.html does not exist, compile client files..." | 6 | echo "client/dist/en_US/index.html does not exist, compile client files..." |
7 | npm run build:client | 7 | npm run build:client -- --light |
8 | fi | 8 | fi |
9 | 9 | ||
10 | npm run watch:server | 10 | npm run watch:server |
diff --git a/scripts/e2e/index.sh b/scripts/e2e/index.sh index cf2e04356..3856af06e 100755 --- a/scripts/e2e/index.sh +++ b/scripts/e2e/index.sh | |||
@@ -6,7 +6,6 @@ npm run clean:server:test | |||
6 | 6 | ||
7 | ( | 7 | ( |
8 | cd client | 8 | cd client |
9 | npm run webdriver-manager update | ||
10 | npm run webpack -- --config webpack/webpack.video-embed.js --mode development | 9 | npm run webpack -- --config webpack/webpack.video-embed.js --mode development |
11 | ) | 10 | ) |
12 | 11 | ||
diff --git a/scripts/e2e/local.sh b/scripts/e2e/local.sh index 65ec653dc..b883ccaa3 100755 --- a/scripts/e2e/local.sh +++ b/scripts/e2e/local.sh | |||
@@ -6,11 +6,9 @@ npm run clean:server:test | |||
6 | 6 | ||
7 | ( | 7 | ( |
8 | cd client | 8 | cd client |
9 | npm run webdriver-manager update | ||
10 | npm run webpack -- --config webpack/webpack.video-embed.js --mode development | 9 | npm run webpack -- --config webpack/webpack.video-embed.js --mode development |
11 | ) | 10 | ) |
12 | 11 | ||
13 | npm run concurrently -- -k -s first \ | 12 | npm run concurrently -- -k -s first \ |
14 | "cd client && npm run webdriver-manager start" \ | ||
15 | "cd client && npm run ng -- e2e --port 3333 -c local" \ | 13 | "cd client && npm run ng -- e2e --port 3333 -c local" \ |
16 | "NODE_ENV=test NODE_APP_INSTANCE=1 NODE_CONFIG='{ \"log\": { \"level\": \"warning\" } }' npm start" | 14 | "NODE_ENV=test NODE_APP_INSTANCE=1 NODE_CONFIG='{ \"log\": { \"level\": \"warning\" } }' npm start" |
diff --git a/scripts/generate-code-contributors.ts b/scripts/generate-code-contributors.ts index 9824bc2f5..0d6266056 100755 --- a/scripts/generate-code-contributors.ts +++ b/scripts/generate-code-contributors.ts | |||
@@ -35,13 +35,17 @@ async function run () { | |||
35 | 35 | ||
36 | { | 36 | { |
37 | console.log('\n\n# Design\n') | 37 | console.log('\n\n# Design\n') |
38 | console.log('By [Olivier Massain](https://twitter.com/omassain)\n') | 38 | console.log(' * [Olivier Massain](https://twitter.com/omassain)') |
39 | console.log('Icons from [Robbie Pearce](https://robbiepearce.com/softies/)') | 39 | |
40 | console.log('\n\n# Icons\n') | ||
41 | console.log(' * [Robbie Pearce](https://robbiepearce.com/softies/)') | ||
42 | console.log(' * [Fork-Awesome](https://github.com/ForkAwesome/Fork-Awesome)') | ||
43 | console.log(' * playlist add by Google') | ||
40 | } | 44 | } |
41 | } | 45 | } |
42 | 46 | ||
43 | function get (url: string, headers: any = {}) { | 47 | function get (url: string, headers: any = {}) { |
44 | return doRequest({ | 48 | return doRequest<any>({ |
45 | uri: url, | 49 | uri: url, |
46 | json: true, | 50 | json: true, |
47 | headers: Object.assign(headers, { | 51 | headers: Object.assign(headers, { |
diff --git a/scripts/i18n/create-custom-files.ts b/scripts/i18n/create-custom-files.ts index ab28f94c8..95897afa3 100755 --- a/scripts/i18n/create-custom-files.ts +++ b/scripts/i18n/create-custom-files.ts | |||
@@ -5,7 +5,7 @@ import { | |||
5 | buildLanguages, | 5 | buildLanguages, |
6 | VIDEO_CATEGORIES, | 6 | VIDEO_CATEGORIES, |
7 | VIDEO_IMPORT_STATES, | 7 | VIDEO_IMPORT_STATES, |
8 | VIDEO_LICENCES, | 8 | VIDEO_LICENCES, VIDEO_PLAYLIST_PRIVACIES, VIDEO_PLAYLIST_TYPES, |
9 | VIDEO_PRIVACIES, | 9 | VIDEO_PRIVACIES, |
10 | VIDEO_STATES | 10 | VIDEO_STATES |
11 | } from '../../server/initializers/constants' | 11 | } from '../../server/initializers/constants' |
@@ -23,12 +23,16 @@ const playerKeys = { | |||
23 | 'Speed': 'Speed', | 23 | 'Speed': 'Speed', |
24 | 'Subtitles/CC': 'Subtitles/CC', | 24 | 'Subtitles/CC': 'Subtitles/CC', |
25 | 'peers': 'peers', | 25 | 'peers': 'peers', |
26 | 'peer': 'peer', | ||
26 | 'Go to the video page': 'Go to the video page', | 27 | 'Go to the video page': 'Go to the video page', |
27 | 'Settings': 'Settings', | 28 | 'Settings': 'Settings', |
28 | 'Uses P2P, others may know you are watching this video.': 'Uses P2P, others may know you are watching this video.', | 29 | 'Uses P2P, others may know you are watching this video.': 'Uses P2P, others may know you are watching this video.', |
29 | 'Copy the video URL': 'Copy the video URL', | 30 | 'Copy the video URL': 'Copy the video URL', |
30 | 'Copy the video URL at the current time': 'Copy the video URL at the current time', | 31 | 'Copy the video URL at the current time': 'Copy the video URL at the current time', |
31 | 'Copy embed code': 'Copy embed code' | 32 | 'Copy embed code': 'Copy embed code', |
33 | 'Copy magnet URI': 'Copy magnet URI', | ||
34 | 'Total downloaded: ': 'Total downloaded: ', | ||
35 | 'Total uploaded: ': 'Total uploaded: ' | ||
32 | } | 36 | } |
33 | const playerTranslations = { | 37 | const playerTranslations = { |
34 | target: join(__dirname, '../../../client/src/locale/source/player_en_US.xml'), | 38 | target: join(__dirname, '../../../client/src/locale/source/player_en_US.xml'), |
@@ -42,6 +46,8 @@ values(VIDEO_CATEGORIES) | |||
42 | .concat(values(VIDEO_PRIVACIES)) | 46 | .concat(values(VIDEO_PRIVACIES)) |
43 | .concat(values(VIDEO_STATES)) | 47 | .concat(values(VIDEO_STATES)) |
44 | .concat(values(VIDEO_IMPORT_STATES)) | 48 | .concat(values(VIDEO_IMPORT_STATES)) |
49 | .concat(values(VIDEO_PLAYLIST_PRIVACIES)) | ||
50 | .concat(values(VIDEO_PLAYLIST_TYPES)) | ||
45 | .concat([ | 51 | .concat([ |
46 | 'This video does not exist.', | 52 | 'This video does not exist.', |
47 | 'We cannot fetch the video. Please try again later.', | 53 | 'We cannot fetch the video. Please try again later.', |
diff --git a/scripts/i18n/pull-hook.sh b/scripts/i18n/pull-hook.sh index b0668436d..2d728fef5 100755 --- a/scripts/i18n/pull-hook.sh +++ b/scripts/i18n/pull-hook.sh | |||
@@ -2,12 +2,13 @@ | |||
2 | 2 | ||
3 | set -eu | 3 | set -eu |
4 | 4 | ||
5 | # Zanata does not support inner elements in <source>, so we hack these special elements | ||
6 | # This regex translate the converted elements to initial Angular elements | ||
7 | |||
8 | for i in 1 2 3; do | 5 | for i in 1 2 3; do |
6 | # Angular does not like when there is not target element, so we create it with the same content than the source element | ||
7 | perl -0pi -e 's#<source>([^<]+)</source>\s*<context-group #<source>\1</source><target>\1</target><context-group #g' client/src/locale/target/angular_*.xml | ||
8 | |||
9 | # Zanata does not support inner elements in <source>, so we hack these special elements | ||
10 | # This regex translate the converted elements to initial Angular elements | ||
9 | perl -pi -e 's|<x id=(.+?)/>([^"])|<x id=\1/>\2|g' client/src/locale/target/*.xml | 11 | perl -pi -e 's|<x id=(.+?)/>([^"])|<x id=\1/>\2|g' client/src/locale/target/*.xml |
10 | perl -0pi -e 's|<source>(.+?)</source>\s*<context-group |<source>\1</source><target>\1</target><context-group |g' client/src/locale/target/angular_*.xml | ||
11 | done | 12 | done |
12 | 13 | ||
13 | npm run i18n:xliff2json | 14 | npm run i18n:xliff2json |
diff --git a/scripts/optimize-old-videos.ts b/scripts/optimize-old-videos.ts index 1bee1b0f3..a1d5345a1 100644 --- a/scripts/optimize-old-videos.ts +++ b/scripts/optimize-old-videos.ts | |||
@@ -1,11 +1,12 @@ | |||
1 | import { CONFIG, VIDEO_TRANSCODING_FPS } from '../server/initializers/constants' | 1 | import { VIDEO_TRANSCODING_FPS } from '../server/initializers/constants' |
2 | import { getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution, getDurationFromVideoFile } from '../server/helpers/ffmpeg-utils' | 2 | import { getDurationFromVideoFile, getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '../server/helpers/ffmpeg-utils' |
3 | import { getMaxBitrate } from '../shared/models/videos' | 3 | import { getMaxBitrate } from '../shared/models/videos' |
4 | import { VideoModel } from '../server/models/video/video' | 4 | import { VideoModel } from '../server/models/video/video' |
5 | import { optimizeVideofile } from '../server/lib/video-transcoding' | 5 | import { optimizeVideofile } from '../server/lib/video-transcoding' |
6 | import { initDatabaseModels } from '../server/initializers' | 6 | import { initDatabaseModels } from '../server/initializers' |
7 | import { join, basename, dirname } from 'path' | 7 | import { basename, dirname, join } from 'path' |
8 | import { copy, remove, move } from 'fs-extra' | 8 | import { copy, move, remove } from 'fs-extra' |
9 | import { CONFIG } from '../server/initializers/config' | ||
9 | 10 | ||
10 | run() | 11 | run() |
11 | .then(() => process.exit(0)) | 12 | .then(() => process.exit(0)) |
diff --git a/scripts/parse-log.ts b/scripts/parse-log.ts index 86aaa7994..83ad45b72 100755 --- a/scripts/parse-log.ts +++ b/scripts/parse-log.ts | |||
@@ -1,10 +1,11 @@ | |||
1 | import * as program from 'commander' | 1 | import * as program from 'commander' |
2 | import { createReadStream, readdirSync, statSync } from 'fs-extra' | 2 | import { createReadStream, readdir } from 'fs-extra' |
3 | import { join } from 'path' | 3 | import { join } from 'path' |
4 | import { createInterface } from 'readline' | 4 | import { createInterface } from 'readline' |
5 | import * as winston from 'winston' | 5 | import * as winston from 'winston' |
6 | import { labelFormatter } from '../server/helpers/logger' | 6 | import { labelFormatter } from '../server/helpers/logger' |
7 | import { CONFIG } from '../server/initializers/constants' | 7 | import { CONFIG } from '../server/initializers/config' |
8 | import { mtimeSortFilesDesc } from '../shared/core-utils/logs/logs' | ||
8 | 9 | ||
9 | program | 10 | program |
10 | .option('-l, --level [level]', 'Level log (debug/info/warn/error)') | 11 | .option('-l, --level [level]', 'Level log (debug/info/warn/error)') |
@@ -52,42 +53,47 @@ const logLevels = { | |||
52 | debug: logger.debug.bind(logger) | 53 | debug: logger.debug.bind(logger) |
53 | } | 54 | } |
54 | 55 | ||
55 | const logFiles = readdirSync(CONFIG.STORAGE.LOG_DIR) | 56 | run() |
56 | const lastLogFile = getNewestFile(logFiles, CONFIG.STORAGE.LOG_DIR) | 57 | .then(() => process.exit(0)) |
58 | .catch(err => console.error(err)) | ||
57 | 59 | ||
58 | const path = join(CONFIG.STORAGE.LOG_DIR, lastLogFile) | 60 | function run () { |
59 | console.log('Opening %s.', path) | 61 | return new Promise(async res => { |
62 | const logFiles = await readdir(CONFIG.STORAGE.LOG_DIR) | ||
63 | const lastLogFile = await getNewestFile(logFiles, CONFIG.STORAGE.LOG_DIR) | ||
60 | 64 | ||
61 | const rl = createInterface({ | 65 | const path = join(CONFIG.STORAGE.LOG_DIR, lastLogFile) |
62 | input: createReadStream(path) | 66 | console.log('Opening %s.', path) |
63 | }) | ||
64 | 67 | ||
65 | rl.on('line', line => { | 68 | const stream = createReadStream(path) |
66 | const log = JSON.parse(line) | ||
67 | // Don't know why but loggerFormat does not remove splat key | ||
68 | Object.assign(log, { splat: undefined }) | ||
69 | 69 | ||
70 | logLevels[log.level](log) | 70 | const rl = createInterface({ |
71 | }) | 71 | input: stream |
72 | }) | ||
72 | 73 | ||
73 | function toTimeFormat (time: string) { | 74 | rl.on('line', line => { |
74 | const timestamp = Date.parse(time) | 75 | const log = JSON.parse(line) |
76 | // Don't know why but loggerFormat does not remove splat key | ||
77 | Object.assign(log, { splat: undefined }) | ||
75 | 78 | ||
76 | if (isNaN(timestamp) === true) return 'Unknown date' | 79 | logLevels[ log.level ](log) |
80 | }) | ||
77 | 81 | ||
78 | return new Date(timestamp).toISOString() | 82 | stream.once('close', () => res()) |
83 | }) | ||
79 | } | 84 | } |
80 | 85 | ||
81 | // Thanks: https://stackoverflow.com/a/37014317 | 86 | // Thanks: https://stackoverflow.com/a/37014317 |
82 | function getNewestFile (files: string[], basePath: string) { | 87 | async function getNewestFile (files: string[], basePath: string) { |
83 | const out = [] | 88 | const sorted = await mtimeSortFilesDesc(files, basePath) |
84 | 89 | ||
85 | files.forEach(file => { | 90 | return (sorted.length > 0) ? sorted[ 0 ].file : '' |
86 | const stats = statSync(basePath + '/' + file) | 91 | } |
87 | if (stats.isFile()) out.push({ file, mtime: stats.mtime.getTime() }) | 92 | |
88 | }) | 93 | function toTimeFormat (time: string) { |
94 | const timestamp = Date.parse(time) | ||
89 | 95 | ||
90 | out.sort((a, b) => b.mtime - a.mtime) | 96 | if (isNaN(timestamp) === true) return 'Unknown date' |
91 | 97 | ||
92 | return (out.length > 0) ? out[ 0 ].file : '' | 98 | return new Date(timestamp).toISOString() |
93 | } | 99 | } |
diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index c9e4dbd4b..4953a7439 100755 --- a/scripts/prune-storage.ts +++ b/scripts/prune-storage.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import * as prompt from 'prompt' | 1 | import * as prompt from 'prompt' |
2 | import { join } from 'path' | 2 | import { join } from 'path' |
3 | import { CONFIG } from '../server/initializers/constants' | 3 | import { CONFIG } from '../server/initializers/config' |
4 | import { VideoModel } from '../server/models/video/video' | 4 | import { VideoModel } from '../server/models/video/video' |
5 | import { initDatabaseModels } from '../server/initializers' | 5 | import { initDatabaseModels } from '../server/initializers' |
6 | import { remove, readdir } from 'fs-extra' | 6 | import { remove, readdir } from 'fs-extra' |
diff --git a/scripts/travis.sh b/scripts/travis.sh index 509b40d87..3557816c8 100755 --- a/scripts/travis.sh +++ b/scripts/travis.sh | |||
@@ -36,8 +36,4 @@ elif [ "$1" = "lint" ]; then | |||
36 | ( cd client | 36 | ( cd client |
37 | npm run lint | 37 | npm run lint |
38 | ) | 38 | ) |
39 | elif [ "$1" = "jest" ]; then | ||
40 | ( cd client | ||
41 | npm run test | ||
42 | ) | ||
43 | fi | 39 | fi |
diff --git a/scripts/update-host.ts b/scripts/update-host.ts index 422a3c9a7..57919b998 100755 --- a/scripts/update-host.ts +++ b/scripts/update-host.ts | |||
@@ -1,11 +1,12 @@ | |||
1 | import { CONFIG, initDatabaseModels } from '../server/initializers' | 1 | import { WEBSERVER } from '../server/initializers/constants' |
2 | import { ActorFollowModel } from '../server/models/activitypub/actor-follow' | 2 | import { ActorFollowModel } from '../server/models/activitypub/actor-follow' |
3 | import { VideoModel } from '../server/models/video/video' | 3 | import { VideoModel } from '../server/models/video/video' |
4 | import { ActorModel } from '../server/models/activitypub/actor' | 4 | import { ActorModel } from '../server/models/activitypub/actor' |
5 | import { | 5 | import { |
6 | getAccountActivityPubUrl, | 6 | getAccountActivityPubUrl, |
7 | getVideoActivityPubUrl, | ||
7 | getVideoAnnounceActivityPubUrl, | 8 | getVideoAnnounceActivityPubUrl, |
8 | getVideoActivityPubUrl, getVideoChannelActivityPubUrl, | 9 | getVideoChannelActivityPubUrl, |
9 | getVideoCommentActivityPubUrl | 10 | getVideoCommentActivityPubUrl |
10 | } from '../server/lib/activitypub' | 11 | } from '../server/lib/activitypub' |
11 | import { VideoShareModel } from '../server/models/video/video-share' | 12 | import { VideoShareModel } from '../server/models/video/video-share' |
@@ -13,6 +14,8 @@ import { VideoCommentModel } from '../server/models/video/video-comment' | |||
13 | import { getServerActor } from '../server/helpers/utils' | 14 | import { getServerActor } from '../server/helpers/utils' |
14 | import { AccountModel } from '../server/models/account/account' | 15 | import { AccountModel } from '../server/models/account/account' |
15 | import { VideoChannelModel } from '../server/models/video/video-channel' | 16 | import { VideoChannelModel } from '../server/models/video/video-channel' |
17 | import { VideoStreamingPlaylistModel } from '../server/models/video/video-streaming-playlist' | ||
18 | import { initDatabaseModels } from '../server/initializers' | ||
16 | 19 | ||
17 | run() | 20 | run() |
18 | .then(() => process.exit(0)) | 21 | .then(() => process.exit(0)) |
@@ -61,7 +64,7 @@ async function run () { | |||
61 | actor.url = newUrl | 64 | actor.url = newUrl |
62 | actor.inboxUrl = newUrl + '/inbox' | 65 | actor.inboxUrl = newUrl + '/inbox' |
63 | actor.outboxUrl = newUrl + '/outbox' | 66 | actor.outboxUrl = newUrl + '/outbox' |
64 | actor.sharedInboxUrl = CONFIG.WEBSERVER.URL + '/inbox' | 67 | actor.sharedInboxUrl = WEBSERVER.URL + '/inbox' |
65 | actor.followersUrl = newUrl + '/followers' | 68 | actor.followersUrl = newUrl + '/followers' |
66 | actor.followingUrl = newUrl + '/following' | 69 | actor.followingUrl = newUrl + '/following' |
67 | 70 | ||
@@ -109,11 +112,9 @@ async function run () { | |||
109 | 112 | ||
110 | console.log('Updating video and torrent files.') | 113 | console.log('Updating video and torrent files.') |
111 | 114 | ||
112 | const videos = await VideoModel.list() | 115 | const videos = await VideoModel.listLocal() |
113 | for (const video of videos) { | 116 | for (const video of videos) { |
114 | if (video.isOwned() === false) continue | 117 | console.log('Updating video ' + video.uuid) |
115 | |||
116 | console.log('Updated video ' + video.uuid) | ||
117 | 118 | ||
118 | video.url = getVideoActivityPubUrl(video) | 119 | video.url = getVideoActivityPubUrl(video) |
119 | await video.save() | 120 | await video.save() |
@@ -122,5 +123,12 @@ async function run () { | |||
122 | console.log('Updating torrent file %s of video %s.', file.resolution, video.uuid) | 123 | console.log('Updating torrent file %s of video %s.', file.resolution, video.uuid) |
123 | await video.createTorrentAndSetInfoHash(file) | 124 | await video.createTorrentAndSetInfoHash(file) |
124 | } | 125 | } |
126 | |||
127 | for (const playlist of video.VideoStreamingPlaylists) { | ||
128 | playlist.playlistUrl = WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsMasterPlaylistStaticPath(video.uuid) | ||
129 | playlist.segmentsSha256Url = WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsSha256SegmentsStaticPath(video.uuid) | ||
130 | |||
131 | await playlist.save() | ||
132 | } | ||
125 | } | 133 | } |
126 | } | 134 | } |
diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index 4f7c58edd..5d7c5b0ea 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh | |||
@@ -73,3 +73,7 @@ cp $PEERTUBE_PATH/peertube-latest/config/default.yaml $PEERTUBE_PATH/config/defa | |||
73 | echo "Differences in configuration files..." | 73 | echo "Differences in configuration files..." |
74 | diff -u $PEERTUBE_PATH/config/production.yaml "$PEERTUBE_PATH/versions/peertube-${VERSION}/config/production.yaml.example" | 74 | diff -u $PEERTUBE_PATH/config/production.yaml "$PEERTUBE_PATH/versions/peertube-${VERSION}/config/production.yaml.example" |
75 | 75 | ||
76 | echo "" | ||
77 | echo "===========================================" | ||
78 | echo "== Don’t forget to restart PeerTube! ==" | ||
79 | echo "===========================================" | ||
diff --git a/scripts/watch/client.sh b/scripts/watch/client.sh index f3799d2e9..1d6b8c2aa 100755 --- a/scripts/watch/client.sh +++ b/scripts/watch/client.sh | |||
@@ -4,4 +4,4 @@ set -eu | |||
4 | 4 | ||
5 | cd client | 5 | cd client |
6 | 6 | ||
7 | npm run ng -- serve --hmr --configuration hmr --host 0.0.0.0 --disable-host-check --port 3000 | 7 | npm run ng -- serve --proxy-config proxy.config.json --hmr --configuration hmr --host 0.0.0.0 --disable-host-check --port 3000 |