mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Fix broken local actors
Some channels can't federate because they don't have public/private keys, maybe because the generation failed for various reasons
This commit is contained in:
parent
92315d979c
commit
8795d6f254
11 changed files with 90 additions and 26 deletions
|
@ -3,6 +3,7 @@ import { Hooks } from '@server/lib/plugins/hooks'
|
|||
import { getServerActor } from '@server/models/application/application'
|
||||
import { MChannelAccountDefault } from '@server/types/models'
|
||||
import { VideoChannelCreate, VideoChannelUpdate } from '../../../shared'
|
||||
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
|
||||
import { auditLoggerFactory, getAuditIdFromRes, VideoChannelAuditView } from '../../helpers/audit-logger'
|
||||
import { resetSequelizeInstance } from '../../helpers/database-utils'
|
||||
import { buildNSFWFilter, createReqFiles, getCountVideos, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils'
|
||||
|
@ -11,7 +12,6 @@ import { getFormattedObjects } from '../../helpers/utils'
|
|||
import { CONFIG } from '../../initializers/config'
|
||||
import { MIMETYPES } from '../../initializers/constants'
|
||||
import { sequelizeTypescript } from '../../initializers/database'
|
||||
import { setAsyncActorKeys } from '../../lib/activitypub/actor'
|
||||
import { sendUpdateActor } from '../../lib/activitypub/send'
|
||||
import { deleteLocalActorAvatarFile, updateLocalActorAvatarFile } from '../../lib/avatar'
|
||||
import { JobQueue } from '../../lib/job-queue'
|
||||
|
@ -39,7 +39,6 @@ import { AccountModel } from '../../models/account/account'
|
|||
import { VideoModel } from '../../models/video/video'
|
||||
import { VideoChannelModel } from '../../models/video/video-channel'
|
||||
import { VideoPlaylistModel } from '../../models/video/video-playlist'
|
||||
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
|
||||
|
||||
const auditLogger = auditLoggerFactory('channels')
|
||||
const reqAvatarFile = createReqFiles([ 'avatarfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.TMP_DIR })
|
||||
|
@ -168,8 +167,8 @@ async function addVideoChannel (req: express.Request, res: express.Response) {
|
|||
return createLocalVideoChannel(videoChannelInfo, account, t)
|
||||
})
|
||||
|
||||
setAsyncActorKeys(videoChannelCreated.Actor)
|
||||
.catch(err => logger.error('Cannot set async actor keys for account %s.', videoChannelCreated.Actor.url, { err }))
|
||||
const payload = { actorId: videoChannelCreated.actorId }
|
||||
await JobQueue.Instance.createJobWithPromise({ type: 'actor-keys', payload })
|
||||
|
||||
auditLogger.create(getAuditIdFromRes(res), new VideoChannelAuditView(videoChannelCreated.toFormattedJSON()))
|
||||
logger.info('Video channel %s created.', videoChannelCreated.Actor.url)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue