aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-20 11:21:08 +0100
committerChocobozzz <me@florianbigard.com>2020-11-20 11:21:08 +0100
commitde94ac86a211dec657332d964693857ec235ce40 (patch)
tree3bff96a40e7c862d83561a26249992b07331b0a2 /scripts
parent3fba4b6bce69247b1d37f923894d8f44818a891c (diff)
downloadPeerTube-de94ac86a211dec657332d964693857ec235ce40.tar.gz
PeerTube-de94ac86a211dec657332d964693857ec235ce40.tar.zst
PeerTube-de94ac86a211dec657332d964693857ec235ce40.zip
Fix incorrect IDs in AP federation
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/update-host.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/scripts/update-host.ts b/scripts/update-host.ts
index d2fb19c76..b030b21c3 100755
--- a/scripts/update-host.ts
+++ b/scripts/update-host.ts
@@ -6,11 +6,11 @@ import { ActorFollowModel } from '../server/models/activitypub/actor-follow'
6import { VideoModel } from '../server/models/video/video' 6import { VideoModel } from '../server/models/video/video'
7import { ActorModel } from '../server/models/activitypub/actor' 7import { ActorModel } from '../server/models/activitypub/actor'
8import { 8import {
9 getAccountActivityPubUrl, 9 getLocalAccountActivityPubUrl,
10 getVideoActivityPubUrl, 10 getLocalVideoActivityPubUrl,
11 getVideoAnnounceActivityPubUrl, 11 getLocalVideoAnnounceActivityPubUrl,
12 getVideoChannelActivityPubUrl, 12 getLocalVideoChannelActivityPubUrl,
13 getVideoCommentActivityPubUrl 13 getLocalVideoCommentActivityPubUrl
14} from '../server/lib/activitypub/url' 14} from '../server/lib/activitypub/url'
15import { VideoShareModel } from '../server/models/video/video-share' 15import { VideoShareModel } from '../server/models/video/video-share'
16import { VideoCommentModel } from '../server/models/video/video-comment' 16import { VideoCommentModel } from '../server/models/video/video-comment'
@@ -62,8 +62,8 @@ async function run () {
62 console.log('Updating actor ' + actor.url) 62 console.log('Updating actor ' + actor.url)
63 63
64 const newUrl = actor.Account 64 const newUrl = actor.Account
65 ? getAccountActivityPubUrl(actor.preferredUsername) 65 ? getLocalAccountActivityPubUrl(actor.preferredUsername)
66 : getVideoChannelActivityPubUrl(actor.preferredUsername) 66 : getLocalVideoChannelActivityPubUrl(actor.preferredUsername)
67 67
68 actor.url = newUrl 68 actor.url = newUrl
69 actor.inboxUrl = newUrl + '/inbox' 69 actor.inboxUrl = newUrl + '/inbox'
@@ -85,7 +85,7 @@ async function run () {
85 85
86 console.log('Updating video share ' + videoShare.url) 86 console.log('Updating video share ' + videoShare.url)
87 87
88 videoShare.url = getVideoAnnounceActivityPubUrl(videoShare.Actor, videoShare.Video) 88 videoShare.url = getLocalVideoAnnounceActivityPubUrl(videoShare.Actor, videoShare.Video)
89 await videoShare.save() 89 await videoShare.save()
90 } 90 }
91 91
@@ -110,7 +110,7 @@ async function run () {
110 110
111 console.log('Updating comment ' + comment.url) 111 console.log('Updating comment ' + comment.url)
112 112
113 comment.url = getVideoCommentActivityPubUrl(comment.Video, comment) 113 comment.url = getLocalVideoCommentActivityPubUrl(comment.Video, comment)
114 await comment.save() 114 await comment.save()
115 } 115 }
116 116
@@ -120,7 +120,7 @@ async function run () {
120 for (const video of videos) { 120 for (const video of videos) {
121 console.log('Updating video ' + video.uuid) 121 console.log('Updating video ' + video.uuid)
122 122
123 video.url = getVideoActivityPubUrl(video) 123 video.url = getLocalVideoActivityPubUrl(video)
124 await video.save() 124 await video.save()
125 125
126 for (const file of video.VideoFiles) { 126 for (const file of video.VideoFiles) {