From a56738a331006b487869e61e4fd1023844275fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Tue, 7 May 2019 20:55:37 +0900 Subject: [PATCH 01/11] Update README.md [AUTOGEN] (#4877) --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1ee61e225..b0ef6950a 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ Please see the [Contribution Guide](./CONTRIBUTING.md). + @@ -112,6 +113,7 @@ Please see the [Contribution Guide](./CONTRIBUTING.md). + @@ -127,7 +129,6 @@ Please see the [Contribution Guide](./CONTRIBUTING.md). - @@ -138,9 +139,9 @@ Please see the [Contribution Guide](./CONTRIBUTING.md). -
Hiroshi Seki weepjpkiritan ne_moni Melilot osapon
Hiroshi Seki weepjpkiritan ne_moni Melilot osaponYUKIMOCHI Sampot sheeta.sSatsuki Yanagi
YuzuRyo61 gutfuckllcYUKIMOCHI Sampot sheeta.sSatsuki Yanagi
+ @@ -149,8 +150,8 @@ Please see the [Contribution Guide](./CONTRIBUTING.md). - + @@ -159,17 +160,18 @@ Please see the [Contribution Guide](./CONTRIBUTING.md). -
Satsuki Yanagi takimura Damillora Atsuko TominagaCG Hekovic dansupGargron
Satsuki Yanagi takimura Damillora Atsuko TominagaCG Hekovic dansupGargron
+ +
Gargron Nokotaro Takeda Takashi Shibuya
Gargron Nokotaro Takeda Takashi Shibuya
-**Last updated:** Fri, 03 May 2019 05:33:07 UTC +**Last updated:** Tue, 07 May 2019 11:55:07 UTC :four_leaf_clover: Copyright From 1ff5151786d9c39ce4eb9ee6205334350a588792 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Thu, 9 May 2019 15:42:56 +0900 Subject: [PATCH 02/11] =?UTF-8?q?Fix:=20=E3=81=BF=E3=81=A4=E3=81=91?= =?UTF-8?q?=E3=82=8B=E3=81=A7=E4=BA=BA=E6=B0=97=E3=81=AE=E3=82=BF=E3=82=B0?= =?UTF-8?q?=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84?= =?UTF-8?q?=20(#4883)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/app/common/views/pages/explore.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/app/common/views/pages/explore.vue b/src/client/app/common/views/pages/explore.vue index 67e92af44..de31ca36c 100644 --- a/src/client/app/common/views/pages/explore.vue +++ b/src/client/app/common/views/pages/explore.vue @@ -13,8 +13,8 @@
- {{ tag.name }} - {{ tag.name }} + {{ tag.tag }} + {{ tag.tag }}
From 9e20fc5c88683d92a0bd9aade4ef6085bfb27e8c Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Thu, 9 May 2019 15:43:31 +0900 Subject: [PATCH 03/11] Validate Note on createNote (#4881) --- src/remote/activitypub/models/note.ts | 28 +++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/remote/activitypub/models/note.ts b/src/remote/activitypub/models/note.ts index d7ca62552..bb9465d90 100644 --- a/src/remote/activitypub/models/note.ts +++ b/src/remote/activitypub/models/note.ts @@ -25,6 +25,28 @@ import { ensure } from '../../../prelude/ensure'; const logger = apLogger; +export function validateNote(object: any, uri: string) { + const expectHost = extractDbHost(uri); + + if (object == null) { + return new Error('invalid Note: object is null'); + } + + if (!['Note', 'Question', 'Article'].includes(object.type)) { + return new Error(`invalid Note: invalied object type ${object.type}`); + } + + if (object.id && extractDbHost(object.id) !== expectHost) { + return new Error(`invalid Note: id has different host. expected: ${expectHost}, actual: ${extractDbHost(object.id)}`); + } + + if (object.attributedTo && extractDbHost(object.attributedTo) !== expectHost) { + return new Error(`invalid Note: attributedTo has different host. expected: ${expectHost}, actual: ${extractDbHost(object.attributedTo)}`); + } + + return null; +} + /** * Noteをフェッチします。 * @@ -59,8 +81,10 @@ export async function createNote(value: any, resolver?: Resolver, silent = false const object: any = await resolver.resolve(value); - if (!object || !['Note', 'Question', 'Article'].includes(object.type)) { - logger.error(`invalid note: ${value}`, { + const entryUri = value.id || value; + const err = validateNote(object, entryUri); + if (err) { + logger.error(`${err.message}`, { resolver: { history: resolver.getHistory() }, From 168de3c31674048856399faf549fcadbe7b4bf02 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 9 May 2019 23:27:34 +0900 Subject: [PATCH 04/11] Resolve #4870 --- locales/ja-JP.yml | 9 --- src/client/app/admin/views/users.user.vue | 2 - src/client/app/admin/views/users.vue | 61 +------------------ .../common/views/components/note-header.vue | 5 -- src/client/app/common/views/pages/explore.vue | 9 --- src/models/entities/user.ts | 5 -- src/models/repositories/user.ts | 5 -- src/server/api/endpoints/admin/show-users.ts | 2 - .../api/endpoints/admin/unverify-user.ts | 38 ------------ src/server/api/endpoints/admin/verify-user.ts | 38 ------------ src/server/api/endpoints/users.ts | 2 - 11 files changed, 2 insertions(+), 174 deletions(-) delete mode 100644 src/server/api/endpoints/admin/unverify-user.ts delete mode 100644 src/server/api/endpoints/admin/verify-user.ts diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index c9f7436a9..f1cfec046 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -263,7 +263,6 @@ common: update-available-title: "更新があります" update-available: "Misskeyの新しいバージョンがあります({newer}。現在{current}を利用中)。ページを再度読み込みすると更新が適用されます。" my-token-regenerated: "あなたのトークンが更新されたのでサインアウトします。" - verified-user: "公式アカウント" hide-password: "パスワードを隠す" show-password: "パスワードを表示する" @@ -339,7 +338,6 @@ auth/views/index.vue: sign-in: "サインインしてください" common/views/pages/explore.vue: - verified-users: "公式アカウント" popular-users: "人気のユーザー" recently-updated-users: "最近投稿したユーザー" recently-registered-users: "新規ユーザー" @@ -1351,12 +1349,6 @@ admin/views/users.vue: silence-confirm: "サイレンスしますか?" unmake-silence: "サイレンスの解除" unsilence-confirm: "サイレンスを解除しますか?" - verify: "公式アカウントにする" - verify-confirm: "公式アカウントにしますか?" - verified: "公式アカウントにしました" - unverify: "公式アカウントを解除する" - unverify-confirm: "公式アカウントを解除しますか?" - unverified: "公式アカウントを解除しました" update-remote-user: "リモートユーザー情報の更新" remote-user-updated: "リモートユーザー情報を更新しました" users: @@ -1373,7 +1365,6 @@ admin/views/users.vue: admin: "管理者" moderator: "モデレーター" adminOrModerator: "管理者+モデレーター" - verified: "公式アカウント" silenced: "サイレンス済み" suspended: "凍結済み" origin: diff --git a/src/client/app/admin/views/users.user.vue b/src/client/app/admin/views/users.user.vue index 096e017e6..929fc8f4b 100644 --- a/src/client/app/admin/views/users.user.vue +++ b/src/client/app/admin/views/users.user.vue @@ -11,7 +11,6 @@ @{{ user | acct }} admin moderator - @@ -77,7 +76,6 @@ export default Vue.extend({ background var(--noteHeaderAdminBg) color var(--noteHeaderAdminFg) - > .is-verified > .is-silenced > .is-suspended margin 0 0 0 .5em diff --git a/src/client/app/admin/views/users.vue b/src/client/app/admin/views/users.vue index 2d6aef337..cc3810853 100644 --- a/src/client/app/admin/views/users.vue +++ b/src/client/app/admin/views/users.vue @@ -12,10 +12,6 @@
{{ $t('reset-password') }} - - {{ $t('verify') }} - {{ $t('unverify') }} - {{ $t('make-silence') }} {{ $t('unmake-silence') }} @@ -47,7 +43,6 @@ - @@ -71,7 +66,7 @@ import Vue from 'vue'; import i18n from '../../i18n'; import parseAcct from "../../../../misc/acct/parse"; -import { faCertificate, faUsers, faTerminal, faSearch, faKey, faSync, faMicrophoneSlash } from '@fortawesome/free-solid-svg-icons'; +import { faUsers, faTerminal, faSearch, faKey, faSync, faMicrophoneSlash } from '@fortawesome/free-solid-svg-icons'; import { faSnowflake } from '@fortawesome/free-regular-svg-icons'; import XUser from './users.user.vue'; @@ -84,8 +79,6 @@ export default Vue.extend({ return { user: null, target: null, - verifying: false, - unverifying: false, suspending: false, unsuspending: false, sort: '+createdAt', @@ -95,7 +88,7 @@ export default Vue.extend({ offset: 0, users: [], existMore: false, - faTerminal, faCertificate, faUsers, faSnowflake, faSearch, faKey, faSync, faMicrophoneSlash + faTerminal, faUsers, faSnowflake, faSearch, faKey, faSync, faMicrophoneSlash }; }, @@ -181,56 +174,6 @@ export default Vue.extend({ }); }, - async verifyUser() { - if (!await this.getConfirmed(this.$t('verify-confirm'))) return; - - this.verifying = true; - - const process = async () => { - await this.$root.api('admin/verify-user', { userId: this.user.id }); - this.$root.dialog({ - type: 'success', - text: this.$t('verified') - }); - }; - - await process().catch(e => { - this.$root.dialog({ - type: 'error', - text: e.toString() - }); - }); - - this.verifying = false; - - this.refreshUser(); - }, - - async unverifyUser() { - if (!await this.getConfirmed(this.$t('unverify-confirm'))) return; - - this.unverifying = true; - - const process = async () => { - await this.$root.api('admin/unverify-user', { userId: this.user.id }); - this.$root.dialog({ - type: 'success', - text: this.$t('unverified') - }); - }; - - await process().catch(e => { - this.$root.dialog({ - type: 'error', - text: e.toString() - }); - }); - - this.unverifying = false; - - this.refreshUser(); - }, - async silenceUser() { if (!await this.getConfirmed(this.$t('silence-confirm'))) return; diff --git a/src/client/app/common/views/components/note-header.vue b/src/client/app/common/views/components/note-header.vue index 26c9c7b7d..a72863e1d 100644 --- a/src/client/app/common/views/components/note-header.vue +++ b/src/client/app/common/views/components/note-header.vue @@ -8,7 +8,6 @@ bot cat -
via {{ note.app.name }} @@ -95,10 +94,6 @@ export default Vue.extend({ color var(--noteHeaderAcct) flex-shrink 2147483647 - > .is-verified - margin 0 .5em 0 0 - color #4dabf7 - > .info margin-left auto font-size 0.9em diff --git a/src/client/app/common/views/pages/explore.vue b/src/client/app/common/views/pages/explore.vue index de31ca36c..107603d69 100644 --- a/src/client/app/common/views/pages/explore.vue +++ b/src/client/app/common/views/pages/explore.vue @@ -26,9 +26,6 @@