From 4ea7b2dd63491e4cdcf8b5bf3896fa666e73a84f Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Sep 2021 03:26:36 +0900 Subject: [PATCH 1/9] fix(server): fix #7786 --- CHANGELOG.md | 1 + src/queue/processors/db/export-blocking.ts | 2 +- src/queue/processors/db/export-following.ts | 2 +- src/queue/processors/db/export-mute.ts | 2 +- src/queue/processors/db/export-notes.ts | 2 +- src/queue/processors/db/export-user-lists.ts | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a25f6fa67..b2b99ff72a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - UIの改善 ### Bugfixes +- アカウントデータのエクスポート/インポート処理ができない問題を修正 - popupで設定ページを表示すると、アカウントの削除ページにアクセスすることができない問題を修正 ## 12.90.1 (2021/09/05) diff --git a/src/queue/processors/db/export-blocking.ts b/src/queue/processors/db/export-blocking.ts index a0fc385006..8b8aa259d4 100644 --- a/src/queue/processors/db/export-blocking.ts +++ b/src/queue/processors/db/export-blocking.ts @@ -4,7 +4,7 @@ import * as fs from 'fs'; import { queueLogger } from '../../logger'; import addFile from '@/services/drive/add-file'; -import dateFormat from 'dateformat'; +import * as dateFormat from 'dateformat'; import { getFullApAccount } from '@/misc/convert-host'; import { Users, Blockings } from '@/models/index'; import { MoreThan } from 'typeorm'; diff --git a/src/queue/processors/db/export-following.ts b/src/queue/processors/db/export-following.ts index 3612150363..a0ecf5f560 100644 --- a/src/queue/processors/db/export-following.ts +++ b/src/queue/processors/db/export-following.ts @@ -4,7 +4,7 @@ import * as fs from 'fs'; import { queueLogger } from '../../logger'; import addFile from '@/services/drive/add-file'; -import dateFormat from 'dateformat'; +import * as dateFormat from 'dateformat'; import { getFullApAccount } from '@/misc/convert-host'; import { Users, Followings } from '@/models/index'; import { MoreThan } from 'typeorm'; diff --git a/src/queue/processors/db/export-mute.ts b/src/queue/processors/db/export-mute.ts index 70b2272cdb..d5976f7d56 100644 --- a/src/queue/processors/db/export-mute.ts +++ b/src/queue/processors/db/export-mute.ts @@ -4,7 +4,7 @@ import * as fs from 'fs'; import { queueLogger } from '../../logger'; import addFile from '@/services/drive/add-file'; -import dateFormat from 'dateformat'; +import * as dateFormat from 'dateformat'; import { getFullApAccount } from '@/misc/convert-host'; import { Users, Mutings } from '@/models/index'; import { MoreThan } from 'typeorm'; diff --git a/src/queue/processors/db/export-notes.ts b/src/queue/processors/db/export-notes.ts index 3f146aff1b..49850aa706 100644 --- a/src/queue/processors/db/export-notes.ts +++ b/src/queue/processors/db/export-notes.ts @@ -4,7 +4,7 @@ import * as fs from 'fs'; import { queueLogger } from '../../logger'; import addFile from '@/services/drive/add-file'; -import dateFormat from 'dateformat'; +import * as dateFormat from 'dateformat'; import { Users, Notes, Polls } from '@/models/index'; import { MoreThan } from 'typeorm'; import { Note } from '@/models/entities/note'; diff --git a/src/queue/processors/db/export-user-lists.ts b/src/queue/processors/db/export-user-lists.ts index 89bbd5af18..8a86c4df5d 100644 --- a/src/queue/processors/db/export-user-lists.ts +++ b/src/queue/processors/db/export-user-lists.ts @@ -4,7 +4,7 @@ import * as fs from 'fs'; import { queueLogger } from '../../logger'; import addFile from '@/services/drive/add-file'; -import dateFormat from 'dateformat'; +import * as dateFormat from 'dateformat'; import { getFullApAccount } from '@/misc/convert-host'; import { Users, UserLists, UserListJoinings } from '@/models/index'; import { In } from 'typeorm'; From 4f63eb0c7e4d23348ff26d613a5d8d135a6a0378 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Sep 2021 03:26:52 +0900 Subject: [PATCH 2/9] add sponsors section --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 816765af67..0aae1b3329 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,12 @@ Related projects - [misskey.js](https://github.com/misskey-dev/misskey.js) - Misskey SDK for JavaScript - [mfm.js](https://github.com/misskey-dev/mfm.js) - MFM parser +Sponsors +---------------------------------------------------------------- +
+ RSS3 +
+ :heart: Backers ---------------------------------------------------------------- From 07bb8067ae62fffe8857c91c7d9f75ccba16789e Mon Sep 17 00:00:00 2001 From: sousuke0422 Date: Sat, 18 Sep 2021 13:30:28 +0900 Subject: [PATCH 3/9] =?UTF-8?q?fix:=20=E3=82=A2=E3=83=B3=E3=83=86=E3=83=8A?= =?UTF-8?q?=E3=81=AE=E6=97=A2=E8=AA=AD=20(#7803)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit from: https://gitlab.com/xianon/misskey/-/commit/a89742319caea378f9cdd70c8ebd83bdf2178ff6 --- src/server/api/endpoints/antennas/notes.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/api/endpoints/antennas/notes.ts b/src/server/api/endpoints/antennas/notes.ts index 3c8a4fbdae..1759e95b4c 100644 --- a/src/server/api/endpoints/antennas/notes.ts +++ b/src/server/api/endpoints/antennas/notes.ts @@ -1,6 +1,7 @@ import $ from 'cafy'; import { ID } from '@/misc/cafy-id'; import define from '../../define'; +import readNote from '@/services/note/read'; import { Antennas, Notes, AntennaNotes } from '@/models/index'; import { makePaginationQuery } from '../../common/make-pagination-query'; import { generateVisibilityQuery } from '../../common/generate-visibility-query'; @@ -84,5 +85,9 @@ export default define(meta, async (ps, user) => { .take(ps.limit!) .getMany(); + if (notes.length > 0) { + readNote(user.id, notes); + } + return await Notes.packMany(notes, user); }); From 4b2afec108466b7fa27b4480f7a99839ba154f92 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Sep 2021 13:31:09 +0900 Subject: [PATCH 4/9] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2b99ff72a..3a58d8d18d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ ### Bugfixes - アカウントデータのエクスポート/インポート処理ができない問題を修正 +- アンテナの既読が付かない問題を修正 - popupで設定ページを表示すると、アカウントの削除ページにアクセスすることができない問題を修正 ## 12.90.1 (2021/09/05) From 4422219be7dcc2b8eb214817feff75dfbd2a0b8c Mon Sep 17 00:00:00 2001 From: tamaina Date: Sat, 18 Sep 2021 15:31:32 +0900 Subject: [PATCH 5/9] =?UTF-8?q?fix:=20=E3=82=A2=E3=83=B3=E3=83=86=E3=83=8A?= =?UTF-8?q?=E3=81=8C=E6=97=A2=E8=AA=AD=E3=81=AB=E3=81=AA=E3=82=89=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=20(#7809)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/note/read.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/note/read.ts b/src/services/note/read.ts index 2e221d553a..b5e7de7976 100644 --- a/src/services/note/read.ts +++ b/src/services/note/read.ts @@ -52,7 +52,7 @@ export default async function( if (note.user != null) { // たぶんnullになることは無いはずだけど一応 for (const antenna of myAntennas) { - if (checkHitAntenna(antenna, note, note.user as any, undefined, Array.from(following))) { + if (await checkHitAntenna(antenna, note, note.user as any, undefined, Array.from(following))) { readAntennaNotes.push(note); } } From 5141afe476fdc0312bb9bbcf127d3fef5dc7ec9f Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Sep 2021 15:39:01 +0900 Subject: [PATCH 6/9] =?UTF-8?q?fix(client):=20=E3=82=BF=E3=82=A4=E3=83=A0?= =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=B3=E3=81=A7=E3=83=AA=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=81=A8=E3=81=8B=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/pages/timeline.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/client/pages/timeline.vue b/src/client/pages/timeline.vue index 125191223c..4b5b90e6ae 100644 --- a/src/client/pages/timeline.vue +++ b/src/client/pages/timeline.vue @@ -51,6 +51,18 @@ export default defineComponent({ icon: this.src === 'local' ? 'fas fa-comments' : this.src === 'social' ? 'fas fa-share-alt' : this.src === 'global' ? 'fas fa-globe' : 'fas fa-home', bg: 'var(--bg)', actions: [{ + icon: 'fas fa-list-ul', + text: this.$ts.lists, + handler: this.chooseList + }, { + icon: 'fas fa-satellite', + text: this.$ts.antennas, + handler: this.chooseAntenna + }, { + icon: 'fas fa-satellite-dish', + text: this.$ts.channel, + handler: this.chooseChannel + }, { icon: 'fas fa-calendar-alt', text: this.$ts.jumpToSpecifiedDate, handler: this.timetravel From d5702f9d51b0d29cfc6fdb464f31ab41ff4fd2cd Mon Sep 17 00:00:00 2001 From: nullobsi Date: Fri, 17 Sep 2021 23:45:02 -0700 Subject: [PATCH 7/9] add resolver check for blocked instance (#7777) * add resolver check for blocked instance * lint * Update note.ts --- src/remote/activitypub/resolver.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/remote/activitypub/resolver.ts b/src/remote/activitypub/resolver.ts index 32f3d9ef26..f392a65e3a 100644 --- a/src/remote/activitypub/resolver.ts +++ b/src/remote/activitypub/resolver.ts @@ -4,6 +4,8 @@ import { ILocalUser } from '@/models/entities/user'; import { getInstanceActor } from '@/services/instance-actor'; import { signedGet } from './request'; import { IObject, isCollectionOrOrderedCollection, ICollection, IOrderedCollection } from './type'; +import { fetchMeta } from '@/misc/fetch-meta'; +import { extractDbHost } from '@/misc/convert-host'; export default class Resolver { private history: Set; @@ -44,6 +46,12 @@ export default class Resolver { this.history.add(value); + const meta = await fetchMeta(); + const host = extractDbHost(value); + if (meta.blockedHosts.includes(host)) { + throw new Error('Instance is blocked'); + } + if (config.signToActivityPubGet && !this.user) { this.user = await getInstanceActor(); } From 502bde55671b98d6f13f07cbb782f6b9214a90f3 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Sep 2021 15:45:45 +0900 Subject: [PATCH 8/9] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a58d8d18d..dce25340f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,8 @@ ## 12.x.x (unreleased) ### Improvements -- リモートユーザーのDeleteアクティビティに対応 +- ActivityPub: リモートユーザーのDeleteアクティビティに対応 +- ActivityPub: add resolver check for blocked instance - UIの改善 ### Bugfixes From a6958da0917ebe981b18f0feefe65a51cef30b6d Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Sep 2021 17:58:37 +0900 Subject: [PATCH 9/9] =?UTF-8?q?enhance(server):=20=E3=82=A2=E3=82=AB?= =?UTF-8?q?=E3=82=A6=E3=83=B3=E3=83=88=E3=81=8C=E5=87=8D=E7=B5=90=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=9F=E3=81=A8=E3=81=8D=E3=81=AE=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E3=82=92=E5=88=A4=E5=AE=9A=E3=81=97=E3=82=84=E3=81=99?= =?UTF-8?q?=E3=81=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/api/call.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/server/api/call.ts b/src/server/api/call.ts index 2768bde07e..bd86ffdc35 100644 --- a/src/server/api/call.ts +++ b/src/server/api/call.ts @@ -40,7 +40,12 @@ export default async (endpoint: string, user: User | null | undefined, token: Ac } if (ep.meta.requireCredential && user!.isSuspended) { - throw new ApiError(accessDenied, { reason: 'Your account has been suspended.' }); + throw new ApiError({ + message: 'Your account has been suspended.', + code: 'YOUR_ACCOUNT_SUSPENDED', + id: 'a8c724b3-6e9c-4b46-b1a8-bc3ed6258370', + httpStatusCode: 403 + }); } if (ep.meta.requireAdmin && !user!.isAdmin) {