forked from mirrors/misskey
Compare commits
No commits in common. "4b9179a4c4e6ccd55f3bc91a1982ca9ec5284696" and "96c7c85ad008a71fb03198a708c8531aacbb39e0" have entirely different histories.
4b9179a4c4
...
96c7c85ad0
5 changed files with 4 additions and 55 deletions
|
@ -641,6 +641,7 @@
|
||||||
- nsfwjs のモデルロードを排他することで、重複ロードによってメモリ使用量が増加しないように
|
- nsfwjs のモデルロードを排他することで、重複ロードによってメモリ使用量が増加しないように
|
||||||
- 連合の配送ジョブのパフォーマンスを向上(ロック機構の見直し、Redisキャッシュの活用)
|
- 連合の配送ジョブのパフォーマンスを向上(ロック機構の見直し、Redisキャッシュの活用)
|
||||||
- featuredノートのsignedGet回数を減らしました
|
- featuredノートのsignedGet回数を減らしました
|
||||||
|
- ActivityPubの署名用鍵長を2048bitに変更しパフォーマンスを向上(新規アカウントのみ)
|
||||||
- リモートサーバーのセンシティブなファイルのキャッシュだけを無効化できるオプションを追加
|
- リモートサーバーのセンシティブなファイルのキャッシュだけを無効化できるオプションを追加
|
||||||
- MeilisearchにIndexするノートの範囲を設定できるように
|
- MeilisearchにIndexするノートの範囲を設定できるように
|
||||||
- Export notes with file detail
|
- Export notes with file detail
|
||||||
|
|
|
@ -93,10 +93,6 @@ type Source = {
|
||||||
perUserNotificationsMaxCount?: number;
|
perUserNotificationsMaxCount?: number;
|
||||||
deactivateAntennaThreshold?: number;
|
deactivateAntennaThreshold?: number;
|
||||||
pidFile: string;
|
pidFile: string;
|
||||||
|
|
||||||
// BEGIN comfy.social
|
|
||||||
noteFilterPlugin?: string;
|
|
||||||
// END comfy.social
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Config = {
|
export type Config = {
|
||||||
|
@ -174,10 +170,6 @@ export type Config = {
|
||||||
perUserNotificationsMaxCount: number;
|
perUserNotificationsMaxCount: number;
|
||||||
deactivateAntennaThreshold: number;
|
deactivateAntennaThreshold: number;
|
||||||
pidFile: string;
|
pidFile: string;
|
||||||
|
|
||||||
// BEGIN comfy.social
|
|
||||||
noteFilterPlugin?: string;
|
|
||||||
// END comfy.social
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const _filename = fileURLToPath(import.meta.url);
|
const _filename = fileURLToPath(import.meta.url);
|
||||||
|
@ -273,9 +265,6 @@ export function loadConfig(): Config {
|
||||||
perUserNotificationsMaxCount: config.perUserNotificationsMaxCount ?? 500,
|
perUserNotificationsMaxCount: config.perUserNotificationsMaxCount ?? 500,
|
||||||
deactivateAntennaThreshold: config.deactivateAntennaThreshold ?? (1000 * 60 * 60 * 24 * 7),
|
deactivateAntennaThreshold: config.deactivateAntennaThreshold ?? (1000 * 60 * 60 * 24 * 7),
|
||||||
pidFile: config.pidFile,
|
pidFile: config.pidFile,
|
||||||
// BEGIN comfy.social
|
|
||||||
noteFilterPlugin: config.noteFilterPlugin,
|
|
||||||
// END comfy.social
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ export class CreateSystemUserService {
|
||||||
// Generate secret
|
// Generate secret
|
||||||
const secret = generateNativeUserToken();
|
const secret = generateNativeUserToken();
|
||||||
|
|
||||||
const keyPair = await genRsaKeyPair(4096);
|
const keyPair = await genRsaKeyPair();
|
||||||
|
|
||||||
let account!: MiUser;
|
let account!: MiUser;
|
||||||
|
|
||||||
|
|
|
@ -147,28 +147,11 @@ type Option = {
|
||||||
app?: MiApp | null;
|
app?: MiApp | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
// BEGIN comfy.social
|
|
||||||
type NoteFilterResult = {
|
|
||||||
verdict: boolean; // true = block
|
|
||||||
reason?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type NoteFilterPluginContext = {
|
|
||||||
data: Option;
|
|
||||||
user: MiUser;
|
|
||||||
mentionedUsers: MiUser[];
|
|
||||||
usersRepository: UsersRepository;
|
|
||||||
}
|
|
||||||
// END comfy.social
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class NoteCreateService implements OnApplicationShutdown {
|
export class NoteCreateService implements OnApplicationShutdown {
|
||||||
#shutdownController = new AbortController();
|
#shutdownController = new AbortController();
|
||||||
|
|
||||||
public static ContainsProhibitedWordsError = class extends Error {};
|
public static ContainsProhibitedWordsError = class extends Error {};
|
||||||
// BEGIN comfy.social
|
|
||||||
private noteFilterPluginFn?: (context: NoteFilterPluginContext) => Promise<NoteFilterResult> = null;
|
|
||||||
// END comfy.social
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(DI.config)
|
@Inject(DI.config)
|
||||||
|
@ -236,15 +219,7 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||||
private instanceChart: InstanceChart,
|
private instanceChart: InstanceChart,
|
||||||
private utilityService: UtilityService,
|
private utilityService: UtilityService,
|
||||||
private userBlockingService: UserBlockingService,
|
private userBlockingService: UserBlockingService,
|
||||||
) {
|
) { }
|
||||||
// BEGIN comfy.social
|
|
||||||
if (this.config.noteFilterPlugin != null) {
|
|
||||||
import(this.config.noteFilterPlugin).then((m) => {
|
|
||||||
this.noteFilterPluginFn = m.default;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// END comfy.social
|
|
||||||
}
|
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public async create(user: {
|
public async create(user: {
|
||||||
|
@ -404,22 +379,6 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// BEGIN comfy.social
|
|
||||||
// Invoke customizable filter policy
|
|
||||||
if (this.noteFilterPluginFn != null) {
|
|
||||||
const filterResult = await this.noteFilterPluginFn({
|
|
||||||
data: data,
|
|
||||||
user: user,
|
|
||||||
mentionedUsers: mentionedUsers,
|
|
||||||
remoteUserResolveService: this.remoteUserResolveService,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (filterResult.verdict) {
|
|
||||||
throw new Error(`Blocked by custom filter policy, reason: ${filterResult.reason}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// END comfy.social
|
|
||||||
|
|
||||||
const note = await this.insertNote(user, data, tags, emojis, mentionedUsers);
|
const note = await this.insertNote(user, data, tags, emojis, mentionedUsers);
|
||||||
|
|
||||||
setImmediate('post created', { signal: this.#shutdownController.signal }).then(
|
setImmediate('post created', { signal: this.#shutdownController.signal }).then(
|
||||||
|
|
|
@ -95,7 +95,7 @@ export class SignupService {
|
||||||
|
|
||||||
const keyPair = await new Promise<string[]>((res, rej) =>
|
const keyPair = await new Promise<string[]>((res, rej) =>
|
||||||
generateKeyPair('rsa', {
|
generateKeyPair('rsa', {
|
||||||
modulusLength: 4096,
|
modulusLength: 2048,
|
||||||
publicKeyEncoding: {
|
publicKeyEncoding: {
|
||||||
type: 'spki',
|
type: 'spki',
|
||||||
format: 'pem',
|
format: 'pem',
|
||||||
|
|
Loading…
Add table
Reference in a new issue