ActivityPub-federated video streaming platform using P2P directly in your web browser
Use handle for param name
Chocobozzz6f68db1be991
diff --git a/packages/tests/src/api/videos/multiple-servers.ts b/packages/tests/src/api/videos/multiple-servers.tsindex de021dcf95..e198cf08fd 100644--- a/packages/tests/src/api/videos/multiple-servers.ts+++ b/packages/tests/src/api/videos/multiple-servers.ts@@ -62,7 +62,6 @@ describe('Test multiple servers', function () {})describe('Should upload the video and propagate on each server', function () {-it('Should upload the video on server 1 and propagate on each server', async function () {this.timeout(60000)@@ -362,7 +361,6 @@ describe('Test multiple servers', function () {})describe('Local videos listing', function () {-it('Should list only local videos on server 1', async function () {const { data, total } = await servers[0].videos.list({ isLocal: true })@@ -393,7 +391,6 @@ describe('Test multiple servers', function () {})describe('All videos listing', function () {-it('Should list and sort by "localVideoFilesSize"', async function () {const { data, total } = await servers[2].videos.list({ sort: '-localVideoFilesSize' })@@ -408,7 +405,6 @@ describe('Test multiple servers', function () {})describe('Should seed the uploaded video', function () {-it('Should add the file 1 by asking server 3', async function () {this.retries(2)this.timeout(30000)@@ -1038,7 +1034,6 @@ describe('Test multiple servers', function () {})describe('With minimum parameters', function () {-it('Should upload and propagate the video', async function () {this.timeout(240000)@@ -1053,7 +1048,7 @@ describe('Test multiple servers', function () {.field('channelId', '1')await req.attach('videofile', buildAbsoluteFixturePath('video_short.webm'))- .expect(HttpStatusCode.OK_200)+ .expect(HttpStatusCode.OK_200)await waitJobs(servers)@@ -1120,13 +1115,11 @@ describe('Test multiple servers', function () {})describe('TMP directory', function () {-it('Should have an empty tmp directory', async function () {for (const server of servers) {await checkTmpIsEmpty(server)}})-})after(async function () {diff --git a/server/core/controllers/activitypub/client.ts b/server/core/controllers/activitypub/client.tsindex 03ef124d5e..1ff2342d4b 100644--- a/server/core/controllers/activitypub/client.ts+++ b/server/core/controllers/activitypub/client.ts@@ -64,28 +64,28 @@ activityPubClientRouter.use(cors())// Intercept ActivityPub client requestsactivityPubClientRouter.get(- [ '/accounts?/:name', '/accounts?/:name/video-channels', '/a/:name', '/a/:name/video-channels' ],+ [ '/accounts?/:handle', '/accounts?/:handle/video-channels', '/a/:handle', '/a/:handle/video-channels' ],executeIfActivityPub,activityPubRateLimiter,asyncMiddleware(accountHandleGetValidatorFactory({ checkIsLocal: true, checkManage: false })),asyncMiddleware(accountController))activityPubClientRouter.get(- '/accounts?/:name/followers',+ '/accounts?/:handle/followers',executeIfActivityPub,activityPubRateLimiter,asyncMiddleware(accountHandleGetValidatorFactory({ checkIsLocal: true, checkManage: false })),asyncMiddleware(accountFollowersController))activityPubClientRouter.get(- '/accounts?/:name/following',+ '/accounts?/:handle/following',executeIfActivityPub,activityPubRateLimiter,asyncMiddleware(accountHandleGetValidatorFactory({ checkIsLocal: true, checkManage: false })),asyncMiddleware(accountFollowingController))activityPubClientRouter.get(- '/accounts?/:name/playlists',+ '/accounts?/:handle/playlists',executeIfActivityPub,activityPubRateLimiter,asyncMiddleware(accountHandleGetValidatorFactory({ checkIsLocal: true, checkManage: false })),@@ -208,28 +208,28 @@ activityPubClientRouter.get(// ---------------------------------------------------------------------------activityPubClientRouter.get(- [ '/video-channels/:nameWithHost', '/video-channels/:nameWithHost/videos', '/c/:nameWithHost', '/c/:nameWithHost/videos' ],+ [ '/video-channels/:handle', '/video-channels/:handle/videos', '/c/:handle', '/c/:handle/videos' ],executeIfActivityPub,activityPubRateLimiter,asyncMiddleware(videoChannelsHandleValidatorFactory({ checkIsLocal: true, checkManage: false })),asyncMiddleware(videoChannelController))activityPubClientRouter.get(- '/video-channels/:nameWithHost/followers',+ '/video-channels/:handle/followers',executeIfActivityPub,activityPubRateLimiter,asyncMiddleware(videoChannelsHandleValidatorFactory({ checkIsLocal: true, checkManage: false })),asyncMiddleware(videoChannelFollowersController))activityPubClientRouter.get(- '/video-channels/:nameWithHost/following',+ '/video-channels/:handle/following',executeIfActivityPub,activityPubRateLimiter,asyncMiddleware(videoChannelsHandleValidatorFactory({ checkIsLocal: true, checkManage: false })),asyncMiddleware(videoChannelFollowingController))activityPubClientRouter.get(- '/video-channels/:nameWithHost/playlists',+ '/video-channels/:handle/playlists',executeIfActivityPub,activityPubRateLimiter,asyncMiddleware(videoChannelsHandleValidatorFactory({ checkIsLocal: true, checkManage: false })),diff --git a/server/core/controllers/activitypub/inbox.ts b/server/core/controllers/activitypub/inbox.tsindex 59ae140f9c..cfbf2d2fa9 100644--- a/server/core/controllers/activitypub/inbox.ts+++ b/server/core/controllers/activitypub/inbox.ts@@ -25,7 +25,7 @@ inboxRouter.post()inboxRouter.post(- '/accounts/:name/inbox',+ '/accounts/:handle/inbox',activityPubRateLimiter,signatureValidator,asyncMiddleware(checkSignature),@@ -35,7 +35,7 @@ inboxRouter.post()inboxRouter.post(- '/video-channels/:nameWithHost/inbox',+ '/video-channels/:handle/inbox',activityPubRateLimiter,signatureValidator,asyncMiddleware(checkSignature),diff --git a/server/core/controllers/activitypub/outbox.ts b/server/core/controllers/activitypub/outbox.tsindex ac9e8d1552..d3ecd848ae 100644--- a/server/core/controllers/activitypub/outbox.ts+++ b/server/core/controllers/activitypub/outbox.ts@@ -20,7 +20,7 @@ import { activityPubResponse } from './utils.js'const outboxRouter = express.Router()outboxRouter.get(- '/accounts/:name/outbox',+ '/accounts/:handle/outbox',activityPubRateLimiter,apPaginationValidator,accountHandleGetValidatorFactory({ checkIsLocal: true, checkManage: false }),@@ -28,7 +28,7 @@ outboxRouter.get()outboxRouter.get(- '/video-channels/:nameWithHost/outbox',+ '/video-channels/:handle/outbox',activityPubRateLimiter,apPaginationValidator,asyncMiddleware(videoChannelsHandleValidatorFactory({ checkIsLocal: true, checkManage: false })),diff --git a/server/core/controllers/api/accounts.ts b/server/core/controllers/api/accounts.tsindex 44de7cd7f4..2fd0722932 100644--- a/server/core/controllers/api/accounts.ts+++ b/server/core/controllers/api/accounts.ts@@ -52,13 +52,13 @@ accountsRouter.get()accountsRouter.get(- '/:accountName',+ '/:handle',asyncMiddleware(accountHandleGetValidatorFactory({ checkIsLocal: false, checkManage: false })),getAccount)accountsRouter.get(- '/:accountName/videos',+ '/:handle/videos',asyncMiddleware(accountHandleGetValidatorFactory({ checkIsLocal: false, checkManage: false })),paginationValidator,videosSortValidator,@@ -70,7 +70,7 @@ accountsRouter.get()accountsRouter.get(- '/:accountName/video-channels',+ '/:handle/video-channels',asyncMiddleware(accountHandleGetValidatorFactory({ checkIsLocal: false, checkManage: false })),videoChannelStatsValidator,paginationValidator,@@ -81,7 +81,7 @@ accountsRouter.get()accountsRouter.get(- '/:accountName/video-playlists',+ '/:handle/video-playlists',optionalAuthenticate,asyncMiddleware(accountHandleGetValidatorFactory({ checkIsLocal: false, checkManage: false })),paginationValidator,@@ -94,7 +94,7 @@ accountsRouter.get()accountsRouter.get(- '/:accountName/video-channel-syncs',+ '/:handle/video-channel-syncs',authenticate,asyncMiddleware(accountHandleGetValidatorFactory({ checkIsLocal: true, checkManage: true })),paginationValidator,@@ -105,7 +105,7 @@ accountsRouter.get()accountsRouter.get(- '/:accountName/ratings',+ '/:handle/ratings',authenticate,asyncMiddleware(accountHandleGetValidatorFactory({ checkIsLocal: true, checkManage: true })),paginationValidator,@@ -117,7 +117,7 @@ accountsRouter.get()accountsRouter.get(- '/:accountName/followers',+ '/:handle/followers',authenticate,asyncMiddleware(accountHandleGetValidatorFactory({ checkIsLocal: true, checkManage: true })),paginationValidator,diff --git a/server/core/controllers/api/video-channel.ts b/server/core/controllers/api/video-channel.tsindex 0f1379dc1a..ed0d942928 100644--- a/server/core/controllers/api/video-channel.ts+++ b/server/core/controllers/api/video-channel.ts@@ -76,7 +76,7 @@ videoChannelRouter.get(videoChannelRouter.post('/', authenticate, asyncMiddleware(videoChannelsAddValidator), asyncRetryTransactionMiddleware(createVideoChannel))videoChannelRouter.post(- '/:nameWithHost/avatar/pick',+ '/:handle/avatar/pick',authenticate,reqAvatarFile,asyncMiddleware(videoChannelsHandleValidatorFactory({ checkIsLocal: true, checkManage: true })),@@ -85,7 +85,7 @@ videoChannelRouter.post()videoChannelRouter.post(- '/:nameWithHost/banner/pick',+ '/:handle/banner/pick',authenticate,reqBannerFile,asyncMiddleware(videoChannelsHandleValidatorFactory({ checkIsLocal: true, checkManage: true })),@@ -94,21 +94,21 @@ videoChannelRouter.post()videoChannelRouter.delete(- '/:nameWithHost/avatar',+ '/:handle/avatar',authenticate,asyncMiddleware(videoChannelsHandleValidatorFactory({ checkIsLocal: true, checkManage: true })),asyncMiddleware(deleteVideoChannelAvatar))videoChannelRouter.delete(- '/:nameWithHost/banner',+ '/:handle/banner',authenticate,asyncMiddleware(videoChannelsHandleValidatorFactory({ checkIsLocal: true, checkManage: true })),asyncMiddleware(deleteVideoChannelBanner))videoChannelRouter.put(- '/:nameWithHost',+ '/:handle',authenticate,asyncMiddleware(videoChannelsHandleValidatorFactory({ checkIsLocal: true, checkManage: true })),videoChannelsUpdateValidator,@@ -116,7 +116,7 @@ videoChannelRouter.put()videoChannelRouter.delete(- '/:nameWithHost',+ '/:handle',authenticate,asyncMiddleware(videoChannelsHandleValidatorFactory({ checkIsLocal: true, checkManage: true })),asyncMiddleware(videoChannelsRemoveValidator),@@ -124,13 +124,13 @@ videoChannelRouter.delete()videoChannelRouter.get(- '/:nameWithHost',+ '/:handle',asyncMiddleware(videoChannelsHandleValidatorFactory({ checkIsLocal: false, checkManage: false })),asyncMiddleware(getVideoChannel))videoChannelRouter.get(- '/:nameWithHost/video-playlists',+ '/:handle/video-playlists',optionalAuthenticate,asyncMiddleware(videoChannelsHandleValidatorFactory({ checkIsLocal: false, checkManage: false })),paginationValidator,@@ -142,7 +142,7 @@ videoChannelRouter.get()videoChannelRouter.get(- '/:nameWithHost/videos',+ '/:handle/videos',asyncMiddleware(videoChannelsHandleValidatorFactory({ checkIsLocal: false, checkManage: false })),paginationValidator,videosSortValidator,@@ -154,7 +154,7 @@ videoChannelRouter.get()videoChannelRouter.get(- '/:nameWithHost/followers',+ '/:handle/followers',authenticate,asyncMiddleware(videoChannelsHandleValidatorFactory({ checkIsLocal: false, checkManage: true })),paginationValidator,@@ -165,7 +165,7 @@ videoChannelRouter.get()videoChannelRouter.post(- '/:nameWithHost/import-videos',+ '/:handle/import-videos',authenticate,asyncMiddleware(videoChannelsHandleValidatorFactory({ checkIsLocal: true, checkManage: true })),asyncMiddleware(videoChannelImportVideosValidator),diff --git a/server/core/controllers/services.ts b/server/core/controllers/services.tsindex eb405f4058..a5a457b0df 100644--- a/server/core/controllers/services.ts+++ b/server/core/controllers/services.ts@@ -10,7 +10,7 @@ const servicesRouter = express.Router()servicesRouter.use('/oembed', cors(), apiRateLimiter, asyncMiddleware(oembedValidator), generateOEmbed)servicesRouter.use(- '/redirect/accounts/:accountName',+ '/redirect/accounts/:handle',apiRateLimiter,asyncMiddleware(accountHandleGetValidatorFactory({ checkIsLocal: false, checkManage: false })),redirectToAccountUrldiff --git a/server/core/middlewares/validators/account.ts b/server/core/middlewares/validators/account.tsindex 89f69ae56b..a3ae023576 100644--- a/server/core/middlewares/validators/account.ts+++ b/server/core/middlewares/validators/account.ts@@ -10,7 +10,7 @@ export const accountHandleGetValidatorFactory = (options: {const { checkManage, checkIsLocal } = optionsreturn [- param('accountName')+ param('handle').exists(),async (req: express.Request, res: express.Response, next: express.NextFunction) => {diff --git a/server/core/middlewares/validators/videos/video-channels.ts b/server/core/middlewares/validators/videos/video-channels.tsindex a98665c4ac..a39e9b1318 100644--- a/server/core/middlewares/validators/videos/video-channels.ts+++ b/server/core/middlewares/validators/videos/video-channels.ts@@ -89,7 +89,7 @@ export const videoChannelsHandleValidatorFactory = (options: {const { checkIsLocal, checkManage } = optionsreturn [- param('nameWithHost')+ param('handle').exists(),async (req: express.Request, res: express.Response, next: express.NextFunction) => {