diff options
Diffstat (limited to 'server/controllers')
60 files changed, 80 insertions, 82 deletions
diff --git a/server/controllers/activitypub/client.ts b/server/controllers/activitypub/client.ts index bef4bc068..c4e3cec6b 100644 --- a/server/controllers/activitypub/client.ts +++ b/server/controllers/activitypub/client.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import * as cors from 'cors' | 1 | import cors from 'cors' |
2 | import * as express from 'express' | 2 | import express from 'express' |
3 | import { getServerActor } from '@server/models/application/application' | 3 | import { getServerActor } from '@server/models/application/application' |
4 | import { MAccountId, MActorId, MChannelId, MVideoId } from '@server/types/models' | 4 | import { MAccountId, MActorId, MChannelId, MVideoId } from '@server/types/models' |
5 | import { VideoPrivacy, VideoRateType } from '../../../shared/models/videos' | 5 | import { VideoPrivacy, VideoRateType } from '../../../shared/models/videos' |
diff --git a/server/controllers/activitypub/inbox.ts b/server/controllers/activitypub/inbox.ts index 30662990a..ece4edff0 100644 --- a/server/controllers/activitypub/inbox.ts +++ b/server/controllers/activitypub/inbox.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { InboxManager } from '@server/lib/activitypub/inbox-manager' | 2 | import { InboxManager } from '@server/lib/activitypub/inbox-manager' |
3 | import { Activity, ActivityPubCollection, ActivityPubOrderedCollection, RootActivity } from '../../../shared' | 3 | import { Activity, ActivityPubCollection, ActivityPubOrderedCollection, RootActivity } from '../../../shared' |
4 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' | 4 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' |
diff --git a/server/controllers/activitypub/index.ts b/server/controllers/activitypub/index.ts index 7e81902af..8c681820a 100644 --- a/server/controllers/activitypub/index.ts +++ b/server/controllers/activitypub/index.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { activityPubClientRouter } from './client' | 2 | import { activityPubClientRouter } from './client' |
3 | import { inboxRouter } from './inbox' | 3 | import { inboxRouter } from './inbox' |
4 | import { outboxRouter } from './outbox' | 4 | import { outboxRouter } from './outbox' |
diff --git a/server/controllers/activitypub/outbox.ts b/server/controllers/activitypub/outbox.ts index 22328da7f..bdf9d138b 100644 --- a/server/controllers/activitypub/outbox.ts +++ b/server/controllers/activitypub/outbox.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { Activity } from '../../../shared/models/activitypub/activity' | 2 | import { Activity } from '../../../shared/models/activitypub/activity' |
3 | import { VideoPrivacy } from '../../../shared/models/videos' | 3 | import { VideoPrivacy } from '../../../shared/models/videos' |
4 | import { activityPubCollectionPagination, activityPubContextify } from '../../helpers/activitypub' | 4 | import { activityPubCollectionPagination, activityPubContextify } from '../../helpers/activitypub' |
diff --git a/server/controllers/activitypub/utils.ts b/server/controllers/activitypub/utils.ts index 19bdd58eb..f851ef652 100644 --- a/server/controllers/activitypub/utils.ts +++ b/server/controllers/activitypub/utils.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | 2 | ||
3 | function activityPubResponse (data: any, res: express.Response) { | 3 | function activityPubResponse (data: any, res: express.Response) { |
4 | return res.type('application/activity+json; charset=utf-8') | 4 | return res.type('application/activity+json; charset=utf-8') |
diff --git a/server/controllers/api/abuse.ts b/server/controllers/api/abuse.ts index e851365e9..72c418e74 100644 --- a/server/controllers/api/abuse.ts +++ b/server/controllers/api/abuse.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { logger } from '@server/helpers/logger' | 2 | import { logger } from '@server/helpers/logger' |
3 | import { createAccountAbuse, createVideoAbuse, createVideoCommentAbuse } from '@server/lib/moderation' | 3 | import { createAccountAbuse, createVideoAbuse, createVideoCommentAbuse } from '@server/lib/moderation' |
4 | import { Notifier } from '@server/lib/notifier' | 4 | import { Notifier } from '@server/lib/notifier' |
diff --git a/server/controllers/api/accounts.ts b/server/controllers/api/accounts.ts index 55e2aaf62..75679b0f4 100644 --- a/server/controllers/api/accounts.ts +++ b/server/controllers/api/accounts.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { pickCommonVideoQuery } from '@server/helpers/query' | 2 | import { pickCommonVideoQuery } from '@server/helpers/query' |
3 | import { getServerActor } from '@server/models/application/application' | 3 | import { getServerActor } from '@server/models/application/application' |
4 | import { buildNSFWFilter, getCountVideos, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils' | 4 | import { buildNSFWFilter, getCountVideos, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils' |
diff --git a/server/controllers/api/bulk.ts b/server/controllers/api/bulk.ts index 62121ece5..d27c3c73e 100644 --- a/server/controllers/api/bulk.ts +++ b/server/controllers/api/bulk.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { removeComment } from '@server/lib/video-comment' | 2 | import { removeComment } from '@server/lib/video-comment' |
3 | import { bulkRemoveCommentsOfValidator } from '@server/middlewares/validators/bulk' | 3 | import { bulkRemoveCommentsOfValidator } from '@server/middlewares/validators/bulk' |
4 | import { VideoCommentModel } from '@server/models/video/video-comment' | 4 | import { VideoCommentModel } from '@server/models/video/video-comment' |
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index ee733a38c..d542f62aa 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { remove, writeJSON } from 'fs-extra' | 2 | import { remove, writeJSON } from 'fs-extra' |
3 | import { snakeCase } from 'lodash' | 3 | import { snakeCase } from 'lodash' |
4 | import validator from 'validator' | 4 | import validator from 'validator' |
diff --git a/server/controllers/api/custom-page.ts b/server/controllers/api/custom-page.ts index 68d8c2ea4..d1c672f3f 100644 --- a/server/controllers/api/custom-page.ts +++ b/server/controllers/api/custom-page.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { ServerConfigManager } from '@server/lib/server-config-manager' | 2 | import { ServerConfigManager } from '@server/lib/server-config-manager' |
3 | import { ActorCustomPageModel } from '@server/models/account/actor-custom-page' | 3 | import { ActorCustomPageModel } from '@server/models/account/actor-custom-page' |
4 | import { HttpStatusCode, UserRight } from '@shared/models' | 4 | import { HttpStatusCode, UserRight } from '@shared/models' |
diff --git a/server/controllers/api/index.ts b/server/controllers/api/index.ts index 93b14dadb..9949b378a 100644 --- a/server/controllers/api/index.ts +++ b/server/controllers/api/index.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import * as cors from 'cors' | 1 | import cors from 'cors' |
2 | import * as express from 'express' | 2 | import express from 'express' |
3 | import * as RateLimit from 'express-rate-limit' | 3 | import RateLimit from 'express-rate-limit' |
4 | import { HttpStatusCode } from '../../../shared/models' | 4 | import { HttpStatusCode } from '../../../shared/models' |
5 | import { badRequest } from '../../helpers/express-utils' | 5 | import { badRequest } from '../../helpers/express-utils' |
6 | import { CONFIG } from '../../initializers/config' | 6 | import { CONFIG } from '../../initializers/config' |
diff --git a/server/controllers/api/jobs.ts b/server/controllers/api/jobs.ts index 9e333322b..7001674bb 100644 --- a/server/controllers/api/jobs.ts +++ b/server/controllers/api/jobs.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { ResultList } from '../../../shared' | 2 | import { ResultList } from '../../../shared' |
3 | import { Job, JobState, JobType } from '../../../shared/models' | 3 | import { Job, JobState, JobType } from '../../../shared/models' |
4 | import { UserRight } from '../../../shared/models/users' | 4 | import { UserRight } from '../../../shared/models/users' |
diff --git a/server/controllers/api/oauth-clients.ts b/server/controllers/api/oauth-clients.ts index f95f06864..4990fb0df 100644 --- a/server/controllers/api/oauth-clients.ts +++ b/server/controllers/api/oauth-clients.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { OAuthClientLocal } from '../../../shared' | 2 | import { OAuthClientLocal } from '../../../shared' |
3 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' | 3 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' |
4 | import { logger } from '../../helpers/logger' | 4 | import { logger } from '../../helpers/logger' |
diff --git a/server/controllers/api/overviews.ts b/server/controllers/api/overviews.ts index 2dfac15ef..5b16232e2 100644 --- a/server/controllers/api/overviews.ts +++ b/server/controllers/api/overviews.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import * as memoizee from 'memoizee' | 2 | import memoizee from 'memoizee' |
3 | import { logger } from '@server/helpers/logger' | 3 | import { logger } from '@server/helpers/logger' |
4 | import { Hooks } from '@server/lib/plugins/hooks' | 4 | import { Hooks } from '@server/lib/plugins/hooks' |
5 | import { VideoModel } from '@server/models/video/video' | 5 | import { VideoModel } from '@server/models/video/video' |
diff --git a/server/controllers/api/plugins.ts b/server/controllers/api/plugins.ts index 3a9ef34e8..2de7fe41f 100644 --- a/server/controllers/api/plugins.ts +++ b/server/controllers/api/plugins.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { logger } from '@server/helpers/logger' | 2 | import { logger } from '@server/helpers/logger' |
3 | import { getFormattedObjects } from '@server/helpers/utils' | 3 | import { getFormattedObjects } from '@server/helpers/utils' |
4 | import { listAvailablePluginsFromIndex } from '@server/lib/plugins/plugin-index' | 4 | import { listAvailablePluginsFromIndex } from '@server/lib/plugins/plugin-index' |
diff --git a/server/controllers/api/search/index.ts b/server/controllers/api/search/index.ts index 67adbb307..39efc0b10 100644 --- a/server/controllers/api/search/index.ts +++ b/server/controllers/api/search/index.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { searchChannelsRouter } from './search-video-channels' | 2 | import { searchChannelsRouter } from './search-video-channels' |
3 | import { searchPlaylistsRouter } from './search-video-playlists' | 3 | import { searchPlaylistsRouter } from './search-video-playlists' |
4 | import { searchVideosRouter } from './search-videos' | 4 | import { searchVideosRouter } from './search-videos' |
diff --git a/server/controllers/api/search/search-video-channels.ts b/server/controllers/api/search/search-video-channels.ts index eef222506..25173ac20 100644 --- a/server/controllers/api/search/search-video-channels.ts +++ b/server/controllers/api/search/search-video-channels.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { sanitizeUrl } from '@server/helpers/core-utils' | 2 | import { sanitizeUrl } from '@server/helpers/core-utils' |
3 | import { pickSearchChannelQuery } from '@server/helpers/query' | 3 | import { pickSearchChannelQuery } from '@server/helpers/query' |
4 | import { doJSONRequest } from '@server/helpers/requests' | 4 | import { doJSONRequest } from '@server/helpers/requests' |
diff --git a/server/controllers/api/search/search-video-playlists.ts b/server/controllers/api/search/search-video-playlists.ts index 0a56f19b7..b28f11c79 100644 --- a/server/controllers/api/search/search-video-playlists.ts +++ b/server/controllers/api/search/search-video-playlists.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { sanitizeUrl } from '@server/helpers/core-utils' | 2 | import { sanitizeUrl } from '@server/helpers/core-utils' |
3 | import { isUserAbleToSearchRemoteURI } from '@server/helpers/express-utils' | 3 | import { isUserAbleToSearchRemoteURI } from '@server/helpers/express-utils' |
4 | import { logger } from '@server/helpers/logger' | 4 | import { logger } from '@server/helpers/logger' |
diff --git a/server/controllers/api/search/search-videos.ts b/server/controllers/api/search/search-videos.ts index 4a6ce0de4..eb7ce0841 100644 --- a/server/controllers/api/search/search-videos.ts +++ b/server/controllers/api/search/search-videos.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { sanitizeUrl } from '@server/helpers/core-utils' | 2 | import { sanitizeUrl } from '@server/helpers/core-utils' |
3 | import { pickSearchVideoQuery } from '@server/helpers/query' | 3 | import { pickSearchVideoQuery } from '@server/helpers/query' |
4 | import { doJSONRequest } from '@server/helpers/requests' | 4 | import { doJSONRequest } from '@server/helpers/requests' |
diff --git a/server/controllers/api/server/contact.ts b/server/controllers/api/server/contact.ts index b315e99cf..09ff50f69 100644 --- a/server/controllers/api/server/contact.ts +++ b/server/controllers/api/server/contact.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 2 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
3 | import { ContactForm } from '../../../../shared/models/server' | 3 | import { ContactForm } from '../../../../shared/models/server' |
4 | import { Emailer } from '../../../lib/emailer' | 4 | import { Emailer } from '../../../lib/emailer' |
diff --git a/server/controllers/api/server/debug.ts b/server/controllers/api/server/debug.ts index 0601b89ce..093e6a03c 100644 --- a/server/controllers/api/server/debug.ts +++ b/server/controllers/api/server/debug.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { InboxManager } from '@server/lib/activitypub/inbox-manager' | 2 | import { InboxManager } from '@server/lib/activitypub/inbox-manager' |
3 | import { RemoveDanglingResumableUploadsScheduler } from '@server/lib/schedulers/remove-dangling-resumable-uploads-scheduler' | 3 | import { RemoveDanglingResumableUploadsScheduler } from '@server/lib/schedulers/remove-dangling-resumable-uploads-scheduler' |
4 | import { Debug, SendDebugCommand } from '@shared/models' | 4 | import { Debug, SendDebugCommand } from '@shared/models' |
diff --git a/server/controllers/api/server/follows.ts b/server/controllers/api/server/follows.ts index cbe6b7e4f..2e0fd25eb 100644 --- a/server/controllers/api/server/follows.ts +++ b/server/controllers/api/server/follows.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { getServerActor } from '@server/models/application/application' | 2 | import { getServerActor } from '@server/models/application/application' |
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
4 | import { UserRight } from '../../../../shared/models/users' | 4 | import { UserRight } from '../../../../shared/models/users' |
diff --git a/server/controllers/api/server/index.ts b/server/controllers/api/server/index.ts index 32fefefc0..b20718d09 100644 --- a/server/controllers/api/server/index.ts +++ b/server/controllers/api/server/index.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { contactRouter } from './contact' | 2 | import { contactRouter } from './contact' |
3 | import { debugRouter } from './debug' | 3 | import { debugRouter } from './debug' |
4 | import { serverFollowsRouter } from './follows' | 4 | import { serverFollowsRouter } from './follows' |
diff --git a/server/controllers/api/server/logs.ts b/server/controllers/api/server/logs.ts index 39eceb654..dfd5491aa 100644 --- a/server/controllers/api/server/logs.ts +++ b/server/controllers/api/server/logs.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { readdir, readFile } from 'fs-extra' | 2 | import { readdir, readFile } from 'fs-extra' |
3 | import { join } from 'path' | 3 | import { join } from 'path' |
4 | import { logger, mtimeSortFilesDesc } from '@server/helpers/logger' | 4 | import { logger, mtimeSortFilesDesc } from '@server/helpers/logger' |
diff --git a/server/controllers/api/server/redundancy.ts b/server/controllers/api/server/redundancy.ts index e36c8d2db..9f43d3e4e 100644 --- a/server/controllers/api/server/redundancy.ts +++ b/server/controllers/api/server/redundancy.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { JobQueue } from '@server/lib/job-queue' | 2 | import { JobQueue } from '@server/lib/job-queue' |
3 | import { VideoRedundancyModel } from '@server/models/redundancy/video-redundancy' | 3 | import { VideoRedundancyModel } from '@server/models/redundancy/video-redundancy' |
4 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 4 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
diff --git a/server/controllers/api/server/server-blocklist.ts b/server/controllers/api/server/server-blocklist.ts index b3ee50d85..740f95da3 100644 --- a/server/controllers/api/server/server-blocklist.ts +++ b/server/controllers/api/server/server-blocklist.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import 'multer' | 1 | import 'multer' |
2 | import * as express from 'express' | 2 | import express from 'express' |
3 | import { logger } from '@server/helpers/logger' | 3 | import { logger } from '@server/helpers/logger' |
4 | import { getServerActor } from '@server/models/application/application' | 4 | import { getServerActor } from '@server/models/application/application' |
5 | import { UserNotificationModel } from '@server/models/user/user-notification' | 5 | import { UserNotificationModel } from '@server/models/user/user-notification' |
diff --git a/server/controllers/api/server/stats.ts b/server/controllers/api/server/stats.ts index 397702548..d661144ca 100644 --- a/server/controllers/api/server/stats.ts +++ b/server/controllers/api/server/stats.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { StatsManager } from '@server/lib/stat-manager' | 2 | import { StatsManager } from '@server/lib/stat-manager' |
3 | import { ROUTE_CACHE_LIFETIME } from '../../../initializers/constants' | 3 | import { ROUTE_CACHE_LIFETIME } from '../../../initializers/constants' |
4 | import { asyncMiddleware } from '../../../middlewares' | 4 | import { asyncMiddleware } from '../../../middlewares' |
diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts index be800e8b5..bc47e5fec 100644 --- a/server/controllers/api/users/index.ts +++ b/server/controllers/api/users/index.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import * as RateLimit from 'express-rate-limit' | 2 | import RateLimit from 'express-rate-limit' |
3 | import { tokensRouter } from '@server/controllers/api/users/token' | 3 | import { tokensRouter } from '@server/controllers/api/users/token' |
4 | import { Hooks } from '@server/lib/plugins/hooks' | 4 | import { Hooks } from '@server/lib/plugins/hooks' |
5 | import { OAuthTokenModel } from '@server/models/oauth/oauth-token' | 5 | import { OAuthTokenModel } from '@server/models/oauth/oauth-token' |
diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.ts index a98d79218..83b774d3c 100644 --- a/server/controllers/api/users/me.ts +++ b/server/controllers/api/users/me.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import 'multer' | 1 | import 'multer' |
2 | import * as express from 'express' | 2 | import express from 'express' |
3 | import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '@server/helpers/audit-logger' | 3 | import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '@server/helpers/audit-logger' |
4 | import { Hooks } from '@server/lib/plugins/hooks' | 4 | import { Hooks } from '@server/lib/plugins/hooks' |
5 | import { AttributesOnly } from '@shared/core-utils' | 5 | import { AttributesOnly } from '@shared/core-utils' |
diff --git a/server/controllers/api/users/my-abuses.ts b/server/controllers/api/users/my-abuses.ts index fcd0ce3fc..103c3d332 100644 --- a/server/controllers/api/users/my-abuses.ts +++ b/server/controllers/api/users/my-abuses.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { AbuseModel } from '@server/models/abuse/abuse' | 2 | import { AbuseModel } from '@server/models/abuse/abuse' |
3 | import { | 3 | import { |
4 | abuseListForUserValidator, | 4 | abuseListForUserValidator, |
diff --git a/server/controllers/api/users/my-blocklist.ts b/server/controllers/api/users/my-blocklist.ts index 24fff83e3..0b56645cf 100644 --- a/server/controllers/api/users/my-blocklist.ts +++ b/server/controllers/api/users/my-blocklist.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import 'multer' | 1 | import 'multer' |
2 | import * as express from 'express' | 2 | import express from 'express' |
3 | import { logger } from '@server/helpers/logger' | 3 | import { logger } from '@server/helpers/logger' |
4 | import { UserNotificationModel } from '@server/models/user/user-notification' | 4 | import { UserNotificationModel } from '@server/models/user/user-notification' |
5 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 5 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
diff --git a/server/controllers/api/users/my-history.ts b/server/controllers/api/users/my-history.ts index a6e723103..2fcb25acf 100644 --- a/server/controllers/api/users/my-history.ts +++ b/server/controllers/api/users/my-history.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 2 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
3 | import { getFormattedObjects } from '../../../helpers/utils' | 3 | import { getFormattedObjects } from '../../../helpers/utils' |
4 | import { sequelizeTypescript } from '../../../initializers/database' | 4 | import { sequelizeTypescript } from '../../../initializers/database' |
diff --git a/server/controllers/api/users/my-notifications.ts b/server/controllers/api/users/my-notifications.ts index 3beee07c0..d107a306e 100644 --- a/server/controllers/api/users/my-notifications.ts +++ b/server/controllers/api/users/my-notifications.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import 'multer' | 1 | import 'multer' |
2 | import * as express from 'express' | 2 | import express from 'express' |
3 | import { UserNotificationModel } from '@server/models/user/user-notification' | 3 | import { UserNotificationModel } from '@server/models/user/user-notification' |
4 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 4 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
5 | import { UserNotificationSetting } from '../../../../shared/models/users' | 5 | import { UserNotificationSetting } from '../../../../shared/models/users' |
diff --git a/server/controllers/api/users/my-subscriptions.ts b/server/controllers/api/users/my-subscriptions.ts index 26a715704..e3c0cf089 100644 --- a/server/controllers/api/users/my-subscriptions.ts +++ b/server/controllers/api/users/my-subscriptions.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import 'multer' | 1 | import 'multer' |
2 | import * as express from 'express' | 2 | import express from 'express' |
3 | import { pickCommonVideoQuery } from '@server/helpers/query' | 3 | import { pickCommonVideoQuery } from '@server/helpers/query' |
4 | import { sendUndoFollow } from '@server/lib/activitypub/send' | 4 | import { sendUndoFollow } from '@server/lib/activitypub/send' |
5 | import { VideoChannelModel } from '@server/models/video/video-channel' | 5 | import { VideoChannelModel } from '@server/models/video/video-channel' |
diff --git a/server/controllers/api/users/my-video-playlists.ts b/server/controllers/api/users/my-video-playlists.ts index 76e741ba5..f55ea2ec4 100644 --- a/server/controllers/api/users/my-video-playlists.ts +++ b/server/controllers/api/users/my-video-playlists.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { VideosExistInPlaylists } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model' | 2 | import { VideosExistInPlaylists } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model' |
3 | import { asyncMiddleware, authenticate } from '../../../middlewares' | 3 | import { asyncMiddleware, authenticate } from '../../../middlewares' |
4 | import { doVideosInPlaylistExistValidator } from '../../../middlewares/validators/videos/video-playlists' | 4 | import { doVideosInPlaylistExistValidator } from '../../../middlewares/validators/videos/video-playlists' |
diff --git a/server/controllers/api/users/token.ts b/server/controllers/api/users/token.ts index b405ddbf4..d5dbe921c 100644 --- a/server/controllers/api/users/token.ts +++ b/server/controllers/api/users/token.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import * as RateLimit from 'express-rate-limit' | 2 | import RateLimit from 'express-rate-limit' |
3 | import { logger } from '@server/helpers/logger' | 3 | import { logger } from '@server/helpers/logger' |
4 | import { buildUUID } from '@server/helpers/uuid' | 4 | import { buildUUID } from '@server/helpers/uuid' |
5 | import { CONFIG } from '@server/initializers/config' | 5 | import { CONFIG } from '@server/initializers/config' |
diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts index a0c6601d9..b79dc5933 100644 --- a/server/controllers/api/video-channel.ts +++ b/server/controllers/api/video-channel.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { pickCommonVideoQuery } from '@server/helpers/query' | 2 | import { pickCommonVideoQuery } from '@server/helpers/query' |
3 | import { Hooks } from '@server/lib/plugins/hooks' | 3 | import { Hooks } from '@server/lib/plugins/hooks' |
4 | import { getServerActor } from '@server/models/application/application' | 4 | import { getServerActor } from '@server/models/application/application' |
diff --git a/server/controllers/api/video-playlist.ts b/server/controllers/api/video-playlist.ts index 4971d0a77..2f81cf43c 100644 --- a/server/controllers/api/video-playlist.ts +++ b/server/controllers/api/video-playlist.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { join } from 'path' | 2 | import { join } from 'path' |
3 | import { uuidToShort } from '@server/helpers/uuid' | 3 | import { uuidToShort } from '@server/helpers/uuid' |
4 | import { scheduleRefreshIfNeeded } from '@server/lib/activitypub/playlists' | 4 | import { scheduleRefreshIfNeeded } from '@server/lib/activitypub/playlists' |
diff --git a/server/controllers/api/videos/blacklist.ts b/server/controllers/api/videos/blacklist.ts index 6bc768471..de65c74f1 100644 --- a/server/controllers/api/videos/blacklist.ts +++ b/server/controllers/api/videos/blacklist.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { blacklistVideo, unblacklistVideo } from '@server/lib/video-blacklist' | 2 | import { blacklistVideo, unblacklistVideo } from '@server/lib/video-blacklist' |
3 | import { UserRight, VideoBlacklistCreate } from '../../../../shared' | 3 | import { UserRight, VideoBlacklistCreate } from '../../../../shared' |
4 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 4 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
diff --git a/server/controllers/api/videos/captions.ts b/server/controllers/api/videos/captions.ts index 4008de60f..2d2213327 100644 --- a/server/controllers/api/videos/captions.ts +++ b/server/controllers/api/videos/captions.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { MVideoCaption } from '@server/types/models' | 2 | import { MVideoCaption } from '@server/types/models' |
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
4 | import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils' | 4 | import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils' |
diff --git a/server/controllers/api/videos/comment.ts b/server/controllers/api/videos/comment.ts index cb696f652..23bba9089 100644 --- a/server/controllers/api/videos/comment.ts +++ b/server/controllers/api/videos/comment.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { ResultList, ThreadsResultList, UserRight, VideoCommentCreate } from '../../../../shared/models' | 2 | import { ResultList, ThreadsResultList, UserRight, VideoCommentCreate } from '../../../../shared/models' |
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
4 | import { VideoCommentThreads } from '../../../../shared/models/videos/comment/video-comment.model' | 4 | import { VideoCommentThreads } from '../../../../shared/models/videos/comment/video-comment.model' |
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index de9a5308a..39fc57788 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { move, readFile } from 'fs-extra' | 2 | import { move, readFile } from 'fs-extra' |
3 | import * as magnetUtil from 'magnet-uri' | 3 | import { decode } from 'magnet-uri' |
4 | import * as parseTorrent from 'parse-torrent' | 4 | import parseTorrent, { Instance } from 'parse-torrent' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { ServerConfigManager } from '@server/lib/server-config-manager' | 6 | import { ServerConfigManager } from '@server/lib/server-config-manager' |
7 | import { setVideoTags } from '@server/lib/video' | 7 | import { setVideoTags } from '@server/lib/video' |
@@ -329,7 +329,7 @@ async function processTorrentOrAbortRequest (req: express.Request, res: express. | |||
329 | torrentfile.path = newTorrentPath | 329 | torrentfile.path = newTorrentPath |
330 | 330 | ||
331 | const buf = await readFile(torrentfile.path) | 331 | const buf = await readFile(torrentfile.path) |
332 | const parsedTorrent = parseTorrent(buf) as parseTorrent.Instance | 332 | const parsedTorrent = parseTorrent(buf) as Instance |
333 | 333 | ||
334 | if (parsedTorrent.files.length !== 1) { | 334 | if (parsedTorrent.files.length !== 1) { |
335 | cleanUpReqFiles(req) | 335 | cleanUpReqFiles(req) |
@@ -349,7 +349,7 @@ async function processTorrentOrAbortRequest (req: express.Request, res: express. | |||
349 | 349 | ||
350 | function processMagnetURI (body: VideoImportCreate) { | 350 | function processMagnetURI (body: VideoImportCreate) { |
351 | const magnetUri = body.magnetUri | 351 | const magnetUri = body.magnetUri |
352 | const parsed = magnetUtil.decode(magnetUri) | 352 | const parsed = decode(magnetUri) |
353 | 353 | ||
354 | return { | 354 | return { |
355 | name: extractNameFromArray(parsed.name), | 355 | name: extractNameFromArray(parsed.name), |
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 10833d48b..c0c77f3f7 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import toInt from 'validator/lib/toInt' | 2 | import toInt from 'validator/lib/toInt' |
3 | import { pickCommonVideoQuery } from '@server/helpers/query' | 3 | import { pickCommonVideoQuery } from '@server/helpers/query' |
4 | import { doJSONRequest } from '@server/helpers/requests' | 4 | import { doJSONRequest } from '@server/helpers/requests' |
diff --git a/server/controllers/api/videos/live.ts b/server/controllers/api/videos/live.ts index 151ff354b..efafe64e9 100644 --- a/server/controllers/api/videos/live.ts +++ b/server/controllers/api/videos/live.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { createReqFiles } from '@server/helpers/express-utils' | 2 | import { createReqFiles } from '@server/helpers/express-utils' |
3 | import { buildUUID, uuidToShort } from '@server/helpers/uuid' | 3 | import { buildUUID, uuidToShort } from '@server/helpers/uuid' |
4 | import { CONFIG } from '@server/initializers/config' | 4 | import { CONFIG } from '@server/initializers/config' |
diff --git a/server/controllers/api/videos/ownership.ts b/server/controllers/api/videos/ownership.ts index f48acbc68..043861ac3 100644 --- a/server/controllers/api/videos/ownership.ts +++ b/server/controllers/api/videos/ownership.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { MVideoFullLight } from '@server/types/models' | 2 | import { MVideoFullLight } from '@server/types/models' |
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
4 | import { VideoChangeOwnershipStatus, VideoState } from '../../../../shared/models/videos' | 4 | import { VideoChangeOwnershipStatus, VideoState } from '../../../../shared/models/videos' |
diff --git a/server/controllers/api/videos/rate.ts b/server/controllers/api/videos/rate.ts index 96f6cd886..c9cc16644 100644 --- a/server/controllers/api/videos/rate.ts +++ b/server/controllers/api/videos/rate.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { UserVideoRateUpdate } from '../../../../shared' | 2 | import { UserVideoRateUpdate } from '../../../../shared' |
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
4 | import { logger } from '../../../helpers/logger' | 4 | import { logger } from '../../../helpers/logger' |
diff --git a/server/controllers/api/videos/update.ts b/server/controllers/api/videos/update.ts index 49639060b..a98a3e67c 100644 --- a/server/controllers/api/videos/update.ts +++ b/server/controllers/api/videos/update.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { Transaction } from 'sequelize/types' | 2 | import { Transaction } from 'sequelize/types' |
3 | import { changeVideoChannelShare } from '@server/lib/activitypub/share' | 3 | import { changeVideoChannelShare } from '@server/lib/activitypub/share' |
4 | import { buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video' | 4 | import { buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video' |
diff --git a/server/controllers/api/videos/upload.ts b/server/controllers/api/videos/upload.ts index 5c740c041..7ffda749d 100644 --- a/server/controllers/api/videos/upload.ts +++ b/server/controllers/api/videos/upload.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { move } from 'fs-extra' | 2 | import { move } from 'fs-extra' |
3 | import { basename } from 'path' | 3 | import { basename } from 'path' |
4 | import { getLowercaseExtension } from '@server/helpers/core-utils' | 4 | import { getLowercaseExtension } from '@server/helpers/core-utils' |
diff --git a/server/controllers/api/videos/watching.ts b/server/controllers/api/videos/watching.ts index 05c75e543..e8c28b613 100644 --- a/server/controllers/api/videos/watching.ts +++ b/server/controllers/api/videos/watching.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { UserWatchingVideo } from '../../../../shared' | 2 | import { UserWatchingVideo } from '../../../../shared' |
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
4 | import { | 4 | import { |
diff --git a/server/controllers/bots.ts b/server/controllers/bots.ts index de0411608..63db345bf 100644 --- a/server/controllers/bots.ts +++ b/server/controllers/bots.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { truncate } from 'lodash' | 2 | import { truncate } from 'lodash' |
3 | import { SitemapStream, streamToPromise } from 'sitemap' | 3 | import { SitemapStream, streamToPromise } from 'sitemap' |
4 | import { buildNSFWFilter } from '../helpers/express-utils' | 4 | import { buildNSFWFilter } from '../helpers/express-utils' |
diff --git a/server/controllers/client.ts b/server/controllers/client.ts index ba3c54440..d81e35ec3 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { constants, promises as fs } from 'fs' | 2 | import { constants, promises as fs } from 'fs' |
3 | import { readFile } from 'fs-extra' | 3 | import { readFile } from 'fs-extra' |
4 | import { join } from 'path' | 4 | import { join } from 'path' |
diff --git a/server/controllers/download.ts b/server/controllers/download.ts index ffe40d57e..8da710669 100644 --- a/server/controllers/download.ts +++ b/server/controllers/download.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import * as cors from 'cors' | 1 | import cors from 'cors' |
2 | import * as express from 'express' | 2 | import express from 'express' |
3 | import { logger } from '@server/helpers/logger' | 3 | import { logger } from '@server/helpers/logger' |
4 | import { VideosTorrentCache } from '@server/lib/files-cache/videos-torrent-cache' | 4 | import { VideosTorrentCache } from '@server/lib/files-cache/videos-torrent-cache' |
5 | import { Hooks } from '@server/lib/plugins/hooks' | 5 | import { Hooks } from '@server/lib/plugins/hooks' |
diff --git a/server/controllers/feeds.ts b/server/controllers/feeds.ts index 9fa70a7c8..5ac2e43a1 100644 --- a/server/controllers/feeds.ts +++ b/server/controllers/feeds.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import * as Feed from 'pfeed' | 2 | import Feed from 'pfeed' |
3 | import { getCategoryLabel } from '@server/models/video/formatter/video-format-utils' | 3 | import { getCategoryLabel } from '@server/models/video/formatter/video-format-utils' |
4 | import { VideoFilter } from '../../shared/models/videos/video-query.type' | 4 | import { VideoFilter } from '../../shared/models/videos/video-query.type' |
5 | import { buildNSFWFilter } from '../helpers/express-utils' | 5 | import { buildNSFWFilter } from '../helpers/express-utils' |
diff --git a/server/controllers/lazy-static.ts b/server/controllers/lazy-static.ts index 632e4dcd8..a4076ee56 100644 --- a/server/controllers/lazy-static.ts +++ b/server/controllers/lazy-static.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import * as cors from 'cors' | 1 | import cors from 'cors' |
2 | import * as express from 'express' | 2 | import express from 'express' |
3 | import { VideosTorrentCache } from '@server/lib/files-cache/videos-torrent-cache' | 3 | import { VideosTorrentCache } from '@server/lib/files-cache/videos-torrent-cache' |
4 | import { HttpStatusCode } from '../../shared/models/http/http-error-codes' | 4 | import { HttpStatusCode } from '../../shared/models/http/http-error-codes' |
5 | import { logger } from '../helpers/logger' | 5 | import { logger } from '../helpers/logger' |
diff --git a/server/controllers/live.ts b/server/controllers/live.ts index 95d5c0135..81008f120 100644 --- a/server/controllers/live.ts +++ b/server/controllers/live.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import * as cors from 'cors' | 1 | import cors from 'cors' |
2 | import * as express from 'express' | 2 | import express from 'express' |
3 | import { mapToJSON } from '@server/helpers/core-utils' | 3 | import { mapToJSON } from '@server/helpers/core-utils' |
4 | import { LiveSegmentShaStore } from '@server/lib/live' | 4 | import { LiveSegmentShaStore } from '@server/lib/live' |
5 | import { HttpStatusCode } from '@shared/models' | 5 | import { HttpStatusCode } from '@shared/models' |
diff --git a/server/controllers/plugins.ts b/server/controllers/plugins.ts index 11ab3f10a..28fffc9e1 100644 --- a/server/controllers/plugins.ts +++ b/server/controllers/plugins.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { join } from 'path' | 2 | import { join } from 'path' |
3 | import { logger } from '@server/helpers/logger' | 3 | import { logger } from '@server/helpers/logger' |
4 | import { optionalAuthenticate } from '@server/middlewares/auth' | 4 | import { optionalAuthenticate } from '@server/middlewares/auth' |
diff --git a/server/controllers/services.ts b/server/controllers/services.ts index 8c0af9ff7..8a8a95486 100644 --- a/server/controllers/services.ts +++ b/server/controllers/services.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { EMBED_SIZE, PREVIEWS_SIZE, WEBSERVER, THUMBNAILS_SIZE } from '../initializers/constants' | 2 | import { EMBED_SIZE, PREVIEWS_SIZE, WEBSERVER, THUMBNAILS_SIZE } from '../initializers/constants' |
3 | import { asyncMiddleware, oembedValidator } from '../middlewares' | 3 | import { asyncMiddleware, oembedValidator } from '../middlewares' |
4 | import { accountNameWithHostGetValidator } from '../middlewares/validators' | 4 | import { accountNameWithHostGetValidator } from '../middlewares/validators' |
diff --git a/server/controllers/static.ts b/server/controllers/static.ts index 912d7e36c..1c04e4b11 100644 --- a/server/controllers/static.ts +++ b/server/controllers/static.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import * as cors from 'cors' | 1 | import cors from 'cors' |
2 | import * as express from 'express' | 2 | import express from 'express' |
3 | import { join } from 'path' | 3 | import { join } from 'path' |
4 | import { serveIndexHTML } from '@server/lib/client-html' | 4 | import { serveIndexHTML } from '@server/lib/client-html' |
5 | import { ServerConfigManager } from '@server/lib/server-config-manager' | 5 | import { ServerConfigManager } from '@server/lib/server-config-manager' |
diff --git a/server/controllers/tracker.ts b/server/controllers/tracker.ts index 37f8f12c9..da9c68c6c 100644 --- a/server/controllers/tracker.ts +++ b/server/controllers/tracker.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import * as bitTorrentTracker from 'bittorrent-tracker' | 1 | import { Server as TrackerServer } from 'bittorrent-tracker' |
2 | import * as express from 'express' | 2 | import express from 'express' |
3 | import * as http from 'http' | 3 | import { createServer } from 'http' |
4 | import * as proxyAddr from 'proxy-addr' | 4 | import proxyAddr from 'proxy-addr' |
5 | import { Server as WebSocketServer } from 'ws' | 5 | import { Server as WebSocketServer } from 'ws' |
6 | import { Redis } from '@server/lib/redis' | 6 | import { Redis } from '@server/lib/redis' |
7 | import { logger } from '../helpers/logger' | 7 | import { logger } from '../helpers/logger' |
@@ -10,8 +10,6 @@ import { TRACKER_RATE_LIMITS } from '../initializers/constants' | |||
10 | import { VideoFileModel } from '../models/video/video-file' | 10 | import { VideoFileModel } from '../models/video/video-file' |
11 | import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-playlist' | 11 | import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-playlist' |
12 | 12 | ||
13 | const TrackerServer = bitTorrentTracker.Server | ||
14 | |||
15 | const trackerRouter = express.Router() | 13 | const trackerRouter = express.Router() |
16 | 14 | ||
17 | let peersIps = {} | 15 | let peersIps = {} |
@@ -86,7 +84,7 @@ trackerRouter.get('/tracker/announce', (req, res) => onHttpRequest(req, res, { a | |||
86 | trackerRouter.get('/tracker/scrape', (req, res) => onHttpRequest(req, res, { action: 'scrape' })) | 84 | trackerRouter.get('/tracker/scrape', (req, res) => onHttpRequest(req, res, { action: 'scrape' })) |
87 | 85 | ||
88 | function createWebsocketTrackerServer (app: express.Application) { | 86 | function createWebsocketTrackerServer (app: express.Application) { |
89 | const server = http.createServer(app) | 87 | const server = createServer(app) |
90 | const wss = new WebSocketServer({ noServer: true }) | 88 | const wss = new WebSocketServer({ noServer: true }) |
91 | 89 | ||
92 | wss.on('connection', function (ws, req) { | 90 | wss.on('connection', function (ws, req) { |
diff --git a/server/controllers/webfinger.ts b/server/controllers/webfinger.ts index 885e4498f..29ce01166 100644 --- a/server/controllers/webfinger.ts +++ b/server/controllers/webfinger.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import * as cors from 'cors' | 1 | import cors from 'cors' |
2 | import * as express from 'express' | 2 | import express from 'express' |
3 | import { WEBSERVER } from '@server/initializers/constants' | 3 | import { WEBSERVER } from '@server/initializers/constants' |
4 | import { asyncMiddleware } from '../middlewares' | 4 | import { asyncMiddleware } from '../middlewares' |
5 | import { webfingerValidator } from '../middlewares/validators' | 5 | import { webfingerValidator } from '../middlewares/validators' |