diff --git a/.github/workflows/api-misskey-js.yml b/.github/workflows/api-misskey-js.yml index 4cf523a6b9..39f29bf773 100644 --- a/.github/workflows/api-misskey-js.yml +++ b/.github/workflows/api-misskey-js.yml @@ -9,7 +9,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.0 - run: corepack enable diff --git a/.github/workflows/check_copyright_year.yml b/.github/workflows/check_copyright_year.yml index 313265f671..fb04cf1b00 100644 --- a/.github/workflows/check_copyright_year.yml +++ b/.github/workflows/check_copyright_year.yml @@ -10,7 +10,7 @@ jobs: check_copyright_year: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 - run: | if [ "$(grep Copyright COPYING | sed -e 's/.*2014-\([0-9]*\) .*/\1/g')" -ne "$(date +%Y)" ]; then echo "Please change copyright year!" diff --git a/.github/workflows/docker-develop.yml b/.github/workflows/docker-develop.yml index 05bb7f77f9..3e5bb17902 100644 --- a/.github/workflows/docker-develop.yml +++ b/.github/workflows/docker-develop.yml @@ -13,7 +13,7 @@ jobs: if: github.repository == 'misskey-dev/misskey' steps: - name: Check out the repo - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.0 - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v3.0.0 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 32a98a416d..33c85cbaf4 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Check out the repo - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.0 - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v3.0.0 diff --git a/.github/workflows/dockle.yml b/.github/workflows/dockle.yml index d811944d61..2a1ac3a16c 100644 --- a/.github/workflows/dockle.yml +++ b/.github/workflows/dockle.yml @@ -14,7 +14,7 @@ jobs: env: DOCKER_CONTENT_TRUST: 1 steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 - run: | curl -L -o dockle.deb "https://github.com/goodwithtech/dockle/releases/download/v0.4.10/dockle_0.4.10_Linux-64bit.deb" sudo dpkg -i dockle.deb diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7c10c23e77..798e6f49a3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,7 +11,7 @@ jobs: pnpm_install: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 with: fetch-depth: 0 submodules: true @@ -38,7 +38,7 @@ jobs: - sw - misskey-js steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 with: fetch-depth: 0 submodules: true @@ -64,7 +64,7 @@ jobs: - backend - misskey-js steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 with: fetch-depth: 0 submodules: true diff --git a/.github/workflows/pr-preview-deploy.yml b/.github/workflows/pr-preview-deploy.yml index 702d8917e3..44f97645d0 100644 --- a/.github/workflows/pr-preview-deploy.yml +++ b/.github/workflows/pr-preview-deploy.yml @@ -53,7 +53,7 @@ jobs: # Check out merge commit - name: Fork based /deploy checkout - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.0 with: ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge' diff --git a/.github/workflows/test-backend.yml b/.github/workflows/test-backend.yml index d3cb415801..5bafbd4263 100644 --- a/.github/workflows/test-backend.yml +++ b/.github/workflows/test-backend.yml @@ -29,7 +29,7 @@ jobs: - 56312:6379 steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 with: submodules: true - name: Install pnpm diff --git a/.github/workflows/test-frontend.yml b/.github/workflows/test-frontend.yml index 7b8c52049d..a2b7b2f0ef 100644 --- a/.github/workflows/test-frontend.yml +++ b/.github/workflows/test-frontend.yml @@ -16,7 +16,7 @@ jobs: node-version: [18.x] steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 with: submodules: true - name: Install pnpm @@ -68,7 +68,7 @@ jobs: - 56312:6379 steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 with: submodules: true # https://github.com/cypress-io/cypress-docker-images/issues/150 diff --git a/.github/workflows/test-misskey-js.yml b/.github/workflows/test-misskey-js.yml index 51fe54581f..22bb056823 100644 --- a/.github/workflows/test-misskey-js.yml +++ b/.github/workflows/test-misskey-js.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.0 - run: corepack enable diff --git a/.github/workflows/test-production.yml b/.github/workflows/test-production.yml index 00d624d8b7..65d9493727 100644 --- a/.github/workflows/test-production.yml +++ b/.github/workflows/test-production.yml @@ -19,7 +19,7 @@ jobs: node-version: [18.x] steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 with: submodules: true - name: Install pnpm diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b696116b7..26013c14df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,19 @@ --> -## 2023.9.0 (unreleased) +## 2023.9.1 + +### General +- Enhance: モデレーションログ機能の強化 + +### Client +- Fix: ノートのメニューにある「詳細」ボタンの表示がログイン/ログアウト状態で統一されていない問題を修正 + +### Server +- Fix: お知らせのページネーションが機能しない +- Fix: 「ユーザーの新規投稿」の通知設定を切り替えるとサーバー内部エラーが出る + +## 2023.9.0 ### Note - meilisearchを使用する場合、v1.2以上が必要です @@ -98,6 +110,7 @@ - Enhance: 自分へのメンション一覧を取得する際のパフォーマンスを向上 - Enhance: Docker環境でjemallocを使用することでメモリ使用量を削減 - Enhance: ID生成方式としてaidxを追加、かつデフォルトに +- Enhance: Add address bind config option (outgoingAddress) - Fix: MK_ONLY_SERVERオプションを指定した際にクラッシュする問題を修正 - Fix: notes/reactionsのページネーションが機能しない問題を修正 - Fix: ノート検索 `notes/search` にてhostを指定した際に検索結果に反映されるように @@ -120,7 +133,6 @@ ### Server - Fix: APIのオフセットが壊れていたせいで「もっと見る」でもっと見れない問題を修正 - Fix: 外部サーバーの投稿がタイムラインに表示されないことがある問題を修正 -- Enhance: Add address bind config option (outgoingAddress) ## 13.14.1 diff --git a/locales/de-DE.yml b/locales/de-DE.yml index eb3a8cc3bf..f8714f3f04 100644 --- a/locales/de-DE.yml +++ b/locales/de-DE.yml @@ -2101,9 +2101,9 @@ _webhookSettings: reaction: "Wenn du eine Reaktion erhältst" mention: "Wenn du erwähnt wirst" _moderationLogTypes: + updateRole: "Rolle aktualisiert" assignRole: "Zu Rolle zugewiesen" unassignRole: "Aus Rolle entfernt" - updateRole: "Rolle aktualisiert" suspend: "Gesperrt" unsuspend: "Entsperrt" addCustomEmoji: "Benutzerdefiniertes Emoji hinzugefügt" diff --git a/locales/en-US.yml b/locales/en-US.yml index 5c7e1f7496..3bd891567e 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -2107,9 +2107,9 @@ _webhookSettings: reaction: "When receiving a reaction" mention: "When being mentioned" _moderationLogTypes: + updateRole: "Role updated" assignRole: "Assigned to role" unassignRole: "Removed from role" - updateRole: "Role updated" suspend: "Suspended" unsuspend: "Unsuspended" addCustomEmoji: "Custom emoji added" diff --git a/locales/index.d.ts b/locales/index.d.ts index 4b1e0a1873..bbea4502b3 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1126,6 +1126,7 @@ export interface Locale { "unnotifyNotes": string; "authentication": string; "authenticationRequiredToContinue": string; + "dateAndTime": string; "_announcement": { "forExistingUsers": string; "forExistingUsersDescription": string; @@ -2276,9 +2277,11 @@ export interface Locale { "resolver": string; }; "_moderationLogTypes": { + "createRole": string; + "deleteRole": string; + "updateRole": string; "assignRole": string; "unassignRole": string; - "updateRole": string; "suspend": string; "unsuspend": string; "addCustomEmoji": string; @@ -2299,6 +2302,7 @@ export interface Locale { "unsuspendRemoteInstance": string; "markSensitiveDriveFile": string; "unmarkSensitiveDriveFile": string; + "resolveAbuseReport": string; }; } declare const locales: { diff --git a/locales/it-IT.yml b/locales/it-IT.yml index 7b07b1097b..cff2ca1ed4 100644 --- a/locales/it-IT.yml +++ b/locales/it-IT.yml @@ -2031,7 +2031,7 @@ _notification: _types: all: "Tutto" note: "Nuove Note" - follow: "Novità follower" + follow: "Nuovi profili follower" mention: "Menzioni" reply: "Risposte" renote: "Rinota" @@ -2101,18 +2101,26 @@ _webhookSettings: reaction: "Quando ricevo una reazione" mention: "Quando mi menzionano" _moderationLogTypes: - assignRole: "Assegna un ruolo" - unassignRole: "Disassegna un ruolo" - updateRole: "Aggiorna un ruolo" + updateRole: "Ruolo aggiornato" + assignRole: "Ruolo assegnato" + unassignRole: "Ruolo disassegnato" suspend: "Sospensione" - unsuspend: "Toglie la sospensione" - addCustomEmoji: "Aggiunge una emoji personalizzata" - updateServerSettings: "Aggiorna le impostazioni del server" - updateUserNote: "Aggiorna il promemoria di moderazione" - deleteDriveFile: "Elimina file da Drive" - deleteNote: "Elimina la Nota" - createGlobalAnnouncement: "Crea un annuncio globale" - createUserAnnouncement: "Crea un annuncio ai profili iscritti" - resetPassword: "Ripristina la password" - suspendRemoteInstance: "Sospendi istanza remota" - unsuspendRemoteInstance: "Riattiva istanza remota" + unsuspend: "Sospensione rimossa" + addCustomEmoji: "Emoji personalizzata aggiunta" + updateCustomEmoji: "Emoji personalizzata aggiornata" + deleteCustomEmoji: "Emoji personalizzata eliminata" + updateServerSettings: "Impostazioni del server aggiornate" + updateUserNote: "Promemoria di moderazione aggiornato" + deleteDriveFile: "File da Drive eliminato" + deleteNote: "Nota eliminata" + createGlobalAnnouncement: "Annuncio globale creato" + createUserAnnouncement: "Annuncio ai profili iscritti creato" + updateGlobalAnnouncement: "Annuncio globale aggiornato" + updateUserAnnouncement: "Annuncio ai profili iscritti aggiornato" + deleteGlobalAnnouncement: "Annuncio globale eliminato" + deleteUserAnnouncement: "Annuncio ai profili iscritti eliminato" + resetPassword: "Password azzerata" + suspendRemoteInstance: "Istanza remota sospesa" + unsuspendRemoteInstance: "Istanza remota riattivata" + markSensitiveDriveFile: "File nel Drive segnato come esplicito" + unmarkSensitiveDriveFile: "File nel Drive segnato come non esplicito" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 6d3b36ad22..fc35811676 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1123,6 +1123,7 @@ notifyNotes: "投稿を通知" unnotifyNotes: "投稿の通知を解除" authentication: "認証" authenticationRequiredToContinue: "続けるには認証を行ってください" +dateAndTime: "日時" _announcement: forExistingUsers: "既存ユーザーのみ" @@ -2188,9 +2189,11 @@ _abuse: resolver: "リソルバー" _moderationLogTypes: + createRole: "ロールを作成" + deleteRole: "ロールを削除" + updateRole: "ロールを更新" assignRole: "ロールへアサイン" unassignRole: "ロールのアサイン解除" - updateRole: "ロール設定更新" suspend: "凍結" unsuspend: "凍結解除" addCustomEmoji: "カスタム絵文字追加" @@ -2211,3 +2214,4 @@ _moderationLogTypes: unsuspendRemoteInstance: "リモートサーバーを再開" markSensitiveDriveFile: "ファイルをセンシティブ付与" unmarkSensitiveDriveFile: "ファイルをセンシティブ解除" + resolveAbuseReport: "通報を解決" diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml index cc858d3bcd..a96bd45557 100644 --- a/locales/zh-CN.yml +++ b/locales/zh-CN.yml @@ -2101,9 +2101,9 @@ _webhookSettings: reaction: "被回应时" mention: "被提及时" _moderationLogTypes: + updateRole: "更新角色" assignRole: "分配角色" unassignRole: "取消分配角色" - updateRole: "更新角色" suspend: "冻结" unsuspend: "解除冻结" addCustomEmoji: "添加自定义表情符号" diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml index 77c8da9b04..2804945aa2 100644 --- a/locales/zh-TW.yml +++ b/locales/zh-TW.yml @@ -1,6 +1,6 @@ --- -_lang_: "繁體中文" -headlineMisskey: "貼文連繫網絡" +_lang_: "繁體中文(台灣)" +headlineMisskey: "貼文連繫網路" introMisskey: "歡迎!Misskey 是一個開放原始碼且去中心化的社群網路服務。\n發布「貼文」向身邊的人分享您的想法!📡\n利用「反應」表達您對貼文的感覺!👍\n讓我們一起探索新的世界吧!🚀" poweredByMisskeyDescription: "{name}是開放原始碼平臺 Misskey 的伺服器之一。" monthAndDay: "{month} 月 {day} 日" @@ -45,7 +45,7 @@ pin: "置頂" unpin: "取消置頂" copyContent: "複製內容" copyLink: "複製連結" -copyLinkRenote: "複製轉貼連結" +copyLinkRenote: "複製轉發的連結" delete: "刪除" deleteAndEdit: "刪除並編輯" deleteAndEditConfirm: "要刪除並再次編輯嗎?此貼文的所有反應、轉發和回覆也將會消失。" @@ -107,7 +107,7 @@ followRequestPending: "追隨許可待批准" enterEmoji: "輸入表情符號" renote: "轉發" unrenote: "取消轉發" -renoted: "轉發成功" +renoted: "轉發成功。" cantRenote: "無法轉發此貼文。" cantReRenote: "無法轉發之前已經轉發過的內容。" quote: "引用" @@ -138,8 +138,8 @@ suspend: "凍結" unsuspend: "解除凍結" blockConfirm: "確定要封鎖此使用者嗎?" unblockConfirm: "確定要解除封鎖此使用者嗎?" -suspendConfirm: "確定凍結此帳戶?" -unsuspendConfirm: "確定解凍此帳戶?" +suspendConfirm: "確定凍結此使用者?" +unsuspendConfirm: "確定解凍此使用者?" selectList: "選擇清單" editList: "編輯清單" selectChannel: "選擇頻道" @@ -152,12 +152,12 @@ customEmojis: "自訂表情符號" emoji: "表情符號" emojis: "表情符號" emojiName: "表情符號名稱" -emojiUrl: "表情符號URL" +emojiUrl: "表情符號 URL" addEmoji: "新增表情符號" settingGuide: "推薦設定" cacheRemoteFiles: "快取遠端檔案" -cacheRemoteFilesDescription: "禁用此設定會停止建立遠端檔案快取,從而節省伺服器儲存空間,但會因從遠端讀取資料而增加網路數據用量。" -youCanCleanRemoteFilesCache: "按檔案管理的🗑️按鈕,將快取全部刪除。" +cacheRemoteFilesDescription: "啟用此設定後,遠端檔案會被快取在本伺服器的儲存空間中。雖然顯示圖片會變快,但會消耗較多伺服器的儲存空間。至於要快取遠端使用者到什麼程度,是依照角色的雲端硬碟容量而定。當超過這個限制時,從較舊的檔案開始自快取中刪除並改為連結。關閉這個設定時,遠端檔案從一開始就維持連結的方式,但為了產生圖片的縮圖並保護使用者的隱私,建議將 default.yml 的 proxyRemoteFiles 設為 true。" +youCanCleanRemoteFilesCache: "按檔案管理的🗑️按鈕,可將快取全部刪除。" cacheRemoteSensitiveFiles: "快取遠端的敏感檔案" cacheRemoteSensitiveFilesDescription: "若停用這個設定,則不會快取遠端的敏感檔案,而是直接連結。" flagAsBot: "此使用者是機器人" @@ -424,7 +424,7 @@ securityKeyAndPasskey: "安全金鑰、Passkey" securityKey: "安全金鑰" lastUsed: "上次使用" lastUsedAt: "上次使用:{t}" -unregister: "註銷帳戶" +unregister: "註銷" passwordLessLogin: "設置無密碼登入" passwordLessLoginDescription: "不使用密碼,以安全金鑰或 Passkey 登入" resetPassword: "重設密碼" @@ -509,8 +509,8 @@ promote: "推廣" numberOfDays: "有效天數" hideThisNote: "隱藏此貼文" showFeaturedNotesInTimeline: "在時間軸上顯示熱門推薦" -objectStorage: "對象存儲" -useObjectStorage: "使用對象存儲" +objectStorage: "物件儲存" +useObjectStorage: "使用物件儲存" objectStorageBaseUrl: "Base URL" objectStorageBaseUrlDesc: "用於引用的 URL。如果您使用的是 CDN 或反向代理,請指定其 URL,例如 S3(https://.s3.amazonaws.com)、GCS(https://storage.googleapis.com/)。" objectStorageBucket: "儲存空間(Bucket)" @@ -1120,6 +1120,7 @@ notifyNotes: "開啟貼文通知" unnotifyNotes: "關閉貼文通知" authentication: "驗證" authenticationRequiredToContinue: "請於繼續前完成驗證" +dateAndTime: "日期與時間" _announcement: forExistingUsers: "僅限既有的使用者" forExistingUsersDescription: "啟用代表僅向現存使用者顯示;停用代表張貼後註冊的新使用者也會看到。" @@ -2101,9 +2102,11 @@ _webhookSettings: reaction: "當獲得反應時" mention: "當被提到時" _moderationLogTypes: + createRole: "新增角色" + deleteRole: "刪除角色 " + updateRole: "更新角色設定" assignRole: "指派角色" unassignRole: "撤銷角色" - updateRole: "更新角色設定" suspend: "凍結" unsuspend: "解除凍結" addCustomEmoji: "新增自訂表情符號" @@ -2122,3 +2125,5 @@ _moderationLogTypes: resetPassword: "重設密碼" suspendRemoteInstance: "封鎖遠端伺服器" unsuspendRemoteInstance: "解除封鎖遠端伺服器" + markSensitiveDriveFile: "標記為敏感檔案" + unmarkSensitiveDriveFile: "撤銷標記為敏感檔案" diff --git a/package.json b/package.json index 80d044a605..7779be0bbc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "2023.9.0-io", + "version": "2023.9.1-io", "codename": "nasubi", "repository": { "type": "git", diff --git a/packages/backend/migration/1695605508898-mutingNotificationTypes.js b/packages/backend/migration/1695605508898-mutingNotificationTypes.js new file mode 100644 index 0000000000..8c0e52a2f0 --- /dev/null +++ b/packages/backend/migration/1695605508898-mutingNotificationTypes.js @@ -0,0 +1,21 @@ +export class MutingNotificationTypes1695605508898 { + name = 'MutingNotificationTypes1695605508898' + + async up(queryRunner) { + await queryRunner.query(`ALTER TYPE "public"."user_profile_mutingnotificationtypes_enum" RENAME TO "user_profile_mutingnotificationtypes_enum_old"`); + await queryRunner.query(`CREATE TYPE "public"."user_profile_mutingnotificationtypes_enum" AS ENUM('note', 'follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'achievementEarned', 'app', 'test', 'pollVote', 'groupInvited')`); + await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" DROP DEFAULT`); + await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" TYPE "public"."user_profile_mutingnotificationtypes_enum"[] USING "mutingNotificationTypes"::"text"::"public"."user_profile_mutingnotificationtypes_enum"[]`); + await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" SET DEFAULT '{}'`); + await queryRunner.query(`DROP TYPE "public"."user_profile_mutingnotificationtypes_enum_old"`); + } + + async down(queryRunner) { + await queryRunner.query(`CREATE TYPE "public"."user_profile_mutingnotificationtypes_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'achievementEarned', 'app')`); + await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" DROP DEFAULT`); + await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" TYPE "public"."user_profile_mutingnotificationtypes_enum_old"[] USING "mutingNotificationTypes"::"text"::"public"."user_profile_mutingnotificationtypes_enum_old"[]`); + await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" SET DEFAULT '{}'`); + await queryRunner.query(`DROP TYPE "public"."user_profile_mutingnotificationtypes_enum"`); + await queryRunner.query(`ALTER TYPE "public"."user_profile_mutingnotificationtypes_enum_old" RENAME TO "user_profile_mutingnotificationtypes_enum"`); + } +} diff --git a/packages/backend/src/core/AnnouncementService.ts b/packages/backend/src/core/AnnouncementService.ts index 5449427b8d..8411b76324 100644 --- a/packages/backend/src/core/AnnouncementService.ts +++ b/packages/backend/src/core/AnnouncementService.ts @@ -162,10 +162,13 @@ export class AnnouncementService { }); if (moderator) { + const user = await this.usersRepository.findOneByOrFail({ id: values.userId }); this.moderationLogService.log(moderator, 'createUserAnnouncement', { announcementId: announcement.id, announcement: announcement, userId: values.userId, + userUsername: user.username, + userHost: user.host, }); } } else { @@ -255,10 +258,14 @@ export class AnnouncementService { if (moderator) { if (announcement.userId) { + const user = await this.usersRepository.findOneByOrFail({ id: announcement.userId }); this.moderationLogService.log(moderator, 'updateUserAnnouncement', { announcementId: announcement.id, before: announcement, after: after, + userId: announcement.userId, + userUsername: user.username, + userHost: user.host, }); } else { this.moderationLogService.log(moderator, 'updateGlobalAnnouncement', { diff --git a/packages/backend/src/core/CustomEmojiService.ts b/packages/backend/src/core/CustomEmojiService.ts index 92d40d2293..333c495691 100644 --- a/packages/backend/src/core/CustomEmojiService.ts +++ b/packages/backend/src/core/CustomEmojiService.ts @@ -138,11 +138,11 @@ export class CustomEmojiService implements OnApplicationShutdown { this.localEmojisCache.refresh(); - const updated = await this.emojiEntityService.packDetailed(emoji.id); + const packed = await this.emojiEntityService.packDetailed(emoji.id); if (emoji.name === data.name) { this.globalEventService.publishBroadcastStream('emojiUpdated', { - emojis: [updated], + emojis: [packed], }); } else { this.globalEventService.publishBroadcastStream('emojiDeleted', { @@ -150,11 +150,12 @@ export class CustomEmojiService implements OnApplicationShutdown { }); this.globalEventService.publishBroadcastStream('emojiAdded', { - emoji: updated, + emoji: packed, }); } if (moderator) { + const updated = await this.emojisRepository.findOneByOrFail({ id: id }); this.moderationLogService.log(moderator, 'updateCustomEmoji', { emojiId: emoji.id, before: emoji, diff --git a/packages/backend/src/core/DriveService.ts b/packages/backend/src/core/DriveService.ts index ef1a8491ee..24a129ac59 100644 --- a/packages/backend/src/core/DriveService.ts +++ b/packages/backend/src/core/DriveService.ts @@ -686,15 +686,20 @@ export class DriveService { if (await this.roleService.isModerator(updater) && (file.userId !== updater.id)) { if (values.isSensitive !== undefined && values.isSensitive !== file.isSensitive) { + const user = file.userId ? await this.usersRepository.findOneByOrFail({ id: file.userId }) : null; if (values.isSensitive) { this.moderationLogService.log(updater, 'markSensitiveDriveFile', { fileId: file.id, fileUserId: file.userId, + fileUserUsername: user?.username ?? null, + fileUserHost: user?.host ?? null, }); } else { this.moderationLogService.log(updater, 'unmarkSensitiveDriveFile', { fileId: file.id, fileUserId: file.userId, + fileUserUsername: user?.username ?? null, + fileUserHost: user?.host ?? null, }); } } @@ -795,9 +800,12 @@ export class DriveService { } if (deleter && await this.roleService.isModerator(deleter) && (file.userId !== deleter.id)) { + const user = file.userId ? await this.usersRepository.findOneByOrFail({ id: file.userId }) : null; this.moderationLogService.log(deleter, 'deleteDriveFile', { fileId: file.id, fileUserId: file.userId, + fileUserUsername: user?.username ?? null, + fileUserHost: user?.host ?? null, }); } } diff --git a/packages/backend/src/core/NoteDeleteService.ts b/packages/backend/src/core/NoteDeleteService.ts index c99f92b9cb..87979f22ac 100644 --- a/packages/backend/src/core/NoteDeleteService.ts +++ b/packages/backend/src/core/NoteDeleteService.ts @@ -135,9 +135,12 @@ export class NoteDeleteService { }); if (deleter && (note.userId !== deleter.id)) { + const user = await this.usersRepository.findOneByOrFail({ id: note.userId }); this.moderationLogService.log(deleter, 'deleteNote', { noteId: note.id, noteUserId: note.userId, + noteUserUsername: user.username, + noteUserHost: user.host, note: note, }); } diff --git a/packages/backend/src/core/RoleService.ts b/packages/backend/src/core/RoleService.ts index 73de249637..16b8db7ac5 100644 --- a/packages/backend/src/core/RoleService.ts +++ b/packages/backend/src/core/RoleService.ts @@ -421,10 +421,13 @@ export class RoleService implements OnApplicationShutdown { this.globalEventService.publishInternalEvent('userRoleAssigned', created); if (moderator) { + const user = await this.usersRepository.findOneByOrFail({ id: userId }); this.moderationLogService.log(moderator, 'assignRole', { roleId: roleId, roleName: role.name, userId: userId, + userUsername: user.username, + userHost: user.host, expiresAt: expiresAt ? expiresAt.toISOString() : null, }); } @@ -454,11 +457,16 @@ export class RoleService implements OnApplicationShutdown { this.globalEventService.publishInternalEvent('userRoleUnassigned', existing); if (moderator) { - const role = await this.rolesRepository.findOneByOrFail({ id: roleId }); + const [user, role] = await Promise.all([ + this.usersRepository.findOneByOrFail({ id: userId }), + this.rolesRepository.findOneByOrFail({ id: roleId }), + ]); this.moderationLogService.log(moderator, 'unassignRole', { roleId: roleId, roleName: role.name, userId: userId, + userUsername: user.username, + userHost: user.host, }); } } @@ -482,6 +490,42 @@ export class RoleService implements OnApplicationShutdown { redisPipeline.exec(); } + @bindThis + public async create(values: Partial, moderator?: MiUser): Promise { + const date = new Date(); + const created = await this.rolesRepository.insert({ + id: this.idService.genId(), + createdAt: date, + updatedAt: date, + lastUsedAt: date, + name: values.name, + description: values.description, + color: values.color, + iconUrl: values.iconUrl, + target: values.target, + condFormula: values.condFormula, + isPublic: values.isPublic, + isAdministrator: values.isAdministrator, + isModerator: values.isModerator, + isExplorable: values.isExplorable, + asBadge: values.asBadge, + canEditMembersByModerator: values.canEditMembersByModerator, + displayOrder: values.displayOrder, + policies: values.policies, + }).then(x => this.rolesRepository.findOneByOrFail(x.identifiers[0])); + + this.globalEventService.publishInternalEvent('roleCreated', created); + + if (moderator) { + this.moderationLogService.log(moderator, 'createRole', { + roleId: created.id, + role: created, + }); + } + + return created; + } + @bindThis public async update(role: MiRole, params: Partial, moderator?: MiUser): Promise { const date = new Date(); diff --git a/packages/backend/src/server/api/endpoints/admin/reset-password.ts b/packages/backend/src/server/api/endpoints/admin/reset-password.ts index 6ce7583276..13e9c30ed8 100644 --- a/packages/backend/src/server/api/endpoints/admin/reset-password.ts +++ b/packages/backend/src/server/api/endpoints/admin/reset-password.ts @@ -73,7 +73,9 @@ export default class extends Endpoint { // eslint- }); this.moderationLogService.log(me, 'resetPassword', { - targetId: user.id, + userId: user.id, + userUsername: user.username, + userHost: user.host, }); return { diff --git a/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts b/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts index 8667640a67..fb5ac7a335 100644 --- a/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts +++ b/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts @@ -10,6 +10,7 @@ import { InstanceActorService } from '@/core/InstanceActorService.js'; import { QueueService } from '@/core/QueueService.js'; import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; import { DI } from '@/di-symbols.js'; +import { ModerationLogService } from '@/core/ModerationLogService.js'; export const meta = { tags: ['admin'], @@ -41,6 +42,7 @@ export default class extends Endpoint { // eslint- private queueService: QueueService, private instanceActorService: InstanceActorService, private apRendererService: ApRendererService, + private moderationLogService: ModerationLogService, ) { super(meta, paramDef, async (ps, me) => { const report = await this.abuseUserReportsRepository.findOneBy({ id: ps.reportId }); @@ -61,6 +63,12 @@ export default class extends Endpoint { // eslint- assigneeId: me.id, forwarded: ps.forward && report.targetUserHost != null, }); + + this.moderationLogService.log(me, 'resolveAbuseReport', { + reportId: report.id, + report: report, + forwarded: ps.forward && report.targetUserHost != null, + }); }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/roles/create.ts b/packages/backend/src/server/api/endpoints/admin/roles/create.ts index f567b0d387..8451b1955f 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/create.ts @@ -5,11 +5,8 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RolesRepository } from '@/models/_.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; -import { DI } from '@/di-symbols.js'; -import { IdService } from '@/core/IdService.js'; import { RoleEntityService } from '@/core/entities/RoleEntityService.js'; +import { RoleService } from '@/core/RoleService.js'; export const meta = { tags: ['admin', 'role'], @@ -58,37 +55,11 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.rolesRepository) - private rolesRepository: RolesRepository, - - private globalEventService: GlobalEventService, - private idService: IdService, private roleEntityService: RoleEntityService, + private roleService: RoleService, ) { super(meta, paramDef, async (ps, me) => { - const date = new Date(); - const created = await this.rolesRepository.insert({ - id: this.idService.genId(), - createdAt: date, - updatedAt: date, - lastUsedAt: date, - name: ps.name, - description: ps.description, - color: ps.color, - iconUrl: ps.iconUrl, - target: ps.target, - condFormula: ps.condFormula, - isPublic: ps.isPublic, - isAdministrator: ps.isAdministrator, - isModerator: ps.isModerator, - isExplorable: ps.isExplorable, - asBadge: ps.asBadge, - canEditMembersByModerator: ps.canEditMembersByModerator, - displayOrder: ps.displayOrder, - policies: ps.policies, - }).then(x => this.rolesRepository.findOneByOrFail(x.identifiers[0])); - - this.globalEventService.publishInternalEvent('roleCreated', created); + const created = await this.roleService.create(ps, me); return await this.roleEntityService.pack(created, me); }); diff --git a/packages/backend/src/server/api/endpoints/admin/roles/update.ts b/packages/backend/src/server/api/endpoints/admin/roles/update.ts index e4e59e487c..6031e2363e 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/update.ts @@ -79,9 +79,7 @@ export default class extends Endpoint { // eslint- throw new ApiError(meta.errors.noSuchRole); } - const date = new Date(); await this.roleService.update(role, { - updatedAt: date, name: ps.name, description: ps.description, color: ps.color, diff --git a/packages/backend/src/server/api/endpoints/admin/suspend-user.ts b/packages/backend/src/server/api/endpoints/admin/suspend-user.ts index 89199f8bff..9464f4b677 100644 --- a/packages/backend/src/server/api/endpoints/admin/suspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/suspend-user.ts @@ -61,7 +61,9 @@ export default class extends Endpoint { // eslint- }); this.moderationLogService.log(me, 'suspend', { - targetId: user.id, + userId: user.id, + userUsername: user.username, + userHost: user.host, }); (async () => { diff --git a/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts b/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts index a2779148ed..5e523bbc31 100644 --- a/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts @@ -46,7 +46,9 @@ export default class extends Endpoint { // eslint- }); this.moderationLogService.log(me, 'unsuspend', { - targetId: user.id, + userId: user.id, + userUsername: user.username, + userHost: user.host, }); this.userSuspendService.doPostUnsuspend(user); diff --git a/packages/backend/src/server/api/endpoints/admin/update-user-note.ts b/packages/backend/src/server/api/endpoints/admin/update-user-note.ts index 2e9fd5ad29..bfccc2a2a5 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-user-note.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-user-note.ts @@ -51,6 +51,8 @@ export default class extends Endpoint { // eslint- this.moderationLogService.log(me, 'updateUserNote', { userId: user.id, + userUsername: user.username, + userHost: user.host, before: currentProfile.moderationNote, after: ps.text, }); diff --git a/packages/backend/src/types.ts b/packages/backend/src/types.ts index 16654edd88..35ea710f9e 100644 --- a/packages/backend/src/types.ts +++ b/packages/backend/src/types.ts @@ -37,6 +37,7 @@ export const moderationLogTypes = [ 'deleteCustomEmoji', 'assignRole', 'unassignRole', + 'createRole', 'updateRole', 'deleteRole', 'clearQueue', @@ -54,6 +55,7 @@ export const moderationLogTypes = [ 'unsuspendRemoteInstance', 'markSensitiveDriveFile', 'unmarkSensitiveDriveFile', + 'resolveAbuseReport', ] as const; export type ModerationLogPayloads = { @@ -62,13 +64,19 @@ export type ModerationLogPayloads = { after: any | null; }; suspend: { - targetId: string; + userId: string; + userUsername: string; + userHost: string | null; }; unsuspend: { - targetId: string; + userId: string; + userUsername: string; + userHost: string | null; }; updateUserNote: { userId: string; + userUsername: string; + userHost: string | null; before: string | null; after: string | null; }; @@ -87,15 +95,23 @@ export type ModerationLogPayloads = { }; assignRole: { userId: string; + userUsername: string; + userHost: string | null; roleId: string; roleName: string; expiresAt: string | null; }; unassignRole: { userId: string; + userUsername: string; + userHost: string | null; roleId: string; roleName: string; }; + createRole: { + roleId: string; + role: any; + }; updateRole: { roleId: string; before: any; @@ -110,10 +126,14 @@ export type ModerationLogPayloads = { deleteDriveFile: { fileId: string; fileUserId: string | null; + fileUserUsername: string | null; + fileUserHost: string | null; }; deleteNote: { noteId: string; noteUserId: string; + noteUserUsername: string; + noteUserHost: string | null; note: any; }; createGlobalAnnouncement: { @@ -124,6 +144,8 @@ export type ModerationLogPayloads = { announcementId: string; announcement: any; userId: string; + userUsername: string; + userHost: string | null; }; updateGlobalAnnouncement: { announcementId: string; @@ -134,6 +156,9 @@ export type ModerationLogPayloads = { announcementId: string; before: any; after: any; + userId: string; + userUsername: string; + userHost: string | null; }; deleteGlobalAnnouncement: { announcementId: string; @@ -144,7 +169,9 @@ export type ModerationLogPayloads = { announcement: any; }; resetPassword: { - targetId: string; + userId: string; + userUsername: string; + userHost: string | null; }; suspendRemoteInstance: { id: string; @@ -157,9 +184,18 @@ export type ModerationLogPayloads = { markSensitiveDriveFile: { fileId: string; fileUserId: string | null; + fileUserUsername: string | null; + fileUserHost: string | null; }; unmarkSensitiveDriveFile: { fileId: string; fileUserId: string | null; + fileUserUsername: string | null; + fileUserHost: string | null; + }; + resolveAbuseReport: { + reportId: string; + report: any; + forwarded: boolean; }; }; diff --git a/packages/frontend/src/pages/admin/modlog.ModLog.vue b/packages/frontend/src/pages/admin/modlog.ModLog.vue index ce7b89f8f7..14f94479f1 100644 --- a/packages/frontend/src/pages/admin/modlog.ModLog.vue +++ b/packages/frontend/src/pages/admin/modlog.ModLog.vue @@ -5,33 +5,61 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index 734a632039..0948741fc5 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -368,8 +368,8 @@ export function getNoteMenu(props: { .filter(x => x !== undefined); } else { menu = [{ - icon: 'ti ti-external-link', - text: i18n.ts.detailed, + icon: 'ti ti-info-circle', + text: i18n.ts.details, action: openDetail, }, { icon: 'ti ti-copy', diff --git a/packages/misskey-js/etc/misskey-js.api.md b/packages/misskey-js/etc/misskey-js.api.md index 753411d37a..529bc893ce 100644 --- a/packages/misskey-js/etc/misskey-js.api.md +++ b/packages/misskey-js/etc/misskey-js.api.md @@ -2571,6 +2571,9 @@ type ModerationLog = { } | { type: 'unassignRole'; info: ModerationLogPayloads['unassignRole']; +} | { + type: 'createRole'; + info: ModerationLogPayloads['createRole']; } | { type: 'updateRole'; info: ModerationLogPayloads['updateRole']; @@ -2625,7 +2628,7 @@ type ModerationLog = { }); // @public (undocumented) -export const moderationLogTypes: readonly ["updateServerSettings", "suspend", "unsuspend", "updateUserNote", "addCustomEmoji", "updateCustomEmoji", "deleteCustomEmoji", "assignRole", "unassignRole", "updateRole", "deleteRole", "clearQueue", "promoteQueue", "deleteDriveFile", "deleteNote", "createGlobalAnnouncement", "createUserAnnouncement", "updateGlobalAnnouncement", "updateUserAnnouncement", "deleteGlobalAnnouncement", "deleteUserAnnouncement", "resetPassword", "suspendRemoteInstance", "unsuspendRemoteInstance", "markSensitiveDriveFile", "unmarkSensitiveDriveFile"]; +export const moderationLogTypes: readonly ["updateServerSettings", "suspend", "unsuspend", "updateUserNote", "addCustomEmoji", "updateCustomEmoji", "deleteCustomEmoji", "assignRole", "unassignRole", "createRole", "updateRole", "deleteRole", "clearQueue", "promoteQueue", "deleteDriveFile", "deleteNote", "createGlobalAnnouncement", "createUserAnnouncement", "updateGlobalAnnouncement", "updateUserAnnouncement", "deleteGlobalAnnouncement", "deleteUserAnnouncement", "resetPassword", "suspendRemoteInstance", "unsuspendRemoteInstance", "markSensitiveDriveFile", "unmarkSensitiveDriveFile", "resolveAbuseReport"]; // @public (undocumented) export const mutedNoteReasons: readonly ["word", "manual", "spam", "other"]; diff --git a/packages/misskey-js/src/consts.ts b/packages/misskey-js/src/consts.ts index 63137dcc83..aedfb5570e 100644 --- a/packages/misskey-js/src/consts.ts +++ b/packages/misskey-js/src/consts.ts @@ -55,6 +55,7 @@ export const moderationLogTypes = [ 'deleteCustomEmoji', 'assignRole', 'unassignRole', + 'createRole', 'updateRole', 'deleteRole', 'clearQueue', @@ -72,6 +73,7 @@ export const moderationLogTypes = [ 'unsuspendRemoteInstance', 'markSensitiveDriveFile', 'unmarkSensitiveDriveFile', + 'resolveAbuseReport', ] as const; export type ModerationLogPayloads = { @@ -80,13 +82,19 @@ export type ModerationLogPayloads = { after: any | null; }; suspend: { - targetId: string; + userId: string; + userUsername: string; + userHost: string | null; }; unsuspend: { - targetId: string; + userId: string; + userUsername: string; + userHost: string | null; }; updateUserNote: { userId: string; + userUsername: string; + userHost: string | null; before: string | null; after: string | null; }; @@ -105,15 +113,23 @@ export type ModerationLogPayloads = { }; assignRole: { userId: string; + userUsername: string; + userHost: string | null; roleId: string; roleName: string; expiresAt: string | null; }; unassignRole: { userId: string; + userUsername: string; + userHost: string | null; roleId: string; roleName: string; }; + createRole: { + roleId: string; + role: any; + }; updateRole: { roleId: string; before: any; @@ -128,10 +144,14 @@ export type ModerationLogPayloads = { deleteDriveFile: { fileId: string; fileUserId: string | null; + fileUserUsername: string | null; + fileUserHost: string | null; }; deleteNote: { noteId: string; noteUserId: string; + noteUserUsername: string; + noteUserHost: string | null; note: any; }; createGlobalAnnouncement: { @@ -142,6 +162,8 @@ export type ModerationLogPayloads = { announcementId: string; announcement: any; userId: string; + userUsername: string; + userHost: string | null; }; updateGlobalAnnouncement: { announcementId: string; @@ -152,6 +174,9 @@ export type ModerationLogPayloads = { announcementId: string; before: any; after: any; + userId: string; + userUsername: string; + userHost: string | null; }; deleteGlobalAnnouncement: { announcementId: string; @@ -162,7 +187,9 @@ export type ModerationLogPayloads = { announcement: any; }; resetPassword: { - targetId: string; + userId: string; + userUsername: string; + userHost: string | null; }; suspendRemoteInstance: { id: string; @@ -175,9 +202,18 @@ export type ModerationLogPayloads = { markSensitiveDriveFile: { fileId: string; fileUserId: string | null; + fileUserUsername: string | null; + fileUserHost: string | null; }; unmarkSensitiveDriveFile: { fileId: string; fileUserId: string | null; + fileUserUsername: string | null; + fileUserHost: string | null; + }; + resolveAbuseReport: { + reportId: string; + report: any; + forwarded: boolean; }; }; diff --git a/packages/misskey-js/src/entities.ts b/packages/misskey-js/src/entities.ts index 86a9bb8ee4..a327f93a59 100644 --- a/packages/misskey-js/src/entities.ts +++ b/packages/misskey-js/src/entities.ts @@ -609,6 +609,9 @@ export type ModerationLog = { } | { type: 'unassignRole'; info: ModerationLogPayloads['unassignRole']; +} | { + type: 'createRole'; + info: ModerationLogPayloads['createRole']; } | { type: 'updateRole'; info: ModerationLogPayloads['updateRole'];