aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/update-host.ts
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/update-host.ts
parent6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0 (diff)
downloadPeerTube-74dc3bca2b14f5fd3fe80c394dfc34177a46db77.tar.gz
PeerTube-74dc3bca2b14f5fd3fe80c394dfc34177a46db77.tar.zst
PeerTube-74dc3bca2b14f5fd3fe80c394dfc34177a46db77.zip
Don't expose constants directly in initializers/
Diffstat (limited to 'scripts/update-host.ts')
-rwxr-xr-xscripts/update-host.ts12
1 files changed, 7 insertions, 5 deletions
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 }