X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=support%2Fdoc%2Fplugins%2Fguide.md;h=9ddab3ece7c89da363e03ea2efeb273de3610735;hb=60b880acdfa85eab5c9ec09ba1283f82ae58ec85;hp=1c809258ab39de80194091d2922706ed592b6fb7;hpb=cea2fd90ddb3bf57c2fed77128938d12d4c2be6b;p=github%2FChocobozzz%2FPeerTube.git diff --git a/support/doc/plugins/guide.md b/support/doc/plugins/guide.md index 1c809258a..9ddab3ece 100644 --- a/support/doc/plugins/guide.md +++ b/support/doc/plugins/guide.md @@ -320,6 +320,8 @@ The `ping` route can be accessed using: #### Add custom WebSocket handlers +**PeerTube >= 5.0** + You can create custom WebSocket servers (like [ws](https://github.com/websockets/ws) for example) using `registerWebSocketRoute`: ```js @@ -431,7 +433,27 @@ function register (...) { username: 'user' email: 'user@example.com' role: 2 - displayName: 'User display name' + displayName: 'User display name', + + // Custom admin flags (bypass video auto moderation etc.) + // https://github.com/Chocobozzz/PeerTube/blob/develop/shared/models/users/user-flag.model.ts + // PeerTube >= 5.1 + adminFlags: 0, + // Quota in bytes + // PeerTube >= 5.1 + videoQuota: 1024 * 1024 * 1024, // 1GB + // PeerTube >= 5.1 + videoQuotaDaily: -1, // Unlimited + + // Update the user profile if it already exists + // Default behaviour is no update + // Introduced in PeerTube >= 5.1 + userUpdater: ({ fieldName, currentValue, newValue }) => { + // Always use new value except for videoQuotaDaily field + if (fieldName === 'videoQuotaDaily') return currentValue + + return newValue + } }) })