diff options
Diffstat (limited to 'scripts/update-host.ts')
-rwxr-xr-x | scripts/update-host.ts | 12 |
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 @@ | |||
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 | } |