diff --git a/packages/backend/src/server/api/endpoints/antennas/create.ts b/packages/backend/src/server/api/endpoints/antennas/create.ts index c1ba7bcdfd..f69501ae20 100644 --- a/packages/backend/src/server/api/endpoints/antennas/create.ts +++ b/packages/backend/src/server/api/endpoints/antennas/create.ts @@ -23,6 +23,12 @@ export const meta = { code: "NO_SUCH_USER_GROUP", id: "aa3c0b9a-8cae-47c0-92ac-202ce5906682", }, + + tooManyAntennas: { + message: "Too many antennas.", + code: "TOO_MANY_ANTENNAS", + id: "c3a5a51e-04d4-11ee-be56-0242ac120002", + }, }, res: { @@ -97,6 +103,13 @@ export default define(meta, paramDef, async (ps, user) => { let userList; let userGroupJoining; + const antennas = await Antennas.findBy({ + userId: user.id, + }); + if (antennas.length > 5 && !user.isAdmin) { + throw new ApiError(meta.errors.tooManyAntennas); + } + if (ps.src === "list" && ps.userListId) { userList = await UserLists.findOneBy({ id: ps.userListId, diff --git a/packages/backend/src/server/api/endpoints/meta.ts b/packages/backend/src/server/api/endpoints/meta.ts index 14256eb7bf..f6c978b2de 100644 --- a/packages/backend/src/server/api/endpoints/meta.ts +++ b/packages/backend/src/server/api/endpoints/meta.ts @@ -323,7 +323,7 @@ export const meta = { optional: false, nullable: false, }, - elasticsearch: { + searchFilters: { type: "boolean", optional: false, nullable: false, @@ -521,7 +521,7 @@ export default define(meta, paramDef, async (ps, me) => { recommendedTimeline: !instance.disableRecommendedTimeline, globalTimeLine: !instance.disableGlobalTimeline, emailRequiredForSignup: instance.emailRequiredForSignup, - elasticsearch: config.elasticsearch ? true : false, + searchFilters: config.meilisearch ? true : false, hcaptcha: instance.enableHcaptcha, recaptcha: instance.enableRecaptcha, objectStorage: instance.useObjectStorage, diff --git a/packages/backend/src/server/nodeinfo.ts b/packages/backend/src/server/nodeinfo.ts index 2a0e1981a4..18e04f4209 100644 --- a/packages/backend/src/server/nodeinfo.ts +++ b/packages/backend/src/server/nodeinfo.ts @@ -82,6 +82,9 @@ const nodeinfo2 = async () => { disableRecommendedTimeline: meta.disableRecommendedTimeline, disableGlobalTimeline: meta.disableGlobalTimeline, emailRequiredForSignup: meta.emailRequiredForSignup, + searchFilters: config.meilisearch ? true : false, + postEditing: meta.experimentalFeatures?.postEditing || false, + postImports: meta.experimentalFeatures?.postImports || false, enableHcaptcha: meta.enableHcaptcha, enableRecaptcha: meta.enableRecaptcha, maxNoteTextLength: MAX_NOTE_TEXT_LENGTH, diff --git a/packages/backend/src/server/web/index.ts b/packages/backend/src/server/web/index.ts index 0d4034f55d..c876635a3c 100644 --- a/packages/backend/src/server/web/index.ts +++ b/packages/backend/src/server/web/index.ts @@ -422,6 +422,10 @@ router.get("/notes/:note", async (ctx, next) => { }); ctx.set("Cache-Control", "public, max-age=15"); + ctx.set( + "Content-Security-Policy", + "default-src 'self'; frame-ancestors '*'", + ); return; } diff --git a/packages/client/src/scripts/search.ts b/packages/client/src/scripts/search.ts index 03f61f1f0b..a0382532f6 100644 --- a/packages/client/src/scripts/search.ts +++ b/packages/client/src/scripts/search.ts @@ -1,6 +1,7 @@ import * as os from "@/os"; import { i18n } from "@/i18n"; import { mainRouter } from "@/router"; +// import { instance } from "@/instance"; export async function search() { // const searchOptions = @@ -14,6 +15,8 @@ export async function search() { // "filter:following => show results only from users you follow\n" + // "filter:followers => show results only from followers\n"; + // const searchFiltersAvailable = instance.searchFilters; + const { canceled, result: query } = await os.inputText({ title: i18n.ts.search, placeholder: i18n.ts.searchPlaceholder, diff --git a/packages/client/src/widgets/server-metric/index.vue b/packages/client/src/widgets/server-metric/index.vue index 1eb9f56b8a..8ecdeb1965 100644 --- a/packages/client/src/widgets/server-metric/index.vue +++ b/packages/client/src/widgets/server-metric/index.vue @@ -39,7 +39,7 @@ :meta="meta" /> @@ -67,6 +67,7 @@ import { GetFormResultType } from "@/scripts/form"; import * as os from "@/os"; import { stream } from "@/stream"; import { i18n } from "@/i18n"; +import { instance } from "@/instance"; const name = "serverMetric"; @@ -108,7 +109,10 @@ os.api("server-info", {}).then((res) => { }); const toggleView = () => { - if (widgetProps.view === 5) { + if ( + (widgetProps.view === 5 && instance.searchFilters) || + (widgetProps.view === 4 && !instance.searchFilters) + ) { widgetProps.view = 0; } else { widgetProps.view++; diff --git a/packages/sw/package.json b/packages/sw/package.json index f64bbfd0a4..001803825a 100644 --- a/packages/sw/package.json +++ b/packages/sw/package.json @@ -5,7 +5,7 @@ "build": "webpack", "watch": "pnpm swc src -d built -D -w", "lint": "pnpm rome check \"src/**/*.ts\"", - "format": "pnpm rome format * --write && pnpm rome check --apply *" + "format": "pnpm rome format * --write" }, "devDependencies": { "@swc/cli": "^0.1.62", diff --git a/packages/sw/src/scripts/create-notification.ts b/packages/sw/src/scripts/create-notification.ts index 01b9ab5888..03ce2a60d5 100644 --- a/packages/sw/src/scripts/create-notification.ts +++ b/packages/sw/src/scripts/create-notification.ts @@ -1,7 +1,7 @@ /* * Notification manager for SW */ -declare var self: ServiceWorkerGlobalScope; +declare let self: ServiceWorkerGlobalScope; import { swLang } from "@/scripts/lang"; import { cli } from "@/scripts/operations"; @@ -45,7 +45,7 @@ async function composeNotification( */ case "notification": switch (data.body.type) { - case "follow": + case "follow": { // users/showの型定義をswos.apiへ当てはめるのが困難なのでapiFetch.requestを直接使用 const account = await getAccountFromId(data.userId); if (!account) return null; @@ -71,6 +71,7 @@ async function composeNotification( ], }, ]; + } case "mention": return [ @@ -157,7 +158,7 @@ async function composeNotification( }, ]; - case "reaction": + case "reaction": { let reaction = data.body.reaction; let badge: string | undefined; @@ -214,6 +215,7 @@ async function composeNotification( ], }, ]; + } case "pollVote": return [ diff --git a/packages/sw/src/scripts/lang.ts b/packages/sw/src/scripts/lang.ts index da4f315266..31cfb7bd3e 100644 --- a/packages/sw/src/scripts/lang.ts +++ b/packages/sw/src/scripts/lang.ts @@ -1,7 +1,7 @@ /* * Language manager for SW */ -declare var self: ServiceWorkerGlobalScope; +declare let self: ServiceWorkerGlobalScope; import { get, set } from "idb-keyval"; import { I18n } from "@/scripts/i18n"; @@ -23,7 +23,7 @@ class SwLang { public i18n: Promise> | null = null; public fetchLocale() { - return (this.i18n = this._fetch()); + return this.i18n === this._fetch(); } private async _fetch() { diff --git a/packages/sw/src/scripts/notification-read.ts b/packages/sw/src/scripts/notification-read.ts index 5b2030d989..9ea4528776 100644 --- a/packages/sw/src/scripts/notification-read.ts +++ b/packages/sw/src/scripts/notification-read.ts @@ -1,4 +1,4 @@ -declare var self: ServiceWorkerGlobalScope; +declare let self: ServiceWorkerGlobalScope; import { get } from "idb-keyval"; import { pushNotificationDataMap } from "@/types"; diff --git a/packages/sw/src/scripts/operations.ts b/packages/sw/src/scripts/operations.ts index a192a9bd7e..ae76d6ecff 100644 --- a/packages/sw/src/scripts/operations.ts +++ b/packages/sw/src/scripts/operations.ts @@ -2,7 +2,7 @@ * Operations * 各種操作 */ -declare var self: ServiceWorkerGlobalScope; +declare let self: ServiceWorkerGlobalScope; import * as Misskey from "calckey-js"; import { SwMessage, swMessageOrderType } from "@/types"; diff --git a/packages/sw/src/sw.ts b/packages/sw/src/sw.ts index 0733400fc3..74603d67ca 100644 --- a/packages/sw/src/sw.ts +++ b/packages/sw/src/sw.ts @@ -1,4 +1,4 @@ -declare var self: ServiceWorkerGlobalScope; +declare let self: ServiceWorkerGlobalScope; import { createEmptyNotification, diff --git a/patrons.json b/patrons.json index cd20886f6e..d5e039696c 100644 --- a/patrons.json +++ b/patrons.json @@ -47,6 +47,11 @@ "@natalie@prismst.one", "@KelsonV@wandering.shop", "@breakfastmtn@calckey.social", + "@richardazia@mastodon.social", + "@joestone@calckey.social", + "@aj@calckey.social", + "@zepfanman@ramblingreaders.org", + "@kimby@stop.voring.me", "\nInterkosmos Link" ] } diff --git a/rome.json b/rome.json index 09db5f75e2..37d738b553 100644 --- a/rome.json +++ b/rome.json @@ -13,7 +13,7 @@ "packages/*/package-lock.json", "packages/backend/src/server/web/manifest.ts", "packages/backend/built/", - "packages/backend/nsfw-model/", + "*/model.json", "packages/client/src/emojilist.json", "*.md", "**/tsconfig.json",