ActivityPub-federated video streaming platform using P2P directly in your web browser
Add more info logging
Chocobozzz8e0fd45e1499
diff --git a/server/lib/activitypub/send/send-accept.ts b/server/lib/activitypub/send/send-accept.tsindex 44644a22f3..dfee1ec3e9 100644--- a/server/lib/activitypub/send/send-accept.ts+++ b/server/lib/activitypub/send/send-accept.ts@@ -4,11 +4,14 @@ import { ActorFollowModel } from '../../../models/activitypub/actor-follow'import { getActorFollowAcceptActivityPubUrl, getActorFollowActivityPubUrl } from '../url'import { unicastTo } from './utils'import { followActivityData } from './send-follow'+import { logger } from '../../../helpers/logger'async function sendAccept (actorFollow: ActorFollowModel) {const follower = actorFollow.ActorFollowerconst me = actorFollow.ActorFollowing+ logger.info('Creating job to accept follower %s.', follower.url)+const followUrl = getActorFollowActivityPubUrl(actorFollow)const followData = followActivityData(followUrl, follower, me)diff --git a/server/lib/activitypub/send/send-announce.ts b/server/lib/activitypub/send/send-announce.tsindex dfc099ff26..1ab05ca3cc 100644--- a/server/lib/activitypub/send/send-announce.ts+++ b/server/lib/activitypub/send/send-announce.ts@@ -5,6 +5,7 @@ import { VideoModel } from '../../../models/video/video'import { VideoShareModel } from '../../../models/video/video-share'import { broadcastToFollowers } from './utils'import { getActorsInvolvedInVideo, getAudience, getObjectFollowersAudience } from '../audience'+import { logger } from '../../../helpers/logger'async function buildVideoAnnounce (byActor: ActorModel, videoShare: VideoShareModel, video: VideoModel, t: Transaction) {const announcedObject = video.url@@ -17,6 +18,8 @@ async function buildVideoAnnounce (byActor: ActorModel, videoShare: VideoShareMoasync function sendVideoAnnounce (byActor: ActorModel, videoShare: VideoShareModel, video: VideoModel, t: Transaction) {const data = await buildVideoAnnounce(byActor, videoShare, video, t)+ logger.info('Creating job to send announce %s.', videoShare.url)+return broadcastToFollowers(data, byActor, [ byActor ], t)}diff --git a/server/lib/activitypub/send/send-create.ts b/server/lib/activitypub/send/send-create.tsindex 293947b052..f7a8cf0b36 100644--- a/server/lib/activitypub/send/send-create.ts+++ b/server/lib/activitypub/send/send-create.ts@@ -16,10 +16,13 @@ import {getVideoAudience,getVideoCommentAudience} from '../audience'+import { logger } from '../../../helpers/logger'async function sendCreateVideo (video: VideoModel, t: Transaction) {if (video.privacy === VideoPrivacy.PRIVATE) return undefined+ logger.info('Creating job to send video creation of %s.', video.url)+const byActor = video.VideoChannel.Account.Actorconst videoObject = video.toActivityPubObject()@@ -32,6 +35,8 @@ async function sendCreateVideo (video: VideoModel, t: Transaction) {async function sendVideoAbuse (byActor: ActorModel, videoAbuse: VideoAbuseModel, video: VideoModel, t: Transaction) {const url = getVideoAbuseActivityPubUrl(videoAbuse)+ logger.info('Creating job to send video abuse %s.', url)+const audience = { to: [ video.VideoChannel.Account.Actor.url ], cc: [] }const data = createActivityData(url, byActor, videoAbuse.toActivityPubObject(), audience)@@ -39,6 +44,8 @@ async function sendVideoAbuse (byActor: ActorModel, videoAbuse: VideoAbuseModel,}async function sendCreateVideoComment (comment: VideoCommentModel, t: Transaction) {+ logger.info('Creating job to send comment %s.', comment.url)+const isOrigin = comment.Video.isOwned()const byActor = comment.Account.Actor@@ -74,6 +81,8 @@ async function sendCreateVideoComment (comment: VideoCommentModel, t: Transactio}async function sendCreateView (byActor: ActorModel, video: VideoModel, t: Transaction) {+ logger.info('Creating job to send view of %s.', video.url)+const url = getVideoViewActivityPubUrl(byActor, video)const viewActivityData = createViewActivityData(byActor, video)@@ -98,6 +107,8 @@ async function sendCreateView (byActor: ActorModel, video: VideoModel, t: Transa}async function sendCreateDislike (byActor: ActorModel, video: VideoModel, t: Transaction) {+ logger.info('Creating job to dislike %s.', video.url)+const url = getVideoDislikeActivityPubUrl(byActor, video)const dislikeActivityData = createDislikeActivityData(byActor, video)diff --git a/server/lib/activitypub/send/send-delete.ts b/server/lib/activitypub/send/send-delete.tsindex e9a8951b59..3d1dfb699e 100644--- a/server/lib/activitypub/send/send-delete.ts+++ b/server/lib/activitypub/send/send-delete.ts@@ -7,8 +7,11 @@ import { VideoShareModel } from '../../../models/video/video-share'import { getDeleteActivityPubUrl } from '../url'import { broadcastToActors, broadcastToFollowers, unicastTo } from './utils'import { audiencify, getActorsInvolvedInVideo, getVideoCommentAudience } from '../audience'+import { logger } from '../../../helpers/logger'async function sendDeleteVideo (video: VideoModel, t: Transaction) {+ logger.info('Creating job to broadcast delete of video %s.', video.url)+const url = getDeleteActivityPubUrl(video.url)const byActor = video.VideoChannel.Account.Actor@@ -21,6 +24,8 @@ async function sendDeleteVideo (video: VideoModel, t: Transaction) {}async function sendDeleteActor (byActor: ActorModel, t: Transaction) {+ logger.info('Creating job to broadcast delete of actor %s.', byActor.url)+const url = getDeleteActivityPubUrl(byActor.url)const data = deleteActivityData(url, byActor.url, byActor)@@ -31,6 +36,8 @@ async function sendDeleteActor (byActor: ActorModel, t: Transaction) {}async function sendDeleteVideoComment (videoComment: VideoCommentModel, t: Transaction) {+ logger.info('Creating job to send delete of comment %s.', videoComment.url)+const isVideoOrigin = videoComment.Video.isOwned()const url = getDeleteActivityPubUrl(videoComment.url)diff --git a/server/lib/activitypub/send/send-follow.ts b/server/lib/activitypub/send/send-follow.tsindex f81d9a1942..2faffe6e70 100644--- a/server/lib/activitypub/send/send-follow.ts+++ b/server/lib/activitypub/send/send-follow.ts@@ -3,11 +3,14 @@ import { ActorModel } from '../../../models/activitypub/actor'import { ActorFollowModel } from '../../../models/activitypub/actor-follow'import { getActorFollowActivityPubUrl } from '../url'import { unicastTo } from './utils'+import { logger } from '../../../helpers/logger'function sendFollow (actorFollow: ActorFollowModel) {const me = actorFollow.ActorFollowerconst following = actorFollow.ActorFollowing+ logger.info('Creating job to send follow request to %s.', following.url)+const url = getActorFollowActivityPubUrl(actorFollow)const data = followActivityData(url, me, following)diff --git a/server/lib/activitypub/send/send-like.ts b/server/lib/activitypub/send/send-like.tsindex 37ee7c0966..83225f5df1 100644--- a/server/lib/activitypub/send/send-like.ts+++ b/server/lib/activitypub/send/send-like.ts@@ -5,8 +5,11 @@ import { VideoModel } from '../../../models/video/video'import { getVideoLikeActivityPubUrl } from '../url'import { broadcastToFollowers, unicastTo } from './utils'import { audiencify, getActorsInvolvedInVideo, getAudience, getObjectFollowersAudience, getVideoAudience } from '../audience'+import { logger } from '../../../helpers/logger'async function sendLike (byActor: ActorModel, video: VideoModel, t: Transaction) {+ logger.info('Creating job to like %s.', video.url)+const url = getVideoLikeActivityPubUrl(byActor, video)const accountsInvolvedInVideo = await getActorsInvolvedInVideo(video, t)diff --git a/server/lib/activitypub/send/send-undo.ts b/server/lib/activitypub/send/send-undo.tsindex 33c3d24291..4e5dd39737 100644--- a/server/lib/activitypub/send/send-undo.ts+++ b/server/lib/activitypub/send/send-undo.ts@@ -18,11 +18,14 @@ import { followActivityData } from './send-follow'import { likeActivityData } from './send-like'import { VideoShareModel } from '../../../models/video/video-share'import { buildVideoAnnounce } from './send-announce'+import { logger } from '../../../helpers/logger'async function sendUndoFollow (actorFollow: ActorFollowModel, t: Transaction) {const me = actorFollow.ActorFollowerconst following = actorFollow.ActorFollowing+ logger.info('Creating job to send an unfollow request to %s.', following.url)+const followUrl = getActorFollowActivityPubUrl(actorFollow)const undoUrl = getUndoActivityPubUrl(followUrl)@@ -33,6 +36,8 @@ async function sendUndoFollow (actorFollow: ActorFollowModel, t: Transaction) {}async function sendUndoLike (byActor: ActorModel, video: VideoModel, t: Transaction) {+ logger.info('Creating job to undo a like of video %s.', video.url)+const likeUrl = getVideoLikeActivityPubUrl(byActor, video)const undoUrl = getUndoActivityPubUrl(likeUrl)@@ -55,6 +60,8 @@ async function sendUndoLike (byActor: ActorModel, video: VideoModel, t: Transact}async function sendUndoDislike (byActor: ActorModel, video: VideoModel, t: Transaction) {+ logger.info('Creating job to undo a dislike of video %s.', video.url)+const dislikeUrl = getVideoDislikeActivityPubUrl(byActor, video)const undoUrl = getUndoActivityPubUrl(dislikeUrl)@@ -76,6 +83,8 @@ async function sendUndoDislike (byActor: ActorModel, video: VideoModel, t: Trans}async function sendUndoAnnounce (byActor: ActorModel, videoShare: VideoShareModel, video: VideoModel, t: Transaction) {+ logger.info('Creating job to undo announce %s.', videoShare.url)+const undoUrl = getUndoActivityPubUrl(videoShare.url)const actorsInvolvedInVideo = await getActorsInvolvedInVideo(video, t)diff --git a/server/lib/activitypub/send/send-update.ts b/server/lib/activitypub/send/send-update.tsindex 2fd374ec65..17d4f185c9 100644--- a/server/lib/activitypub/send/send-update.ts+++ b/server/lib/activitypub/send/send-update.ts@@ -9,8 +9,11 @@ import { VideoShareModel } from '../../../models/video/video-share'import { getUpdateActivityPubUrl } from '../url'import { broadcastToFollowers } from './utils'import { audiencify, getAudience } from '../audience'+import { logger } from '../../../helpers/logger'async function sendUpdateVideo (video: VideoModel, t: Transaction) {+ logger.info('Creating job to update video %s.', video.url)+const byActor = video.VideoChannel.Account.Actorconst url = getUpdateActivityPubUrl(video.url, video.updatedAt.toISOString())@@ -28,6 +31,8 @@ async function sendUpdateVideo (video: VideoModel, t: Transaction) {async function sendUpdateActor (accountOrChannel: AccountModel | VideoChannelModel, t: Transaction) {const byActor = accountOrChannel.Actor+ logger.info('Creating job to update actor %s.', byActor.url)+const url = getUpdateActivityPubUrl(byActor.url, byActor.updatedAt.toISOString())const accountOrChannelObject = accountOrChannel.toActivityPubObject()const audience = getAudience(byActor)diff --git a/server/lib/activitypub/send/utils.ts b/server/lib/activitypub/send/utils.tsindex 241db6c8cf..0d28444ec4 100644--- a/server/lib/activitypub/send/utils.ts+++ b/server/lib/activitypub/send/utils.ts@@ -26,6 +26,8 @@ async function forwardActivity (followersException: ActorModel[] = [],additionalFollowerUrls: string[] = []) {+ logger.info('Forwarding activity %s.', activity.id)+const to = activity.to || []const cc = activity.cc || []diff --git a/server/models/account/account.ts b/server/models/account/account.tsindex 2eed66fc26..d674d8d22d 100644--- a/server/models/account/account.ts+++ b/server/models/account/account.ts@@ -139,7 +139,6 @@ export class AccountModel extends Model<AccountModel> {}if (instance.isOwned()) {- logger.debug('Sending delete of actor of account %s.', instance.Actor.url)return sendDeleteActor(instance.Actor, options.transaction)}diff --git a/server/models/avatar/avatar.ts b/server/models/avatar/avatar.tsindex e1d4c20bcc..51e26c87b3 100644--- a/server/models/avatar/avatar.ts+++ b/server/models/avatar/avatar.ts@@ -3,6 +3,7 @@ import { AfterDestroy, AllowNull, Column, CreatedAt, Model, Table, UpdatedAt } fimport { Avatar } from '../../../shared/models/avatars/avatar.model'import { unlinkPromise } from '../../helpers/core-utils'import { CONFIG, STATIC_PATHS } from '../../initializers'+import { logger } from '../../helpers/logger'@Table({tableName: 'avatar'@@ -21,6 +22,7 @@ export class AvatarModel extends Model<AvatarModel> {@AfterDestroystatic removeFilesAndSendDelete (instance: AvatarModel) {+ logger.info('Removing avatar file %s.', instance.filename)return instance.removeAvatar()}diff --git a/server/models/video/video-caption.ts b/server/models/video/video-caption.tsindex 5a1becc479..4a25097f8a 100644--- a/server/models/video/video-caption.ts+++ b/server/models/video/video-caption.ts@@ -80,7 +80,7 @@ export class VideoCaptionModel extends Model<VideoCaptionModel> {}if (instance.isOwned()) {- logger.debug('Removing captions %s of video %s.', instance.Video.uuid, instance.language)+ logger.info('Removing captions %s of video %s.', instance.Video.uuid, instance.language)try {await instance.removeCaptionFile()diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.tsindex 6567b00d69..d0dba18d5a 100644--- a/server/models/video/video-channel.ts+++ b/server/models/video/video-channel.ts@@ -140,8 +140,6 @@ export class VideoChannelModel extends Model<VideoChannelModel> {}if (instance.Actor.isOwned()) {- logger.debug('Sending delete of actor of video channel %s.', instance.Actor.url)-return sendDeleteActor(instance.Actor, options.transaction)}diff --git a/server/models/video/video.ts b/server/models/video/video.tsindex 5808f3936d..a6c4620b23 100644--- a/server/models/video/video.ts+++ b/server/models/video/video.ts@@ -607,8 +607,6 @@ export class VideoModel extends Model<VideoModel> {}) as VideoChannelModel}- logger.debug('Sending delete of video %s.', instance.url)-return sendDeleteVideo(instance, options.transaction)}@@ -619,7 +617,7 @@ export class VideoModel extends Model<VideoModel> {static async removeFiles (instance: VideoModel) {const tasks: Promise<any>[] = []- logger.debug('Removing files of video %s.', instance.url)+ logger.info('Removing files of video %s.', instance.url)tasks.push(instance.removeThumbnail())