Upgrade server dependencies
This commit is contained in:
parent
f55cc0f97a
commit
fbd51e69f2
14
package.json
14
package.json
|
@ -87,10 +87,10 @@
|
|||
"http-signature": "1.3.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"apicache": "1.5.2",
|
||||
"apicache": "1.6.2",
|
||||
"async": "^3.0.1",
|
||||
"async-lru": "^1.1.1",
|
||||
"bcrypt": "5.0.0",
|
||||
"bcrypt": "5.0.1",
|
||||
"bittorrent-tracker": "^9.0.0",
|
||||
"bluebird": "^3.5.0",
|
||||
"body-parser": "^1.12.4",
|
||||
|
@ -119,7 +119,7 @@
|
|||
"iso-639-3": "^2.0.0",
|
||||
"jimp": "^0.16.0",
|
||||
"js-yaml": "^4.0.0",
|
||||
"jsonld": "~3.3.0",
|
||||
"jsonld": "~4.0.1",
|
||||
"lodash": "^4.17.10",
|
||||
"lru-cache": "^6.0.0",
|
||||
"magnet-uri": "^6.1.0",
|
||||
|
@ -155,7 +155,7 @@
|
|||
"uuid": "^8.1.0",
|
||||
"validator": "^13.0.0",
|
||||
"webfinger.js": "^2.6.6",
|
||||
"webtorrent": "^0.112.3",
|
||||
"webtorrent": "^0.115.1",
|
||||
"winston": "3.3.3",
|
||||
"ws": "^7.0.0",
|
||||
"youtube-dl": "^3.0.2"
|
||||
|
@ -188,7 +188,7 @@
|
|||
"@types/mocha": "^8.0.3",
|
||||
"@types/morgan": "^1.7.32",
|
||||
"@types/multer": "^1.3.3",
|
||||
"@types/node": "^12",
|
||||
"@types/node": "^14.14.31",
|
||||
"@types/nodemailer": "^6.2.0",
|
||||
"@types/oauth2-server": "^3.0.8",
|
||||
"@types/pem": "^1.9.3",
|
||||
|
@ -203,7 +203,7 @@
|
|||
"chai": "^4.1.1",
|
||||
"chai-json-schema": "^1.5.0",
|
||||
"chai-xml": "^0.4.0",
|
||||
"concurrently": "^5.0.0",
|
||||
"concurrently": "^6.0.0",
|
||||
"eslint": "^7.2.0",
|
||||
"eslint-config-standard-with-typescript": "^20.0.0",
|
||||
"eslint-plugin-import": "^2.20.1",
|
||||
|
@ -212,7 +212,7 @@
|
|||
"eslint-plugin-standard": "^5.0.0",
|
||||
"libxmljs": "0.19.7",
|
||||
"maildev": "^1.0.0-rc3",
|
||||
"marked": "^1.1.0",
|
||||
"marked": "^2.0.1",
|
||||
"marked-man": "^0.7.0",
|
||||
"mocha": "^8.0.1",
|
||||
"nodemon": "^2.0.1",
|
||||
|
|
|
@ -22,7 +22,7 @@ class PeerTubeSocket {
|
|||
io.of('/user-notifications')
|
||||
.use(authenticateSocket)
|
||||
.on('connection', socket => {
|
||||
const userId = socket.handshake.query.user.id
|
||||
const userId = socket.handshake.auth.user.id
|
||||
|
||||
logger.debug('User %d connected on the notification system.', userId)
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ function authenticateSocket (socket: Socket, next: (err?: any) => void) {
|
|||
logger.debug('Checking socket access token %s.', accessToken)
|
||||
|
||||
if (!accessToken) return next(new Error('No access token provided'))
|
||||
if (typeof accessToken !== 'string') return next(new Error('Access token is invalid'))
|
||||
|
||||
getAccessToken(accessToken)
|
||||
.then(tokenDB => {
|
||||
|
@ -41,7 +42,7 @@ function authenticateSocket (socket: Socket, next: (err?: any) => void) {
|
|||
return next(new Error('Invalid access token.'))
|
||||
}
|
||||
|
||||
socket.handshake.query['user'] = tokenDB.User
|
||||
socket.handshake.auth.user = tokenDB.User
|
||||
|
||||
return next()
|
||||
})
|
||||
|
|
|
@ -8,9 +8,9 @@ import {
|
|||
MVideoChangeOwnershipFull,
|
||||
MVideoFile,
|
||||
MVideoImmutable,
|
||||
MVideoLive,
|
||||
MVideoPlaylistFull,
|
||||
MVideoPlaylistFullSummary,
|
||||
MVideoLive
|
||||
MVideoPlaylistFullSummary
|
||||
} from '@server/types/models'
|
||||
import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token'
|
||||
import { MPlugin, MServer, MServerBlocklist } from '@server/types/models/server'
|
||||
|
@ -43,97 +43,97 @@ declare module 'express' {
|
|||
export interface Request {
|
||||
query: any
|
||||
}
|
||||
|
||||
interface Response {
|
||||
|
||||
locals: {
|
||||
bypassLogin?: {
|
||||
bypass: boolean
|
||||
pluginName: string
|
||||
authName?: string
|
||||
user: {
|
||||
username: string
|
||||
email: string
|
||||
displayName: string
|
||||
role: UserRole
|
||||
}
|
||||
}
|
||||
|
||||
refreshTokenAuthName?: string
|
||||
|
||||
explicitLogout: boolean
|
||||
|
||||
videoAll?: MVideoFullLight
|
||||
onlyImmutableVideo?: MVideoImmutable
|
||||
onlyVideo?: MVideoThumbnail
|
||||
onlyVideoWithRights?: MVideoWithRights
|
||||
videoId?: MVideoIdThumbnail
|
||||
|
||||
videoLive?: MVideoLive
|
||||
|
||||
videoShare?: MVideoShareActor
|
||||
|
||||
videoFile?: MVideoFile
|
||||
|
||||
videoImport?: MVideoImportDefault
|
||||
|
||||
videoBlacklist?: MVideoBlacklist
|
||||
|
||||
videoCaption?: MVideoCaptionVideo
|
||||
|
||||
abuse?: MAbuseReporter
|
||||
abuseMessage?: MAbuseMessage
|
||||
|
||||
videoStreamingPlaylist?: MStreamingPlaylist
|
||||
|
||||
videoChannel?: MChannelAccountDefault
|
||||
|
||||
videoPlaylistFull?: MVideoPlaylistFull
|
||||
videoPlaylistSummary?: MVideoPlaylistFullSummary
|
||||
|
||||
videoPlaylistElement?: MVideoPlaylistElement
|
||||
videoPlaylistElementAP?: MVideoPlaylistElementVideoUrlPlaylistPrivacy
|
||||
|
||||
accountVideoRate?: MAccountVideoRateAccountVideo
|
||||
|
||||
videoCommentFull?: MCommentOwnerVideoReply
|
||||
videoCommentThread?: MComment
|
||||
|
||||
follow?: MActorFollowActorsDefault
|
||||
subscription?: MActorFollowActorsDefaultSubscription
|
||||
|
||||
nextOwner?: MAccountDefault
|
||||
videoChangeOwnership?: MVideoChangeOwnershipFull
|
||||
|
||||
account?: MAccountDefault
|
||||
|
||||
actorUrl?: MActorUrl
|
||||
actorFull?: MActorFull
|
||||
|
||||
user?: MUserDefault
|
||||
|
||||
server?: MServer
|
||||
|
||||
videoRedundancy?: MVideoRedundancyVideo
|
||||
|
||||
accountBlock?: MAccountBlocklist
|
||||
serverBlock?: MServerBlocklist
|
||||
|
||||
oauth?: {
|
||||
token: MOAuthTokenUser
|
||||
}
|
||||
|
||||
signature?: {
|
||||
actor: MActorAccountChannelId
|
||||
}
|
||||
|
||||
authenticated?: boolean
|
||||
|
||||
registeredPlugin?: RegisteredPlugin
|
||||
|
||||
externalAuth?: RegisterServerAuthExternalOptions
|
||||
|
||||
plugin?: MPlugin
|
||||
}
|
||||
locals: PeerTubeLocals
|
||||
}
|
||||
}
|
||||
|
||||
interface PeerTubeLocals {
|
||||
bypassLogin?: {
|
||||
bypass: boolean
|
||||
pluginName: string
|
||||
authName?: string
|
||||
user: {
|
||||
username: string
|
||||
email: string
|
||||
displayName: string
|
||||
role: UserRole
|
||||
}
|
||||
}
|
||||
|
||||
refreshTokenAuthName?: string
|
||||
|
||||
explicitLogout?: boolean
|
||||
|
||||
videoAll?: MVideoFullLight
|
||||
onlyImmutableVideo?: MVideoImmutable
|
||||
onlyVideo?: MVideoThumbnail
|
||||
onlyVideoWithRights?: MVideoWithRights
|
||||
videoId?: MVideoIdThumbnail
|
||||
|
||||
videoLive?: MVideoLive
|
||||
|
||||
videoShare?: MVideoShareActor
|
||||
|
||||
videoFile?: MVideoFile
|
||||
|
||||
videoImport?: MVideoImportDefault
|
||||
|
||||
videoBlacklist?: MVideoBlacklist
|
||||
|
||||
videoCaption?: MVideoCaptionVideo
|
||||
|
||||
abuse?: MAbuseReporter
|
||||
abuseMessage?: MAbuseMessage
|
||||
|
||||
videoStreamingPlaylist?: MStreamingPlaylist
|
||||
|
||||
videoChannel?: MChannelAccountDefault
|
||||
|
||||
videoPlaylistFull?: MVideoPlaylistFull
|
||||
videoPlaylistSummary?: MVideoPlaylistFullSummary
|
||||
|
||||
videoPlaylistElement?: MVideoPlaylistElement
|
||||
videoPlaylistElementAP?: MVideoPlaylistElementVideoUrlPlaylistPrivacy
|
||||
|
||||
accountVideoRate?: MAccountVideoRateAccountVideo
|
||||
|
||||
videoCommentFull?: MCommentOwnerVideoReply
|
||||
videoCommentThread?: MComment
|
||||
|
||||
follow?: MActorFollowActorsDefault
|
||||
subscription?: MActorFollowActorsDefaultSubscription
|
||||
|
||||
nextOwner?: MAccountDefault
|
||||
videoChangeOwnership?: MVideoChangeOwnershipFull
|
||||
|
||||
account?: MAccountDefault
|
||||
|
||||
actorUrl?: MActorUrl
|
||||
actorFull?: MActorFull
|
||||
|
||||
user?: MUserDefault
|
||||
|
||||
server?: MServer
|
||||
|
||||
videoRedundancy?: MVideoRedundancyVideo
|
||||
|
||||
accountBlock?: MAccountBlocklist
|
||||
serverBlock?: MServerBlocklist
|
||||
|
||||
oauth?: {
|
||||
token: MOAuthTokenUser
|
||||
}
|
||||
|
||||
signature?: {
|
||||
actor: MActorAccountChannelId
|
||||
}
|
||||
|
||||
authenticated?: boolean
|
||||
|
||||
registeredPlugin?: RegisteredPlugin
|
||||
|
||||
externalAuth?: RegisterServerAuthExternalOptions
|
||||
|
||||
plugin?: MPlugin
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue