2023-12-05 07:12:10 +00:00
|
|
|
import JSON5 from "json5";
|
|
|
|
import { IsNull, MoreThan } from "typeorm";
|
2023-01-13 04:40:33 +00:00
|
|
|
import config from "@/config/index.js";
|
2024-04-14 11:16:22 +00:00
|
|
|
import { fetchMeta } from "backend-rs";
|
2023-01-13 04:40:33 +00:00
|
|
|
import { Ads, Emojis, Users } from "@/models/index.js";
|
2023-12-05 07:12:10 +00:00
|
|
|
import { MAX_NOTE_TEXT_LENGTH, MAX_CAPTION_TEXT_LENGTH } from "@/const.js";
|
2023-10-30 08:58:37 +00:00
|
|
|
import define from "@/server/api/define.js";
|
2016-12-28 22:49:51 +00:00
|
|
|
|
2018-10-08 16:01:48 +00:00
|
|
|
export const meta = {
|
2023-01-13 04:40:33 +00:00
|
|
|
tags: ["meta"],
|
2019-02-23 02:20:58 +00:00
|
|
|
|
2022-01-18 13:27:10 +00:00
|
|
|
requireCredential: false,
|
2018-10-08 16:01:48 +00:00
|
|
|
|
2019-02-24 18:21:54 +00:00
|
|
|
res: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "object",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2019-02-24 18:21:54 +00:00
|
|
|
properties: {
|
2021-03-06 13:34:11 +00:00
|
|
|
maintainerName: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: true,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
maintainerEmail: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: true,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
2019-02-24 18:21:54 +00:00
|
|
|
version: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-12-09 14:58:30 +00:00
|
|
|
example: config.version,
|
2019-02-24 18:21:54 +00:00
|
|
|
},
|
|
|
|
name: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2019-02-24 18:21:54 +00:00
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
uri: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
|
|
|
format: "url",
|
2023-07-02 22:18:30 +00:00
|
|
|
example: "https://firefish.example.com",
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
description: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: true,
|
2019-02-24 18:21:54 +00:00
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
langs: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "array",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
items: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-12-09 14:58:30 +00:00
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
tosUrl: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: true,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
2023-11-26 20:14:02 +00:00
|
|
|
moreUrls: {
|
|
|
|
type: "object",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
repositoryUrl: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2024-02-14 13:44:11 +00:00
|
|
|
default: "https://firefish.dev/firefish/firefish",
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
feedbackUrl: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2024-02-14 13:44:11 +00:00
|
|
|
default: "https://firefish.dev/firefish/firefish/issues",
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
2022-03-01 14:58:01 +00:00
|
|
|
defaultDarkTheme: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: true,
|
2022-03-01 14:58:01 +00:00
|
|
|
},
|
|
|
|
defaultLightTheme: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: true,
|
2022-03-01 14:58:01 +00:00
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
disableRegistration: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
disableLocalTimeline: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
2022-07-29 04:28:13 +00:00
|
|
|
disableRecommendedTimeline: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2022-07-29 04:28:13 +00:00
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
disableGlobalTimeline: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
2024-03-01 15:19:05 +00:00
|
|
|
enableGuestTimeline: {
|
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
driveCapacityPerLocalUserMb: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "number",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
driveCapacityPerRemoteUserMb: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "number",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
2024-04-13 00:59:11 +00:00
|
|
|
antennaLimit: {
|
|
|
|
type: "number",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
cacheRemoteFiles: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
2024-03-01 11:26:28 +00:00
|
|
|
markLocalFilesNsfwByDefault: {
|
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
|
|
|
},
|
2021-10-08 04:37:02 +00:00
|
|
|
emailRequiredForSignup: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-10-08 04:37:02 +00:00
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
enableHcaptcha: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
hcaptchaSiteKey: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: true,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
enableRecaptcha: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
recaptchaSiteKey: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: true,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
swPublickey: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: true,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
mascotImageUrl: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2023-09-26 03:57:14 +00:00
|
|
|
default: "/static-assets/badges/info.webp",
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
bannerUrl: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
errorImageUrl: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2023-09-26 03:57:14 +00:00
|
|
|
default: "/static-assets/badges/error.webp",
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
iconUrl: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: true,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
2022-02-20 10:01:06 +00:00
|
|
|
maxNoteTextLength: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "number",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2022-02-20 10:01:06 +00:00
|
|
|
},
|
2023-03-04 14:16:20 +00:00
|
|
|
maxCaptionTextLength: {
|
|
|
|
type: "number",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
emojis: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "array",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2019-02-24 18:21:54 +00:00
|
|
|
items: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "object",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2019-02-24 18:21:54 +00:00
|
|
|
properties: {
|
2021-03-06 13:34:11 +00:00
|
|
|
id: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
|
|
|
format: "id",
|
2019-02-24 18:21:54 +00:00
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
aliases: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "array",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
items: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-12-09 14:58:30 +00:00
|
|
|
},
|
2019-02-24 18:21:54 +00:00
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
category: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: true,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
host: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: true,
|
|
|
|
description: "The local host is represented with `null`.",
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
url: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
|
|
|
format: "url",
|
2021-12-09 14:58:30 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2019-02-24 18:21:54 +00:00
|
|
|
},
|
2021-05-04 12:15:57 +00:00
|
|
|
ads: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "array",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-05-04 12:15:57 +00:00
|
|
|
items: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "object",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-05-04 12:15:57 +00:00
|
|
|
properties: {
|
|
|
|
place: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-05-04 12:15:57 +00:00
|
|
|
},
|
|
|
|
url: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
|
|
|
format: "url",
|
2021-05-04 12:15:57 +00:00
|
|
|
},
|
|
|
|
imageUrl: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
|
|
|
format: "url",
|
2021-05-04 12:15:57 +00:00
|
|
|
},
|
2021-12-09 14:58:30 +00:00
|
|
|
},
|
|
|
|
},
|
2021-05-04 12:15:57 +00:00
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
requireSetup: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-12-09 14:58:30 +00:00
|
|
|
example: false,
|
2019-02-24 18:21:54 +00:00
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
enableEmail: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2019-02-24 18:21:54 +00:00
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
enableServiceWorker: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
2021-08-15 11:26:44 +00:00
|
|
|
translatorAvailable: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-08-15 11:26:44 +00:00
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
proxyAccountName: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: false,
|
|
|
|
nullable: true,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
features: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "object",
|
|
|
|
optional: true,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
properties: {
|
|
|
|
registration: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
localTimeLine: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
2022-07-29 04:49:36 +00:00
|
|
|
recommendedTimeLine: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2022-07-29 04:28:13 +00:00
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
globalTimeLine: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
2023-06-06 23:19:13 +00:00
|
|
|
searchFilters: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
hcaptcha: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
recaptcha: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
objectStorage: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
serviceWorker: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: false,
|
|
|
|
nullable: false,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
|
|
|
miauth: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: true,
|
|
|
|
nullable: false,
|
2021-12-09 14:58:30 +00:00
|
|
|
default: true,
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
2021-12-09 14:58:30 +00:00
|
|
|
},
|
2021-03-06 13:34:11 +00:00
|
|
|
},
|
2021-07-20 16:45:41 +00:00
|
|
|
secureMode: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: true,
|
|
|
|
nullable: false,
|
2021-07-20 16:45:41 +00:00
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
privateMode: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "boolean",
|
|
|
|
optional: true,
|
|
|
|
nullable: false,
|
2021-07-20 16:45:41 +00:00
|
|
|
default: false,
|
|
|
|
},
|
2023-01-05 04:06:48 +00:00
|
|
|
defaultReaction: {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "string",
|
|
|
|
optional: "false",
|
|
|
|
nullable: false,
|
|
|
|
default: "⭐",
|
2023-01-05 04:06:48 +00:00
|
|
|
},
|
2023-07-12 07:54:28 +00:00
|
|
|
donationLink: {
|
|
|
|
type: "string",
|
|
|
|
optional: "true",
|
|
|
|
nullable: true,
|
2023-07-13 06:22:58 +00:00
|
|
|
},
|
2023-07-26 04:49:09 +00:00
|
|
|
enableServerMachineStats: {
|
|
|
|
type: "boolean",
|
|
|
|
optional: "true",
|
|
|
|
nullable: false,
|
|
|
|
default: false,
|
|
|
|
},
|
2021-12-09 14:58:30 +00:00
|
|
|
},
|
|
|
|
},
|
2022-01-18 13:27:10 +00:00
|
|
|
} as const;
|
2018-10-08 16:01:48 +00:00
|
|
|
|
2022-02-20 04:15:40 +00:00
|
|
|
export const paramDef = {
|
2023-01-13 04:40:33 +00:00
|
|
|
type: "object",
|
2022-02-19 05:05:32 +00:00
|
|
|
properties: {
|
2023-01-13 04:40:33 +00:00
|
|
|
detail: { type: "boolean", default: true },
|
2022-02-19 05:05:32 +00:00
|
|
|
},
|
|
|
|
required: [],
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
export default define(meta, paramDef, async (ps, me) => {
|
2024-04-14 11:16:22 +00:00
|
|
|
const instance = await fetchMeta(false);
|
2017-11-15 00:47:47 +00:00
|
|
|
|
2019-10-20 15:43:39 +00:00
|
|
|
const emojis = await Emojis.find({
|
|
|
|
where: {
|
2022-03-26 06:34:00 +00:00
|
|
|
host: IsNull(),
|
2019-10-20 15:43:39 +00:00
|
|
|
},
|
|
|
|
order: {
|
2023-01-13 04:40:33 +00:00
|
|
|
category: "ASC",
|
|
|
|
name: "ASC",
|
2019-10-20 15:43:39 +00:00
|
|
|
},
|
|
|
|
cache: {
|
2023-01-13 04:40:33 +00:00
|
|
|
id: "meta_emojis",
|
|
|
|
milliseconds: 3600000, // 1 hour
|
2021-12-09 14:58:30 +00:00
|
|
|
},
|
2019-10-20 15:43:39 +00:00
|
|
|
});
|
2018-11-02 14:23:01 +00:00
|
|
|
|
2021-05-04 12:15:57 +00:00
|
|
|
const ads = await Ads.find({
|
|
|
|
where: {
|
2021-12-09 14:58:30 +00:00
|
|
|
expiresAt: MoreThan(new Date()),
|
2021-05-04 12:15:57 +00:00
|
|
|
},
|
|
|
|
});
|
2021-07-20 18:51:59 +00:00
|
|
|
|
2018-11-06 15:08:21 +00:00
|
|
|
const response: any = {
|
2019-04-07 12:50:36 +00:00
|
|
|
maintainerName: instance.maintainerName,
|
|
|
|
maintainerEmail: instance.maintainerEmail,
|
2018-04-22 12:32:09 +00:00
|
|
|
|
2019-11-01 13:34:26 +00:00
|
|
|
version: config.version,
|
2018-04-22 12:32:09 +00:00
|
|
|
|
2018-11-05 22:14:43 +00:00
|
|
|
name: instance.name,
|
2018-12-26 19:50:35 +00:00
|
|
|
uri: config.url,
|
2018-11-05 22:14:43 +00:00
|
|
|
description: instance.description,
|
2018-11-07 03:28:53 +00:00
|
|
|
langs: instance.langs,
|
2024-03-02 04:13:03 +00:00
|
|
|
tosUrl: instance.tosUrl,
|
2023-11-26 20:14:02 +00:00
|
|
|
moreUrls: instance.moreUrls,
|
2019-05-13 17:57:04 +00:00
|
|
|
repositoryUrl: instance.repositoryUrl,
|
|
|
|
feedbackUrl: instance.feedbackUrl,
|
2021-07-20 18:51:59 +00:00
|
|
|
|
|
|
|
secureMode: instance.secureMode,
|
|
|
|
privateMode: instance.privateMode,
|
|
|
|
|
2018-11-05 22:14:43 +00:00
|
|
|
disableRegistration: instance.disableRegistration,
|
|
|
|
disableLocalTimeline: instance.disableLocalTimeline,
|
2022-07-29 04:28:13 +00:00
|
|
|
disableRecommendedTimeline: instance.disableRecommendedTimeline,
|
2019-01-16 05:54:14 +00:00
|
|
|
disableGlobalTimeline: instance.disableGlobalTimeline,
|
2024-03-01 15:19:05 +00:00
|
|
|
enableGuestTimeline: instance.enableGuestTimeline,
|
2018-11-05 22:14:43 +00:00
|
|
|
driveCapacityPerLocalUserMb: instance.localDriveCapacityMb,
|
|
|
|
driveCapacityPerRemoteUserMb: instance.remoteDriveCapacityMb,
|
2024-04-13 00:59:11 +00:00
|
|
|
antennaLimit: instance.antennaLimit,
|
2021-10-08 04:37:02 +00:00
|
|
|
emailRequiredForSignup: instance.emailRequiredForSignup,
|
2020-04-28 05:29:33 +00:00
|
|
|
enableHcaptcha: instance.enableHcaptcha,
|
|
|
|
hcaptchaSiteKey: instance.hcaptchaSiteKey,
|
2018-11-07 03:09:24 +00:00
|
|
|
enableRecaptcha: instance.enableRecaptcha,
|
|
|
|
recaptchaSiteKey: instance.recaptchaSiteKey,
|
2018-12-19 19:08:13 +00:00
|
|
|
swPublickey: instance.swPublicKey,
|
2022-02-09 12:25:48 +00:00
|
|
|
themeColor: instance.themeColor,
|
2019-01-03 18:52:50 +00:00
|
|
|
mascotImageUrl: instance.mascotImageUrl,
|
2018-11-05 22:14:43 +00:00
|
|
|
bannerUrl: instance.bannerUrl,
|
2018-12-11 12:17:57 +00:00
|
|
|
errorImageUrl: instance.errorImageUrl,
|
2019-03-15 03:40:10 +00:00
|
|
|
iconUrl: instance.iconUrl,
|
2020-11-25 12:31:34 +00:00
|
|
|
backgroundImageUrl: instance.backgroundImageUrl,
|
|
|
|
logoImageUrl: instance.logoImageUrl,
|
2022-02-20 10:01:06 +00:00
|
|
|
maxNoteTextLength: MAX_NOTE_TEXT_LENGTH, // 後方互換性のため
|
2023-03-04 14:16:20 +00:00
|
|
|
maxCaptionTextLength: MAX_CAPTION_TEXT_LENGTH,
|
2021-07-20 18:51:59 +00:00
|
|
|
emojis: instance.privateMode && !me ? [] : await Emojis.packMany(emojis),
|
2023-06-03 06:28:21 +00:00
|
|
|
// クライアントの手間を減らすためあらかじめJSONに変換しておく
|
|
|
|
defaultLightTheme: instance.defaultLightTheme
|
|
|
|
? JSON.stringify(JSON5.parse(instance.defaultLightTheme))
|
|
|
|
: null,
|
|
|
|
defaultDarkTheme: instance.defaultDarkTheme
|
|
|
|
? JSON.stringify(JSON5.parse(instance.defaultDarkTheme))
|
|
|
|
: null,
|
2023-01-13 04:40:33 +00:00
|
|
|
ads:
|
|
|
|
instance.privateMode && !me
|
|
|
|
? []
|
|
|
|
: ads.map((ad) => ({
|
|
|
|
id: ad.id,
|
|
|
|
url: ad.url,
|
|
|
|
place: ad.place,
|
|
|
|
ratio: ad.ratio,
|
|
|
|
imageUrl: ad.imageUrl,
|
2024-03-28 05:25:33 +00:00
|
|
|
})),
|
2018-11-29 11:33:31 +00:00
|
|
|
enableEmail: instance.enableEmail,
|
2018-11-16 17:13:01 +00:00
|
|
|
|
2019-03-31 16:04:55 +00:00
|
|
|
enableServiceWorker: instance.enableServiceWorker,
|
2020-08-28 23:56:32 +00:00
|
|
|
|
2023-04-30 01:09:51 +00:00
|
|
|
translatorAvailable:
|
|
|
|
instance.deeplAuthKey != null || instance.libreTranslateApiUrl != null,
|
2023-01-05 04:06:48 +00:00
|
|
|
defaultReaction: instance.defaultReaction,
|
2023-07-12 07:54:28 +00:00
|
|
|
donationLink: instance.donationLink,
|
2023-07-26 04:49:09 +00:00
|
|
|
enableServerMachineStats: instance.enableServerMachineStats,
|
|
|
|
enableIdenticonGeneration: instance.enableIdenticonGeneration,
|
2021-08-15 11:26:44 +00:00
|
|
|
|
2023-01-13 04:40:33 +00:00
|
|
|
...(ps.detail
|
|
|
|
? {
|
|
|
|
pinnedPages: instance.privateMode && !me ? [] : instance.pinnedPages,
|
|
|
|
pinnedClipId:
|
|
|
|
instance.privateMode && !me ? [] : instance.pinnedClipId,
|
|
|
|
cacheRemoteFiles: instance.cacheRemoteFiles,
|
2024-03-01 11:26:28 +00:00
|
|
|
markLocalFilesNsfwByDefault: instance.markLocalFilesNsfwByDefault,
|
2023-01-13 04:40:33 +00:00
|
|
|
requireSetup:
|
|
|
|
(await Users.countBy({
|
|
|
|
host: IsNull(),
|
2023-02-13 04:18:45 +00:00
|
|
|
isAdmin: true,
|
2023-01-13 04:40:33 +00:00
|
|
|
})) === 0,
|
2024-03-28 05:25:33 +00:00
|
|
|
}
|
2023-01-13 04:40:33 +00:00
|
|
|
: {}),
|
2018-11-06 15:08:21 +00:00
|
|
|
};
|
2018-11-02 14:23:01 +00:00
|
|
|
|
2018-11-06 15:08:21 +00:00
|
|
|
if (ps.detail) {
|
2021-07-20 18:51:59 +00:00
|
|
|
if (!instance.privateMode || me) {
|
2023-01-13 04:40:33 +00:00
|
|
|
const proxyAccount = instance.proxyAccountId
|
|
|
|
? await Users.pack(instance.proxyAccountId).catch(() => null)
|
|
|
|
: null;
|
2021-07-20 18:51:59 +00:00
|
|
|
response.proxyAccountName = proxyAccount ? proxyAccount.username : null;
|
|
|
|
}
|
2020-11-17 05:59:15 +00:00
|
|
|
|
2018-11-06 15:08:21 +00:00
|
|
|
response.features = {
|
2018-11-05 22:14:43 +00:00
|
|
|
registration: !instance.disableRegistration,
|
|
|
|
localTimeLine: !instance.disableLocalTimeline,
|
2022-07-29 04:49:36 +00:00
|
|
|
recommendedTimeline: !instance.disableRecommendedTimeline,
|
2019-01-16 05:54:14 +00:00
|
|
|
globalTimeLine: !instance.disableGlobalTimeline,
|
2024-03-01 15:19:05 +00:00
|
|
|
guestTimeline: instance.enableGuestTimeline,
|
2021-10-08 04:37:02 +00:00
|
|
|
emailRequiredForSignup: instance.emailRequiredForSignup,
|
2020-04-28 05:29:33 +00:00
|
|
|
hcaptcha: instance.enableHcaptcha,
|
2018-11-06 15:08:21 +00:00
|
|
|
recaptcha: instance.enableRecaptcha,
|
2019-05-15 16:07:32 +00:00
|
|
|
objectStorage: instance.useObjectStorage,
|
2018-12-19 19:08:13 +00:00
|
|
|
serviceWorker: instance.enableServiceWorker,
|
2023-07-02 03:00:51 +00:00
|
|
|
postEditing: true,
|
2023-06-06 04:15:49 +00:00
|
|
|
postImports: instance.experimentalFeatures?.postImports || false,
|
2020-03-29 08:44:14 +00:00
|
|
|
miauth: true,
|
2018-11-06 15:08:21 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-02-22 02:46:58 +00:00
|
|
|
return response;
|
|
|
|
});
|