From 5245430a79d7cbf06f526434dda1150676b8eb7b Mon Sep 17 00:00:00 2001
From: syuilo <4439005+syuilo@users.noreply.github.com>
Date: Thu, 3 Oct 2024 13:10:28 +0900
Subject: [PATCH 1/7] wip
---
packages/backend/src/server/api/SigninService.ts | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/packages/backend/src/server/api/SigninService.ts b/packages/backend/src/server/api/SigninService.ts
index 70306c31135b..f31e5aeaba80 100644
--- a/packages/backend/src/server/api/SigninService.ts
+++ b/packages/backend/src/server/api/SigninService.ts
@@ -5,12 +5,13 @@
import { Inject, Injectable } from '@nestjs/common';
import { DI } from '@/di-symbols.js';
-import type { SigninsRepository } from '@/models/_.js';
+import type { SigninsRepository, UserProfilesRepository } from '@/models/_.js';
import { IdService } from '@/core/IdService.js';
import type { MiLocalUser } from '@/models/User.js';
import { GlobalEventService } from '@/core/GlobalEventService.js';
import { SigninEntityService } from '@/core/entities/SigninEntityService.js';
import { bindThis } from '@/decorators.js';
+import { EmailService } from '@/core/EmailService.js';
import type { FastifyRequest, FastifyReply } from 'fastify';
@Injectable()
@@ -19,7 +20,11 @@ export class SigninService {
@Inject(DI.signinsRepository)
private signinsRepository: SigninsRepository,
+ @Inject(DI.userProfilesRepository)
+ private userProfilesRepository: UserProfilesRepository,
+
private signinEntityService: SigninEntityService,
+ private emailService: EmailService,
private idService: IdService,
private globalEventService: GlobalEventService,
) {
@@ -28,7 +33,6 @@ export class SigninService {
@bindThis
public signin(request: FastifyRequest, reply: FastifyReply, user: MiLocalUser) {
setImmediate(async () => {
- // Append signin history
const record = await this.signinsRepository.insertOne({
id: this.idService.gen(),
userId: user.id,
@@ -37,8 +41,14 @@ export class SigninService {
success: true,
});
- // Publish signin event
this.globalEventService.publishMainStream(user.id, 'signin', await this.signinEntityService.pack(record));
+
+ const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id });
+ if (profile.email && profile.emailVerified) {
+ this.emailService.sendEmail(profile.email, 'New login / ログインがありました',
+ 'There is a new login. If you do not recognize this login, update the security status of your account, including changing your password. / 新しいログインがありました。このログインに心当たりがない場合は、パスワードを変更するなど、アカウントのセキュリティ状態を更新してください。',
+ 'There is a new login. If you do not recognize this login, update the security status of your account, including changing your password. / 新しいログインがありました。このログインに心当たりがない場合は、パスワードを変更するなど、アカウントのセキュリティ状態を更新してください。');
+ }
});
reply.code(200);
From ed2c2e12862bab22ae9c93ff5ad96cdc34bbdaff Mon Sep 17 00:00:00 2001
From: syuilo <4439005+syuilo@users.noreply.github.com>
Date: Thu, 3 Oct 2024 13:10:58 +0900
Subject: [PATCH 2/7] Update CHANGELOG.md
---
CHANGELOG.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8f0fd24c449c..72c3b22d69bd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,7 @@
- Enhance: フォロワーへのメッセージ欄のデザイン改良
### Server
--
+- Enhance: セキュリティ向上のため、ログイン時にメール通知を行うように
## 2024.9.0
From 234e803d10cb7af043cb3632d8a792333375c20a Mon Sep 17 00:00:00 2001
From: syuilo <4439005+syuilo@users.noreply.github.com>
Date: Thu, 3 Oct 2024 13:31:50 +0900
Subject: [PATCH 3/7] wip
---
locales/ja-JP.yml | 2 ++
packages/backend/src/models/Notification.ts | 6 +++++-
.../src/models/json-schema/notification.ts | 10 ++++++++++
packages/backend/src/types.ts | 2 ++
packages/frontend-shared/js/const.ts | 1 +
.../frontend/src/components/MkNotification.vue | 6 ++++--
packages/misskey-js/src/autogen/types.ts | 17 ++++++++++++-----
packages/sw/src/scripts/create-notification.ts | 6 ++++++
8 files changed, 42 insertions(+), 8 deletions(-)
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index 678af6987c82..cfbe0dcc75fe 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -2451,6 +2451,7 @@ _notification:
followedBySomeUsers: "{n}人にフォローされました"
flushNotification: "通知の履歴をリセットする"
exportOfXCompleted: "{x}のエクスポートが完了しました"
+ login: "ログインがありました"
_types:
all: "すべて"
@@ -2467,6 +2468,7 @@ _notification:
roleAssigned: "ロールが付与された"
achievementEarned: "実績の獲得"
exportCompleted: "エクスポートが完了した"
+ login: "ログイン"
test: "通知のテスト"
app: "連携アプリからの通知"
diff --git a/packages/backend/src/models/Notification.ts b/packages/backend/src/models/Notification.ts
index c1d3d42134d4..b7f8e94d691d 100644
--- a/packages/backend/src/models/Notification.ts
+++ b/packages/backend/src/models/Notification.ts
@@ -3,12 +3,12 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
+import { userExportableEntities } from '@/types.js';
import { MiUser } from './User.js';
import { MiNote } from './Note.js';
import { MiAccessToken } from './AccessToken.js';
import { MiRole } from './Role.js';
import { MiDriveFile } from './DriveFile.js';
-import { userExportableEntities } from '@/types.js';
export type MiNotification = {
type: 'note';
@@ -86,6 +86,10 @@ export type MiNotification = {
createdAt: string;
exportedEntity: typeof userExportableEntities[number];
fileId: MiDriveFile['id'];
+} | {
+ type: 'login';
+ id: string;
+ createdAt: string;
} | {
type: 'app';
id: string;
diff --git a/packages/backend/src/models/json-schema/notification.ts b/packages/backend/src/models/json-schema/notification.ts
index 264501049101..cddaf4bc8370 100644
--- a/packages/backend/src/models/json-schema/notification.ts
+++ b/packages/backend/src/models/json-schema/notification.ts
@@ -322,6 +322,16 @@ export const packedNotificationSchema = {
format: 'id',
},
},
+ }, {
+ type: 'object',
+ properties: {
+ ...baseSchema.properties,
+ type: {
+ type: 'string',
+ optional: false, nullable: false,
+ enum: ['login'],
+ },
+ },
}, {
type: 'object',
properties: {
diff --git a/packages/backend/src/types.ts b/packages/backend/src/types.ts
index 5854c6b392e3..0389143dafdb 100644
--- a/packages/backend/src/types.ts
+++ b/packages/backend/src/types.ts
@@ -17,6 +17,7 @@
* roleAssigned - ロールが付与された
* achievementEarned - 実績を獲得
* exportCompleted - エクスポートが完了
+ * login - ログイン
* app - アプリ通知
* test - テスト通知(サーバー側)
*/
@@ -34,6 +35,7 @@ export const notificationTypes = [
'roleAssigned',
'achievementEarned',
'exportCompleted',
+ 'login',
'app',
'test',
] as const;
diff --git a/packages/frontend-shared/js/const.ts b/packages/frontend-shared/js/const.ts
index aec4a4a58bb2..4fe5cbb205a7 100644
--- a/packages/frontend-shared/js/const.ts
+++ b/packages/frontend-shared/js/const.ts
@@ -68,6 +68,7 @@ export const notificationTypes = [
'roleAssigned',
'achievementEarned',
'exportCompleted',
+ 'login',
'test',
'app',
] as const;
diff --git a/packages/frontend/src/components/MkNotification.vue b/packages/frontend/src/components/MkNotification.vue
index 12c2974de48c..5e2665f55738 100644
--- a/packages/frontend/src/components/MkNotification.vue
+++ b/packages/frontend/src/components/MkNotification.vue
@@ -7,13 +7,12 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
-
@@ -40,6 +40,7 @@ SPDX-License-Identifier: AGPL-3.0-only
+
@@ -59,6 +60,7 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts._notification.newNote }}:
{{ i18n.ts._notification.roleAssigned }}
{{ i18n.ts._notification.achievementEarned }}
+ {{ i18n.ts._notification.login }}
{{ i18n.ts._notification.testNotification }}
{{ i18n.tsx._notification.exportOfXCompleted({ x: exportEntityName[notification.exportedEntity] }) }}
diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts
index 6aaeabec7b4b..46fc2496dac4 100644
--- a/packages/misskey-js/src/autogen/types.ts
+++ b/packages/misskey-js/src/autogen/types.ts
@@ -4288,7 +4288,14 @@ export type components = {
exportedEntity: 'antenna' | 'blocking' | 'clip' | 'customEmoji' | 'favorite' | 'following' | 'muting' | 'note' | 'userList';
/** Format: id */
fileId: string;
- }) | ({
+ }) | {
+ /** Format: id */
+ id: string;
+ /** Format: date-time */
+ createdAt: string;
+ /** @enum {string} */
+ type: 'login';
+ } | ({
/** Format: id */
id: string;
/** Format: date-time */
@@ -18550,8 +18557,8 @@ export type operations = {
untilId?: string;
/** @default true */
markAsRead?: boolean;
- includeTypes?: ('note' | 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollEnded' | 'receiveFollowRequest' | 'followRequestAccepted' | 'roleAssigned' | 'achievementEarned' | 'exportCompleted' | 'app' | 'test' | 'pollVote' | 'groupInvited')[];
- excludeTypes?: ('note' | 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollEnded' | 'receiveFollowRequest' | 'followRequestAccepted' | 'roleAssigned' | 'achievementEarned' | 'exportCompleted' | 'app' | 'test' | 'pollVote' | 'groupInvited')[];
+ includeTypes?: ('note' | 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollEnded' | 'receiveFollowRequest' | 'followRequestAccepted' | 'roleAssigned' | 'achievementEarned' | 'exportCompleted' | 'login' | 'app' | 'test' | 'pollVote' | 'groupInvited')[];
+ excludeTypes?: ('note' | 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollEnded' | 'receiveFollowRequest' | 'followRequestAccepted' | 'roleAssigned' | 'achievementEarned' | 'exportCompleted' | 'login' | 'app' | 'test' | 'pollVote' | 'groupInvited')[];
};
};
};
@@ -18618,8 +18625,8 @@ export type operations = {
untilId?: string;
/** @default true */
markAsRead?: boolean;
- includeTypes?: ('note' | 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollEnded' | 'receiveFollowRequest' | 'followRequestAccepted' | 'roleAssigned' | 'achievementEarned' | 'exportCompleted' | 'app' | 'test' | 'reaction:grouped' | 'renote:grouped' | 'pollVote' | 'groupInvited')[];
- excludeTypes?: ('note' | 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollEnded' | 'receiveFollowRequest' | 'followRequestAccepted' | 'roleAssigned' | 'achievementEarned' | 'exportCompleted' | 'app' | 'test' | 'reaction:grouped' | 'renote:grouped' | 'pollVote' | 'groupInvited')[];
+ includeTypes?: ('note' | 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollEnded' | 'receiveFollowRequest' | 'followRequestAccepted' | 'roleAssigned' | 'achievementEarned' | 'exportCompleted' | 'login' | 'app' | 'test' | 'reaction:grouped' | 'renote:grouped' | 'pollVote' | 'groupInvited')[];
+ excludeTypes?: ('note' | 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollEnded' | 'receiveFollowRequest' | 'followRequestAccepted' | 'roleAssigned' | 'achievementEarned' | 'exportCompleted' | 'login' | 'app' | 'test' | 'reaction:grouped' | 'renote:grouped' | 'pollVote' | 'groupInvited')[];
};
};
};
diff --git a/packages/sw/src/scripts/create-notification.ts b/packages/sw/src/scripts/create-notification.ts
index 2b7dfd4f2df8..364328d4b070 100644
--- a/packages/sw/src/scripts/create-notification.ts
+++ b/packages/sw/src/scripts/create-notification.ts
@@ -210,6 +210,12 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif
tag: `achievement:${data.body.achievement}`,
}];
+ case 'login':
+ return [i18n.ts._notification.login, {
+ badge: iconUrl('login-2'),
+ data,
+ }];
+
case 'exportCompleted': {
const entityName = {
antenna: i18n.ts.antennas,
From 5d9a9b4452a471c325ae1379da38b01c62fd6361 Mon Sep 17 00:00:00 2001
From: syuilo <4439005+syuilo@users.noreply.github.com>
Date: Thu, 3 Oct 2024 13:40:47 +0900
Subject: [PATCH 4/7] fix
---
.../backend/assets/tabler-badges/login-2.png | Bin 0 -> 3770 bytes
packages/sw/src/types.ts | 3 ++-
2 files changed, 2 insertions(+), 1 deletion(-)
create mode 100644 packages/backend/assets/tabler-badges/login-2.png
diff --git a/packages/backend/assets/tabler-badges/login-2.png b/packages/backend/assets/tabler-badges/login-2.png
new file mode 100644
index 0000000000000000000000000000000000000000..f3ca8de3ddd0125ef523a249dd0ebd8d086c7566
GIT binary patch
literal 3770
zcmd^C`8yQ+7XQvL(%8$MEKw-CEXh(MTklwFkjWS{wy{MrgoYPMl&|44E?4EO&Z;y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QmdfY`6+bJ9Yg7p_iyx@=)2mTmaC*$s4$LMCGsZ9
zrPgOD91G@=Z?zN~_4|i7O#h#V|wDM)L;+aewfcOFuWf0kzcD55h2ed&H%
zXz03EU%~ggGhW;2t*^$;-RyS<#!In#H+#31Zo29@44nuNJG+vdTwBfjnzk2M32_dB
z+|N
zd>=fFuHtX>HB={RoZ&4!)}!~P
zA1S%ibrH94GkR8Ozl^$Uc=Sw(*?!o?&Gqj;o&3H<#9J3YhAYZ2{XPx6x2K<-nac=8
z7A|!zoJu8irCVmh<0oqNVH-jsUDKOZ@gh>76B-aJj15L;V@sD5>j
z{V=d;c~@w-=SBX#@0&R5=^OC)9iK@@2e62DmR%bR$FYQ+9=nB$6QfmS8SZs2j;<%2
zS~#9|08@de)XZFe&%#H(4m#n>?l@u3g_GFitB6;+YXC21H=LnEw{?C*e(oXVevcbO
zA9m-9A~nvMw5vW}87<$s@(OLXZoo$=Rr$fVp6k#)xBFtyb6=*`BSpY0O5fVuyZnqD
zT{m*X)fNy)txdC#>dL0tr#TZXV!wy+QWWIUcZsg+8sq4{rWZEr{ii#txACtp$%0Dl
z?i$s@8hev|rX{Lh--HruyQyV83Kwj;J>V;B#R_a$yR9-09M%woH|M5qLN
z7fM0NDGKLa1VqJzsguGTF97f^gP$s-6hncbvT#Y^8FLuW_e6EETNUc_!L*J8
zibN^GMoHr(0JiWCzDjBK5YX)`5`u`ef&qeql8tF>3LFHty-GU>N3yLm5LYGPSJ*+c
w9TW2GunrKAFPz+OCtCysd9RQECn3?jgP*AhjJT}Dv6oR`WoC1(0)dVD7ZGyJrvLx|
literal 0
HcmV?d00001
diff --git a/packages/sw/src/types.ts b/packages/sw/src/types.ts
index fac3e707d811..4f827798083d 100644
--- a/packages/sw/src/types.ts
+++ b/packages/sw/src/types.ts
@@ -50,4 +50,5 @@ export type BadgeNames =
| 'quote'
| 'repeat'
| 'user-plus'
- | 'users';
+ | 'users'
+ | 'login-2';
From ed15767fb97ea4c005cb6cc2e679038bf8b9d257 Mon Sep 17 00:00:00 2001
From: syuilo <4439005+syuilo@users.noreply.github.com>
Date: Thu, 3 Oct 2024 13:42:02 +0900
Subject: [PATCH 5/7] Update index.d.ts
---
locales/index.d.ts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/locales/index.d.ts b/locales/index.d.ts
index 29c93453ff8c..0a9123f03d9e 100644
--- a/locales/index.d.ts
+++ b/locales/index.d.ts
@@ -9285,6 +9285,10 @@ export interface Locale extends ILocale {
* {x}のエクスポートが完了しました
*/
"exportOfXCompleted": ParameterizedString<"x">;
+ /**
+ * ログインがありました
+ */
+ "login": string;
"_types": {
/**
* すべて
@@ -9342,6 +9346,10 @@ export interface Locale extends ILocale {
* エクスポートが完了した
*/
"exportCompleted": string;
+ /**
+ * ログイン
+ */
+ "login": string;
/**
* 通知のテスト
*/
From 77aef936b432cf16563357d7afd373090d64802c Mon Sep 17 00:00:00 2001
From: syuilo <4439005+syuilo@users.noreply.github.com>
Date: Thu, 3 Oct 2024 14:34:43 +0900
Subject: [PATCH 6/7] Update SigninService.ts
---
packages/backend/src/server/api/SigninService.ts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/packages/backend/src/server/api/SigninService.ts b/packages/backend/src/server/api/SigninService.ts
index f31e5aeaba80..4b041f373f89 100644
--- a/packages/backend/src/server/api/SigninService.ts
+++ b/packages/backend/src/server/api/SigninService.ts
@@ -12,6 +12,7 @@ import { GlobalEventService } from '@/core/GlobalEventService.js';
import { SigninEntityService } from '@/core/entities/SigninEntityService.js';
import { bindThis } from '@/decorators.js';
import { EmailService } from '@/core/EmailService.js';
+import { NotificationService } from '@/core/NotificationService.js';
import type { FastifyRequest, FastifyReply } from 'fastify';
@Injectable()
@@ -25,6 +26,7 @@ export class SigninService {
private signinEntityService: SigninEntityService,
private emailService: EmailService,
+ private notificationService: NotificationService,
private idService: IdService,
private globalEventService: GlobalEventService,
) {
@@ -33,6 +35,8 @@ export class SigninService {
@bindThis
public signin(request: FastifyRequest, reply: FastifyReply, user: MiLocalUser) {
setImmediate(async () => {
+ this.notificationService.createNotification(user.id, 'login', {});
+
const record = await this.signinsRepository.insertOne({
id: this.idService.gen(),
userId: user.id,
From 31ae6e4913f0db16112a2d7e9a3722b34bffa328 Mon Sep 17 00:00:00 2001
From: syuilo <4439005+syuilo@users.noreply.github.com>
Date: Thu, 3 Oct 2024 14:36:38 +0900
Subject: [PATCH 7/7] Update MkNotification.vue
---
packages/frontend/src/components/MkNotification.vue | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/packages/frontend/src/components/MkNotification.vue b/packages/frontend/src/components/MkNotification.vue
index 5e2665f55738..b27d883b85dc 100644
--- a/packages/frontend/src/components/MkNotification.vue
+++ b/packages/frontend/src/components/MkNotification.vue
@@ -227,6 +227,7 @@ function getActualReactedUsersCount(notification: Misskey.entities.Notification)
--eventReactionHeart: var(--love);
--eventReaction: #e99a0b;
--eventAchievement: #cb9a11;
+ --eventLogin: #007aff;
--eventOther: #88a6b7;
}
@@ -348,6 +349,12 @@ function getActualReactedUsersCount(notification: Misskey.entities.Notification)
pointer-events: none;
}
+.t_login {
+ padding: 3px;
+ background: var(--eventLogin);
+ pointer-events: none;
+}
+
.tail {
flex: 1;
min-width: 0;