diff options
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/activitypub/process/process-create.ts | 2 | ||||
-rw-r--r-- | server/lib/activitypub/videos/shared/creator.ts | 2 | ||||
-rw-r--r-- | server/lib/activitypub/videos/shared/object-to-model-attributes.ts | 2 | ||||
-rw-r--r-- | server/lib/client-html.ts | 6 | ||||
-rw-r--r-- | server/lib/emailer.ts | 2 | ||||
-rw-r--r-- | server/lib/notifier/shared/abuse/abstract-new-abuse-message.ts | 2 | ||||
-rw-r--r-- | server/lib/redis.ts | 2 | ||||
-rw-r--r-- | server/lib/schedulers/geo-ip-update-scheduler.ts | 2 | ||||
-rw-r--r-- | server/lib/signup.ts | 2 |
9 files changed, 12 insertions, 10 deletions
diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts index 3e7931bb2..76ed37aae 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts | |||
@@ -124,7 +124,7 @@ async function processCreateVideoComment (activity: ActivityCreate, byActor: MAc | |||
124 | return | 124 | return |
125 | } | 125 | } |
126 | 126 | ||
127 | // Try to not forward unwanted commments on our videos | 127 | // Try to not forward unwanted comments on our videos |
128 | if (video.isOwned()) { | 128 | if (video.isOwned()) { |
129 | if (await isBlockedByServerOrAccount(comment.Account, video.VideoChannel.Account)) { | 129 | if (await isBlockedByServerOrAccount(comment.Account, video.VideoChannel.Account)) { |
130 | logger.info('Skip comment forward from blocked account or server %s.', comment.Account.Actor.url) | 130 | logger.info('Skip comment forward from blocked account or server %s.', comment.Account.Actor.url) |
diff --git a/server/lib/activitypub/videos/shared/creator.ts b/server/lib/activitypub/videos/shared/creator.ts index 688bcbb53..07252fea2 100644 --- a/server/lib/activitypub/videos/shared/creator.ts +++ b/server/lib/activitypub/videos/shared/creator.ts | |||
@@ -24,7 +24,7 @@ export class APVideoCreator extends APVideoAbstractBuilder { | |||
24 | const channel = channelActor.VideoChannel | 24 | const channel = channelActor.VideoChannel |
25 | 25 | ||
26 | const videoData = getVideoAttributesFromObject(channel, this.videoObject, this.videoObject.to) | 26 | const videoData = getVideoAttributesFromObject(channel, this.videoObject, this.videoObject.to) |
27 | const video = VideoModel.build(videoData) as MVideoThumbnail | 27 | const video = VideoModel.build({ ...videoData, likes: 0, dislikes: 0 }) as MVideoThumbnail |
28 | 28 | ||
29 | const promiseThumbnail = this.tryToGenerateThumbnail(video) | 29 | const promiseThumbnail = this.tryToGenerateThumbnail(video) |
30 | 30 | ||
diff --git a/server/lib/activitypub/videos/shared/object-to-model-attributes.ts b/server/lib/activitypub/videos/shared/object-to-model-attributes.ts index f02b9cba6..86699c5b8 100644 --- a/server/lib/activitypub/videos/shared/object-to-model-attributes.ts +++ b/server/lib/activitypub/videos/shared/object-to-model-attributes.ts | |||
@@ -210,8 +210,6 @@ function getVideoAttributesFromObject (videoChannel: MChannelId, videoObject: Vi | |||
210 | 210 | ||
211 | updatedAt: new Date(videoObject.updated), | 211 | updatedAt: new Date(videoObject.updated), |
212 | views: videoObject.views, | 212 | views: videoObject.views, |
213 | likes: 0, | ||
214 | dislikes: 0, | ||
215 | remote: true, | 213 | remote: true, |
216 | privacy | 214 | privacy |
217 | } | 215 | } |
diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index 337364ac9..1e8d03023 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts | |||
@@ -30,6 +30,7 @@ import { MAccountActor, MChannelActor } from '../types/models' | |||
30 | import { getActivityStreamDuration } from './activitypub/activity' | 30 | import { getActivityStreamDuration } from './activitypub/activity' |
31 | import { getBiggestActorImage } from './actor-image' | 31 | import { getBiggestActorImage } from './actor-image' |
32 | import { ServerConfigManager } from './server-config-manager' | 32 | import { ServerConfigManager } from './server-config-manager' |
33 | import { isTestInstance } from '@server/helpers/core-utils' | ||
33 | 34 | ||
34 | type Tags = { | 35 | type Tags = { |
35 | ogType: string | 36 | ogType: string |
@@ -232,7 +233,10 @@ class ClientHtml { | |||
232 | static async getEmbedHTML () { | 233 | static async getEmbedHTML () { |
233 | const path = ClientHtml.getEmbedPath() | 234 | const path = ClientHtml.getEmbedPath() |
234 | 235 | ||
235 | if (ClientHtml.htmlCache[path]) return ClientHtml.htmlCache[path] | 236 | // Disable HTML cache in dev mode because webpack can regenerate JS files |
237 | if (!isTestInstance() && ClientHtml.htmlCache[path]) { | ||
238 | return ClientHtml.htmlCache[path] | ||
239 | } | ||
236 | 240 | ||
237 | const buffer = await readFile(path) | 241 | const buffer = await readFile(path) |
238 | const serverConfig = await ServerConfigManager.Instance.getHTMLServerConfig() | 242 | const serverConfig = await ServerConfigManager.Instance.getHTMLServerConfig() |
diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts index aebca04fe..edc99057c 100644 --- a/server/lib/emailer.ts +++ b/server/lib/emailer.ts | |||
@@ -179,7 +179,7 @@ class Emailer { | |||
179 | } | 179 | } |
180 | } | 180 | } |
181 | 181 | ||
182 | // overriden/new variables given for a specific template in the payload | 182 | // overridden/new variables given for a specific template in the payload |
183 | const sendOptions = merge(baseOptions, options) | 183 | const sendOptions = merge(baseOptions, options) |
184 | 184 | ||
185 | await email.send(sendOptions) | 185 | await email.send(sendOptions) |
diff --git a/server/lib/notifier/shared/abuse/abstract-new-abuse-message.ts b/server/lib/notifier/shared/abuse/abstract-new-abuse-message.ts index daefa25bd..a7292de69 100644 --- a/server/lib/notifier/shared/abuse/abstract-new-abuse-message.ts +++ b/server/lib/notifier/shared/abuse/abstract-new-abuse-message.ts | |||
@@ -5,7 +5,7 @@ import { MAbuseFull, MAbuseMessage, MAccountDefault, MUserWithNotificationSettin | |||
5 | import { UserNotificationType } from '@shared/models' | 5 | import { UserNotificationType } from '@shared/models' |
6 | import { AbstractNotification } from '../common/abstract-notification' | 6 | import { AbstractNotification } from '../common/abstract-notification' |
7 | 7 | ||
8 | export type NewAbuseMessagePayload = { | 8 | type NewAbuseMessagePayload = { |
9 | abuse: MAbuseFull | 9 | abuse: MAbuseFull |
10 | message: MAbuseMessage | 10 | message: MAbuseMessage |
11 | } | 11 | } |
diff --git a/server/lib/redis.ts b/server/lib/redis.ts index d052de786..158f3c080 100644 --- a/server/lib/redis.ts +++ b/server/lib/redis.ts | |||
@@ -308,7 +308,7 @@ class Redis { | |||
308 | return this.deleteKey('resumable-upload-' + uploadId) | 308 | return this.deleteKey('resumable-upload-' + uploadId) |
309 | } | 309 | } |
310 | 310 | ||
311 | /* ************ AP ressource unavailability ************ */ | 311 | /* ************ AP resource unavailability ************ */ |
312 | 312 | ||
313 | async addAPUnavailability (url: string) { | 313 | async addAPUnavailability (url: string) { |
314 | const key = this.generateAPUnavailabilityKey(url) | 314 | const key = this.generateAPUnavailabilityKey(url) |
diff --git a/server/lib/schedulers/geo-ip-update-scheduler.ts b/server/lib/schedulers/geo-ip-update-scheduler.ts index 9dda6d76c..b06f5a9b5 100644 --- a/server/lib/schedulers/geo-ip-update-scheduler.ts +++ b/server/lib/schedulers/geo-ip-update-scheduler.ts | |||
@@ -6,7 +6,7 @@ export class GeoIPUpdateScheduler extends AbstractScheduler { | |||
6 | 6 | ||
7 | private static instance: AbstractScheduler | 7 | private static instance: AbstractScheduler |
8 | 8 | ||
9 | protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.YOUTUBE_DL_UPDATE | 9 | protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.GEO_IP_UPDATE |
10 | 10 | ||
11 | private constructor () { | 11 | private constructor () { |
12 | super() | 12 | super() |
diff --git a/server/lib/signup.ts b/server/lib/signup.ts index 3c1397a12..f094531eb 100644 --- a/server/lib/signup.ts +++ b/server/lib/signup.ts | |||
@@ -26,7 +26,7 @@ function isSignupAllowedForCurrentIP (ip: string) { | |||
26 | const excludeList = [ 'blacklist' ] | 26 | const excludeList = [ 'blacklist' ] |
27 | let matched = '' | 27 | let matched = '' |
28 | 28 | ||
29 | // if there is a valid, non-empty whitelist, we exclude all unknown adresses too | 29 | // if there is a valid, non-empty whitelist, we exclude all unknown addresses too |
30 | if (CONFIG.SIGNUP.FILTERS.CIDR.WHITELIST.filter(cidr => isCidr(cidr)).length > 0) { | 30 | if (CONFIG.SIGNUP.FILTERS.CIDR.WHITELIST.filter(cidr => isCidr(cidr)).length > 0) { |
31 | excludeList.push('unknown') | 31 | excludeList.push('unknown') |
32 | } | 32 | } |