aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-11 14:26:41 +0200
committerChocobozzz <me@florianbigard.com>2019-04-11 14:26:41 +0200
commit74dc3bca2b14f5fd3fe80c394dfc34177a46db77 (patch)
treee4b307beb6255420c9993a2aed470438317f100f /scripts
parent6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0 (diff)
downloadPeerTube-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.ts3
-rw-r--r--scripts/optimize-old-videos.ts9
-rwxr-xr-xscripts/parse-log.ts2
-rwxr-xr-xscripts/prune-storage.ts2
-rwxr-xr-xscripts/update-host.ts12
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 @@
1import * as Promise from 'bluebird' 1import * as Promise from 'bluebird'
2import * as rimraf from 'rimraf' 2import * as rimraf from 'rimraf'
3import { CONFIG, initDatabaseModels, sequelizeTypescript } from '../../../server/initializers' 3import { initDatabaseModels, sequelizeTypescript } from '../../../server/initializers'
4import { CONFIG } from '../../../server/initializers/config'
4 5
5initDatabaseModels(true) 6initDatabaseModels(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 @@
1import { CONFIG, VIDEO_TRANSCODING_FPS } from '../server/initializers/constants' 1import { VIDEO_TRANSCODING_FPS } from '../server/initializers/constants'
2import { getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution, getDurationFromVideoFile } from '../server/helpers/ffmpeg-utils' 2import { getDurationFromVideoFile, getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '../server/helpers/ffmpeg-utils'
3import { getMaxBitrate } from '../shared/models/videos' 3import { getMaxBitrate } from '../shared/models/videos'
4import { VideoModel } from '../server/models/video/video' 4import { VideoModel } from '../server/models/video/video'
5import { optimizeVideofile } from '../server/lib/video-transcoding' 5import { optimizeVideofile } from '../server/lib/video-transcoding'
6import { initDatabaseModels } from '../server/initializers' 6import { initDatabaseModels } from '../server/initializers'
7import { join, basename, dirname } from 'path' 7import { basename, dirname, join } from 'path'
8import { copy, remove, move } from 'fs-extra' 8import { copy, move, remove } from 'fs-extra'
9import { CONFIG } from '../server/initializers/config'
9 10
10run() 11run()
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'
4import { createInterface } from 'readline' 4import { createInterface } from 'readline'
5import * as winston from 'winston' 5import * as winston from 'winston'
6import { labelFormatter } from '../server/helpers/logger' 6import { labelFormatter } from '../server/helpers/logger'
7import { CONFIG } from '../server/initializers/constants' 7import { CONFIG } from '../server/initializers/config'
8import { mtimeSortFilesDesc } from '../shared/utils/logs/logs' 8import { mtimeSortFilesDesc } from '../shared/utils/logs/logs'
9 9
10program 10program
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 @@
1import * as prompt from 'prompt' 1import * as prompt from 'prompt'
2import { join } from 'path' 2import { join } from 'path'
3import { CONFIG } from '../server/initializers/constants' 3import { CONFIG } from '../server/initializers/config'
4import { VideoModel } from '../server/models/video/video' 4import { VideoModel } from '../server/models/video/video'
5import { initDatabaseModels } from '../server/initializers' 5import { initDatabaseModels } from '../server/initializers'
6import { remove, readdir } from 'fs-extra' 6import { 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 @@
1import { CONFIG, initDatabaseModels } from '../server/initializers' 1import { WEBSERVER } from '../server/initializers/constants'
2import { ActorFollowModel } from '../server/models/activitypub/actor-follow' 2import { ActorFollowModel } from '../server/models/activitypub/actor-follow'
3import { VideoModel } from '../server/models/video/video' 3import { VideoModel } from '../server/models/video/video'
4import { ActorModel } from '../server/models/activitypub/actor' 4import { ActorModel } from '../server/models/activitypub/actor'
5import { 5import {
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'
11import { VideoShareModel } from '../server/models/video/video-share' 12import { VideoShareModel } from '../server/models/video/video-share'
@@ -14,6 +15,7 @@ import { getServerActor } from '../server/helpers/utils'
14import { AccountModel } from '../server/models/account/account' 15import { AccountModel } from '../server/models/account/account'
15import { VideoChannelModel } from '../server/models/video/video-channel' 16import { VideoChannelModel } from '../server/models/video/video-channel'
16import { VideoStreamingPlaylistModel } from '../server/models/video/video-streaming-playlist' 17import { VideoStreamingPlaylistModel } from '../server/models/video/video-streaming-playlist'
18import { initDatabaseModels } from '../server/initializers'
17 19
18run() 20run()
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 }