diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-11 14:26:41 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-11 14:26:41 +0200 |
commit | 74dc3bca2b14f5fd3fe80c394dfc34177a46db77 (patch) | |
tree | e4b307beb6255420c9993a2aed470438317f100f /scripts | |
parent | 6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0 (diff) | |
download | PeerTube-74dc3bca2b14f5fd3fe80c394dfc34177a46db77.tar.gz PeerTube-74dc3bca2b14f5fd3fe80c394dfc34177a46db77.tar.zst PeerTube-74dc3bca2b14f5fd3fe80c394dfc34177a46db77.zip |
Don't expose constants directly in initializers/
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/danger/clean/cleaner.ts | 3 | ||||
-rw-r--r-- | scripts/optimize-old-videos.ts | 9 | ||||
-rwxr-xr-x | scripts/parse-log.ts | 2 | ||||
-rwxr-xr-x | scripts/prune-storage.ts | 2 | ||||
-rwxr-xr-x | scripts/update-host.ts | 12 |
5 files changed, 16 insertions, 12 deletions
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/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 66a5b8719..fe87db009 100755 --- a/scripts/parse-log.ts +++ b/scripts/parse-log.ts | |||
@@ -4,7 +4,7 @@ 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/utils/logs/logs' | 8 | import { mtimeSortFilesDesc } from '../shared/utils/logs/logs' |
9 | 9 | ||
10 | program | 10 | program |
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/update-host.ts b/scripts/update-host.ts index 64eba867a..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' |
@@ -14,6 +15,7 @@ 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' |
16 | import { VideoStreamingPlaylistModel } from '../server/models/video/video-streaming-playlist' | 17 | import { VideoStreamingPlaylistModel } from '../server/models/video/video-streaming-playlist' |
18 | import { initDatabaseModels } from '../server/initializers' | ||
17 | 19 | ||
18 | run() | 20 | run() |
19 | .then(() => process.exit(0)) | 21 | .then(() => process.exit(0)) |
@@ -62,7 +64,7 @@ async function run () { | |||
62 | actor.url = newUrl | 64 | actor.url = newUrl |
63 | actor.inboxUrl = newUrl + '/inbox' | 65 | actor.inboxUrl = newUrl + '/inbox' |
64 | actor.outboxUrl = newUrl + '/outbox' | 66 | actor.outboxUrl = newUrl + '/outbox' |
65 | actor.sharedInboxUrl = CONFIG.WEBSERVER.URL + '/inbox' | 67 | actor.sharedInboxUrl = WEBSERVER.URL + '/inbox' |
66 | actor.followersUrl = newUrl + '/followers' | 68 | actor.followersUrl = newUrl + '/followers' |
67 | actor.followingUrl = newUrl + '/following' | 69 | actor.followingUrl = newUrl + '/following' |
68 | 70 | ||
@@ -123,8 +125,8 @@ async function run () { | |||
123 | } | 125 | } |
124 | 126 | ||
125 | for (const playlist of video.VideoStreamingPlaylists) { | 127 | for (const playlist of video.VideoStreamingPlaylists) { |
126 | playlist.playlistUrl = CONFIG.WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsMasterPlaylistStaticPath(video.uuid) | 128 | playlist.playlistUrl = WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsMasterPlaylistStaticPath(video.uuid) |
127 | playlist.segmentsSha256Url = CONFIG.WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsSha256SegmentsStaticPath(video.uuid) | 129 | playlist.segmentsSha256Url = WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsSha256SegmentsStaticPath(video.uuid) |
128 | 130 | ||
129 | await playlist.save() | 131 | await playlist.save() |
130 | } | 132 | } |