2023-08-14 19:52:38 +02:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2022-02-20 08:07:43 +01:00
|
|
|
export const MAX_NOTE_TEXT_LENGTH = 3000;
|
|
|
|
|
2021-04-17 08:30:26 +02:00
|
|
|
export const USER_ONLINE_THRESHOLD = 1000 * 60 * 10; // 10min
|
|
|
|
export const USER_ACTIVE_THRESHOLD = 1000 * 60 * 60 * 24 * 3; // 3days
|
2022-01-01 14:25:30 +01:00
|
|
|
|
2022-12-25 06:22:23 +01:00
|
|
|
//#region hard limits
|
|
|
|
// If you change DB_* values, you must also change the DB schema.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Maximum note text length that can be stored in DB.
|
|
|
|
* Surrogate pairs count as one
|
|
|
|
*/
|
|
|
|
export const DB_MAX_NOTE_TEXT_LENGTH = 8192;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Maximum image description length that can be stored in DB.
|
|
|
|
* Surrogate pairs count as one
|
|
|
|
*/
|
|
|
|
export const DB_MAX_IMAGE_COMMENT_LENGTH = 512;
|
|
|
|
//#endregion
|
|
|
|
|
2022-01-01 14:25:30 +01:00
|
|
|
// ブラウザで直接表示することを許可するファイルの種類のリスト
|
|
|
|
// ここに含まれないものは application/octet-stream としてレスポンスされる
|
|
|
|
// SVGはXSSを生むので許可しない
|
|
|
|
export const FILE_TYPE_BROWSERSAFE = [
|
|
|
|
// Images
|
|
|
|
'image/png',
|
|
|
|
'image/gif',
|
|
|
|
'image/jpeg',
|
|
|
|
'image/webp',
|
2022-12-08 06:49:49 +01:00
|
|
|
'image/avif',
|
2022-01-01 14:25:30 +01:00
|
|
|
'image/apng',
|
|
|
|
'image/bmp',
|
|
|
|
'image/tiff',
|
|
|
|
'image/x-icon',
|
|
|
|
|
|
|
|
// OggS
|
|
|
|
'audio/opus',
|
|
|
|
'video/ogg',
|
|
|
|
'audio/ogg',
|
|
|
|
'application/ogg',
|
|
|
|
|
|
|
|
// ISO/IEC base media file format
|
|
|
|
'video/quicktime',
|
|
|
|
'video/mp4',
|
|
|
|
'audio/mp4',
|
|
|
|
'video/x-m4v',
|
|
|
|
'audio/x-m4a',
|
|
|
|
'video/3gpp',
|
|
|
|
'video/3gpp2',
|
|
|
|
|
|
|
|
'video/mpeg',
|
|
|
|
'audio/mpeg',
|
|
|
|
|
|
|
|
'video/webm',
|
|
|
|
'audio/webm',
|
|
|
|
|
|
|
|
'audio/aac',
|
2023-04-25 19:17:58 +02:00
|
|
|
|
|
|
|
// see https://github.com/misskey-dev/misskey/pull/10686
|
|
|
|
'audio/flac',
|
|
|
|
'audio/wav',
|
|
|
|
// backward compatibility
|
2022-01-01 14:25:30 +01:00
|
|
|
'audio/x-flac',
|
|
|
|
'audio/vnd.wave',
|
|
|
|
];
|
|
|
|
/*
|
|
|
|
https://github.com/sindresorhus/file-type/blob/main/supported.js
|
|
|
|
https://github.com/sindresorhus/file-type/blob/main/core.js
|
|
|
|
https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers
|
|
|
|
*/
|