Merge branch 'develop' into refactor-use-formkit-dnd

This commit is contained in:
syuilo 2024-10-14 20:05:44 +09:00 committed by GitHub
commit 3bb022aee0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
394 changed files with 3215 additions and 1850 deletions

View File

@ -75,7 +75,7 @@ jobs:
- run: corepack enable - run: corepack enable
- run: pnpm i --frozen-lockfile - run: pnpm i --frozen-lockfile
- name: Restore eslint cache - name: Restore eslint cache
uses: actions/cache@v4.0.2 uses: actions/cache@v4.1.0
with: with:
path: ${{ env.eslint-cache-path }} path: ${{ env.eslint-cache-path }}
key: eslint-${{ env.eslint-cache-version }}-${{ matrix.workspace }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.ref_name }}-${{ github.sha }} key: eslint-${{ env.eslint-cache-version }}-${{ matrix.workspace }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.ref_name }}-${{ github.sha }}

View File

@ -1,7 +1,32 @@
## 2024.10.1
### Note
- 悪質なユーザからサーバを守る措置の一環として、モデレータ権限を持つユーザの最終アクティブ日時を確認し、
7日間活動していない場合は自動的に招待制へと移行コントロールパネル -> モデレーション -> "誰でも新規登録できるようにする"をオフに変更)するようになりました。
詳細な経緯は https://github.com/misskey-dev/misskey/issues/13437 をご確認ください。
### General
- Feat: ユーザーの名前に禁止ワードを設定できるように
### Client
- Enhance: タイムライン表示時のパフォーマンスを向上
- Enhance: アーカイブした個人宛のお知らせを表示・編集できるように
- Enhance: l10nの更新
- Fix: メールアドレス不要でCaptchaが有効な場合にアカウント登録完了後自動でのログインに失敗する問題を修正
### Server
- Feat: モデレータ権限を持つユーザが全員7日間活動しなかった場合は自動的に招待制へと移行するように ( #13437 )
- Enhance: 個人宛のお知らせは「わかった」を押すと自動的にアーカイブされるように
- Fix: `admin/emoji/update`エンドポイントのidのみ指定した時不正なエラーが発生するバグを修正
- Fix: RBT有効時、リートのリアクションが反映されない問題を修正
### Server
- Fix: キューのエラーログを簡略化するように
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/649)
## 2024.10.0 ## 2024.10.0
### Note ### Note
- サーバー初期設定時に使用する初期パスワードを設定できるようになりました。今後Misskeyサーバーを新たに設置する際には、初回の起動前にコンフィグファイルの`setupPassword`をコメントアウトし、初期パスワードを設定することをおすすめします。(すでに初期設定を完了しているサーバーについては、この変更に伴い対応する必要はありません) - セキュリティ向上のため、サーバー初期設定時に使用する初期パスワードを設定できるようになりました。今後Misskeyサーバーを新たに設置する際には、初回の起動前にコンフィグファイルの`setupPassword`をコメントアウトし、初期パスワードを設定することをおすすめします。(すでに初期設定を完了しているサーバーについては、この変更に伴い対応する必要はありません)
- ホスティングサービスを運営している場合は、コンフィグファイルを構築する際に`setupPassword`をランダムな値に設定し、ユーザーに通知するようにシステムを更新することをおすすめします。 - ホスティングサービスを運営している場合は、コンフィグファイルを構築する際に`setupPassword`をランダムな値に設定し、ユーザーに通知するようにシステムを更新することをおすすめします。
- なお、初期パスワードが設定されていない場合でも初期設定を行うことが可能ですUI上で初期パスワードの入力欄を空欄にすると続行できます - なお、初期パスワードが設定されていない場合でも初期設定を行うことが可能ですUI上で初期パスワードの入力欄を空欄にすると続行できます
- ユーザーデータを読み込む際の型が一部変更されました。 - ユーザーデータを読み込む際の型が一部変更されました。

View File

@ -578,18 +578,18 @@ ESMではディレクトリインポートは廃止されているのと、デ
### Lighten CSS vars ### Lighten CSS vars
``` css ``` css
color: hsl(from var(--accent) h s calc(l + 10)); color: hsl(from var(--MI_THEME-accent) h s calc(l + 10));
``` ```
### Darken CSS vars ### Darken CSS vars
``` css ``` css
color: hsl(from var(--accent) h s calc(l - 10)); color: hsl(from var(--MI_THEME-accent) h s calc(l - 10));
``` ```
### Add alpha to CSS vars ### Add alpha to CSS vars
``` css ``` css
color: color(from var(--accent) srgb r g b / 0.5); color: color(from var(--MI_THEME-accent) srgb r g b / 0.5);
``` ```

View File

@ -34,7 +34,7 @@ defineProps<{
width: 100%; width: 100%;
height: 100%; height: 100%;
cursor: not-allowed; cursor: not-allowed;
--color: color(from var(--error) srgb r g b / 0.25); --color: color(from var(--MI_THEME-error) srgb r g b / 0.25);
background-size: auto auto; background-size: auto auto;
background-image: repeating-linear-gradient(135deg, transparent, transparent 10px, var(--color) 4px, var(--color) 14px); background-image: repeating-linear-gradient(135deg, transparent, transparent 10px, var(--color) 4px, var(--color) 14px);
} }

View File

@ -1252,7 +1252,6 @@ _theme:
buttonBg: "خلفية الأزرار" buttonBg: "خلفية الأزرار"
buttonHoverBg: "خلفية الأزرار (عند التمرير فوقها)" buttonHoverBg: "خلفية الأزرار (عند التمرير فوقها)"
inputBorder: "حواف حقل الإدخال" inputBorder: "حواف حقل الإدخال"
listItemHoverBg: "خلفية عناصر القائمة (عند التمرير فوقها)"
driveFolderBg: "خلفية مجلد قرص التخزين" driveFolderBg: "خلفية مجلد قرص التخزين"
messageBg: "خلفية المحادثة" messageBg: "خلفية المحادثة"
_sfx: _sfx:

View File

@ -1017,7 +1017,6 @@ _theme:
buttonBg: "বাটনের পটভূমি" buttonBg: "বাটনের পটভূমি"
buttonHoverBg: "বাটনের পটভূমি (হভার)" buttonHoverBg: "বাটনের পটভূমি (হভার)"
inputBorder: "ইনপুট ফিল্ডের বর্ডার" inputBorder: "ইনপুট ফিল্ডের বর্ডার"
listItemHoverBg: "লিস্ট আইটেমের পটভূমি (হোভার)"
driveFolderBg: "ড্রাইভ ফোল্ডারের পটভূমি" driveFolderBg: "ড্রাইভ ফোল্ডারের পটভূমি"
wallpaperOverlay: "ওয়ালপেপার ওভারলে" wallpaperOverlay: "ওয়ালপেপার ওভারলে"
badge: "ব্যাজ" badge: "ব্যাজ"

View File

@ -453,6 +453,7 @@ totpDescription: "Escriu una contrasenya d'un sol us fent servir l'aplicació d'
moderator: "Moderador/a" moderator: "Moderador/a"
moderation: "Moderació" moderation: "Moderació"
moderationNote: "Nota de moderació " moderationNote: "Nota de moderació "
moderationNoteDescription: "Pots escriure notes que es compartiran entre els moderadors."
addModerationNote: "Afegir una nota de moderació " addModerationNote: "Afegir una nota de moderació "
moderationLogs: "Registre de moderació " moderationLogs: "Registre de moderació "
nUsersMentioned: "{n} usuaris mencionats" nUsersMentioned: "{n} usuaris mencionats"
@ -1284,6 +1285,15 @@ unknownWebAuthnKey: "Passkey desconeguda"
passkeyVerificationFailed: "La verificació a fallat" passkeyVerificationFailed: "La verificació a fallat"
passkeyVerificationSucceededButPasswordlessLoginDisabled: "La verificació de la passkey a estat correcta, però s'ha deshabilitat l'inici de sessió sense contrasenya." passkeyVerificationSucceededButPasswordlessLoginDisabled: "La verificació de la passkey a estat correcta, però s'ha deshabilitat l'inici de sessió sense contrasenya."
messageToFollower: "Missatge als meus seguidors" messageToFollower: "Missatge als meus seguidors"
target: "Assumpte "
testCaptchaWarning: "És una característica dissenyada per a la prova de CAPTCHA. <strong>No l'utilitzes en l'entorn real.</strong>"
_abuseUserReport:
forward: "Reenviar "
forwardDescription: "Reenvia l'informe a una altra instància com un compte del sistema anònima."
resolve: "Solució "
accept: "Acceptar "
reject: "Rebutjar"
resolveTutorial: "Si l'informe és legítim selecciona \"Acceptar\" per resoldre'l positivament. Però si l'informe no és legítim selecciona \"Rebutjar\" per resoldre'l negativament."
_delivery: _delivery:
status: "Estat d'entrega " status: "Estat d'entrega "
stop: "Suspés" stop: "Suspés"
@ -1421,6 +1431,7 @@ _serverSettings:
reactionsBufferingDescription: "Quan s'activa aquesta opció millora bastant el rendiment en recuperar les línies de temps reduint la càrrega de la base. Com a contrapunt, augmentarà l'ús de memòria de Redís. Desactiva aquesta opció en cas de tenir un servidor amb poca memòria o si tens problemes d'inestabilitat." reactionsBufferingDescription: "Quan s'activa aquesta opció millora bastant el rendiment en recuperar les línies de temps reduint la càrrega de la base. Com a contrapunt, augmentarà l'ús de memòria de Redís. Desactiva aquesta opció en cas de tenir un servidor amb poca memòria o si tens problemes d'inestabilitat."
inquiryUrl: "URL de consulta " inquiryUrl: "URL de consulta "
inquiryUrlDescription: "Escriu adreça URL per al formulari de consulta per al mantenidor del servidor o una pàgina web amb el contacte d'informació." inquiryUrlDescription: "Escriu adreça URL per al formulari de consulta per al mantenidor del servidor o una pàgina web amb el contacte d'informació."
thisSettingWillAutomaticallyOffWhenModeratorsInactive: "Si no es detecta activitat per part del moderador durant un període de temps, aquesta opció es desactiva automàticament per evitar el correu brossa."
_accountMigration: _accountMigration:
moveFrom: "Migrar un altre compte a aquest" moveFrom: "Migrar un altre compte a aquest"
moveFromSub: "Crear un àlies per un altre compte" moveFromSub: "Crear un àlies per un altre compte"
@ -1974,7 +1985,6 @@ _theme:
buttonBg: "Fons botó " buttonBg: "Fons botó "
buttonHoverBg: "Fons botó (en passar-hi per sobre)" buttonHoverBg: "Fons botó (en passar-hi per sobre)"
inputBorder: "Contorn del cap d'introducció " inputBorder: "Contorn del cap d'introducció "
listItemHoverBg: "Fons dels elements d'una llista"
driveFolderBg: "Fons de la carpeta Disc" driveFolderBg: "Fons de la carpeta Disc"
wallpaperOverlay: "Superposició del fons de pantalla " wallpaperOverlay: "Superposició del fons de pantalla "
badge: "Insígnia " badge: "Insígnia "
@ -2520,6 +2530,8 @@ _moderationLogTypes:
markSensitiveDriveFile: "Fitxer marcat com a sensible" markSensitiveDriveFile: "Fitxer marcat com a sensible"
unmarkSensitiveDriveFile: "S'ha tret la marca de sensible del fitxer" unmarkSensitiveDriveFile: "S'ha tret la marca de sensible del fitxer"
resolveAbuseReport: "Informe resolt" resolveAbuseReport: "Informe resolt"
forwardAbuseReport: "Informe reenviat"
updateAbuseReportNote: "Nota de moderació d'un informe actualitzat"
createInvitation: "Crear codi d'invitació " createInvitation: "Crear codi d'invitació "
createAd: "Anunci creat" createAd: "Anunci creat"
deleteAd: "Anunci esborrat" deleteAd: "Anunci esborrat"

View File

@ -1629,7 +1629,6 @@ _theme:
buttonBg: "Pozadí tlačítka" buttonBg: "Pozadí tlačítka"
buttonHoverBg: "Pozadí tlačítka (Hover)" buttonHoverBg: "Pozadí tlačítka (Hover)"
inputBorder: "Ohraničení vstupního pole" inputBorder: "Ohraničení vstupního pole"
listItemHoverBg: "Pozadí položky seznamu (Hover)"
driveFolderBg: "Pozadí složky disku" driveFolderBg: "Pozadí složky disku"
wallpaperOverlay: "Překrytí tapety" wallpaperOverlay: "Překrytí tapety"
badge: "Odznak" badge: "Odznak"

View File

@ -1784,7 +1784,6 @@ _theme:
buttonBg: "Hintergrund von Schaltflächen" buttonBg: "Hintergrund von Schaltflächen"
buttonHoverBg: "Hintergrund von Schaltflächen (Mouseover)" buttonHoverBg: "Hintergrund von Schaltflächen (Mouseover)"
inputBorder: "Rahmen von Eingabefeldern" inputBorder: "Rahmen von Eingabefeldern"
listItemHoverBg: "Hintergrund von Listeneinträgen (Mouseover)"
driveFolderBg: "Hintergrund von Drive-Ordnern" driveFolderBg: "Hintergrund von Drive-Ordnern"
wallpaperOverlay: "Hintergrundbild-Overlay" wallpaperOverlay: "Hintergrundbild-Overlay"
badge: "Wappen" badge: "Wappen"

View File

@ -112,7 +112,7 @@ enterEmoji: "Enter an emoji"
renote: "Renote" renote: "Renote"
unrenote: "Remove renote" unrenote: "Remove renote"
renoted: "Renoted." renoted: "Renoted."
renotedToX: "Renote to {name}." renotedToX: "Renoted to {name}."
cantRenote: "This post can't be renoted." cantRenote: "This post can't be renoted."
cantReRenote: "A renote can't be renoted." cantReRenote: "A renote can't be renoted."
quote: "Quote" quote: "Quote"
@ -454,6 +454,7 @@ totpDescription: "Use an authenticator app to enter one-time passwords"
moderator: "Moderator" moderator: "Moderator"
moderation: "Moderation" moderation: "Moderation"
moderationNote: "Moderation note" moderationNote: "Moderation note"
moderationNoteDescription: "You can fill in notes that will be shared only among moderators."
addModerationNote: "Add moderation note" addModerationNote: "Add moderation note"
moderationLogs: "Moderation logs" moderationLogs: "Moderation logs"
nUsersMentioned: "Mentioned by {n} users" nUsersMentioned: "Mentioned by {n} users"
@ -921,6 +922,7 @@ followersVisibility: "Visibility of followers"
continueThread: "View thread continuation" continueThread: "View thread continuation"
deleteAccountConfirm: "This will irreversibly delete your account. Proceed?" deleteAccountConfirm: "This will irreversibly delete your account. Proceed?"
incorrectPassword: "Incorrect password." incorrectPassword: "Incorrect password."
incorrectTotp: "The one-time password is incorrect or has expired."
voteConfirm: "Confirm your vote for \"{choice}\"?" voteConfirm: "Confirm your vote for \"{choice}\"?"
hide: "Hide" hide: "Hide"
useDrawerReactionPickerForMobile: "Display reaction picker as drawer on mobile" useDrawerReactionPickerForMobile: "Display reaction picker as drawer on mobile"
@ -1284,6 +1286,14 @@ unknownWebAuthnKey: "Unknown Passkey"
passkeyVerificationFailed: "Passkey verification has failed." passkeyVerificationFailed: "Passkey verification has failed."
passkeyVerificationSucceededButPasswordlessLoginDisabled: "Passkey verification has succeeded but password-less login is disabled." passkeyVerificationSucceededButPasswordlessLoginDisabled: "Passkey verification has succeeded but password-less login is disabled."
messageToFollower: "Message to followers" messageToFollower: "Message to followers"
target: "Target"
_abuseUserReport:
forward: "Forward"
forwardDescription: "Forward the report to a remote server as an anonymous system account."
resolve: "Resolve"
accept: "Accept"
reject: "Reject"
resolveTutorial: "If the report is legitimate in content, select \"Accept\" to mark the case as resolved in the affirmative.\nIf the content of the report is not legitimate, select \"Reject\" to mark the case as resolved in the negative."
_delivery: _delivery:
status: "Delivery status" status: "Delivery status"
stop: "Suspended" stop: "Suspended"
@ -1737,7 +1747,7 @@ _role:
canManageAvatarDecorations: "Manage avatar decorations" canManageAvatarDecorations: "Manage avatar decorations"
driveCapacity: "Drive capacity" driveCapacity: "Drive capacity"
alwaysMarkNsfw: "Always mark files as NSFW" alwaysMarkNsfw: "Always mark files as NSFW"
canUpdateBioMedia: "Allow to edit an icon or a banner image" canUpdateBioMedia: "Can edit an icon or a banner image"
pinMax: "Maximum number of pinned notes" pinMax: "Maximum number of pinned notes"
antennaMax: "Maximum number of antennas" antennaMax: "Maximum number of antennas"
wordMuteMax: "Maximum number of characters allowed in word mutes" wordMuteMax: "Maximum number of characters allowed in word mutes"
@ -1974,7 +1984,6 @@ _theme:
buttonBg: "Button background" buttonBg: "Button background"
buttonHoverBg: "Button background (Hover)" buttonHoverBg: "Button background (Hover)"
inputBorder: "Input field border" inputBorder: "Input field border"
listItemHoverBg: "List item background (Hover)"
driveFolderBg: "Drive folder background" driveFolderBg: "Drive folder background"
wallpaperOverlay: "Wallpaper overlay" wallpaperOverlay: "Wallpaper overlay"
badge: "Badge" badge: "Badge"
@ -2473,22 +2482,22 @@ _webhookSettings:
reaction: "When receiving a reaction" reaction: "When receiving a reaction"
mention: "When being mentioned" mention: "When being mentioned"
_systemEvents: _systemEvents:
abuseReport: "When received a new abuse report" abuseReport: "When received a new report"
abuseReportResolved: "When resolved abuse report" abuseReportResolved: "When resolved report"
userCreated: "When user is created" userCreated: "When user is created"
deleteConfirm: "Are you sure you want to delete the Webhook?" deleteConfirm: "Are you sure you want to delete the Webhook?"
testRemarks: "Click the button to the right of the switch to send a test Webhook with dummy data." testRemarks: "Click the button to the right of the switch to send a test Webhook with dummy data."
_abuseReport: _abuseReport:
_notificationRecipient: _notificationRecipient:
createRecipient: "Add a recipient for abuse reports" createRecipient: "Add a recipient for reports"
modifyRecipient: "Edit a recipient for abuse reports" modifyRecipient: "Edit a recipient for reports"
recipientType: "Notification type" recipientType: "Notification type"
_recipientType: _recipientType:
mail: "Email" mail: "Email"
webhook: "Webhook" webhook: "Webhook"
_captions: _captions:
mail: "Send the email to moderators' email addresses when you receive abuse." mail: "Send the email to moderators' email addresses when you receive reports."
webhook: "Send a notification to SystemWebhook when you receive or resolve abuse." webhook: "Send a notification to System Webhook when you receive or resolve reports."
keywords: "Keywords" keywords: "Keywords"
notifiedUser: "Users to notify" notifiedUser: "Users to notify"
notifiedWebhook: "Webhook to use" notifiedWebhook: "Webhook to use"
@ -2521,6 +2530,8 @@ _moderationLogTypes:
markSensitiveDriveFile: "File marked as sensitive" markSensitiveDriveFile: "File marked as sensitive"
unmarkSensitiveDriveFile: "File unmarked as sensitive" unmarkSensitiveDriveFile: "File unmarked as sensitive"
resolveAbuseReport: "Report resolved" resolveAbuseReport: "Report resolved"
forwardAbuseReport: "Report forwarded"
updateAbuseReportNote: "Moderation note of a report updated"
createInvitation: "Invite generated" createInvitation: "Invite generated"
createAd: "Ad created" createAd: "Ad created"
deleteAd: "Ad deleted" deleteAd: "Ad deleted"
@ -2528,18 +2539,18 @@ _moderationLogTypes:
createAvatarDecoration: "Avatar decoration created" createAvatarDecoration: "Avatar decoration created"
updateAvatarDecoration: "Avatar decoration updated" updateAvatarDecoration: "Avatar decoration updated"
deleteAvatarDecoration: "Avatar decoration deleted" deleteAvatarDecoration: "Avatar decoration deleted"
unsetUserAvatar: "Unset this user's avatar" unsetUserAvatar: "User avatar unset"
unsetUserBanner: "Unset this user's banner" unsetUserBanner: "User banner unset"
createSystemWebhook: "Create SystemWebhook" createSystemWebhook: "System Webhook created"
updateSystemWebhook: "Update SystemWebhook" updateSystemWebhook: "System Webhook updated"
deleteSystemWebhook: "Delete SystemWebhook" deleteSystemWebhook: "System Webhook deleted"
createAbuseReportNotificationRecipient: "Create a recipient for abuse reports" createAbuseReportNotificationRecipient: "Recipient for reports created"
updateAbuseReportNotificationRecipient: "Update recipients for abuse reports" updateAbuseReportNotificationRecipient: "Recipient for reports updated"
deleteAbuseReportNotificationRecipient: "Delete a recipient for abuse reports" deleteAbuseReportNotificationRecipient: "Recipient for reports deleted"
deleteAccount: "Delete the account" deleteAccount: "Account deleted"
deletePage: "Delete the page" deletePage: "Page deleted"
deleteFlash: "Delete Play" deleteFlash: "Play deleted"
deleteGalleryPost: "Delete the gallery post" deleteGalleryPost: "Gallery post deleted"
_fileViewer: _fileViewer:
title: "File details" title: "File details"
type: "File type" type: "File type"

View File

@ -1915,7 +1915,6 @@ _theme:
buttonBg: "Fondo de botón" buttonBg: "Fondo de botón"
buttonHoverBg: "Fondo de botón (hover)" buttonHoverBg: "Fondo de botón (hover)"
inputBorder: "Borde de los campos de entrada" inputBorder: "Borde de los campos de entrada"
listItemHoverBg: "Fondo de elemento de listas (hover)"
driveFolderBg: "Fondo de capeta del drive" driveFolderBg: "Fondo de capeta del drive"
wallpaperOverlay: "Transparencia del fondo de pantalla" wallpaperOverlay: "Transparencia del fondo de pantalla"
badge: "Medalla" badge: "Medalla"

View File

@ -1701,7 +1701,6 @@ _theme:
buttonBg: "Arrière-plan du bouton" buttonBg: "Arrière-plan du bouton"
buttonHoverBg: "Arrière-plan du bouton (survolé)" buttonHoverBg: "Arrière-plan du bouton (survolé)"
inputBorder: "Cadre de la zone de texte" inputBorder: "Cadre de la zone de texte"
listItemHoverBg: "Arrière-plan d'item de liste (survolé)"
driveFolderBg: "Arrière-plan du dossier de disque" driveFolderBg: "Arrière-plan du dossier de disque"
wallpaperOverlay: "Superposition de fond d'écran" wallpaperOverlay: "Superposition de fond d'écran"
badge: "Badge" badge: "Badge"

View File

@ -1924,7 +1924,6 @@ _theme:
buttonBg: "Latar belakang tombol" buttonBg: "Latar belakang tombol"
buttonHoverBg: "Latar belakang tombol (Mengambang)" buttonHoverBg: "Latar belakang tombol (Mengambang)"
inputBorder: "Batas bidang masukan" inputBorder: "Batas bidang masukan"
listItemHoverBg: "Latar belakang daftar item (Mengambang)"
driveFolderBg: "Latar belakang folder drive" driveFolderBg: "Latar belakang folder drive"
wallpaperOverlay: "Lapisan wallpaper" wallpaperOverlay: "Lapisan wallpaper"
badge: "Lencana" badge: "Lencana"

40
locales/index.d.ts vendored
View File

@ -4366,6 +4366,10 @@ export interface Locale extends ILocale {
* *
*/ */
"enableChartsForFederatedInstances": string; "enableChartsForFederatedInstances": string;
/**
*
*/
"enableStatsForFederatedInstances": string;
/** /**
* *
*/ */
@ -5166,6 +5170,26 @@ export interface Locale extends ILocale {
* *
*/ */
"target": string; "target": string;
/**
* CAPTCHAのテストを目的とした機能です<strong>使</strong>
*/
"testCaptchaWarning": string;
/**
*
*/
"prohibitedWordsForNameOfUser": string;
/**
*
*/
"prohibitedWordsForNameOfUserDescription": string;
/**
*
*/
"yourNameContainsProhibitedWords": string;
/**
* 使
*/
"yourNameContainsProhibitedWordsDescription": string;
"_abuseUserReport": { "_abuseUserReport": {
/** /**
* *
@ -5696,6 +5720,10 @@ export interface Locale extends ILocale {
* URLやWebページのURLを指定します * URLやWebページのURLを指定します
*/ */
"inquiryUrlDescription": string; "inquiryUrlDescription": string;
/**
*
*/
"thisSettingWillAutomaticallyOffWhenModeratorsInactive": string;
}; };
"_accountMigration": { "_accountMigration": {
/** /**
@ -7705,10 +7733,6 @@ export interface Locale extends ILocale {
* *
*/ */
"inputBorder": string; "inputBorder": string;
/**
* ()
*/
"listItemHoverBg": string;
/** /**
* *
*/ */
@ -9637,6 +9661,14 @@ export interface Locale extends ILocale {
* *
*/ */
"userCreated": string; "userCreated": string;
/**
*
*/
"inactiveModeratorsWarning": string;
/**
*
*/
"inactiveModeratorsInvitationOnlyChanged": string;
}; };
/** /**
* Webhookを削除しますか * Webhookを削除しますか

View File

@ -454,6 +454,7 @@ totpDescription: "Puoi autenticarti inserendo un codice OTP tramite la tua App d
moderator: "Moderatore" moderator: "Moderatore"
moderation: "moderazione" moderation: "moderazione"
moderationNote: "Promemoria di moderazione" moderationNote: "Promemoria di moderazione"
moderationNoteDescription: "Puoi scrivere promemoria condivisi solo tra moderatori."
addModerationNote: "Aggiungi promemoria di moderazione" addModerationNote: "Aggiungi promemoria di moderazione"
moderationLogs: "Cronologia di moderazione" moderationLogs: "Cronologia di moderazione"
nUsersMentioned: "{n} profili ne parlano" nUsersMentioned: "{n} profili ne parlano"
@ -841,7 +842,7 @@ onlineStatus: "Stato di connessione"
hideOnlineStatus: "Modalità invisibile" hideOnlineStatus: "Modalità invisibile"
hideOnlineStatusDescription: "Attivando questa opzione potresti ridurre l'usabilità di alcune funzioni, come la ricerca." hideOnlineStatusDescription: "Attivando questa opzione potresti ridurre l'usabilità di alcune funzioni, come la ricerca."
online: "Online" online: "Online"
active: "Attività" active: "Attivo"
offline: "Offline" offline: "Offline"
notRecommended: "Sconsigliato" notRecommended: "Sconsigliato"
botProtection: "Protezione contro i bot" botProtection: "Protezione contro i bot"
@ -1086,6 +1087,7 @@ retryAllQueuesConfirmTitle: "Vuoi ritentare adesso?"
retryAllQueuesConfirmText: "Potrebbe sovraccaricare il server temporaneamente." retryAllQueuesConfirmText: "Potrebbe sovraccaricare il server temporaneamente."
enableChartsForRemoteUser: "Abilita i grafici per i profili remoti" enableChartsForRemoteUser: "Abilita i grafici per i profili remoti"
enableChartsForFederatedInstances: "Abilita i grafici per le istanze federate" enableChartsForFederatedInstances: "Abilita i grafici per le istanze federate"
enableStatsForFederatedInstances: "Informazioni statistiche sui server federati"
showClipButtonInNoteFooter: "Aggiungi il bottone Clip tra le azioni delle Note" showClipButtonInNoteFooter: "Aggiungi il bottone Clip tra le azioni delle Note"
reactionsDisplaySize: "Grandezza delle reazioni" reactionsDisplaySize: "Grandezza delle reazioni"
limitWidthOfReaction: "Limita la larghezza delle reazioni e ridimensionale" limitWidthOfReaction: "Limita la larghezza delle reazioni e ridimensionale"
@ -1285,6 +1287,19 @@ unknownWebAuthnKey: "Questa è una passkey sconosciuta."
passkeyVerificationFailed: "La verifica della passkey non è riuscita." passkeyVerificationFailed: "La verifica della passkey non è riuscita."
passkeyVerificationSucceededButPasswordlessLoginDisabled: "La verifica della passkey è riuscita, ma l'accesso senza password è disabilitato." passkeyVerificationSucceededButPasswordlessLoginDisabled: "La verifica della passkey è riuscita, ma l'accesso senza password è disabilitato."
messageToFollower: "Messaggio ai follower" messageToFollower: "Messaggio ai follower"
target: "Riferimento"
testCaptchaWarning: "Questa funzione è destinata al test CAPTCHA. <strong>Da non utilizzare in ambiente di produzione.</strong>"
prohibitedWordsForNameOfUser: "Parole proibite (nome utente)"
prohibitedWordsForNameOfUserDescription: "Il sistema rifiuta di rinominare un utente, se il nome contiene qualsiasi parola nell'elenco. Sono esenti i profili con privilegi di moderazione."
yourNameContainsProhibitedWords: "Il nome che hai scelto contiene una o più parole vietate"
yourNameContainsProhibitedWordsDescription: "Se desideri comunque utilizzare questo nome, contatta l''amministrazione."
_abuseUserReport:
forward: "Inoltra"
forwardDescription: "Inoltra il report al server remoto, per mezzo di account di sistema, anonimo."
resolve: "Risolvi"
accept: "Approva"
reject: "Rifiuta"
resolveTutorial: "Se moderi una segnalazione legittima, scegli \"Approva\" per risolvere positivamente.\nSe la segnalazione non è legittima, seleziona \"Rifiuta\" per risolvere negativamente."
_delivery: _delivery:
status: "Stato della consegna" status: "Stato della consegna"
stop: "Sospensione" stop: "Sospensione"
@ -1312,16 +1327,16 @@ _bubbleGame:
_announcement: _announcement:
forExistingUsers: "Solo ai profili attuali" forExistingUsers: "Solo ai profili attuali"
forExistingUsersDescription: "L'annuncio sarà visibile solo ai profili esistenti in questo momento. Se disabilitato, sarà visibile anche ai profili che verranno creati dopo la pubblicazione di questo annuncio." forExistingUsersDescription: "L'annuncio sarà visibile solo ai profili esistenti in questo momento. Se disabilitato, sarà visibile anche ai profili che verranno creati dopo la pubblicazione di questo annuncio."
needConfirmationToRead: "Richiede la conferma di lettura" needConfirmationToRead: "Conferma di lettura obbligatoria"
needConfirmationToReadDescription: "Sarà visualizzata una finestra di dialogo che richiede la conferma di lettura. Inoltre, non è soggetto a conferme di lettura massicce." needConfirmationToReadDescription: "I profili riceveranno una finestra di dialogo che richiede di accettare obbligatoriamente per procedere. Tale richiesta è esente da \"conferma tutte\"."
end: "Archivia l'annuncio" end: "Archivia l'annuncio"
tooManyActiveAnnouncementDescription: "L'esperienza delle persone può peggiorare se ci sono troppi annunci attivi. Considera anche l'archiviazione degli annunci conclusi." tooManyActiveAnnouncementDescription: "L'esperienza delle persone può peggiorare se ci sono troppi annunci attivi. Considera anche l'archiviazione degli annunci conclusi."
readConfirmTitle: "Segnare come già letto?" readConfirmTitle: "Segnare come già letto?"
readConfirmText: "Hai già letto \"{title}˝?" readConfirmText: "Hai già letto \"{title}˝?"
shouldNotBeUsedToPresentPermanentInfo: "Ti consigliamo di utilizzare gli annunci per pubblicare informazioni tempestive e limitate nel tempo, anziché informazioni importanti a lungo andare nel tempo, poiché potrebbero risultare difficili da ritrovare e peggiorare la fruibilità del servizio, specialmente alle nuove persone iscritte." shouldNotBeUsedToPresentPermanentInfo: "Ti consigliamo di utilizzare gli annunci per pubblicare informazioni tempestive e limitate nel tempo, anziché informazioni importanti a lungo andare nel tempo, poiché potrebbero risultare difficili da ritrovare e peggiorare la fruibilità del servizio, specialmente alle nuove persone iscritte."
dialogAnnouncementUxWarn: "Ti consigliamo di usarli con cautela, poiché è molto probabile che avere più di un annuncio in stile \"finestra di dialogo\" peggiori sensibilmente la fruibilità del servizio, specialmente alle nuove persone iscritte." dialogAnnouncementUxWarn: "Ti consigliamo di usarli con cautela, poiché è molto probabile che avere più di un annuncio in stile \"finestra di dialogo\" peggiori sensibilmente la fruibilità del servizio, specialmente alle nuove persone iscritte."
silence: "Silenziare gli annunci" silence: "Annuncio silenzioso"
silenceDescription: "Se attivi questa opzione, non riceverai notifiche sugli annunci, evitando di contrassegnarle come già lette." silenceDescription: "Attivando questa opzione, non invierai la notifica, evitando che debba essere contrassegnata come già letta."
_initialAccountSetting: _initialAccountSetting:
accountCreated: "Il tuo profilo è stato creato!" accountCreated: "Il tuo profilo è stato creato!"
letsStartAccountSetup: "Per iniziare, impostiamo il tuo profilo." letsStartAccountSetup: "Per iniziare, impostiamo il tuo profilo."
@ -1422,6 +1437,7 @@ _serverSettings:
reactionsBufferingDescription: "Attivando questa opzione, puoi migliorare significativamente le prestazioni durante la creazione delle reazioni e ridurre il carico sul database. Tuttavia, aumenterà l'impiego di memoria Redis." reactionsBufferingDescription: "Attivando questa opzione, puoi migliorare significativamente le prestazioni durante la creazione delle reazioni e ridurre il carico sul database. Tuttavia, aumenterà l'impiego di memoria Redis."
inquiryUrl: "URL di contatto" inquiryUrl: "URL di contatto"
inquiryUrlDescription: "Specificare l'URL al modulo di contatto, oppure le informazioni con i dati di contatto dell'amministrazione." inquiryUrlDescription: "Specificare l'URL al modulo di contatto, oppure le informazioni con i dati di contatto dell'amministrazione."
thisSettingWillAutomaticallyOffWhenModeratorsInactive: "Per prevenire SPAM, questa impostazione verrà disattivata automaticamente, se non si rileva alcuna attività di moderazione durante un certo periodo di tempo."
_accountMigration: _accountMigration:
moveFrom: "Migra un altro profilo dentro a questo" moveFrom: "Migra un altro profilo dentro a questo"
moveFromSub: "Crea un alias verso un altro profilo remoto" moveFromSub: "Crea un alias verso un altro profilo remoto"
@ -1975,7 +1991,6 @@ _theme:
buttonBg: "Sfondo del pulsante" buttonBg: "Sfondo del pulsante"
buttonHoverBg: "Sfondo del pulsante (sorvolato)" buttonHoverBg: "Sfondo del pulsante (sorvolato)"
inputBorder: "Inquadra casella di testo" inputBorder: "Inquadra casella di testo"
listItemHoverBg: "Sfondo della voce di elenco (sorvolato)"
driveFolderBg: "Sfondo della cartella di disco" driveFolderBg: "Sfondo della cartella di disco"
wallpaperOverlay: "Sovrapposizione dello sfondo" wallpaperOverlay: "Sovrapposizione dello sfondo"
badge: "Distintivo" badge: "Distintivo"
@ -2188,7 +2203,7 @@ _widgets:
_userList: _userList:
chooseList: "Seleziona una lista" chooseList: "Seleziona una lista"
clicker: "Cliccaggio" clicker: "Cliccaggio"
birthdayFollowings: "Chi nacque oggi" birthdayFollowings: "Compleanni del giorno"
_cw: _cw:
hide: "Nascondere" hide: "Nascondere"
show: "Continua la lettura..." show: "Continua la lettura..."
@ -2477,6 +2492,8 @@ _webhookSettings:
abuseReport: "Quando arriva una segnalazione" abuseReport: "Quando arriva una segnalazione"
abuseReportResolved: "Quando una segnalazione è risolta" abuseReportResolved: "Quando una segnalazione è risolta"
userCreated: "Quando viene creato un profilo" userCreated: "Quando viene creato un profilo"
inactiveModeratorsWarning: "Quando un profilo moderatore rimane inattivo per un determinato periodo"
inactiveModeratorsInvitationOnlyChanged: "Quando la moderazione è rimasta inattiva per un determinato periodo e il sistema è cambiato in modalità \"solo inviti\""
deleteConfirm: "Vuoi davvero eliminare il Webhook?" deleteConfirm: "Vuoi davvero eliminare il Webhook?"
testRemarks: "Clicca il bottone a destra dell'interruttore, per provare l'invio di un webhook con dati fittizi." testRemarks: "Clicca il bottone a destra dell'interruttore, per provare l'invio di un webhook con dati fittizi."
_abuseReport: _abuseReport:
@ -2522,6 +2539,8 @@ _moderationLogTypes:
markSensitiveDriveFile: "File nel Drive segnato come esplicito" markSensitiveDriveFile: "File nel Drive segnato come esplicito"
unmarkSensitiveDriveFile: "File nel Drive segnato come non esplicito" unmarkSensitiveDriveFile: "File nel Drive segnato come non esplicito"
resolveAbuseReport: "Segnalazione risolta" resolveAbuseReport: "Segnalazione risolta"
forwardAbuseReport: "Segnalazione inoltrata"
updateAbuseReportNote: "Ha aggiornato la segnalazione"
createInvitation: "Genera codice di invito" createInvitation: "Genera codice di invito"
createAd: "Banner creato" createAd: "Banner creato"
deleteAd: "Banner eliminato" deleteAd: "Banner eliminato"

View File

@ -1087,6 +1087,7 @@ retryAllQueuesConfirmTitle: "今すぐ再試行しますか?"
retryAllQueuesConfirmText: "一時的にサーバーの負荷が増大することがあります。" retryAllQueuesConfirmText: "一時的にサーバーの負荷が増大することがあります。"
enableChartsForRemoteUser: "リモートユーザーのチャートを生成" enableChartsForRemoteUser: "リモートユーザーのチャートを生成"
enableChartsForFederatedInstances: "リモートサーバーのチャートを生成" enableChartsForFederatedInstances: "リモートサーバーのチャートを生成"
enableStatsForFederatedInstances: "リモートサーバーの情報を取得"
showClipButtonInNoteFooter: "ノートのアクションにクリップを追加" showClipButtonInNoteFooter: "ノートのアクションにクリップを追加"
reactionsDisplaySize: "リアクションの表示サイズ" reactionsDisplaySize: "リアクションの表示サイズ"
limitWidthOfReaction: "リアクションの最大横幅を制限し、縮小して表示する" limitWidthOfReaction: "リアクションの最大横幅を制限し、縮小して表示する"
@ -1287,6 +1288,11 @@ passkeyVerificationFailed: "パスキーの検証に失敗しました。"
passkeyVerificationSucceededButPasswordlessLoginDisabled: "パスキーの検証に成功しましたが、パスワードレスログインが無効になっています。" passkeyVerificationSucceededButPasswordlessLoginDisabled: "パスキーの検証に成功しましたが、パスワードレスログインが無効になっています。"
messageToFollower: "フォロワーへのメッセージ" messageToFollower: "フォロワーへのメッセージ"
target: "対象" target: "対象"
testCaptchaWarning: "CAPTCHAのテストを目的とした機能です。<strong>本番環境で使用しないでください。</strong>"
prohibitedWordsForNameOfUser: "禁止ワード(ユーザーの名前)"
prohibitedWordsForNameOfUserDescription: "このリストに含まれる文字列がユーザーの名前に含まれる場合、ユーザーの名前の変更を拒否します。モデレーター権限を持つユーザーはこの制限の影響を受けません。"
yourNameContainsProhibitedWords: "変更しようとした名前に禁止された文字列が含まれています"
yourNameContainsProhibitedWordsDescription: "名前に禁止されている文字列が含まれています。この名前を使用したい場合は、サーバー管理者にお問い合わせください。"
_abuseUserReport: _abuseUserReport:
forward: "転送" forward: "転送"
@ -1440,6 +1446,7 @@ _serverSettings:
reactionsBufferingDescription: "有効にすると、リアクション作成時のパフォーマンスが大幅に向上し、データベースへの負荷を軽減することが可能です。ただし、Redisのメモリ使用量は増加します。" reactionsBufferingDescription: "有効にすると、リアクション作成時のパフォーマンスが大幅に向上し、データベースへの負荷を軽減することが可能です。ただし、Redisのメモリ使用量は増加します。"
inquiryUrl: "問い合わせ先URL" inquiryUrl: "問い合わせ先URL"
inquiryUrlDescription: "サーバー運営者へのお問い合わせフォームのURLや、運営者の連絡先等が記載されたWebページのURLを指定します。" inquiryUrlDescription: "サーバー運営者へのお問い合わせフォームのURLや、運営者の連絡先等が記載されたWebページのURLを指定します。"
thisSettingWillAutomaticallyOffWhenModeratorsInactive: "一定期間モデレーターのアクティビティが検出されなかった場合、スパム防止のためこの設定は自動でオフになります。"
_accountMigration: _accountMigration:
moveFrom: "別のアカウントからこのアカウントに移行" moveFrom: "別のアカウントからこのアカウントに移行"
@ -2018,7 +2025,6 @@ _theme:
buttonBg: "ボタンの背景" buttonBg: "ボタンの背景"
buttonHoverBg: "ボタンの背景 (ホバー)" buttonHoverBg: "ボタンの背景 (ホバー)"
inputBorder: "入力ボックスの縁取り" inputBorder: "入力ボックスの縁取り"
listItemHoverBg: "リスト項目の背景 (ホバー)"
driveFolderBg: "ドライブフォルダーの背景" driveFolderBg: "ドライブフォルダーの背景"
wallpaperOverlay: "壁紙のオーバーレイ" wallpaperOverlay: "壁紙のオーバーレイ"
badge: "バッジ" badge: "バッジ"
@ -2553,6 +2559,8 @@ _webhookSettings:
abuseReport: "ユーザーから通報があったとき" abuseReport: "ユーザーから通報があったとき"
abuseReportResolved: "ユーザーからの通報を処理したとき" abuseReportResolved: "ユーザーからの通報を処理したとき"
userCreated: "ユーザーが作成されたとき" userCreated: "ユーザーが作成されたとき"
inactiveModeratorsWarning: "モデレーターが一定期間非アクティブになったとき"
inactiveModeratorsInvitationOnlyChanged: "モデレーターが一定期間非アクティブだったため、システムにより招待制へと変更されたとき"
deleteConfirm: "Webhookを削除しますか" deleteConfirm: "Webhookを削除しますか"
testRemarks: "スイッチの右にあるボタンをクリックするとダミーのデータを使用したテスト用Webhookを送信できます。" testRemarks: "スイッチの右にあるボタンをクリックするとダミーのデータを使用したテスト用Webhookを送信できます。"

View File

@ -1943,7 +1943,6 @@ _theme:
buttonBg: "ボタンの背景" buttonBg: "ボタンの背景"
buttonHoverBg: "ボタンの背景 (ホバー)" buttonHoverBg: "ボタンの背景 (ホバー)"
inputBorder: "入力ボックスの縁取り" inputBorder: "入力ボックスの縁取り"
listItemHoverBg: "リスト項目の背景 (ホバー)"
driveFolderBg: "ドライブフォルダーの背景" driveFolderBg: "ドライブフォルダーの背景"
wallpaperOverlay: "壁紙のオーバーレイ" wallpaperOverlay: "壁紙のオーバーレイ"
badge: "バッジ" badge: "バッジ"

View File

@ -1087,6 +1087,7 @@ retryAllQueuesConfirmTitle: "지금 다시 시도하시겠습니까?"
retryAllQueuesConfirmText: "일시적으로 서버의 부하가 증가할 수 있습니다." retryAllQueuesConfirmText: "일시적으로 서버의 부하가 증가할 수 있습니다."
enableChartsForRemoteUser: "리모트 유저의 차트를 생성" enableChartsForRemoteUser: "리모트 유저의 차트를 생성"
enableChartsForFederatedInstances: "리모트 서버의 차트를 생성" enableChartsForFederatedInstances: "리모트 서버의 차트를 생성"
enableStatsForFederatedInstances: "리모트 서버 정보 받아오기"
showClipButtonInNoteFooter: "노트 동작에 클립을 추가" showClipButtonInNoteFooter: "노트 동작에 클립을 추가"
reactionsDisplaySize: "리액션 표시 크기" reactionsDisplaySize: "리액션 표시 크기"
limitWidthOfReaction: "리액션의 최대 폭을 제한하고 작게 표시하기" limitWidthOfReaction: "리액션의 최대 폭을 제한하고 작게 표시하기"
@ -1287,6 +1288,11 @@ passkeyVerificationFailed: "패스키 검증을 실패했습니다."
passkeyVerificationSucceededButPasswordlessLoginDisabled: "패스키를 검증했으나, 비밀번호 없이 로그인하기가 꺼져 있습니다." passkeyVerificationSucceededButPasswordlessLoginDisabled: "패스키를 검증했으나, 비밀번호 없이 로그인하기가 꺼져 있습니다."
messageToFollower: "팔로워에 보낼 메시지" messageToFollower: "팔로워에 보낼 메시지"
target: "대상" target: "대상"
testCaptchaWarning: "CAPTCHA를 테스트하기 위한 기능입니다. <strong>실제 환경에서는 사용하지 마세요.</strong>"
prohibitedWordsForNameOfUser: "금지 단어 (사용자 이름)"
prohibitedWordsForNameOfUserDescription: "이 목록에 포함되는 키워드가 사용자 이름에 있는 경우, 일반 사용자는 이름을 바꿀 수 없습니다. 모더레이터 권한을 가진 사용자는 제한 대상에서 제외됩니다."
yourNameContainsProhibitedWords: "바꾸려는 이름에 금지된 키워드가 포함되어 있습니다."
yourNameContainsProhibitedWordsDescription: "이름에 금지된 키워드가 있습니다. 이름을 사용해야 하는 경우, 서버 관리자에 문의하세요."
_abuseUserReport: _abuseUserReport:
forward: "전달" forward: "전달"
forwardDescription: "익명 시스템 계정을 사용하여 리모트 서버에 신고 내용을 전달할 수 있습니다." forwardDescription: "익명 시스템 계정을 사용하여 리모트 서버에 신고 내용을 전달할 수 있습니다."
@ -1431,6 +1437,7 @@ _serverSettings:
reactionsBufferingDescription: "활성화 한 경우, 리액션 작성 퍼포먼스가 대폭 향상되어 DB의 부하를 줄일 수 있으나, Redis의 메모리 사용량이 많아집니다." reactionsBufferingDescription: "활성화 한 경우, 리액션 작성 퍼포먼스가 대폭 향상되어 DB의 부하를 줄일 수 있으나, Redis의 메모리 사용량이 많아집니다."
inquiryUrl: "문의처 URL" inquiryUrl: "문의처 URL"
inquiryUrlDescription: "서버 운영자에게 보내는 문의 양식의 URL이나 운영자의 연락처 등이 적힌 웹 페이지의 URL을 설정합니다." inquiryUrlDescription: "서버 운영자에게 보내는 문의 양식의 URL이나 운영자의 연락처 등이 적힌 웹 페이지의 URL을 설정합니다."
thisSettingWillAutomaticallyOffWhenModeratorsInactive: "일정 기간동안 모더레이터의 활동이 감지되지 않는 경우, 스팸 방지를 위해 이 설정은 자동으로 꺼집니다."
_accountMigration: _accountMigration:
moveFrom: "다른 계정에서 이 계정으로 이사" moveFrom: "다른 계정에서 이 계정으로 이사"
moveFromSub: "다른 계정에 대한 별칭을 생성" moveFromSub: "다른 계정에 대한 별칭을 생성"
@ -1984,7 +1991,6 @@ _theme:
buttonBg: "버튼 배경" buttonBg: "버튼 배경"
buttonHoverBg: "버튼 배경 (호버)" buttonHoverBg: "버튼 배경 (호버)"
inputBorder: "입력 필드 테두리" inputBorder: "입력 필드 테두리"
listItemHoverBg: "리스트 항목 배경 (호버)"
driveFolderBg: "드라이브 폴더 배경" driveFolderBg: "드라이브 폴더 배경"
wallpaperOverlay: "배경화면 오버레이" wallpaperOverlay: "배경화면 오버레이"
badge: "배지" badge: "배지"
@ -2486,6 +2492,8 @@ _webhookSettings:
abuseReport: "유저롭" abuseReport: "유저롭"
abuseReportResolved: "받은 신고를 처리했을 때" abuseReportResolved: "받은 신고를 처리했을 때"
userCreated: "유저가 생성되었을 때" userCreated: "유저가 생성되었을 때"
inactiveModeratorsWarning: "모더레이터가 일정 기간동안 활동하지 않은 경우"
inactiveModeratorsInvitationOnlyChanged: "모더레이터가 일정 기간 활동하지 않아 시스템에 의해 초대제로 바뀐 경우"
deleteConfirm: "Webhook을 삭제할까요?" deleteConfirm: "Webhook을 삭제할까요?"
testRemarks: "스위치 오른쪽에 있는 버튼을 클릭하여 더미 데이터를 사용한 테스트용 웹 훅을 보낼 수 있습니다." testRemarks: "스위치 오른쪽에 있는 버튼을 클릭하여 더미 데이터를 사용한 테스트용 웹 훅을 보낼 수 있습니다."
_abuseReport: _abuseReport:

View File

@ -1205,7 +1205,6 @@ _theme:
buttonBg: "Tło przycisku" buttonBg: "Tło przycisku"
buttonHoverBg: "Tło przycisku (po najechaniu)" buttonHoverBg: "Tło przycisku (po najechaniu)"
inputBorder: "Obramowanie pola wejścia" inputBorder: "Obramowanie pola wejścia"
listItemHoverBg: "Tło elementu listy (po najechaniu)"
driveFolderBg: "Tło folderu na dysku" driveFolderBg: "Tło folderu na dysku"
wallpaperOverlay: "Nakładka tapety" wallpaperOverlay: "Nakładka tapety"
badge: "Odznaka" badge: "Odznaka"

View File

@ -1,5 +1,5 @@
--- ---
_lang_: "日本語" _lang_: "Português"
headlineMisskey: "Uma rede ligada por notas" headlineMisskey: "Uma rede ligada por notas"
introMisskey: "Bem-vindo! O Misskey é um serviço de microblog descentralizado de código aberto.\nCrie \"notas\" para compartilhar o que está acontecendo agora ou para se expressar com todos à sua volta 📡\nVocê também pode adicionar rapidamente reações às notas de outras pessoas usando a função \"Reações\" 👍\nVamos explorar um novo mundo 🚀" introMisskey: "Bem-vindo! O Misskey é um serviço de microblog descentralizado de código aberto.\nCrie \"notas\" para compartilhar o que está acontecendo agora ou para se expressar com todos à sua volta 📡\nVocê também pode adicionar rapidamente reações às notas de outras pessoas usando a função \"Reações\" 👍\nVamos explorar um novo mundo 🚀"
poweredByMisskeyDescription: "{name} é uma instância da plataforma de código aberto <b>Misskey</b>." poweredByMisskeyDescription: "{name} é uma instância da plataforma de código aberto <b>Misskey</b>."
@ -25,7 +25,7 @@ basicSettings: "Configurações básicas"
otherSettings: "Outras configurações" otherSettings: "Outras configurações"
openInWindow: "Abrir em um janela" openInWindow: "Abrir em um janela"
profile: "Perfil" profile: "Perfil"
timeline: "Cronologia" timeline: "Linha do tempo"
noAccountDescription: "Este usuário não tem uma descrição." noAccountDescription: "Este usuário não tem uma descrição."
login: "Iniciar sessão" login: "Iniciar sessão"
loggingIn: "Iniciando sessão…" loggingIn: "Iniciando sessão…"
@ -1058,7 +1058,7 @@ resetPasswordConfirm: "Deseja realmente mudar a sua senha?"
sensitiveWords: "Palavras sensíveis" sensitiveWords: "Palavras sensíveis"
sensitiveWordsDescription: "A visibilidade de todas as notas contendo as palavras configuradas será colocadas como \"Início\" automaticamente. Você pode listar várias delas separando-as por linha." sensitiveWordsDescription: "A visibilidade de todas as notas contendo as palavras configuradas será colocadas como \"Início\" automaticamente. Você pode listar várias delas separando-as por linha."
sensitiveWordsDescription2: "Utilizar espaços irá criar expressões aditivas (AND) e cercar palavras-chave com barras irá transformá-las em expressões regulares (RegEx)" sensitiveWordsDescription2: "Utilizar espaços irá criar expressões aditivas (AND) e cercar palavras-chave com barras irá transformá-las em expressões regulares (RegEx)"
prohibitedWords: "Palavras proibídas" prohibitedWords: "Palavras proibidas"
prohibitedWordsDescription: "Habilita um erro ao tentar publicar uma nota contendo as palavras escolhidas. Várias palavras podem ser escolhidas, separando-as por linha." prohibitedWordsDescription: "Habilita um erro ao tentar publicar uma nota contendo as palavras escolhidas. Várias palavras podem ser escolhidas, separando-as por linha."
prohibitedWordsDescription2: "Utilizar espaços irá criar expressões aditivas (AND) e cercar palavras-chave com barras irá transformá-las em expressões regulares (RegEx)" prohibitedWordsDescription2: "Utilizar espaços irá criar expressões aditivas (AND) e cercar palavras-chave com barras irá transformá-las em expressões regulares (RegEx)"
hiddenTags: "Hashtags escondidas" hiddenTags: "Hashtags escondidas"
@ -1416,7 +1416,7 @@ _achievements:
_types: _types:
_notes1: _notes1:
title: "Configurando o meu misskey" title: "Configurando o meu misskey"
description: "Post uma nota pela primeira vez" description: "Poste uma nota pela primeira vez"
flavor: "Divirta-se com o Misskey!" flavor: "Divirta-se com o Misskey!"
_notes10: _notes10:
title: "Algumas notas" title: "Algumas notas"
@ -1944,7 +1944,6 @@ _theme:
buttonBg: "Plano de fundo de botão" buttonBg: "Plano de fundo de botão"
buttonHoverBg: "Plano de fundo de botão (Selecionado)" buttonHoverBg: "Plano de fundo de botão (Selecionado)"
inputBorder: "Borda de campo digitável" inputBorder: "Borda de campo digitável"
listItemHoverBg: "Plano de fundo do item de uma lista (Selecionado)"
driveFolderBg: "Plano de fundo da pasta no Drive" driveFolderBg: "Plano de fundo da pasta no Drive"
wallpaperOverlay: "Sobreposição do papel de parede." wallpaperOverlay: "Sobreposição do papel de parede."
badge: "Emblema" badge: "Emblema"

View File

@ -1694,7 +1694,6 @@ _theme:
buttonBg: "Фон кнопки" buttonBg: "Фон кнопки"
buttonHoverBg: "Текст кнопки" buttonHoverBg: "Текст кнопки"
inputBorder: "Рамка поля ввода" inputBorder: "Рамка поля ввода"
listItemHoverBg: "Фон пункта списка (под указателем)"
driveFolderBg: "Фон папки «Диска»" driveFolderBg: "Фон папки «Диска»"
wallpaperOverlay: "Слой обоев" wallpaperOverlay: "Слой обоев"
badge: "Значок" badge: "Значок"

View File

@ -1108,7 +1108,6 @@ _theme:
buttonBg: "Pozadie tlačidla" buttonBg: "Pozadie tlačidla"
buttonHoverBg: "Pozadie tlačidla (pod kurzorom)" buttonHoverBg: "Pozadie tlačidla (pod kurzorom)"
inputBorder: "Okraj vstupného poľa" inputBorder: "Okraj vstupného poľa"
listItemHoverBg: "Pozadie položky zoznamu (pod kurzorom)"
driveFolderBg: "Pozadie priečinu disku" driveFolderBg: "Pozadie priečinu disku"
wallpaperOverlay: "Vrstvenie pozadia" wallpaperOverlay: "Vrstvenie pozadia"
badge: "Odznak" badge: "Odznak"

View File

@ -1943,7 +1943,6 @@ _theme:
buttonBg: "ปุ่มพื้นหลัง" buttonBg: "ปุ่มพื้นหลัง"
buttonHoverBg: "ปุ่มพื้นหลัง (โฮเวอร์)" buttonHoverBg: "ปุ่มพื้นหลัง (โฮเวอร์)"
inputBorder: "เส้นขอบของช่องป้อนข้อมูล" inputBorder: "เส้นขอบของช่องป้อนข้อมูล"
listItemHoverBg: "รายการไอเทมพื้นหลัง (โฮเวอร์)"
driveFolderBg: "พื้นหลังโฟลเดอร์ไดรฟ์" driveFolderBg: "พื้นหลังโฟลเดอร์ไดรฟ์"
wallpaperOverlay: "วอลล์เปเปอร์ซ้อนทับ" wallpaperOverlay: "วอลล์เปเปอร์ซ้อนทับ"
badge: "ตรา" badge: "ตรา"

View File

@ -1302,7 +1302,6 @@ _theme:
buttonBg: "Фон кнопки" buttonBg: "Фон кнопки"
buttonHoverBg: "Фон кнопки (при наведенні)" buttonHoverBg: "Фон кнопки (при наведенні)"
inputBorder: "Край поля вводу" inputBorder: "Край поля вводу"
listItemHoverBg: "Фон елементу в списку (при наведенні)"
driveFolderBg: "Фон папки на диску" driveFolderBg: "Фон папки на диску"
wallpaperOverlay: "Накладання шпалер" wallpaperOverlay: "Накладання шпалер"
badge: "Значок" badge: "Значок"

View File

@ -1546,7 +1546,6 @@ _theme:
buttonBg: "Nền nút" buttonBg: "Nền nút"
buttonHoverBg: "Nền nút (Chạm)" buttonHoverBg: "Nền nút (Chạm)"
inputBorder: "Đường viền khung soạn thảo" inputBorder: "Đường viền khung soạn thảo"
listItemHoverBg: "Nền mục liệt kê (Chạm)"
driveFolderBg: "Nền thư mục Ổ đĩa" driveFolderBg: "Nền thư mục Ổ đĩa"
wallpaperOverlay: "Lớp phủ hình nền" wallpaperOverlay: "Lớp phủ hình nền"
badge: "Huy hiệu" badge: "Huy hiệu"

View File

@ -1087,6 +1087,7 @@ retryAllQueuesConfirmTitle: "要再尝试一次吗?"
retryAllQueuesConfirmText: "可能会使服务器负荷在一定时间内增加" retryAllQueuesConfirmText: "可能会使服务器负荷在一定时间内增加"
enableChartsForRemoteUser: "生成远程用户的图表" enableChartsForRemoteUser: "生成远程用户的图表"
enableChartsForFederatedInstances: "生成远程服务器的图表" enableChartsForFederatedInstances: "生成远程服务器的图表"
enableStatsForFederatedInstances: "获取远程服务器的信息"
showClipButtonInNoteFooter: "在贴文下方显示便签按钮" showClipButtonInNoteFooter: "在贴文下方显示便签按钮"
reactionsDisplaySize: "回应显示大小" reactionsDisplaySize: "回应显示大小"
limitWidthOfReaction: "限制回应的最大宽度,并将其缩小显示" limitWidthOfReaction: "限制回应的最大宽度,并将其缩小显示"
@ -1199,10 +1200,10 @@ followingOrFollower: "关注中或关注者"
fileAttachedOnly: "仅限媒体" fileAttachedOnly: "仅限媒体"
showRepliesToOthersInTimeline: "在时间线中包含给别人的回复" showRepliesToOthersInTimeline: "在时间线中包含给别人的回复"
hideRepliesToOthersInTimeline: "在时间线中隐藏给别人的回复" hideRepliesToOthersInTimeline: "在时间线中隐藏给别人的回复"
showRepliesToOthersInTimelineAll: "在时间线中包含现在关注的所有人的回复" showRepliesToOthersInTimelineAll: "在时间线中显示所有现在关注的人的回复"
hideRepliesToOthersInTimelineAll: "在时间线中隐藏现在关注的所有人的回复" hideRepliesToOthersInTimelineAll: "在时间线中隐藏所有现在关注的人的回复"
confirmShowRepliesAll: "此操作不可撤销。确认要在时间线中包含现在关注的所有人的回复吗?" confirmShowRepliesAll: "此操作不可撤销。确认要在时间线中显示所有现在关注的人的回复吗?"
confirmHideRepliesAll: "此操作不可撤销。确认要在时间线中隐藏现在关注的所有人的回复吗?" confirmHideRepliesAll: "此操作不可撤销。确认要在时间线中隐藏所有现在关注的人的回复吗?"
externalServices: "外部服务" externalServices: "外部服务"
sourceCode: "源代码" sourceCode: "源代码"
sourceCodeIsNotYetProvided: "还未提供源代码。要解决此问题请联系管理员。" sourceCodeIsNotYetProvided: "还未提供源代码。要解决此问题请联系管理员。"
@ -1287,9 +1288,18 @@ passkeyVerificationFailed: "验证通行密钥失败。"
passkeyVerificationSucceededButPasswordlessLoginDisabled: "通行密钥验证成功,但账户未开启无密码登录。" passkeyVerificationSucceededButPasswordlessLoginDisabled: "通行密钥验证成功,但账户未开启无密码登录。"
messageToFollower: "给关注者的消息" messageToFollower: "给关注者的消息"
target: "对象" target: "对象"
testCaptchaWarning: "此功能为测试 CAPTCHA 用。<strong>请勿在正式环境中使用。</strong>"
prohibitedWordsForNameOfUser: "用户名中禁止的词"
prohibitedWordsForNameOfUserDescription: "更改用户名时,如果用户名中包含此列表里的词汇,用户的改名请求将被拒绝。持有管理员权限的用户不受此限制。"
yourNameContainsProhibitedWords: "目标用户名包含违禁词"
yourNameContainsProhibitedWordsDescription: "用户名内含有违禁词。若想使用此用户名,请联系服务器管理员。"
_abuseUserReport: _abuseUserReport:
forward: "转发" forward: "转发"
forwardDescription: "目标是匿名系统账户,将把举报转发给远程服务器。" forwardDescription: "目标是匿名系统账户,将把举报转发给远程服务器。"
resolve: "解决"
accept: "确认"
reject: "拒绝"
resolveTutorial: "如果举报内容有理且已解决,选择「确认」将案件以肯定的态度标记为已解决。\n如果举报内容站不住脚选择「拒绝」将案件以否定的态度标记为已解决。"
_delivery: _delivery:
status: "投递状态" status: "投递状态"
stop: "停止投递" stop: "停止投递"
@ -1427,6 +1437,7 @@ _serverSettings:
reactionsBufferingDescription: "开启时可显著提高发送回应时的性能,及减轻数据库负荷。但 Redis 的内存用量会相应增加。" reactionsBufferingDescription: "开启时可显著提高发送回应时的性能,及减轻数据库负荷。但 Redis 的内存用量会相应增加。"
inquiryUrl: "联络地址" inquiryUrl: "联络地址"
inquiryUrlDescription: "用来指定诸如向服务运营商咨询的论坛地址,或记载了运营商联系方式之类的网页地址。" inquiryUrlDescription: "用来指定诸如向服务运营商咨询的论坛地址,或记载了运营商联系方式之类的网页地址。"
thisSettingWillAutomaticallyOffWhenModeratorsInactive: "若在一段时间内没有检测到管理活动,为防止垃圾信息,此设定将自动关闭。"
_accountMigration: _accountMigration:
moveFrom: "从别的账号迁移到此账户" moveFrom: "从别的账号迁移到此账户"
moveFromSub: "为另一个账户建立别名" moveFromSub: "为另一个账户建立别名"
@ -1626,7 +1637,7 @@ _achievements:
_postedAt0min0sec: _postedAt0min0sec:
title: "报时" title: "报时"
description: "在 0 点发布一篇帖子" description: "在 0 点发布一篇帖子"
flavor: "报时信号最后一响,零点整" flavor: "嘟 · 嘟 · 嘟 · 哔——"
_selfQuote: _selfQuote:
title: "自我引用" title: "自我引用"
description: "引用了自己的帖子" description: "引用了自己的帖子"
@ -1980,7 +1991,6 @@ _theme:
buttonBg: "按钮背景" buttonBg: "按钮背景"
buttonHoverBg: "按钮背景(悬停)" buttonHoverBg: "按钮背景(悬停)"
inputBorder: "输入框边框" inputBorder: "输入框边框"
listItemHoverBg: "下拉列表项目背景(悬停)"
driveFolderBg: "网盘的文件夹背景" driveFolderBg: "网盘的文件夹背景"
wallpaperOverlay: "壁纸叠加层" wallpaperOverlay: "壁纸叠加层"
badge: "徽章" badge: "徽章"
@ -2259,7 +2269,7 @@ _profile:
avatarDecorationMax: "最多可添加 {max} 个挂件" avatarDecorationMax: "最多可添加 {max} 个挂件"
followedMessage: "被关注时显示的消息" followedMessage: "被关注时显示的消息"
followedMessageDescription: "可以设置被关注时向对方显示的短消息。" followedMessageDescription: "可以设置被关注时向对方显示的短消息。"
followedMessageDescriptionForLockedAccount: "需要批准才能关注的情况下,消息是在请求被批准后显示。" followedMessageDescriptionForLockedAccount: "需要批准才能关注的情况下,消息是在请求被批准后显示。"
_exportOrImport: _exportOrImport:
allNotes: "所有帖子" allNotes: "所有帖子"
favoritedNotes: "收藏的帖子" favoritedNotes: "收藏的帖子"
@ -2482,6 +2492,8 @@ _webhookSettings:
abuseReport: "当收到举报时" abuseReport: "当收到举报时"
abuseReportResolved: "当举报被处理时" abuseReportResolved: "当举报被处理时"
userCreated: "当用户被创建时" userCreated: "当用户被创建时"
inactiveModeratorsWarning: "当管理员在一段时间内不活跃时"
inactiveModeratorsInvitationOnlyChanged: "当因为管理员在一段时间内不活跃,导致服务器变为邀请制时"
deleteConfirm: "要删除 webhook 吗?" deleteConfirm: "要删除 webhook 吗?"
testRemarks: "点击开关右侧的按钮,可以发送使用假数据的测试 Webhook。" testRemarks: "点击开关右侧的按钮,可以发送使用假数据的测试 Webhook。"
_abuseReport: _abuseReport:

View File

@ -454,6 +454,7 @@ totpDescription: "以驗證應用程式輸入一次性密碼"
moderator: "審查員" moderator: "審查員"
moderation: "審查" moderation: "審查"
moderationNote: "管理筆記" moderationNote: "管理筆記"
moderationNoteDescription: "您可以編寫僅在審查員之間共用的註解。"
addModerationNote: "新增管理筆記" addModerationNote: "新增管理筆記"
moderationLogs: "管理日誌" moderationLogs: "管理日誌"
nUsersMentioned: "被 {n} 個人提及" nUsersMentioned: "被 {n} 個人提及"
@ -519,7 +520,7 @@ menuStyle: "選單風格"
style: "風格" style: "風格"
drawer: "側邊欄" drawer: "側邊欄"
popup: "彈出式視窗" popup: "彈出式視窗"
showNoteActionsOnlyHover: "僅在游標停留時顯示貼文的操作選項" showNoteActionsOnlyHover: "僅在游標停留時顯示貼文的"
showReactionsCount: "顯示貼文的反應數目" showReactionsCount: "顯示貼文的反應數目"
noHistory: "沒有歷史紀錄" noHistory: "沒有歷史紀錄"
signinHistory: "登入歷史" signinHistory: "登入歷史"
@ -1018,7 +1019,7 @@ show: "檢視"
neverShow: "不再顯示" neverShow: "不再顯示"
remindMeLater: "以後再說" remindMeLater: "以後再說"
didYouLikeMisskey: "您喜歡 Misskey 嗎?" didYouLikeMisskey: "您喜歡 Misskey 嗎?"
pleaseDonate: "Misskey 是由 {host} 使用的免費軟體。請贊助我們,讓開發得以持續!" pleaseDonate: "Misskey是由{host}使用的免費軟體。請贊助我們,讓開發的工作能夠持續!"
correspondingSourceIsAvailable: "對應的原始碼可以在 {anchor} 處找到。" correspondingSourceIsAvailable: "對應的原始碼可以在 {anchor} 處找到。"
roles: "角色" roles: "角色"
role: "角色" role: "角色"
@ -1086,6 +1087,7 @@ retryAllQueuesConfirmTitle: "要現在重試嗎?"
retryAllQueuesConfirmText: "伺服器的負荷可能會暫時增加。" retryAllQueuesConfirmText: "伺服器的負荷可能會暫時增加。"
enableChartsForRemoteUser: "生成遠端使用者的圖表" enableChartsForRemoteUser: "生成遠端使用者的圖表"
enableChartsForFederatedInstances: "生成遠端伺服器的圖表" enableChartsForFederatedInstances: "生成遠端伺服器的圖表"
enableStatsForFederatedInstances: "取得遠端伺服器資訊"
showClipButtonInNoteFooter: "新增摘錄按鈕至貼文" showClipButtonInNoteFooter: "新增摘錄按鈕至貼文"
reactionsDisplaySize: "反應的顯示尺寸" reactionsDisplaySize: "反應的顯示尺寸"
limitWidthOfReaction: "限制反應的最大寬度,並縮小顯示尺寸。" limitWidthOfReaction: "限制反應的最大寬度,並縮小顯示尺寸。"
@ -1194,7 +1196,7 @@ showRenotes: "顯示其他人的轉發貼文"
edited: "已編輯" edited: "已編輯"
notificationRecieveConfig: "接受通知的設定" notificationRecieveConfig: "接受通知的設定"
mutualFollow: "互相追隨" mutualFollow: "互相追隨"
followingOrFollower: "追隨中或追隨者" followingOrFollower: "追隨中或追隨者"
fileAttachedOnly: "只顯示包含附件的貼文" fileAttachedOnly: "只顯示包含附件的貼文"
showRepliesToOthersInTimeline: "顯示給其他人的回覆" showRepliesToOthersInTimeline: "顯示給其他人的回覆"
hideRepliesToOthersInTimeline: "在時間軸上隱藏給其他人的回覆" hideRepliesToOthersInTimeline: "在時間軸上隱藏給其他人的回覆"
@ -1265,7 +1267,7 @@ useNativeUIForVideoAudioPlayer: "使用瀏覽器的 UI 播放影片與音訊"
keepOriginalFilename: "保留原始檔名" keepOriginalFilename: "保留原始檔名"
keepOriginalFilenameDescription: "如果關閉此設置,上傳時檔案名稱會自動替換為隨機字串。" keepOriginalFilenameDescription: "如果關閉此設置,上傳時檔案名稱會自動替換為隨機字串。"
noDescription: "沒有說明文字" noDescription: "沒有說明文字"
alwaysConfirmFollow: "點擊追隨時總是顯示確認訊息" alwaysConfirmFollow: "跟隨時總是確認"
inquiry: "聯絡我們" inquiry: "聯絡我們"
tryAgain: "請再試一次。" tryAgain: "請再試一次。"
confirmWhenRevealingSensitiveMedia: "要顯示敏感媒體時需確認" confirmWhenRevealingSensitiveMedia: "要顯示敏感媒體時需確認"
@ -1285,6 +1287,19 @@ unknownWebAuthnKey: "未註冊的金鑰。"
passkeyVerificationFailed: "驗證金鑰失敗。" passkeyVerificationFailed: "驗證金鑰失敗。"
passkeyVerificationSucceededButPasswordlessLoginDisabled: "雖然驗證金鑰成功,但是無密碼登入的方式是停用的。" passkeyVerificationSucceededButPasswordlessLoginDisabled: "雖然驗證金鑰成功,但是無密碼登入的方式是停用的。"
messageToFollower: "給追隨者的訊息" messageToFollower: "給追隨者的訊息"
target: "目標 "
testCaptchaWarning: "此功能用於 CAPTCHA 的測試。<strong>請勿在正式環境中使用。</strong>"
prohibitedWordsForNameOfUser: "禁止使用的字詞(使用者名稱)"
prohibitedWordsForNameOfUserDescription: "如果使用者名稱包含此清單中的任何字串,則拒絕重新命名使用者。 具有審查員權限的使用者不受此限制的影響。"
yourNameContainsProhibitedWords: "您嘗試更改的名稱包含禁止的字串"
yourNameContainsProhibitedWordsDescription: "名稱中包含禁止使用的字串。 如果您想使用此名稱,請聯絡您的伺服器管理員。"
_abuseUserReport:
forward: "轉發"
forwardDescription: "以匿名系統帳戶將檢舉轉發至遠端伺服器。"
resolve: "解決"
accept: "接受"
reject: "拒絕"
resolveTutorial: "如果您已回覆正當的檢舉,請選擇「接受」以將案件標記為已解決。\n 如果檢舉的內容不正當,請選擇「拒絕」將案件標記為已解決。"
_delivery: _delivery:
status: "傳送狀態" status: "傳送狀態"
stop: "停止發送" stop: "停止發送"
@ -1422,6 +1437,7 @@ _serverSettings:
reactionsBufferingDescription: "啟用時,可以顯著提高建立反應時的效能並減少資料庫的負載。 但是Redis 記憶體使用量會增加。" reactionsBufferingDescription: "啟用時,可以顯著提高建立反應時的效能並減少資料庫的負載。 但是Redis 記憶體使用量會增加。"
inquiryUrl: "聯絡表單網址" inquiryUrl: "聯絡表單網址"
inquiryUrlDescription: "指定伺服器運營者的聯絡表單網址,或包含運營者聯絡資訊網頁的網址。" inquiryUrlDescription: "指定伺服器運營者的聯絡表單網址,或包含運營者聯絡資訊網頁的網址。"
thisSettingWillAutomaticallyOffWhenModeratorsInactive: "為了防止 spam如果一段期間內沒有偵測到審查員的活動此設定將自動關閉。"
_accountMigration: _accountMigration:
moveFrom: "從其他帳戶遷移到這個帳戶" moveFrom: "從其他帳戶遷移到這個帳戶"
moveFromSub: "為另一個帳戶建立別名" moveFromSub: "為另一個帳戶建立別名"
@ -1435,7 +1451,7 @@ _accountMigration:
startMigration: "遷移" startMigration: "遷移"
migrationConfirm: "確定要將這個帳戶遷移至 {account} 嗎?一旦遷移就無法撤銷,也就無法以原來的狀態使用這個帳戶。\n另外請確認在要遷移到的帳戶已經建立了一個別名。" migrationConfirm: "確定要將這個帳戶遷移至 {account} 嗎?一旦遷移就無法撤銷,也就無法以原來的狀態使用這個帳戶。\n另外請確認在要遷移到的帳戶已經建立了一個別名。"
movedAndCannotBeUndone: "帳戶已遷移。\n遷移無法撤消。" movedAndCannotBeUndone: "帳戶已遷移。\n遷移無法撤消。"
postMigrationNote: "在完成遷移的 24 小時後解除此帳戶的追隨。此帳戶的追隨中、追隨者數量變為 0。由於不會解除追隨者你的追隨者仍然可以繼續檢視這個帳戶發布給追隨者的貼文。" postMigrationNote: "取消追蹤此帳戶將在遷移操作後 24 小時執行。\n 此帳戶有 0 個關注者/關注者。 您的關注者仍然可以看到此帳戶的關注者帖子,因為您不會被取消關注。"
movedTo: "要遷移到的帳戶:" movedTo: "要遷移到的帳戶:"
_achievements: _achievements:
earnedAt: "獲得日期" earnedAt: "獲得日期"
@ -1555,7 +1571,7 @@ _achievements:
_markedAsCat: _markedAsCat:
title: "我是貓" title: "我是貓"
description: "已將帳戶設定為貓" description: "已將帳戶設定為貓"
flavor: "沒有名字。" flavor: "沒有名字。"
_following1: _following1:
title: "首次追隨" title: "首次追隨"
description: "首次追隨了" description: "首次追隨了"
@ -1569,7 +1585,7 @@ _achievements:
title: "一百位朋友" title: "一百位朋友"
description: "追隨超過100人了" description: "追隨超過100人了"
_following300: _following300:
title: "朋友多" title: "朋友多"
description: "追隨超過300人了" description: "追隨超過300人了"
_followers1: _followers1:
title: "第一個追隨者" title: "第一個追隨者"
@ -1895,7 +1911,7 @@ _channel:
following: "追隨中" following: "追隨中"
usersCount: "有 {n} 人參與" usersCount: "有 {n} 人參與"
notesCount: "有 {n} 篇貼文" notesCount: "有 {n} 篇貼文"
nameAndDescription: "名稱與說明" nameAndDescription: "名稱"
nameOnly: "僅名稱" nameOnly: "僅名稱"
allowRenoteToExternal: "允許在頻道外轉發和引用" allowRenoteToExternal: "允許在頻道外轉發和引用"
_menuDisplay: _menuDisplay:
@ -1975,7 +1991,6 @@ _theme:
buttonBg: "按鈕背景" buttonBg: "按鈕背景"
buttonHoverBg: "按鈕背景 (漂浮)" buttonHoverBg: "按鈕背景 (漂浮)"
inputBorder: "輸入框邊框" inputBorder: "輸入框邊框"
listItemHoverBg: "列表物品背景 (漂浮)"
driveFolderBg: "雲端硬碟文件夾背景" driveFolderBg: "雲端硬碟文件夾背景"
wallpaperOverlay: "壁紙覆蓋層" wallpaperOverlay: "壁紙覆蓋層"
badge: "徽章" badge: "徽章"
@ -2477,6 +2492,8 @@ _webhookSettings:
abuseReport: "當使用者檢舉時" abuseReport: "當使用者檢舉時"
abuseReportResolved: "當處理了使用者的檢舉時" abuseReportResolved: "當處理了使用者的檢舉時"
userCreated: "使用者被新增時" userCreated: "使用者被新增時"
inactiveModeratorsWarning: "當審查員在一段時間內沒有活動時"
inactiveModeratorsInvitationOnlyChanged: "當審查員在一段時間內不活動時,系統會將模式變更為邀請制"
deleteConfirm: "請問是否要刪除 Webhook" deleteConfirm: "請問是否要刪除 Webhook"
testRemarks: "按下切換開關右側的按鈕,就會將假資料發送至 Webhook。" testRemarks: "按下切換開關右側的按鈕,就會將假資料發送至 Webhook。"
_abuseReport: _abuseReport:
@ -2491,7 +2508,7 @@ _abuseReport:
mail: "寄送到擁有監察員權限的使用者電子郵件地址(僅在收到檢舉時)" mail: "寄送到擁有監察員權限的使用者電子郵件地址(僅在收到檢舉時)"
webhook: "向指定的 SystemWebhook 發送通知(在收到檢舉和解決檢舉時發送)" webhook: "向指定的 SystemWebhook 發送通知(在收到檢舉和解決檢舉時發送)"
keywords: "關鍵字" keywords: "關鍵字"
notifiedUser: "通知的使用者" notifiedUser: "通知的使用者"
notifiedWebhook: "使用的 Webhook" notifiedWebhook: "使用的 Webhook"
deleteConfirm: "確定要刪除通知對象嗎?" deleteConfirm: "確定要刪除通知對象嗎?"
_moderationLogTypes: _moderationLogTypes:
@ -2522,6 +2539,8 @@ _moderationLogTypes:
markSensitiveDriveFile: "標記為敏感檔案" markSensitiveDriveFile: "標記為敏感檔案"
unmarkSensitiveDriveFile: "撤銷標記為敏感檔案" unmarkSensitiveDriveFile: "撤銷標記為敏感檔案"
resolveAbuseReport: "解決檢舉" resolveAbuseReport: "解決檢舉"
forwardAbuseReport: "轉發檢舉"
updateAbuseReportNote: "更新檢舉的審查備註"
createInvitation: "建立邀請碼" createInvitation: "建立邀請碼"
createAd: "建立廣告" createAd: "建立廣告"
deleteAd: "刪除廣告" deleteAd: "刪除廣告"

View File

@ -1,6 +1,6 @@
{ {
"name": "misskey", "name": "misskey",
"version": "2024.10.0-beta.6", "version": "2024.10.1-beta.6",
"codename": "nasubi", "codename": "nasubi",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
export class EnableStatsForFederatedInstances1727318020265 {
name = 'EnableStatsForFederatedInstances1727318020265'
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" ADD "enableStatsForFederatedInstances" boolean NOT NULL DEFAULT true`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableStatsForFederatedInstances"`);
}
}

View File

@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
export class Testcaptcha1728550878802 {
name = 'Testcaptcha1728550878802'
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" ADD "enableTestcaptcha" boolean NOT NULL DEFAULT false`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableTestcaptcha"`);
}
}

View File

@ -0,0 +1,14 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
export class ProhibitedWordsForNameOfUser1728634286056 {
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" ADD "prohibitedWordsForNameOfUser" character varying(1024) array NOT NULL DEFAULT '{}'`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "prohibitedWordsForNameOfUser"`);
}
}

View File

@ -61,7 +61,10 @@ export class AbuseReportNotificationService implements OnApplicationShutdown {
return; return;
} }
const moderatorIds = await this.roleService.getModeratorIds(true, true); const moderatorIds = await this.roleService.getModeratorIds({
includeAdmins: true,
excludeExpire: true,
});
for (const moderatorId of moderatorIds) { for (const moderatorId of moderatorIds) {
for (const abuseReport of abuseReports) { for (const abuseReport of abuseReports) {
@ -285,8 +288,7 @@ export class AbuseReportNotificationService implements OnApplicationShutdown {
.log(updater, 'createAbuseReportNotificationRecipient', { .log(updater, 'createAbuseReportNotificationRecipient', {
recipientId: id, recipientId: id,
recipient: created, recipient: created,
}) });
.then();
return created; return created;
} }
@ -324,8 +326,7 @@ export class AbuseReportNotificationService implements OnApplicationShutdown {
recipientId: params.id, recipientId: params.id,
before: beforeEntity, before: beforeEntity,
after: afterEntity, after: afterEntity,
}) });
.then();
return afterEntity; return afterEntity;
} }
@ -346,8 +347,7 @@ export class AbuseReportNotificationService implements OnApplicationShutdown {
.log(updater, 'deleteAbuseReportNotificationRecipient', { .log(updater, 'deleteAbuseReportNotificationRecipient', {
recipientId: id, recipientId: id,
recipient: entity, recipient: entity,
}) });
.then();
} }
/** /**
@ -370,7 +370,10 @@ export class AbuseReportNotificationService implements OnApplicationShutdown {
} }
// モデレータ権限の有無で通知先設定を振り分ける // モデレータ権限の有無で通知先設定を振り分ける
const authorizedUserIds = await this.roleService.getModeratorIds(true, true); const authorizedUserIds = await this.roleService.getModeratorIds({
includeAdmins: true,
excludeExpire: true,
});
const authorizedUserRecipients = Array.of<MiAbuseReportNotificationRecipient>(); const authorizedUserRecipients = Array.of<MiAbuseReportNotificationRecipient>();
const unauthorizedUserRecipients = Array.of<MiAbuseReportNotificationRecipient>(); const unauthorizedUserRecipients = Array.of<MiAbuseReportNotificationRecipient>();
for (const recipient of userRecipients) { for (const recipient of userRecipients) {

View File

@ -110,8 +110,7 @@ export class AbuseReportService {
reportId: report.id, reportId: report.id,
report: report, report: report,
resolvedAs: ps.resolvedAs, resolvedAs: ps.resolvedAs,
}) });
.then();
} }
return this.abuseUserReportsRepository.findBy({ id: In(reports.map(it => it.id)) }) return this.abuseUserReportsRepository.findBy({ id: In(reports.map(it => it.id)) })
@ -148,8 +147,7 @@ export class AbuseReportService {
.log(moderator, 'forwardAbuseReport', { .log(moderator, 'forwardAbuseReport', {
reportId: report.id, reportId: report.id,
report: report, report: report,
}) });
.then();
} }
@bindThis @bindThis

View File

@ -274,14 +274,16 @@ export class AccountMoveService {
} }
// Update instance stats by decreasing remote followers count by the number of local followers who were following the old account. // Update instance stats by decreasing remote followers count by the number of local followers who were following the old account.
if (this.meta.enableStatsForFederatedInstances) {
if (this.userEntityService.isRemoteUser(oldAccount)) { if (this.userEntityService.isRemoteUser(oldAccount)) {
this.federatedInstanceService.fetch(oldAccount.host).then(async i => { this.federatedInstanceService.fetchOrRegister(oldAccount.host).then(async i => {
this.instancesRepository.decrement({ id: i.id }, 'followersCount', localFollowerIds.length); this.instancesRepository.decrement({ id: i.id }, 'followersCount', localFollowerIds.length);
if (this.meta.enableChartsForFederatedInstances) { if (this.meta.enableChartsForFederatedInstances) {
this.instanceChart.updateFollowers(i.host, false); this.instanceChart.updateFollowers(i.host, false);
} }
}); });
} }
}
// FIXME: expensive? // FIXME: expensive?
for (const followerId of localFollowerIds) { for (const followerId of localFollowerIds) {

View File

@ -209,6 +209,13 @@ export class AnnouncementService {
return; return;
} }
const announcement = await this.announcementsRepository.findOneBy({ id: announcementId });
if (announcement != null && announcement.userId === user.id) {
await this.announcementsRepository.update(announcementId, {
isActive: false,
});
}
if ((await this.getUnreadAnnouncements(user)).length === 0) { if ((await this.getUnreadAnnouncements(user)).length === 0) {
this.globalEventService.publishMainStream(user.id, 'readAllAnnouncements'); this.globalEventService.publishMainStream(user.id, 'readAllAnnouncements');
} }

View File

@ -119,5 +119,18 @@ export class CaptchaService {
throw new Error(`turnstile-failed: ${errorCodes}`); throw new Error(`turnstile-failed: ${errorCodes}`);
} }
} }
@bindThis
public async verifyTestcaptcha(response: string | null | undefined): Promise<void> {
if (response == null) {
throw new Error('testcaptcha-failed: no response provided');
}
const success = response === 'testcaptcha-passed';
if (!success) {
throw new Error('testcaptcha-failed');
}
}
} }

View File

@ -103,19 +103,33 @@ export class CustomEmojiService implements OnApplicationShutdown {
} }
@bindThis @bindThis
public async update(id: MiEmoji['id'], data: { public async update(data: (
{ id: MiEmoji['id'], name?: string; } | { name: string; id?: MiEmoji['id'], }
) & {
driveFile?: MiDriveFile; driveFile?: MiDriveFile;
name?: string;
category?: string | null; category?: string | null;
aliases?: string[]; aliases?: string[];
license?: string | null; license?: string | null;
isSensitive?: boolean; isSensitive?: boolean;
localOnly?: boolean; localOnly?: boolean;
roleIdsThatCanBeUsedThisEmojiAsReaction?: MiRole['id'][]; roleIdsThatCanBeUsedThisEmojiAsReaction?: MiRole['id'][];
}, moderator?: MiUser): Promise<void> { }, moderator?: MiUser): Promise<
const emoji = await this.emojisRepository.findOneByOrFail({ id: id }); null
const sameNameEmoji = await this.emojisRepository.findOneBy({ name: data.name, host: IsNull() }); | 'NO_SUCH_EMOJI'
if (sameNameEmoji != null && sameNameEmoji.id !== id) throw new Error('name already exists'); | 'SAME_NAME_EMOJI_EXISTS'
> {
const emoji = data.id
? await this.getEmojiById(data.id)
: await this.getEmojiByName(data.name!);
if (emoji === null) return 'NO_SUCH_EMOJI';
const id = emoji.id;
// IDと絵文字名が両方指定されている場合は絵文字名の変更を行うため重複チェックが必要
const doNameUpdate = data.id && data.name && (data.name !== emoji.name);
if (doNameUpdate) {
const isDuplicate = await this.checkDuplicate(data.name!);
if (isDuplicate) return 'SAME_NAME_EMOJI_EXISTS';
}
await this.emojisRepository.update(emoji.id, { await this.emojisRepository.update(emoji.id, {
updatedAt: new Date(), updatedAt: new Date(),
@ -135,7 +149,7 @@ export class CustomEmojiService implements OnApplicationShutdown {
const packed = await this.emojiEntityService.packDetailed(emoji.id); const packed = await this.emojiEntityService.packDetailed(emoji.id);
if (emoji.name === data.name) { if (!doNameUpdate) {
this.globalEventService.publishBroadcastStream('emojiUpdated', { this.globalEventService.publishBroadcastStream('emojiUpdated', {
emojis: [packed], emojis: [packed],
}); });
@ -157,6 +171,7 @@ export class CustomEmojiService implements OnApplicationShutdown {
after: updated, after: updated,
}); });
} }
return null;
} }
@bindThis @bindThis

View File

@ -47,7 +47,7 @@ export class FederatedInstanceService implements OnApplicationShutdown {
} }
@bindThis @bindThis
public async fetch(host: string): Promise<MiInstance> { public async fetchOrRegister(host: string): Promise<MiInstance> {
host = this.utilityService.toPuny(host); host = this.utilityService.toPuny(host);
const cached = await this.federatedInstanceCache.get(host); const cached = await this.federatedInstanceCache.get(host);
@ -70,6 +70,24 @@ export class FederatedInstanceService implements OnApplicationShutdown {
} }
} }
@bindThis
public async fetch(host: string): Promise<MiInstance | null> {
host = this.utilityService.toPuny(host);
const cached = await this.federatedInstanceCache.get(host);
if (cached !== undefined) return cached;
const index = await this.instancesRepository.findOneBy({ host });
if (index == null) {
this.federatedInstanceCache.set(host, null);
return null;
} else {
this.federatedInstanceCache.set(host, index);
return index;
}
}
@bindThis @bindThis
public async update(id: MiInstance['id'], data: Partial<MiInstance>): Promise<void> { public async update(id: MiInstance['id'], data: Partial<MiInstance>): Promise<void> {
const result = await this.instancesRepository.createQueryBuilder().update() const result = await this.instancesRepository.createQueryBuilder().update()

View File

@ -82,7 +82,7 @@ export class FetchInstanceMetadataService {
try { try {
if (!force) { if (!force) {
const _instance = await this.federatedInstanceService.fetch(host); const _instance = await this.federatedInstanceService.fetchOrRegister(host);
const now = Date.now(); const now = Date.now();
if (_instance && _instance.infoUpdatedAt && (now - _instance.infoUpdatedAt.getTime() < 1000 * 60 * 60 * 24)) { if (_instance && _instance.infoUpdatedAt && (now - _instance.infoUpdatedAt.getTime() < 1000 * 60 * 60 * 24)) {
// unlock at the finally caluse // unlock at the finally caluse

View File

@ -511,14 +511,16 @@ export class NoteCreateService implements OnApplicationShutdown {
} }
// Register host // Register host
if (this.meta.enableStatsForFederatedInstances) {
if (this.userEntityService.isRemoteUser(user)) { if (this.userEntityService.isRemoteUser(user)) {
this.federatedInstanceService.fetch(user.host).then(async i => { this.federatedInstanceService.fetchOrRegister(user.host).then(async i => {
this.updateNotesCountQueue.enqueue(i.id, 1); this.updateNotesCountQueue.enqueue(i.id, 1);
if (this.meta.enableChartsForFederatedInstances) { if (this.meta.enableChartsForFederatedInstances) {
this.instanceChart.updateNote(i.host, note, true); this.instanceChart.updateNote(i.host, note, true);
} }
}); });
} }
}
// ハッシュタグ更新 // ハッシュタグ更新
if (data.visibility === 'public' || data.visibility === 'home') { if (data.visibility === 'public' || data.visibility === 'home') {

View File

@ -106,8 +106,9 @@ export class NoteDeleteService {
this.perUserNotesChart.update(user, note, false); this.perUserNotesChart.update(user, note, false);
} }
if (this.meta.enableStatsForFederatedInstances) {
if (this.userEntityService.isRemoteUser(user)) { if (this.userEntityService.isRemoteUser(user)) {
this.federatedInstanceService.fetch(user.host).then(async i => { this.federatedInstanceService.fetchOrRegister(user.host).then(async i => {
this.instancesRepository.decrement({ id: i.id }, 'notesCount', 1); this.instancesRepository.decrement({ id: i.id }, 'notesCount', 1);
if (this.meta.enableChartsForFederatedInstances) { if (this.meta.enableChartsForFederatedInstances) {
this.instanceChart.updateNote(i.host, note, false); this.instanceChart.updateNote(i.host, note, false);
@ -115,6 +116,7 @@ export class NoteDeleteService {
}); });
} }
} }
}
for (const cascadingNote of cascadingNotes) { for (const cascadingNote of cascadingNotes) {
this.searchService.unindexNote(cascadingNote); this.searchService.unindexNote(cascadingNote);

View File

@ -93,6 +93,13 @@ export class QueueService {
repeat: { pattern: '0 0 * * *' }, repeat: { pattern: '0 0 * * *' },
removeOnComplete: true, removeOnComplete: true,
}); });
this.systemQueue.add('checkModeratorsActivity', {
}, {
// 毎時30分に起動
repeat: { pattern: '30 * * * *' },
removeOnComplete: true,
});
} }
@bindThis @bindThis

View File

@ -101,6 +101,7 @@ export const DEFAULT_POLICIES: RolePolicies = {
@Injectable() @Injectable()
export class RoleService implements OnApplicationShutdown, OnModuleInit { export class RoleService implements OnApplicationShutdown, OnModuleInit {
private rootUserIdCache: MemorySingleCache<MiUser['id']>;
private rolesCache: MemorySingleCache<MiRole[]>; private rolesCache: MemorySingleCache<MiRole[]>;
private roleAssignmentByUserIdCache: MemoryKVCache<MiRoleAssignment[]>; private roleAssignmentByUserIdCache: MemoryKVCache<MiRoleAssignment[]>;
private notificationService: NotificationService; private notificationService: NotificationService;
@ -136,6 +137,7 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
private moderationLogService: ModerationLogService, private moderationLogService: ModerationLogService,
private fanoutTimelineService: FanoutTimelineService, private fanoutTimelineService: FanoutTimelineService,
) { ) {
this.rootUserIdCache = new MemorySingleCache<MiUser['id']>(1000 * 60 * 60 * 24 * 7); // 1week. rootユーザのIDは不変なので長めに
this.rolesCache = new MemorySingleCache<MiRole[]>(1000 * 60 * 60); // 1h this.rolesCache = new MemorySingleCache<MiRole[]>(1000 * 60 * 60); // 1h
this.roleAssignmentByUserIdCache = new MemoryKVCache<MiRoleAssignment[]>(1000 * 60 * 5); // 5m this.roleAssignmentByUserIdCache = new MemoryKVCache<MiRoleAssignment[]>(1000 * 60 * 5); // 5m
@ -423,22 +425,35 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
return check.isExplorable; return check.isExplorable;
} }
/**
* ID一覧を取得する.
*
* @param opts.includeAdmins (デフォルト: true)
* @param opts.includeRoot rootユーザも含めるか(デフォルト: false)
* @param opts.excludeExpire (デフォルト: false)
*/
@bindThis @bindThis
public async getModeratorIds(includeAdmins = true, excludeExpire = false): Promise<MiUser['id'][]> { public async getModeratorIds(opts?: {
includeAdmins?: boolean,
includeRoot?: boolean,
excludeExpire?: boolean,
}): Promise<MiUser['id'][]> {
const includeAdmins = opts?.includeAdmins ?? true;
const includeRoot = opts?.includeRoot ?? false;
const excludeExpire = opts?.excludeExpire ?? false;
const roles = await this.rolesCache.fetch(() => this.rolesRepository.findBy({})); const roles = await this.rolesCache.fetch(() => this.rolesRepository.findBy({}));
const moderatorRoles = includeAdmins const moderatorRoles = includeAdmins
? roles.filter(r => r.isModerator || r.isAdministrator) ? roles.filter(r => r.isModerator || r.isAdministrator)
: roles.filter(r => r.isModerator); : roles.filter(r => r.isModerator);
// TODO: isRootなアカウントも含める
const assigns = moderatorRoles.length > 0 const assigns = moderatorRoles.length > 0
? await this.roleAssignmentsRepository.findBy({ roleId: In(moderatorRoles.map(r => r.id)) }) ? await this.roleAssignmentsRepository.findBy({ roleId: In(moderatorRoles.map(r => r.id)) })
: []; : [];
const now = Date.now();
const result = [
// Setを経由して重複を除去ユーザIDは重複する可能性があるので // Setを経由して重複を除去ユーザIDは重複する可能性があるので
...new Set( const now = Date.now();
const resultSet = new Set(
assigns assigns
.filter(it => .filter(it =>
(excludeExpire) (excludeExpire)
@ -446,19 +461,35 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
: true, : true,
) )
.map(a => a.userId), .map(a => a.userId),
), );
];
return result.sort((x, y) => x.localeCompare(y)); if (includeRoot) {
const rootUserId = await this.rootUserIdCache.fetch(async () => {
const it = await this.usersRepository.createQueryBuilder('users')
.select('id')
.where({ isRoot: true })
.getRawOne<{ id: string }>();
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return it!.id;
});
resultSet.add(rootUserId);
}
return [...resultSet].sort((x, y) => x.localeCompare(y));
} }
@bindThis @bindThis
public async getModerators(includeAdmins = true): Promise<MiUser[]> { public async getModerators(opts?: {
const ids = await this.getModeratorIds(includeAdmins); includeAdmins?: boolean,
const users = ids.length > 0 ? await this.usersRepository.findBy({ includeRoot?: boolean,
excludeExpire?: boolean,
}): Promise<MiUser[]> {
const ids = await this.getModeratorIds(opts);
return ids.length > 0
? await this.usersRepository.findBy({
id: In(ids), id: In(ids),
}) : []; })
return users; : [];
} }
@bindThis @bindThis

View File

@ -150,8 +150,8 @@ export class SignupService {
})); }));
}); });
this.usersChart.update(account, true).then(); this.usersChart.update(account, true);
this.userService.notifySystemWebhook(account, 'userCreated').then(); this.userService.notifySystemWebhook(account, 'userCreated');
return { account, secret }; return { account, secret };
} }

View File

@ -101,8 +101,7 @@ export class SystemWebhookService implements OnApplicationShutdown {
.log(updater, 'createSystemWebhook', { .log(updater, 'createSystemWebhook', {
systemWebhookId: webhook.id, systemWebhookId: webhook.id,
webhook: webhook, webhook: webhook,
}) });
.then();
return webhook; return webhook;
} }
@ -139,8 +138,7 @@ export class SystemWebhookService implements OnApplicationShutdown {
systemWebhookId: beforeEntity.id, systemWebhookId: beforeEntity.id,
before: beforeEntity, before: beforeEntity,
after: afterEntity, after: afterEntity,
}) });
.then();
return afterEntity; return afterEntity;
} }
@ -158,8 +156,7 @@ export class SystemWebhookService implements OnApplicationShutdown {
.log(updater, 'deleteSystemWebhook', { .log(updater, 'deleteSystemWebhook', {
systemWebhookId: webhook.id, systemWebhookId: webhook.id,
webhook, webhook,
}) });
.then();
} }
/** /**

View File

@ -305,21 +305,23 @@ export class UserFollowingService implements OnModuleInit {
//#endregion //#endregion
//#region Update instance stats //#region Update instance stats
if (this.meta.enableStatsForFederatedInstances) {
if (this.userEntityService.isRemoteUser(follower) && this.userEntityService.isLocalUser(followee)) { if (this.userEntityService.isRemoteUser(follower) && this.userEntityService.isLocalUser(followee)) {
this.federatedInstanceService.fetch(follower.host).then(async i => { this.federatedInstanceService.fetchOrRegister(follower.host).then(async i => {
this.instancesRepository.increment({ id: i.id }, 'followingCount', 1); this.instancesRepository.increment({ id: i.id }, 'followingCount', 1);
if (this.meta.enableChartsForFederatedInstances) { if (this.meta.enableChartsForFederatedInstances) {
this.instanceChart.updateFollowing(i.host, true); this.instanceChart.updateFollowing(i.host, true);
} }
}); });
} else if (this.userEntityService.isLocalUser(follower) && this.userEntityService.isRemoteUser(followee)) { } else if (this.userEntityService.isLocalUser(follower) && this.userEntityService.isRemoteUser(followee)) {
this.federatedInstanceService.fetch(followee.host).then(async i => { this.federatedInstanceService.fetchOrRegister(followee.host).then(async i => {
this.instancesRepository.increment({ id: i.id }, 'followersCount', 1); this.instancesRepository.increment({ id: i.id }, 'followersCount', 1);
if (this.meta.enableChartsForFederatedInstances) { if (this.meta.enableChartsForFederatedInstances) {
this.instanceChart.updateFollowers(i.host, true); this.instanceChart.updateFollowers(i.host, true);
} }
}); });
} }
}
//#endregion //#endregion
this.perUserFollowingChart.update(follower, followee, true); this.perUserFollowingChart.update(follower, followee, true);
@ -437,21 +439,23 @@ export class UserFollowingService implements OnModuleInit {
//#endregion //#endregion
//#region Update instance stats //#region Update instance stats
if (this.meta.enableStatsForFederatedInstances) {
if (this.userEntityService.isRemoteUser(follower) && this.userEntityService.isLocalUser(followee)) { if (this.userEntityService.isRemoteUser(follower) && this.userEntityService.isLocalUser(followee)) {
this.federatedInstanceService.fetch(follower.host).then(async i => { this.federatedInstanceService.fetchOrRegister(follower.host).then(async i => {
this.instancesRepository.decrement({ id: i.id }, 'followingCount', 1); this.instancesRepository.decrement({ id: i.id }, 'followingCount', 1);
if (this.meta.enableChartsForFederatedInstances) { if (this.meta.enableChartsForFederatedInstances) {
this.instanceChart.updateFollowing(i.host, false); this.instanceChart.updateFollowing(i.host, false);
} }
}); });
} else if (this.userEntityService.isLocalUser(follower) && this.userEntityService.isRemoteUser(followee)) { } else if (this.userEntityService.isLocalUser(follower) && this.userEntityService.isRemoteUser(followee)) {
this.federatedInstanceService.fetch(followee.host).then(async i => { this.federatedInstanceService.fetchOrRegister(followee.host).then(async i => {
this.instancesRepository.decrement({ id: i.id }, 'followersCount', 1); this.instancesRepository.decrement({ id: i.id }, 'followersCount', 1);
if (this.meta.enableChartsForFederatedInstances) { if (this.meta.enableChartsForFederatedInstances) {
this.instanceChart.updateFollowers(i.host, false); this.instanceChart.updateFollowers(i.host, false);
} }
}); });
} }
}
//#endregion //#endregion
this.perUserFollowingChart.update(follower, followee, false); this.perUserFollowingChart.update(follower, followee, false);

View File

@ -12,6 +12,7 @@ import { Packed } from '@/misc/json-schema.js';
import { type WebhookEventTypes } from '@/models/Webhook.js'; import { type WebhookEventTypes } from '@/models/Webhook.js';
import { UserWebhookService } from '@/core/UserWebhookService.js'; import { UserWebhookService } from '@/core/UserWebhookService.js';
import { QueueService } from '@/core/QueueService.js'; import { QueueService } from '@/core/QueueService.js';
import { ModeratorInactivityRemainingTime } from '@/queue/processors/CheckModeratorsActivityProcessorService.js';
const oneDayMillis = 24 * 60 * 60 * 1000; const oneDayMillis = 24 * 60 * 60 * 1000;
@ -446,6 +447,22 @@ export class WebhookTestService {
send(toPackedUserLite(dummyUser1)); send(toPackedUserLite(dummyUser1));
break; break;
} }
case 'inactiveModeratorsWarning': {
const dummyTime: ModeratorInactivityRemainingTime = {
time: 100000,
asDays: 1,
asHours: 24,
};
send({
remainingTime: dummyTime,
});
break;
}
case 'inactiveModeratorsInvitationOnlyChanged': {
send({});
break;
}
} }
} }
} }

View File

@ -408,13 +408,15 @@ export class ApPersonService implements OnModuleInit {
this.cacheService.uriPersonCache.set(user.uri, user); this.cacheService.uriPersonCache.set(user.uri, user);
// Register host // Register host
this.federatedInstanceService.fetch(host).then(i => { if (this.meta.enableStatsForFederatedInstances) {
this.federatedInstanceService.fetchOrRegister(host).then(i => {
this.instancesRepository.increment({ id: i.id }, 'usersCount', 1); this.instancesRepository.increment({ id: i.id }, 'usersCount', 1);
this.fetchInstanceMetadataService.fetchInstanceMetadata(i);
if (this.meta.enableChartsForFederatedInstances) { if (this.meta.enableChartsForFederatedInstances) {
this.instanceChart.newUser(i.host); this.instanceChart.newUser(i.host);
} }
this.fetchInstanceMetadataService.fetchInstanceMetadata(i);
}); });
}
this.usersChart.update(user, true); this.usersChart.update(user, true);

View File

@ -40,7 +40,7 @@ export class FlashEntityService {
// { schema: 'UserDetailed' } すると無限ループするので注意 // { schema: 'UserDetailed' } すると無限ループするので注意
const user = hint?.packedUser ?? await this.userEntityService.pack(flash.user ?? flash.userId, me); const user = hint?.packedUser ?? await this.userEntityService.pack(flash.user ?? flash.userId, me);
let isLiked = false; let isLiked = undefined;
if (meId) { if (meId) {
isLiked = hint?.likedFlashIds isLiked = hint?.likedFlashIds
? hint.likedFlashIds.includes(flash.id) ? hint.likedFlashIds.includes(flash.id)

View File

@ -96,6 +96,7 @@ export class MetaEntityService {
recaptchaSiteKey: instance.recaptchaSiteKey, recaptchaSiteKey: instance.recaptchaSiteKey,
enableTurnstile: instance.enableTurnstile, enableTurnstile: instance.enableTurnstile,
turnstileSiteKey: instance.turnstileSiteKey, turnstileSiteKey: instance.turnstileSiteKey,
enableTestcaptcha: instance.enableTestcaptcha,
swPublickey: instance.swPublicKey, swPublickey: instance.swPublicKey,
themeColor: instance.themeColor, themeColor: instance.themeColor,
mascotImageUrl: instance.mascotImageUrl ?? '/assets/ai.png', mascotImageUrl: instance.mascotImageUrl ?? '/assets/ai.png',

View File

@ -22,6 +22,29 @@ import type { ReactionService } from '../ReactionService.js';
import type { UserEntityService } from './UserEntityService.js'; import type { UserEntityService } from './UserEntityService.js';
import type { DriveFileEntityService } from './DriveFileEntityService.js'; import type { DriveFileEntityService } from './DriveFileEntityService.js';
function isPureRenote(note: MiNote): note is MiNote & { renoteId: MiNote['id']; renote: MiNote } {
return (
note.renote != null &&
note.reply == null &&
note.text == null &&
note.cw == null &&
(note.fileIds == null || note.fileIds.length === 0) &&
!note.hasPoll
);
}
function getAppearNoteIds(notes: MiNote[]): Set<string> {
const appearNoteIds = new Set<string>();
for (const note of notes) {
if (isPureRenote(note)) {
appearNoteIds.add(note.renoteId);
} else {
appearNoteIds.add(note.id);
}
}
return appearNoteIds;
}
@Injectable() @Injectable()
export class NoteEntityService implements OnModuleInit { export class NoteEntityService implements OnModuleInit {
private userEntityService: UserEntityService; private userEntityService: UserEntityService;
@ -90,7 +113,7 @@ export class NoteEntityService implements OnModuleInit {
hide = false; hide = false;
} else { } else {
// 指定されているかどうか // 指定されているかどうか
const specified = packedNote.visibleUserIds!.some((id: any) => meId === id); const specified = packedNote.visibleUserIds!.some(id => meId === id);
if (specified) { if (specified) {
hide = false; hide = false;
@ -227,7 +250,7 @@ export class NoteEntityService implements OnModuleInit {
return true; return true;
} else { } else {
// 指定されているかどうか // 指定されているかどうか
return note.visibleUserIds.some((id: any) => meId === id); return note.visibleUserIds.some(id => meId === id);
} }
} }
@ -421,7 +444,7 @@ export class NoteEntityService implements OnModuleInit {
) { ) {
if (notes.length === 0) return []; if (notes.length === 0) return [];
const bufferedReactions = this.meta.enableReactionsBuffering ? await this.reactionsBufferingService.getMany(notes.map(x => x.id)) : null; const bufferedReactions = this.meta.enableReactionsBuffering ? await this.reactionsBufferingService.getMany([...getAppearNoteIds(notes)]) : null;
const meId = me ? me.id : null; const meId = me ? me.id : null;
const myReactionsMap = new Map<MiNote['id'], string | null>(); const myReactionsMap = new Map<MiNote['id'], string | null>();
@ -432,7 +455,7 @@ export class NoteEntityService implements OnModuleInit {
const oldId = this.idService.gen(Date.now() - 2000); const oldId = this.idService.gen(Date.now() - 2000);
for (const note of notes) { for (const note of notes) {
if (note.renote && (note.text == null && note.fileIds.length === 0)) { // pure renote if (isPureRenote(note)) {
const reactionsCount = Object.values(this.reactionsBufferingService.mergeReactions(note.renote.reactions, bufferedReactions?.get(note.renote.id)?.deltas ?? {})).reduce((a, b) => a + b, 0); const reactionsCount = Object.values(this.reactionsBufferingService.mergeReactions(note.renote.reactions, bufferedReactions?.get(note.renote.id)?.deltas ?? {})).reduce((a, b) => a + b, 0);
if (reactionsCount === 0) { if (reactionsCount === 0) {
myReactionsMap.set(note.renote.id, null); myReactionsMap.set(note.renote.id, null);

View File

@ -81,6 +81,11 @@ export class MiMeta {
}) })
public prohibitedWords: string[]; public prohibitedWords: string[];
@Column('varchar', {
length: 1024, array: true, default: '{}',
})
public prohibitedWordsForNameOfUser: string[];
@Column('varchar', { @Column('varchar', {
length: 1024, array: true, default: '{}', length: 1024, array: true, default: '{}',
}) })
@ -258,6 +263,11 @@ export class MiMeta {
}) })
public turnstileSecretKey: string | null; public turnstileSecretKey: string | null;
@Column('boolean', {
default: false,
})
public enableTestcaptcha: boolean;
// chaptcha系を追加した際にはnodeinfoのレスポンスに追加するのを忘れないようにすること // chaptcha系を追加した際にはnodeinfoのレスポンスに追加するのを忘れないようにすること
@Column('enum', { @Column('enum', {
@ -519,6 +529,11 @@ export class MiMeta {
}) })
public enableChartsForFederatedInstances: boolean; public enableChartsForFederatedInstances: boolean;
@Column('boolean', {
default: true,
})
public enableStatsForFederatedInstances: boolean;
@Column('boolean', { @Column('boolean', {
default: false, default: false,
}) })

View File

@ -14,6 +14,10 @@ export const systemWebhookEventTypes = [
'abuseReportResolved', 'abuseReportResolved',
// ユーザが作成された時 // ユーザが作成された時
'userCreated', 'userCreated',
// モデレータが一定期間不在である警告
'inactiveModeratorsWarning',
// モデレータが一定期間不在のためシステムにより招待制へと変更された
'inactiveModeratorsInvitationOnlyChanged',
] as const; ] as const;
export type SystemWebhookEventType = typeof systemWebhookEventTypes[number]; export type SystemWebhookEventType = typeof systemWebhookEventTypes[number];

View File

@ -115,6 +115,10 @@ export const packedMetaLiteSchema = {
type: 'string', type: 'string',
optional: false, nullable: true, optional: false, nullable: true,
}, },
enableTestcaptcha: {
type: 'boolean',
optional: false, nullable: false,
},
swPublickey: { swPublickey: {
type: 'string', type: 'string',
optional: false, nullable: true, optional: false, nullable: true,

View File

@ -6,6 +6,7 @@
import { Module } from '@nestjs/common'; import { Module } from '@nestjs/common';
import { CoreModule } from '@/core/CoreModule.js'; import { CoreModule } from '@/core/CoreModule.js';
import { GlobalModule } from '@/GlobalModule.js'; import { GlobalModule } from '@/GlobalModule.js';
import { CheckModeratorsActivityProcessorService } from '@/queue/processors/CheckModeratorsActivityProcessorService.js';
import { QueueLoggerService } from './QueueLoggerService.js'; import { QueueLoggerService } from './QueueLoggerService.js';
import { QueueProcessorService } from './QueueProcessorService.js'; import { QueueProcessorService } from './QueueProcessorService.js';
import { DeliverProcessorService } from './processors/DeliverProcessorService.js'; import { DeliverProcessorService } from './processors/DeliverProcessorService.js';
@ -80,6 +81,8 @@ import { RelationshipProcessorService } from './processors/RelationshipProcessor
DeliverProcessorService, DeliverProcessorService,
InboxProcessorService, InboxProcessorService,
AggregateRetentionProcessorService, AggregateRetentionProcessorService,
CheckExpiredMutingsProcessorService,
CheckModeratorsActivityProcessorService,
QueueProcessorService, QueueProcessorService,
], ],
exports: [ exports: [

View File

@ -10,6 +10,7 @@ import type { Config } from '@/config.js';
import { DI } from '@/di-symbols.js'; import { DI } from '@/di-symbols.js';
import type Logger from '@/logger.js'; import type Logger from '@/logger.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { CheckModeratorsActivityProcessorService } from '@/queue/processors/CheckModeratorsActivityProcessorService.js';
import { UserWebhookDeliverProcessorService } from './processors/UserWebhookDeliverProcessorService.js'; import { UserWebhookDeliverProcessorService } from './processors/UserWebhookDeliverProcessorService.js';
import { SystemWebhookDeliverProcessorService } from './processors/SystemWebhookDeliverProcessorService.js'; import { SystemWebhookDeliverProcessorService } from './processors/SystemWebhookDeliverProcessorService.js';
import { EndedPollNotificationProcessorService } from './processors/EndedPollNotificationProcessorService.js'; import { EndedPollNotificationProcessorService } from './processors/EndedPollNotificationProcessorService.js';
@ -66,7 +67,7 @@ function getJobInfo(job: Bull.Job | undefined, increment = false): string {
// onActiveとかonCompletedのattemptsMadeがなぜか0始まりなのでインクリメントする // onActiveとかonCompletedのattemptsMadeがなぜか0始まりなのでインクリメントする
const currentAttempts = job.attemptsMade + (increment ? 1 : 0); const currentAttempts = job.attemptsMade + (increment ? 1 : 0);
const maxAttempts = job.opts ? job.opts.attempts : 0; const maxAttempts = job.opts.attempts ?? 0;
return `id=${job.id} attempts=${currentAttempts}/${maxAttempts} age=${formated}`; return `id=${job.id} attempts=${currentAttempts}/${maxAttempts} age=${formated}`;
} }
@ -120,24 +121,35 @@ export class QueueProcessorService implements OnApplicationShutdown {
private aggregateRetentionProcessorService: AggregateRetentionProcessorService, private aggregateRetentionProcessorService: AggregateRetentionProcessorService,
private checkExpiredMutingsProcessorService: CheckExpiredMutingsProcessorService, private checkExpiredMutingsProcessorService: CheckExpiredMutingsProcessorService,
private bakeBufferedReactionsProcessorService: BakeBufferedReactionsProcessorService, private bakeBufferedReactionsProcessorService: BakeBufferedReactionsProcessorService,
private checkModeratorsActivityProcessorService: CheckModeratorsActivityProcessorService,
private cleanProcessorService: CleanProcessorService, private cleanProcessorService: CleanProcessorService,
) { ) {
this.logger = this.queueLoggerService.logger; this.logger = this.queueLoggerService.logger;
function renderError(e: Error): any { function renderError(e?: Error) {
if (e) { // 何故かeがundefinedで来ることがある // 何故かeがundefinedで来ることがある
if (!e) return '?';
if (e instanceof Bull.UnrecoverableError || e.name === 'AbortError') {
return `${e.name}: ${e.message}`;
}
return { return {
stack: e.stack, stack: e.stack,
message: e.message, message: e.message,
name: e.name, name: e.name,
}; };
} else {
return {
stack: '?',
message: '?',
name: '?',
};
} }
function renderJob(job?: Bull.Job) {
if (!job) return '?';
return {
name: job.name || undefined,
info: getJobInfo(job),
failedReason: job.failedReason || undefined,
data: job.data,
};
} }
//#region system //#region system
@ -150,6 +162,7 @@ export class QueueProcessorService implements OnApplicationShutdown {
case 'aggregateRetention': return this.aggregateRetentionProcessorService.process(); case 'aggregateRetention': return this.aggregateRetentionProcessorService.process();
case 'checkExpiredMutings': return this.checkExpiredMutingsProcessorService.process(); case 'checkExpiredMutings': return this.checkExpiredMutingsProcessorService.process();
case 'bakeBufferedReactions': return this.bakeBufferedReactionsProcessorService.process(); case 'bakeBufferedReactions': return this.bakeBufferedReactionsProcessorService.process();
case 'checkModeratorsActivity': return this.checkModeratorsActivityProcessorService.process();
case 'clean': return this.cleanProcessorService.process(); case 'clean': return this.cleanProcessorService.process();
default: throw new Error(`unrecognized job type ${job.name} for system`); default: throw new Error(`unrecognized job type ${job.name} for system`);
} }
@ -172,15 +185,15 @@ export class QueueProcessorService implements OnApplicationShutdown {
.on('active', (job) => logger.debug(`active id=${job.id}`)) .on('active', (job) => logger.debug(`active id=${job.id}`))
.on('completed', (job, result) => logger.debug(`completed(${result}) id=${job.id}`)) .on('completed', (job, result) => logger.debug(`completed(${result}) id=${job.id}`))
.on('failed', (job, err: Error) => { .on('failed', (job, err: Error) => {
logger.error(`failed(${err.stack}) id=${job ? job.id : '-'}`, { job, e: renderError(err) }); logger.error(`failed(${err.name}: ${err.message}) id=${job?.id ?? '?'}`, { job: renderJob(job), e: renderError(err) });
if (config.sentryForBackend) { if (config.sentryForBackend) {
Sentry.captureMessage(`Queue: System: ${job?.name ?? '?'}: ${err.message}`, { Sentry.captureMessage(`Queue: System: ${job?.name ?? '?'}: ${err.name}: ${err.message}`, {
level: 'error', level: 'error',
extra: { job, err }, extra: { job, err },
}); });
} }
}) })
.on('error', (err: Error) => logger.error(`error ${err.stack}`, { e: renderError(err) })) .on('error', (err: Error) => logger.error(`error ${err.name}: ${err.message}`, { e: renderError(err) }))
.on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`)); .on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`));
} }
//#endregion //#endregion
@ -229,15 +242,15 @@ export class QueueProcessorService implements OnApplicationShutdown {
.on('active', (job) => logger.debug(`active id=${job.id}`)) .on('active', (job) => logger.debug(`active id=${job.id}`))
.on('completed', (job, result) => logger.debug(`completed(${result}) id=${job.id}`)) .on('completed', (job, result) => logger.debug(`completed(${result}) id=${job.id}`))
.on('failed', (job, err) => { .on('failed', (job, err) => {
logger.error(`failed(${err.stack}) id=${job ? job.id : '-'}`, { job, e: renderError(err) }); logger.error(`failed(${err.name}: ${err.message}) id=${job?.id ?? '?'}`, { job: renderJob(job), e: renderError(err) });
if (config.sentryForBackend) { if (config.sentryForBackend) {
Sentry.captureMessage(`Queue: DB: ${job?.name ?? '?'}: ${err.message}`, { Sentry.captureMessage(`Queue: DB: ${job?.name ?? '?'}: ${err.name}: ${err.message}`, {
level: 'error', level: 'error',
extra: { job, err }, extra: { job, err },
}); });
} }
}) })
.on('error', (err: Error) => logger.error(`error ${err.stack}`, { e: renderError(err) })) .on('error', (err: Error) => logger.error(`error ${err.name}: ${err.message}`, { e: renderError(err) }))
.on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`)); .on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`));
} }
//#endregion //#endregion
@ -269,15 +282,15 @@ export class QueueProcessorService implements OnApplicationShutdown {
.on('active', (job) => logger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`)) .on('active', (job) => logger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`))
.on('completed', (job, result) => logger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`)) .on('completed', (job, result) => logger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`))
.on('failed', (job, err) => { .on('failed', (job, err) => {
logger.error(`failed(${err.stack}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`); logger.error(`failed(${err.name}: ${err.message}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`);
if (config.sentryForBackend) { if (config.sentryForBackend) {
Sentry.captureMessage(`Queue: Deliver: ${err.message}`, { Sentry.captureMessage(`Queue: Deliver: ${err.name}: ${err.message}`, {
level: 'error', level: 'error',
extra: { job, err }, extra: { job, err },
}); });
} }
}) })
.on('error', (err: Error) => logger.error(`error ${err.stack}`, { e: renderError(err) })) .on('error', (err: Error) => logger.error(`error ${err.name}: ${err.message}`, { e: renderError(err) }))
.on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`)); .on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`));
} }
//#endregion //#endregion
@ -309,15 +322,15 @@ export class QueueProcessorService implements OnApplicationShutdown {
.on('active', (job) => logger.debug(`active ${getJobInfo(job, true)}`)) .on('active', (job) => logger.debug(`active ${getJobInfo(job, true)}`))
.on('completed', (job, result) => logger.debug(`completed(${result}) ${getJobInfo(job, true)}`)) .on('completed', (job, result) => logger.debug(`completed(${result}) ${getJobInfo(job, true)}`))
.on('failed', (job, err) => { .on('failed', (job, err) => {
logger.error(`failed(${err.stack}) ${getJobInfo(job)} activity=${job ? (job.data.activity ? job.data.activity.id : 'none') : '-'}`, { job, e: renderError(err) }); logger.error(`failed(${err.name}: ${err.message}) ${getJobInfo(job)} activity=${job ? (job.data.activity ? job.data.activity.id : 'none') : '-'}`, { job: renderJob(job), e: renderError(err) });
if (config.sentryForBackend) { if (config.sentryForBackend) {
Sentry.captureMessage(`Queue: Inbox: ${err.message}`, { Sentry.captureMessage(`Queue: Inbox: ${err.name}: ${err.message}`, {
level: 'error', level: 'error',
extra: { job, err }, extra: { job, err },
}); });
} }
}) })
.on('error', (err: Error) => logger.error(`error ${err.stack}`, { e: renderError(err) })) .on('error', (err: Error) => logger.error(`error ${err.name}: ${err.message}`, { e: renderError(err) }))
.on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`)); .on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`));
} }
//#endregion //#endregion
@ -349,15 +362,15 @@ export class QueueProcessorService implements OnApplicationShutdown {
.on('active', (job) => logger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`)) .on('active', (job) => logger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`))
.on('completed', (job, result) => logger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`)) .on('completed', (job, result) => logger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`))
.on('failed', (job, err) => { .on('failed', (job, err) => {
logger.error(`failed(${err.stack}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`); logger.error(`failed(${err.name}: ${err.message}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`);
if (config.sentryForBackend) { if (config.sentryForBackend) {
Sentry.captureMessage(`Queue: UserWebhookDeliver: ${err.message}`, { Sentry.captureMessage(`Queue: UserWebhookDeliver: ${err.name}: ${err.message}`, {
level: 'error', level: 'error',
extra: { job, err }, extra: { job, err },
}); });
} }
}) })
.on('error', (err: Error) => logger.error(`error ${err.stack}`, { e: renderError(err) })) .on('error', (err: Error) => logger.error(`error ${err.name}: ${err.message}`, { e: renderError(err) }))
.on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`)); .on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`));
} }
//#endregion //#endregion
@ -389,15 +402,15 @@ export class QueueProcessorService implements OnApplicationShutdown {
.on('active', (job) => logger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`)) .on('active', (job) => logger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`))
.on('completed', (job, result) => logger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`)) .on('completed', (job, result) => logger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`))
.on('failed', (job, err) => { .on('failed', (job, err) => {
logger.error(`failed(${err.stack}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`); logger.error(`failed(${err.name}: ${err.message}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`);
if (config.sentryForBackend) { if (config.sentryForBackend) {
Sentry.captureMessage(`Queue: SystemWebhookDeliver: ${err.message}`, { Sentry.captureMessage(`Queue: SystemWebhookDeliver: ${err.name}: ${err.message}`, {
level: 'error', level: 'error',
extra: { job, err }, extra: { job, err },
}); });
} }
}) })
.on('error', (err: Error) => logger.error(`error ${err.stack}`, { e: renderError(err) })) .on('error', (err: Error) => logger.error(`error ${err.name}: ${err.message}`, { e: renderError(err) }))
.on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`)); .on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`));
} }
//#endregion //#endregion
@ -436,15 +449,15 @@ export class QueueProcessorService implements OnApplicationShutdown {
.on('active', (job) => logger.debug(`active id=${job.id}`)) .on('active', (job) => logger.debug(`active id=${job.id}`))
.on('completed', (job, result) => logger.debug(`completed(${result}) id=${job.id}`)) .on('completed', (job, result) => logger.debug(`completed(${result}) id=${job.id}`))
.on('failed', (job, err) => { .on('failed', (job, err) => {
logger.error(`failed(${err.stack}) id=${job ? job.id : '-'}`, { job, e: renderError(err) }); logger.error(`failed(${err.name}: ${err.message}) id=${job?.id ?? '?'}`, { job: renderJob(job), e: renderError(err) });
if (config.sentryForBackend) { if (config.sentryForBackend) {
Sentry.captureMessage(`Queue: Relationship: ${job?.name ?? '?'}: ${err.message}`, { Sentry.captureMessage(`Queue: Relationship: ${job?.name ?? '?'}: ${err.name}: ${err.message}`, {
level: 'error', level: 'error',
extra: { job, err }, extra: { job, err },
}); });
} }
}) })
.on('error', (err: Error) => logger.error(`error ${err.stack}`, { e: renderError(err) })) .on('error', (err: Error) => logger.error(`error ${err.name}: ${err.message}`, { e: renderError(err) }))
.on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`)); .on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`));
} }
//#endregion //#endregion
@ -477,15 +490,15 @@ export class QueueProcessorService implements OnApplicationShutdown {
.on('active', (job) => logger.debug(`active id=${job.id}`)) .on('active', (job) => logger.debug(`active id=${job.id}`))
.on('completed', (job, result) => logger.debug(`completed(${result}) id=${job.id}`)) .on('completed', (job, result) => logger.debug(`completed(${result}) id=${job.id}`))
.on('failed', (job, err) => { .on('failed', (job, err) => {
logger.error(`failed(${err.stack}) id=${job ? job.id : '-'}`, { job, e: renderError(err) }); logger.error(`failed(${err.name}: ${err.message}) id=${job?.id ?? '?'}`, { job: renderJob(job), e: renderError(err) });
if (config.sentryForBackend) { if (config.sentryForBackend) {
Sentry.captureMessage(`Queue: ObjectStorage: ${job?.name ?? '?'}: ${err.message}`, { Sentry.captureMessage(`Queue: ObjectStorage: ${job?.name ?? '?'}: ${err.name}: ${err.message}`, {
level: 'error', level: 'error',
extra: { job, err }, extra: { job, err },
}); });
} }
}) })
.on('error', (err: Error) => logger.error(`error ${err.stack}`, { e: renderError(err) })) .on('error', (err: Error) => logger.error(`error ${err.name}: ${err.message}`, { e: renderError(err) }))
.on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`)); .on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`));
} }
//#endregion //#endregion

View File

@ -0,0 +1,292 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { Inject, Injectable } from '@nestjs/common';
import { In } from 'typeorm';
import type Logger from '@/logger.js';
import { bindThis } from '@/decorators.js';
import { MetaService } from '@/core/MetaService.js';
import { RoleService } from '@/core/RoleService.js';
import { EmailService } from '@/core/EmailService.js';
import { MiUser, type UserProfilesRepository } from '@/models/_.js';
import { DI } from '@/di-symbols.js';
import { SystemWebhookService } from '@/core/SystemWebhookService.js';
import { AnnouncementService } from '@/core/AnnouncementService.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
// モデレーターが不在と判断する日付の閾値
const MODERATOR_INACTIVITY_LIMIT_DAYS = 7;
// 警告通知やログ出力を行う残日数の閾値
const MODERATOR_INACTIVITY_WARNING_REMAINING_DAYS = 2;
// 期限から6時間ごとに通知を行う
const MODERATOR_INACTIVITY_WARNING_NOTIFY_INTERVAL_HOURS = 6;
const ONE_HOUR_MILLI_SEC = 1000 * 60 * 60;
const ONE_DAY_MILLI_SEC = ONE_HOUR_MILLI_SEC * 24;
export type ModeratorInactivityEvaluationResult = {
isModeratorsInactive: boolean;
inactiveModerators: MiUser[];
remainingTime: ModeratorInactivityRemainingTime;
}
export type ModeratorInactivityRemainingTime = {
time: number;
asHours: number;
asDays: number;
};
function generateModeratorInactivityMail(remainingTime: ModeratorInactivityRemainingTime) {
const subject = 'Moderator Inactivity Warning / モデレーター不在の通知';
const timeVariant = remainingTime.asDays === 0 ? `${remainingTime.asHours} hours` : `${remainingTime.asDays} days`;
const timeVariantJa = remainingTime.asDays === 0 ? `${remainingTime.asHours} 時間` : `${remainingTime.asDays} 日間`;
const message = [
'To Moderators,',
'',
`A moderator has been inactive for a period of time. If there are ${timeVariant} of inactivity left, it will switch to invitation only.`,
'If you do not wish to move to invitation only, you must log into Misskey and update your last active date and time.',
'',
'---------------',
'',
'To モデレーター各位',
'',
`モデレーターが一定期間活動していないようです。あと${timeVariantJa}活動していない状態が続くと招待制に切り替わります。`,
'招待制に切り替わることを望まない場合は、Misskeyにログインして最終アクティブ日時を更新してください。',
'',
];
const html = message.join('<br>');
const text = message.join('\n');
return {
subject,
html,
text,
};
}
function generateInvitationOnlyChangedMail() {
const subject = 'Change to Invitation-Only / 招待制に変更されました';
const message = [
'To Moderators,',
'',
`Changed to invitation only because no moderator activity was detected for ${MODERATOR_INACTIVITY_LIMIT_DAYS} days.`,
'To cancel the invitation only, you need to access the control panel.',
'',
'---------------',
'',
'To モデレーター各位',
'',
`モデレーターの活動が${MODERATOR_INACTIVITY_LIMIT_DAYS}日間検出されなかったため、招待制に変更されました。`,
'招待制を解除するには、コントロールパネルにアクセスする必要があります。',
'',
];
const html = message.join('<br>');
const text = message.join('\n');
return {
subject,
html,
text,
};
}
@Injectable()
export class CheckModeratorsActivityProcessorService {
private logger: Logger;
constructor(
@Inject(DI.userProfilesRepository)
private userProfilesRepository: UserProfilesRepository,
private metaService: MetaService,
private roleService: RoleService,
private emailService: EmailService,
private announcementService: AnnouncementService,
private systemWebhookService: SystemWebhookService,
private queueLoggerService: QueueLoggerService,
) {
this.logger = this.queueLoggerService.logger.createSubLogger('check-moderators-activity');
}
@bindThis
public async process(): Promise<void> {
this.logger.info('start.');
const meta = await this.metaService.fetch(false);
if (!meta.disableRegistration) {
await this.processImpl();
} else {
this.logger.info('is already invitation only.');
}
this.logger.succ('finish.');
}
@bindThis
private async processImpl() {
const evaluateResult = await this.evaluateModeratorsInactiveDays();
if (evaluateResult.isModeratorsInactive) {
this.logger.warn(`The moderator has been inactive for ${MODERATOR_INACTIVITY_LIMIT_DAYS} days. We will move to invitation only.`);
await this.changeToInvitationOnly();
await this.notifyChangeToInvitationOnly();
} else {
const remainingTime = evaluateResult.remainingTime;
if (remainingTime.asDays <= MODERATOR_INACTIVITY_WARNING_REMAINING_DAYS) {
const timeVariant = remainingTime.asDays === 0 ? `${remainingTime.asHours} hours` : `${remainingTime.asDays} days`;
this.logger.warn(`A moderator has been inactive for a period of time. If you are inactive for an additional ${timeVariant}, it will switch to invitation only.`);
if (remainingTime.asHours % MODERATOR_INACTIVITY_WARNING_NOTIFY_INTERVAL_HOURS === 0) {
// ジョブの実行頻度と同等だと通知が多すぎるため期限から6時間ごとに通知する
// つまり、のこり2日を切ったら6時間ごとに通知が送られる
await this.notifyInactiveModeratorsWarning(remainingTime);
}
}
}
}
/**
* trueの場合はモデレーターが不在である
* isModerator, isAdministrator, isRootのいずれかがtrueのユーザを対象に
* {@link MiUser.lastActiveDate}{@link MODERATOR_INACTIVITY_LIMIT_DAYS}
* {@link MiUser.lastActiveDate}nullの場合は
*
* -----
*
* ###
* - 実行日時: 2022-01-30 12:00:00
* - 判定基準: 2022-01-23 12:00:00{@link MODERATOR_INACTIVITY_LIMIT_DAYS}
*
* ####
* - モデレータA: lastActiveDate = 2022-01-20 00:00:00
* - モデレータB: lastActiveDate = 2022-01-23 12:00:00 0
* - モデレータC: lastActiveDate = 2022-01-23 11:59:59 -1
* - モデレータD: lastActiveDate = null
*
* Bのアクティビティのみ判定基準日よりも古くないため
*
* ####
* - モデレータA: lastActiveDate = 2022-01-20 00:00:00
* - モデレータB: lastActiveDate = 2022-01-22 12:00:00 -1
* - モデレータC: lastActiveDate = 2022-01-23 11:59:59 -1
* - モデレータD: lastActiveDate = null
*
* A, B, Cのアクティビティは判定基準日よりも古いため
*/
@bindThis
public async evaluateModeratorsInactiveDays(): Promise<ModeratorInactivityEvaluationResult> {
const today = new Date();
const inactivePeriod = new Date(today);
inactivePeriod.setDate(today.getDate() - MODERATOR_INACTIVITY_LIMIT_DAYS);
const moderators = await this.fetchModerators()
.then(it => it.filter(it => it.lastActiveDate != null));
const inactiveModerators = moderators
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
.filter(it => it.lastActiveDate!.getTime() < inactivePeriod.getTime());
// 残りの猶予を示したいので、最終アクティブ日時が一番若いモデレータの日数を基準に猶予を計算する
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const newestLastActiveDate = new Date(Math.max(...moderators.map(it => it.lastActiveDate!.getTime())));
const remainingTime = newestLastActiveDate.getTime() - inactivePeriod.getTime();
const remainingTimeAsDays = Math.floor(remainingTime / ONE_DAY_MILLI_SEC);
const remainingTimeAsHours = Math.floor((remainingTime / ONE_HOUR_MILLI_SEC));
return {
isModeratorsInactive: inactiveModerators.length === moderators.length,
inactiveModerators,
remainingTime: {
time: remainingTime,
asHours: remainingTimeAsHours,
asDays: remainingTimeAsDays,
},
};
}
@bindThis
private async changeToInvitationOnly() {
await this.metaService.update({ disableRegistration: true });
}
@bindThis
public async notifyInactiveModeratorsWarning(remainingTime: ModeratorInactivityRemainingTime) {
// -- モデレータへのメール送信
const moderators = await this.fetchModerators();
const moderatorProfiles = await this.userProfilesRepository
.findBy({ userId: In(moderators.map(it => it.id)) })
.then(it => new Map(it.map(it => [it.userId, it])));
const mail = generateModeratorInactivityMail(remainingTime);
for (const moderator of moderators) {
const profile = moderatorProfiles.get(moderator.id);
if (profile && profile.email && profile.emailVerified) {
this.emailService.sendEmail(profile.email, mail.subject, mail.html, mail.text);
}
}
// -- SystemWebhook
const systemWebhooks = await this.systemWebhookService.fetchActiveSystemWebhooks()
.then(it => it.filter(it => it.on.includes('inactiveModeratorsWarning')));
for (const systemWebhook of systemWebhooks) {
this.systemWebhookService.enqueueSystemWebhook(
systemWebhook,
'inactiveModeratorsWarning',
{ remainingTime: remainingTime },
);
}
}
@bindThis
public async notifyChangeToInvitationOnly() {
// -- モデレータへのメールとお知らせ(個人向け)送信
const moderators = await this.fetchModerators();
const moderatorProfiles = await this.userProfilesRepository
.findBy({ userId: In(moderators.map(it => it.id)) })
.then(it => new Map(it.map(it => [it.userId, it])));
const mail = generateInvitationOnlyChangedMail();
for (const moderator of moderators) {
this.announcementService.create({
title: mail.subject,
text: mail.text,
forExistingUsers: true,
needConfirmationToRead: true,
userId: moderator.id,
});
const profile = moderatorProfiles.get(moderator.id);
if (profile && profile.email && profile.emailVerified) {
this.emailService.sendEmail(profile.email, mail.subject, mail.html, mail.text);
}
}
// -- SystemWebhook
const systemWebhooks = await this.systemWebhookService.fetchActiveSystemWebhooks()
.then(it => it.filter(it => it.on.includes('inactiveModeratorsInvitationOnlyChanged')));
for (const systemWebhook of systemWebhooks) {
this.systemWebhookService.enqueueSystemWebhook(
systemWebhook,
'inactiveModeratorsInvitationOnlyChanged',
{},
);
}
}
@bindThis
private async fetchModerators() {
// TODO: モデレーター以外にも特別な権限を持つユーザーがいる場合は考慮する
return this.roleService.getModerators({
includeAdmins: true,
includeRoot: true,
excludeExpire: true,
});
}
}

View File

@ -74,8 +74,17 @@ export class DeliverProcessorService {
try { try {
await this.apRequestService.signedPost(job.data.user, job.data.to, job.data.content, job.data.digest); await this.apRequestService.signedPost(job.data.user, job.data.to, job.data.content, job.data.digest);
// Update stats this.apRequestChart.deliverSucc();
this.federatedInstanceService.fetch(host).then(i => { this.federationChart.deliverd(host, true);
// Update instance stats
process.nextTick(async () => {
const i = await (this.meta.enableStatsForFederatedInstances
? this.federatedInstanceService.fetchOrRegister(host)
: this.federatedInstanceService.fetch(host));
if (i == null) return;
if (i.isNotResponding) { if (i.isNotResponding) {
this.federatedInstanceService.update(i.id, { this.federatedInstanceService.update(i.id, {
isNotResponding: false, isNotResponding: false,
@ -83,9 +92,9 @@ export class DeliverProcessorService {
}); });
} }
if (this.meta.enableStatsForFederatedInstances) {
this.fetchInstanceMetadataService.fetchInstanceMetadata(i); this.fetchInstanceMetadataService.fetchInstanceMetadata(i);
this.apRequestChart.deliverSucc(); }
this.federationChart.deliverd(i.host, true);
if (this.meta.enableChartsForFederatedInstances) { if (this.meta.enableChartsForFederatedInstances) {
this.instanceChart.requestSent(i.host, true); this.instanceChart.requestSent(i.host, true);
@ -94,8 +103,11 @@ export class DeliverProcessorService {
return 'Success'; return 'Success';
} catch (res) { } catch (res) {
// Update stats this.apRequestChart.deliverFail();
this.federatedInstanceService.fetch(host).then(i => { this.federationChart.deliverd(host, false);
// Update instance stats
this.federatedInstanceService.fetchOrRegister(host).then(i => {
if (!i.isNotResponding) { if (!i.isNotResponding) {
this.federatedInstanceService.update(i.id, { this.federatedInstanceService.update(i.id, {
isNotResponding: true, isNotResponding: true,
@ -116,9 +128,6 @@ export class DeliverProcessorService {
}); });
} }
this.apRequestChart.deliverFail();
this.federationChart.deliverd(i.host, false);
if (this.meta.enableChartsForFederatedInstances) { if (this.meta.enableChartsForFederatedInstances) {
this.instanceChart.requestSent(i.host, false); this.instanceChart.requestSent(i.host, false);
} }
@ -129,7 +138,7 @@ export class DeliverProcessorService {
if (!res.isRetryable) { if (!res.isRetryable) {
// 相手が閉鎖していることを明示しているため、配送停止する // 相手が閉鎖していることを明示しているため、配送停止する
if (job.data.isSharedInbox && res.statusCode === 410) { if (job.data.isSharedInbox && res.statusCode === 410) {
this.federatedInstanceService.fetch(host).then(i => { this.federatedInstanceService.fetchOrRegister(host).then(i => {
this.federatedInstanceService.update(i.id, { this.federatedInstanceService.update(i.id, {
suspensionState: 'goneSuspended', suspensionState: 'goneSuspended',
}); });

View File

@ -192,21 +192,27 @@ export class InboxProcessorService implements OnApplicationShutdown {
} }
} }
// Update stats this.apRequestChart.inbox();
this.federatedInstanceService.fetch(authUser.user.host).then(i => { this.federationChart.inbox(authUser.user.host);
// Update instance stats
process.nextTick(async () => {
const i = await (this.meta.enableStatsForFederatedInstances
? this.federatedInstanceService.fetchOrRegister(authUser.user.host)
: this.federatedInstanceService.fetch(authUser.user.host));
if (i == null) return;
this.updateInstanceQueue.enqueue(i.id, { this.updateInstanceQueue.enqueue(i.id, {
latestRequestReceivedAt: new Date(), latestRequestReceivedAt: new Date(),
shouldUnsuspend: i.suspensionState === 'autoSuspendedForNotResponding', shouldUnsuspend: i.suspensionState === 'autoSuspendedForNotResponding',
}); });
this.fetchInstanceMetadataService.fetchInstanceMetadata(i);
this.apRequestChart.inbox();
this.federationChart.inbox(i.host);
if (this.meta.enableChartsForFederatedInstances) { if (this.meta.enableChartsForFederatedInstances) {
this.instanceChart.requestReceived(i.host); this.instanceChart.requestReceived(i.host);
} }
this.fetchInstanceMetadataService.fetchInstanceMetadata(i);
}); });
// アクティビティを処理 // アクティビティを処理

View File

@ -119,6 +119,7 @@ export class ApiServerService {
'g-recaptcha-response'?: string; 'g-recaptcha-response'?: string;
'turnstile-response'?: string; 'turnstile-response'?: string;
'm-captcha-response'?: string; 'm-captcha-response'?: string;
'testcaptcha-response'?: string;
} }
}>('/signup', (request, reply) => this.signupApiService.signup(request, reply)); }>('/signup', (request, reply) => this.signupApiService.signup(request, reply));
@ -132,6 +133,7 @@ export class ApiServerService {
'g-recaptcha-response'?: string; 'g-recaptcha-response'?: string;
'turnstile-response'?: string; 'turnstile-response'?: string;
'm-captcha-response'?: string; 'm-captcha-response'?: string;
'testcaptcha-response'?: string;
}; };
}>('/signin-flow', (request, reply) => this.signinApiService.signin(request, reply)); }>('/signin-flow', (request, reply) => this.signinApiService.signin(request, reply));

View File

@ -71,6 +71,7 @@ export class SigninApiService {
'g-recaptcha-response'?: string; 'g-recaptcha-response'?: string;
'turnstile-response'?: string; 'turnstile-response'?: string;
'm-captcha-response'?: string; 'm-captcha-response'?: string;
'testcaptcha-response'?: string;
}; };
}>, }>,
reply: FastifyReply, reply: FastifyReply,
@ -194,6 +195,12 @@ export class SigninApiService {
throw new FastifyReplyError(400, err); throw new FastifyReplyError(400, err);
}); });
} }
if (this.meta.enableTestcaptcha) {
await this.captchaService.verifyTestcaptcha(body['testcaptcha-response']).catch(err => {
throw new FastifyReplyError(400, err);
});
}
} }
if (same) { if (same) {

View File

@ -67,6 +67,7 @@ export class SignupApiService {
'g-recaptcha-response'?: string; 'g-recaptcha-response'?: string;
'turnstile-response'?: string; 'turnstile-response'?: string;
'm-captcha-response'?: string; 'm-captcha-response'?: string;
'testcaptcha-response'?: string;
} }
}>, }>,
reply: FastifyReply, reply: FastifyReply,
@ -99,6 +100,12 @@ export class SignupApiService {
throw new FastifyReplyError(400, err); throw new FastifyReplyError(400, err);
}); });
} }
if (this.meta.enableTestcaptcha) {
await this.captchaService.verifyTestcaptcha(body['testcaptcha-response']).catch(err => {
throw new FastifyReplyError(400, err);
});
}
} }
const username = body['username']; const username = body['username'];

View File

@ -6,7 +6,7 @@
import { Inject, Injectable } from '@nestjs/common'; import { Inject, Injectable } from '@nestjs/common';
import { Endpoint } from '@/server/api/endpoint-base.js'; import { Endpoint } from '@/server/api/endpoint-base.js';
import { CustomEmojiService } from '@/core/CustomEmojiService.js'; import { CustomEmojiService } from '@/core/CustomEmojiService.js';
import type { DriveFilesRepository } from '@/models/_.js'; import type { DriveFilesRepository, MiEmoji } from '@/models/_.js';
import { DI } from '@/di-symbols.js'; import { DI } from '@/di-symbols.js';
import { ApiError } from '../../../error.js'; import { ApiError } from '../../../error.js';
@ -78,25 +78,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
if (driveFile == null) throw new ApiError(meta.errors.noSuchFile); if (driveFile == null) throw new ApiError(meta.errors.noSuchFile);
} }
let emojiId; // JSON schemeのanyOfの型変換がうまくいっていないらしい
if (ps.id) { const required = { id: ps.id, name: ps.name } as
emojiId = ps.id; | { id: MiEmoji['id']; name?: string }
const emoji = await this.customEmojiService.getEmojiById(ps.id); | { id?: MiEmoji['id']; name: string };
if (!emoji) throw new ApiError(meta.errors.noSuchEmoji);
if (ps.name && (ps.name !== emoji.name)) {
const isDuplicate = await this.customEmojiService.checkDuplicate(ps.name);
if (isDuplicate) throw new ApiError(meta.errors.sameNameEmojiExists);
}
} else {
if (!ps.name) throw new Error('Invalid Params unexpectedly passed. This is a BUG. Please report it to the development team.');
const emoji = await this.customEmojiService.getEmojiByName(ps.name);
if (!emoji) throw new ApiError(meta.errors.noSuchEmoji);
emojiId = emoji.id;
}
await this.customEmojiService.update(emojiId, { const error = await this.customEmojiService.update({
...required,
driveFile, driveFile,
name: ps.name,
category: ps.category, category: ps.category,
aliases: ps.aliases, aliases: ps.aliases,
license: ps.license, license: ps.license,
@ -104,6 +93,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
localOnly: ps.localOnly, localOnly: ps.localOnly,
roleIdsThatCanBeUsedThisEmojiAsReaction: ps.roleIdsThatCanBeUsedThisEmojiAsReaction, roleIdsThatCanBeUsedThisEmojiAsReaction: ps.roleIdsThatCanBeUsedThisEmojiAsReaction,
}, me); }, me);
switch (error) {
case null: return;
case 'NO_SUCH_EMOJI': throw new ApiError(meta.errors.noSuchEmoji);
case 'SAME_NAME_EMOJI_EXISTS': throw new ApiError(meta.errors.sameNameEmojiExists);
}
// 網羅性チェック
const mustBeNever: never = error;
}); });
} }
} }

View File

@ -69,6 +69,10 @@ export const meta = {
type: 'string', type: 'string',
optional: false, nullable: true, optional: false, nullable: true,
}, },
enableTestcaptcha: {
type: 'boolean',
optional: false, nullable: false,
},
swPublickey: { swPublickey: {
type: 'string', type: 'string',
optional: false, nullable: true, optional: false, nullable: true,
@ -173,6 +177,13 @@ export const meta = {
type: 'string', type: 'string',
}, },
}, },
prohibitedWordsForNameOfUser: {
type: 'array',
optional: false, nullable: false,
items: {
type: 'string',
},
},
bannedEmailDomains: { bannedEmailDomains: {
type: 'array', type: 'array',
optional: true, nullable: false, optional: true, nullable: false,
@ -337,6 +348,10 @@ export const meta = {
type: 'boolean', type: 'boolean',
optional: false, nullable: false, optional: false, nullable: false,
}, },
enableStatsForFederatedInstances: {
type: 'boolean',
optional: false, nullable: false,
},
enableServerMachineStats: { enableServerMachineStats: {
type: 'boolean', type: 'boolean',
optional: false, nullable: false, optional: false, nullable: false,
@ -555,6 +570,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
recaptchaSiteKey: instance.recaptchaSiteKey, recaptchaSiteKey: instance.recaptchaSiteKey,
enableTurnstile: instance.enableTurnstile, enableTurnstile: instance.enableTurnstile,
turnstileSiteKey: instance.turnstileSiteKey, turnstileSiteKey: instance.turnstileSiteKey,
enableTestcaptcha: instance.enableTestcaptcha,
swPublickey: instance.swPublicKey, swPublickey: instance.swPublicKey,
themeColor: instance.themeColor, themeColor: instance.themeColor,
mascotImageUrl: instance.mascotImageUrl, mascotImageUrl: instance.mascotImageUrl,
@ -581,6 +597,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
mediaSilencedHosts: instance.mediaSilencedHosts, mediaSilencedHosts: instance.mediaSilencedHosts,
sensitiveWords: instance.sensitiveWords, sensitiveWords: instance.sensitiveWords,
prohibitedWords: instance.prohibitedWords, prohibitedWords: instance.prohibitedWords,
prohibitedWordsForNameOfUser: instance.prohibitedWordsForNameOfUser,
preservedUsernames: instance.preservedUsernames, preservedUsernames: instance.preservedUsernames,
hcaptchaSecretKey: instance.hcaptchaSecretKey, hcaptchaSecretKey: instance.hcaptchaSecretKey,
mcaptchaSecretKey: instance.mcaptchaSecretKey, mcaptchaSecretKey: instance.mcaptchaSecretKey,
@ -622,6 +639,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
truemailAuthKey: instance.truemailAuthKey, truemailAuthKey: instance.truemailAuthKey,
enableChartsForRemoteUser: instance.enableChartsForRemoteUser, enableChartsForRemoteUser: instance.enableChartsForRemoteUser,
enableChartsForFederatedInstances: instance.enableChartsForFederatedInstances, enableChartsForFederatedInstances: instance.enableChartsForFederatedInstances,
enableStatsForFederatedInstances: instance.enableStatsForFederatedInstances,
enableServerMachineStats: instance.enableServerMachineStats, enableServerMachineStats: instance.enableServerMachineStats,
enableIdenticonGeneration: instance.enableIdenticonGeneration, enableIdenticonGeneration: instance.enableIdenticonGeneration,
bannedEmailDomains: instance.bannedEmailDomains, bannedEmailDomains: instance.bannedEmailDomains,

View File

@ -71,13 +71,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
break; break;
} }
case 'moderator': { case 'moderator': {
const moderatorIds = await this.roleService.getModeratorIds(false); const moderatorIds = await this.roleService.getModeratorIds({ includeAdmins: false });
if (moderatorIds.length === 0) return []; if (moderatorIds.length === 0) return [];
query.where('user.id IN (:...moderatorIds)', { moderatorIds: moderatorIds }); query.where('user.id IN (:...moderatorIds)', { moderatorIds: moderatorIds });
break; break;
} }
case 'adminOrModerator': { case 'adminOrModerator': {
const adminOrModeratorIds = await this.roleService.getModeratorIds(); const adminOrModeratorIds = await this.roleService.getModeratorIds({ includeAdmins: true });
if (adminOrModeratorIds.length === 0) return []; if (adminOrModeratorIds.length === 0) return [];
query.where('user.id IN (:...adminOrModeratorIds)', { adminOrModeratorIds: adminOrModeratorIds }); query.where('user.id IN (:...adminOrModeratorIds)', { adminOrModeratorIds: adminOrModeratorIds });
break; break;

View File

@ -46,6 +46,11 @@ export const paramDef = {
type: 'string', type: 'string',
}, },
}, },
prohibitedWordsForNameOfUser: {
type: 'array', nullable: true, items: {
type: 'string',
},
},
themeColor: { type: 'string', nullable: true, pattern: '^#[0-9a-fA-F]{6}$' }, themeColor: { type: 'string', nullable: true, pattern: '^#[0-9a-fA-F]{6}$' },
mascotImageUrl: { type: 'string', nullable: true }, mascotImageUrl: { type: 'string', nullable: true },
bannerUrl: { type: 'string', nullable: true }, bannerUrl: { type: 'string', nullable: true },
@ -78,6 +83,7 @@ export const paramDef = {
enableTurnstile: { type: 'boolean' }, enableTurnstile: { type: 'boolean' },
turnstileSiteKey: { type: 'string', nullable: true }, turnstileSiteKey: { type: 'string', nullable: true },
turnstileSecretKey: { type: 'string', nullable: true }, turnstileSecretKey: { type: 'string', nullable: true },
enableTestcaptcha: { type: 'boolean' },
sensitiveMediaDetection: { type: 'string', enum: ['none', 'all', 'local', 'remote'] }, sensitiveMediaDetection: { type: 'string', enum: ['none', 'all', 'local', 'remote'] },
sensitiveMediaDetectionSensitivity: { type: 'string', enum: ['medium', 'low', 'high', 'veryLow', 'veryHigh'] }, sensitiveMediaDetectionSensitivity: { type: 'string', enum: ['medium', 'low', 'high', 'veryLow', 'veryHigh'] },
setSensitiveFlagAutomatically: { type: 'boolean' }, setSensitiveFlagAutomatically: { type: 'boolean' },
@ -130,6 +136,7 @@ export const paramDef = {
truemailAuthKey: { type: 'string', nullable: true }, truemailAuthKey: { type: 'string', nullable: true },
enableChartsForRemoteUser: { type: 'boolean' }, enableChartsForRemoteUser: { type: 'boolean' },
enableChartsForFederatedInstances: { type: 'boolean' }, enableChartsForFederatedInstances: { type: 'boolean' },
enableStatsForFederatedInstances: { type: 'boolean' },
enableServerMachineStats: { type: 'boolean' }, enableServerMachineStats: { type: 'boolean' },
enableIdenticonGeneration: { type: 'boolean' }, enableIdenticonGeneration: { type: 'boolean' },
serverRules: { type: 'array', items: { type: 'string' } }, serverRules: { type: 'array', items: { type: 'string' } },
@ -213,6 +220,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
if (Array.isArray(ps.prohibitedWords)) { if (Array.isArray(ps.prohibitedWords)) {
set.prohibitedWords = ps.prohibitedWords.filter(Boolean); set.prohibitedWords = ps.prohibitedWords.filter(Boolean);
} }
if (Array.isArray(ps.prohibitedWordsForNameOfUser)) {
set.prohibitedWordsForNameOfUser = ps.prohibitedWordsForNameOfUser.filter(Boolean);
}
if (Array.isArray(ps.silencedHosts)) { if (Array.isArray(ps.silencedHosts)) {
let lastValue = ''; let lastValue = '';
set.silencedHosts = ps.silencedHosts.sort().filter((h) => { set.silencedHosts = ps.silencedHosts.sort().filter((h) => {
@ -357,6 +367,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
set.turnstileSecretKey = ps.turnstileSecretKey; set.turnstileSecretKey = ps.turnstileSecretKey;
} }
if (ps.enableTestcaptcha !== undefined) {
set.enableTestcaptcha = ps.enableTestcaptcha;
}
if (ps.sensitiveMediaDetection !== undefined) { if (ps.sensitiveMediaDetection !== undefined) {
set.sensitiveMediaDetection = ps.sensitiveMediaDetection; set.sensitiveMediaDetection = ps.sensitiveMediaDetection;
} }
@ -565,6 +579,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
set.enableChartsForFederatedInstances = ps.enableChartsForFederatedInstances; set.enableChartsForFederatedInstances = ps.enableChartsForFederatedInstances;
} }
if (ps.enableStatsForFederatedInstances !== undefined) {
set.enableStatsForFederatedInstances = ps.enableStatsForFederatedInstances;
}
if (ps.enableServerMachineStats !== undefined) { if (ps.enableServerMachineStats !== undefined) {
set.enableServerMachineStats = ps.enableServerMachineStats; set.enableServerMachineStats = ps.enableServerMachineStats;
} }

View File

@ -11,7 +11,7 @@ import { JSDOM } from 'jsdom';
import { extractCustomEmojisFromMfm } from '@/misc/extract-custom-emojis-from-mfm.js'; import { extractCustomEmojisFromMfm } from '@/misc/extract-custom-emojis-from-mfm.js';
import { extractHashtags } from '@/misc/extract-hashtags.js'; import { extractHashtags } from '@/misc/extract-hashtags.js';
import * as Acct from '@/misc/acct.js'; import * as Acct from '@/misc/acct.js';
import type { UsersRepository, DriveFilesRepository, UserProfilesRepository, PagesRepository } from '@/models/_.js'; import type { UsersRepository, DriveFilesRepository, MiMeta, UserProfilesRepository, PagesRepository } from '@/models/_.js';
import type { MiLocalUser, MiUser } from '@/models/User.js'; import type { MiLocalUser, MiUser } from '@/models/User.js';
import { birthdaySchema, descriptionSchema, followedMessageSchema, locationSchema, nameSchema } from '@/models/User.js'; import { birthdaySchema, descriptionSchema, followedMessageSchema, locationSchema, nameSchema } from '@/models/User.js';
import type { MiUserProfile } from '@/models/UserProfile.js'; import type { MiUserProfile } from '@/models/UserProfile.js';
@ -22,6 +22,7 @@ import { UserEntityService } from '@/core/entities/UserEntityService.js';
import { GlobalEventService } from '@/core/GlobalEventService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js';
import { UserFollowingService } from '@/core/UserFollowingService.js'; import { UserFollowingService } from '@/core/UserFollowingService.js';
import { AccountUpdateService } from '@/core/AccountUpdateService.js'; import { AccountUpdateService } from '@/core/AccountUpdateService.js';
import { UtilityService } from '@/core/UtilityService.js';
import { HashtagService } from '@/core/HashtagService.js'; import { HashtagService } from '@/core/HashtagService.js';
import { DI } from '@/di-symbols.js'; import { DI } from '@/di-symbols.js';
import { RolePolicies, RoleService } from '@/core/RoleService.js'; import { RolePolicies, RoleService } from '@/core/RoleService.js';
@ -114,6 +115,13 @@ export const meta = {
code: 'RESTRICTED_BY_ROLE', code: 'RESTRICTED_BY_ROLE',
id: '8feff0ba-5ab5-585b-31f4-4df816663fad', id: '8feff0ba-5ab5-585b-31f4-4df816663fad',
}, },
nameContainsProhibitedWords: {
message: 'Your new name contains prohibited words.',
code: 'YOUR_NAME_CONTAINS_PROHIBITED_WORDS',
id: '0b3f9f6a-2f4d-4b1f-9fb4-49d3a2fd7191',
httpStatusCode: 422,
},
}, },
res: { res: {
@ -223,6 +231,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
@Inject(DI.config) @Inject(DI.config)
private config: Config, private config: Config,
@Inject(DI.meta)
private instanceMeta: MiMeta,
@Inject(DI.usersRepository) @Inject(DI.usersRepository)
private usersRepository: UsersRepository, private usersRepository: UsersRepository,
@ -247,6 +258,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private cacheService: CacheService, private cacheService: CacheService,
private httpRequestService: HttpRequestService, private httpRequestService: HttpRequestService,
private avatarDecorationService: AvatarDecorationService, private avatarDecorationService: AvatarDecorationService,
private utilityService: UtilityService,
) { ) {
super(meta, paramDef, async (ps, _user, token) => { super(meta, paramDef, async (ps, _user, token) => {
const user = await this.usersRepository.findOneByOrFail({ id: _user.id }) as MiLocalUser; const user = await this.usersRepository.findOneByOrFail({ id: _user.id }) as MiLocalUser;
@ -449,6 +461,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const newFields = profileUpdates.fields === undefined ? profile.fields : profileUpdates.fields; const newFields = profileUpdates.fields === undefined ? profile.fields : profileUpdates.fields;
if (newName != null) { if (newName != null) {
let hasProhibitedWords = false;
if (!await this.roleService.isModerator(user)) {
hasProhibitedWords = this.utilityService.isKeyWordIncluded(newName, this.instanceMeta.prohibitedWordsForNameOfUser);
}
if (hasProhibitedWords) {
throw new ApiError(meta.errors.nameContainsProhibitedWords);
}
const tokens = mfm.parseSimple(newName); const tokens = mfm.parseSimple(newName);
emojis = emojis.concat(extractCustomEmojisFromMfm(tokens)); emojis = emojis.concat(extractCustomEmojisFromMfm(tokens));
} }

View File

@ -98,7 +98,7 @@
const theme = localStorage.getItem('theme'); const theme = localStorage.getItem('theme');
if (theme) { if (theme) {
for (const [k, v] of Object.entries(JSON.parse(theme))) { for (const [k, v] of Object.entries(JSON.parse(theme))) {
document.documentElement.style.setProperty(`--${k}`, v.toString()); document.documentElement.style.setProperty(`--MI_THEME-${k}`, v.toString());
// HTMLの theme-color 適用 // HTMLの theme-color 適用
if (k === 'htmlThemeColor') { if (k === 'htmlThemeColor') {

View File

@ -5,8 +5,8 @@
*/ */
html { html {
background-color: var(--bg); background-color: var(--MI_THEME-bg);
color: var(--fg); color: var(--MI_THEME-fg);
} }
#splash { #splash {
@ -17,7 +17,7 @@ html {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
cursor: wait; cursor: wait;
background-color: var(--bg); background-color: var(--MI_THEME-bg);
opacity: 1; opacity: 1;
transition: opacity 0.5s ease; transition: opacity 0.5s ease;
} }
@ -45,7 +45,7 @@ html {
width: 28px; width: 28px;
height: 28px; height: 28px;
transform: translateY(70px); transform: translateY(70px);
color: var(--accent); color: var(--MI_THEME-accent);
} }
#splashSpinner > .spinner { #splashSpinner > .spinner {

View File

@ -5,8 +5,8 @@
*/ */
html { html {
background-color: var(--bg); background-color: var(--MI_THEME-bg);
color: var(--fg); color: var(--MI_THEME-fg);
} }
html.embed { html.embed {
@ -24,7 +24,7 @@ html.embed {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
cursor: wait; cursor: wait;
background-color: var(--bg); background-color: var(--MI_THEME-bg);
opacity: 1; opacity: 1;
transition: opacity 0.5s ease; transition: opacity 0.5s ease;
} }
@ -33,7 +33,7 @@ html.embed #splash {
box-sizing: border-box; box-sizing: border-box;
min-height: 300px; min-height: 300px;
border-radius: var(--radius, 12px); border-radius: var(--radius, 12px);
border: 1px solid var(--divider, #e8e8e8); border: 1px solid var(--MI_THEME-divider, #e8e8e8);
} }
html.embed.norounded #splash { html.embed.norounded #splash {
@ -67,7 +67,7 @@ html.embed.noborder #splash {
width: 28px; width: 28px;
height: 28px; height: 28px;
transform: translateY(70px); transform: translateY(70px);
color: var(--accent); color: var(--MI_THEME-accent);
} }
#splashSpinner > .spinner { #splashSpinner > .spinner {

View File

@ -8,6 +8,7 @@ process.env.NODE_ENV = 'test';
import { jest } from '@jest/globals'; import { jest } from '@jest/globals';
import { Test } from '@nestjs/testing'; import { Test } from '@nestjs/testing';
import { Redis } from 'ioredis'; import { Redis } from 'ioredis';
import type { TestingModule } from '@nestjs/testing';
import { GlobalModule } from '@/GlobalModule.js'; import { GlobalModule } from '@/GlobalModule.js';
import { FetchInstanceMetadataService } from '@/core/FetchInstanceMetadataService.js'; import { FetchInstanceMetadataService } from '@/core/FetchInstanceMetadataService.js';
import { FederatedInstanceService } from '@/core/FederatedInstanceService.js'; import { FederatedInstanceService } from '@/core/FederatedInstanceService.js';
@ -16,7 +17,6 @@ import { LoggerService } from '@/core/LoggerService.js';
import { UtilityService } from '@/core/UtilityService.js'; import { UtilityService } from '@/core/UtilityService.js';
import { IdService } from '@/core/IdService.js'; import { IdService } from '@/core/IdService.js';
import { DI } from '@/di-symbols.js'; import { DI } from '@/di-symbols.js';
import type { TestingModule } from '@nestjs/testing';
function mockRedis() { function mockRedis() {
const hash = {} as any; const hash = {} as any;
@ -52,7 +52,7 @@ describe('FetchInstanceMetadataService', () => {
if (token === HttpRequestService) { if (token === HttpRequestService) {
return { getJson: jest.fn(), getHtml: jest.fn(), send: jest.fn() }; return { getJson: jest.fn(), getHtml: jest.fn(), send: jest.fn() };
} else if (token === FederatedInstanceService) { } else if (token === FederatedInstanceService) {
return { fetch: jest.fn() }; return { fetchOrRegister: jest.fn() };
} else if (token === DI.redis) { } else if (token === DI.redis) {
return mockRedis; return mockRedis;
} }
@ -75,7 +75,7 @@ describe('FetchInstanceMetadataService', () => {
test('Lock and update', async () => { test('Lock and update', async () => {
redisClient.set = mockRedis(); redisClient.set = mockRedis();
const now = Date.now(); const now = Date.now();
federatedInstanceService.fetch.mockResolvedValue({ infoUpdatedAt: { getTime: () => { return now - 10 * 1000 * 60 * 60 * 24; } } } as any); federatedInstanceService.fetchOrRegister.mockResolvedValue({ infoUpdatedAt: { getTime: () => { return now - 10 * 1000 * 60 * 60 * 24; } } } as any);
httpRequestService.getJson.mockImplementation(() => { throw Error(); }); httpRequestService.getJson.mockImplementation(() => { throw Error(); });
const tryLockSpy = jest.spyOn(fetchInstanceMetadataService, 'tryLock'); const tryLockSpy = jest.spyOn(fetchInstanceMetadataService, 'tryLock');
const unlockSpy = jest.spyOn(fetchInstanceMetadataService, 'unlock'); const unlockSpy = jest.spyOn(fetchInstanceMetadataService, 'unlock');
@ -83,14 +83,14 @@ describe('FetchInstanceMetadataService', () => {
await fetchInstanceMetadataService.fetchInstanceMetadata({ host: 'example.com' } as any); await fetchInstanceMetadataService.fetchInstanceMetadata({ host: 'example.com' } as any);
expect(tryLockSpy).toHaveBeenCalledTimes(1); expect(tryLockSpy).toHaveBeenCalledTimes(1);
expect(unlockSpy).toHaveBeenCalledTimes(1); expect(unlockSpy).toHaveBeenCalledTimes(1);
expect(federatedInstanceService.fetch).toHaveBeenCalledTimes(1); expect(federatedInstanceService.fetchOrRegister).toHaveBeenCalledTimes(1);
expect(httpRequestService.getJson).toHaveBeenCalled(); expect(httpRequestService.getJson).toHaveBeenCalled();
}); });
test('Lock and don\'t update', async () => { test('Lock and don\'t update', async () => {
redisClient.set = mockRedis(); redisClient.set = mockRedis();
const now = Date.now(); const now = Date.now();
federatedInstanceService.fetch.mockResolvedValue({ infoUpdatedAt: { getTime: () => now } } as any); federatedInstanceService.fetchOrRegister.mockResolvedValue({ infoUpdatedAt: { getTime: () => now } } as any);
httpRequestService.getJson.mockImplementation(() => { throw Error(); }); httpRequestService.getJson.mockImplementation(() => { throw Error(); });
const tryLockSpy = jest.spyOn(fetchInstanceMetadataService, 'tryLock'); const tryLockSpy = jest.spyOn(fetchInstanceMetadataService, 'tryLock');
const unlockSpy = jest.spyOn(fetchInstanceMetadataService, 'unlock'); const unlockSpy = jest.spyOn(fetchInstanceMetadataService, 'unlock');
@ -98,14 +98,14 @@ describe('FetchInstanceMetadataService', () => {
await fetchInstanceMetadataService.fetchInstanceMetadata({ host: 'example.com' } as any); await fetchInstanceMetadataService.fetchInstanceMetadata({ host: 'example.com' } as any);
expect(tryLockSpy).toHaveBeenCalledTimes(1); expect(tryLockSpy).toHaveBeenCalledTimes(1);
expect(unlockSpy).toHaveBeenCalledTimes(1); expect(unlockSpy).toHaveBeenCalledTimes(1);
expect(federatedInstanceService.fetch).toHaveBeenCalledTimes(1); expect(federatedInstanceService.fetchOrRegister).toHaveBeenCalledTimes(1);
expect(httpRequestService.getJson).toHaveBeenCalledTimes(0); expect(httpRequestService.getJson).toHaveBeenCalledTimes(0);
}); });
test('Do nothing when lock not acquired', async () => { test('Do nothing when lock not acquired', async () => {
redisClient.set = mockRedis(); redisClient.set = mockRedis();
const now = Date.now(); const now = Date.now();
federatedInstanceService.fetch.mockResolvedValue({ infoUpdatedAt: { getTime: () => now - 10 * 1000 * 60 * 60 * 24 } } as any); federatedInstanceService.fetchOrRegister.mockResolvedValue({ infoUpdatedAt: { getTime: () => now - 10 * 1000 * 60 * 60 * 24 } } as any);
httpRequestService.getJson.mockImplementation(() => { throw Error(); }); httpRequestService.getJson.mockImplementation(() => { throw Error(); });
await fetchInstanceMetadataService.tryLock('example.com'); await fetchInstanceMetadataService.tryLock('example.com');
const tryLockSpy = jest.spyOn(fetchInstanceMetadataService, 'tryLock'); const tryLockSpy = jest.spyOn(fetchInstanceMetadataService, 'tryLock');
@ -114,14 +114,14 @@ describe('FetchInstanceMetadataService', () => {
await fetchInstanceMetadataService.fetchInstanceMetadata({ host: 'example.com' } as any); await fetchInstanceMetadataService.fetchInstanceMetadata({ host: 'example.com' } as any);
expect(tryLockSpy).toHaveBeenCalledTimes(1); expect(tryLockSpy).toHaveBeenCalledTimes(1);
expect(unlockSpy).toHaveBeenCalledTimes(0); expect(unlockSpy).toHaveBeenCalledTimes(0);
expect(federatedInstanceService.fetch).toHaveBeenCalledTimes(0); expect(federatedInstanceService.fetchOrRegister).toHaveBeenCalledTimes(0);
expect(httpRequestService.getJson).toHaveBeenCalledTimes(0); expect(httpRequestService.getJson).toHaveBeenCalledTimes(0);
}); });
test('Do when lock not acquired but forced', async () => { test('Do when lock not acquired but forced', async () => {
redisClient.set = mockRedis(); redisClient.set = mockRedis();
const now = Date.now(); const now = Date.now();
federatedInstanceService.fetch.mockResolvedValue({ infoUpdatedAt: { getTime: () => now - 10 * 1000 * 60 * 60 * 24 } } as any); federatedInstanceService.fetchOrRegister.mockResolvedValue({ infoUpdatedAt: { getTime: () => now - 10 * 1000 * 60 * 60 * 24 } } as any);
httpRequestService.getJson.mockImplementation(() => { throw Error(); }); httpRequestService.getJson.mockImplementation(() => { throw Error(); });
await fetchInstanceMetadataService.tryLock('example.com'); await fetchInstanceMetadataService.tryLock('example.com');
const tryLockSpy = jest.spyOn(fetchInstanceMetadataService, 'tryLock'); const tryLockSpy = jest.spyOn(fetchInstanceMetadataService, 'tryLock');
@ -130,7 +130,7 @@ describe('FetchInstanceMetadataService', () => {
await fetchInstanceMetadataService.fetchInstanceMetadata({ host: 'example.com' } as any, true); await fetchInstanceMetadataService.fetchInstanceMetadata({ host: 'example.com' } as any, true);
expect(tryLockSpy).toHaveBeenCalledTimes(0); expect(tryLockSpy).toHaveBeenCalledTimes(0);
expect(unlockSpy).toHaveBeenCalledTimes(1); expect(unlockSpy).toHaveBeenCalledTimes(1);
expect(federatedInstanceService.fetch).toHaveBeenCalledTimes(0); expect(federatedInstanceService.fetchOrRegister).toHaveBeenCalledTimes(0);
expect(httpRequestService.getJson).toHaveBeenCalled(); expect(httpRequestService.getJson).toHaveBeenCalled();
}); });
}); });

View File

@ -10,6 +10,8 @@ import { jest } from '@jest/globals';
import { ModuleMocker } from 'jest-mock'; import { ModuleMocker } from 'jest-mock';
import { Test } from '@nestjs/testing'; import { Test } from '@nestjs/testing';
import * as lolex from '@sinonjs/fake-timers'; import * as lolex from '@sinonjs/fake-timers';
import type { TestingModule } from '@nestjs/testing';
import type { MockFunctionMetadata } from 'jest-mock';
import { GlobalModule } from '@/GlobalModule.js'; import { GlobalModule } from '@/GlobalModule.js';
import { RoleService } from '@/core/RoleService.js'; import { RoleService } from '@/core/RoleService.js';
import { import {
@ -31,8 +33,6 @@ import { secureRndstr } from '@/misc/secure-rndstr.js';
import { NotificationService } from '@/core/NotificationService.js'; import { NotificationService } from '@/core/NotificationService.js';
import { RoleCondFormulaValue } from '@/models/Role.js'; import { RoleCondFormulaValue } from '@/models/Role.js';
import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js';
import type { TestingModule } from '@nestjs/testing';
import type { MockFunctionMetadata } from 'jest-mock';
const moduleMocker = new ModuleMocker(global); const moduleMocker = new ModuleMocker(global);
@ -277,9 +277,9 @@ describe('RoleService', () => {
}); });
describe('getModeratorIds', () => { describe('getModeratorIds', () => {
test('includeAdmins = false, excludeExpire = false', async () => { test('includeAdmins = false, includeRoot = false, excludeExpire = false', async () => {
const [adminUser1, adminUser2, modeUser1, modeUser2, normalUser1, normalUser2] = await Promise.all([ const [adminUser1, adminUser2, modeUser1, modeUser2, normalUser1, normalUser2, rootUser] = await Promise.all([
createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser({ isRoot: true }),
]); ]);
const role1 = await createRole({ name: 'admin', isAdministrator: true }); const role1 = await createRole({ name: 'admin', isAdministrator: true });
@ -295,13 +295,17 @@ describe('RoleService', () => {
assignRole({ userId: normalUser2.id, roleId: role3.id, expiresAt: new Date(Date.now() - 1000) }), assignRole({ userId: normalUser2.id, roleId: role3.id, expiresAt: new Date(Date.now() - 1000) }),
]); ]);
const result = await roleService.getModeratorIds(false, false); const result = await roleService.getModeratorIds({
includeAdmins: false,
includeRoot: false,
excludeExpire: false,
});
expect(result).toEqual([modeUser1.id, modeUser2.id]); expect(result).toEqual([modeUser1.id, modeUser2.id]);
}); });
test('includeAdmins = false, excludeExpire = true', async () => { test('includeAdmins = false, includeRoot = false, excludeExpire = true', async () => {
const [adminUser1, adminUser2, modeUser1, modeUser2, normalUser1, normalUser2] = await Promise.all([ const [adminUser1, adminUser2, modeUser1, modeUser2, normalUser1, normalUser2, rootUser] = await Promise.all([
createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser({ isRoot: true }),
]); ]);
const role1 = await createRole({ name: 'admin', isAdministrator: true }); const role1 = await createRole({ name: 'admin', isAdministrator: true });
@ -317,13 +321,17 @@ describe('RoleService', () => {
assignRole({ userId: normalUser2.id, roleId: role3.id, expiresAt: new Date(Date.now() - 1000) }), assignRole({ userId: normalUser2.id, roleId: role3.id, expiresAt: new Date(Date.now() - 1000) }),
]); ]);
const result = await roleService.getModeratorIds(false, true); const result = await roleService.getModeratorIds({
includeAdmins: false,
includeRoot: false,
excludeExpire: true,
});
expect(result).toEqual([modeUser1.id]); expect(result).toEqual([modeUser1.id]);
}); });
test('includeAdmins = true, excludeExpire = false', async () => { test('includeAdmins = true, includeRoot = false, excludeExpire = false', async () => {
const [adminUser1, adminUser2, modeUser1, modeUser2, normalUser1, normalUser2] = await Promise.all([ const [adminUser1, adminUser2, modeUser1, modeUser2, normalUser1, normalUser2, rootUser] = await Promise.all([
createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser({ isRoot: true }),
]); ]);
const role1 = await createRole({ name: 'admin', isAdministrator: true }); const role1 = await createRole({ name: 'admin', isAdministrator: true });
@ -339,13 +347,17 @@ describe('RoleService', () => {
assignRole({ userId: normalUser2.id, roleId: role3.id, expiresAt: new Date(Date.now() - 1000) }), assignRole({ userId: normalUser2.id, roleId: role3.id, expiresAt: new Date(Date.now() - 1000) }),
]); ]);
const result = await roleService.getModeratorIds(true, false); const result = await roleService.getModeratorIds({
includeAdmins: true,
includeRoot: false,
excludeExpire: false,
});
expect(result).toEqual([adminUser1.id, adminUser2.id, modeUser1.id, modeUser2.id]); expect(result).toEqual([adminUser1.id, adminUser2.id, modeUser1.id, modeUser2.id]);
}); });
test('includeAdmins = true, excludeExpire = true', async () => { test('includeAdmins = true, includeRoot = false, excludeExpire = true', async () => {
const [adminUser1, adminUser2, modeUser1, modeUser2, normalUser1, normalUser2] = await Promise.all([ const [adminUser1, adminUser2, modeUser1, modeUser2, normalUser1, normalUser2, rootUser] = await Promise.all([
createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser({ isRoot: true }),
]); ]);
const role1 = await createRole({ name: 'admin', isAdministrator: true }); const role1 = await createRole({ name: 'admin', isAdministrator: true });
@ -361,9 +373,111 @@ describe('RoleService', () => {
assignRole({ userId: normalUser2.id, roleId: role3.id, expiresAt: new Date(Date.now() - 1000) }), assignRole({ userId: normalUser2.id, roleId: role3.id, expiresAt: new Date(Date.now() - 1000) }),
]); ]);
const result = await roleService.getModeratorIds(true, true); const result = await roleService.getModeratorIds({
includeAdmins: true,
includeRoot: false,
excludeExpire: true,
});
expect(result).toEqual([adminUser1.id, modeUser1.id]); expect(result).toEqual([adminUser1.id, modeUser1.id]);
}); });
test('includeAdmins = false, includeRoot = true, excludeExpire = false', async () => {
const [adminUser1, adminUser2, modeUser1, modeUser2, normalUser1, normalUser2, rootUser] = await Promise.all([
createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser({ isRoot: true }),
]);
const role1 = await createRole({ name: 'admin', isAdministrator: true });
const role2 = await createRole({ name: 'moderator', isModerator: true });
const role3 = await createRole({ name: 'normal' });
await Promise.all([
assignRole({ userId: adminUser1.id, roleId: role1.id }),
assignRole({ userId: adminUser2.id, roleId: role1.id, expiresAt: new Date(Date.now() - 1000) }),
assignRole({ userId: modeUser1.id, roleId: role2.id }),
assignRole({ userId: modeUser2.id, roleId: role2.id, expiresAt: new Date(Date.now() - 1000) }),
assignRole({ userId: normalUser1.id, roleId: role3.id }),
assignRole({ userId: normalUser2.id, roleId: role3.id, expiresAt: new Date(Date.now() - 1000) }),
]);
const result = await roleService.getModeratorIds({
includeAdmins: false,
includeRoot: true,
excludeExpire: false,
});
expect(result).toEqual([modeUser1.id, modeUser2.id, rootUser.id]);
});
test('root has moderator role', async () => {
const [adminUser1, modeUser1, normalUser1, rootUser] = await Promise.all([
createUser(), createUser(), createUser(), createUser({ isRoot: true }),
]);
const role1 = await createRole({ name: 'admin', isAdministrator: true });
const role2 = await createRole({ name: 'moderator', isModerator: true });
const role3 = await createRole({ name: 'normal' });
await Promise.all([
assignRole({ userId: adminUser1.id, roleId: role1.id }),
assignRole({ userId: modeUser1.id, roleId: role2.id }),
assignRole({ userId: rootUser.id, roleId: role2.id }),
assignRole({ userId: normalUser1.id, roleId: role3.id }),
]);
const result = await roleService.getModeratorIds({
includeAdmins: false,
includeRoot: true,
excludeExpire: false,
});
expect(result).toEqual([modeUser1.id, rootUser.id]);
});
test('root has administrator role', async () => {
const [adminUser1, modeUser1, normalUser1, rootUser] = await Promise.all([
createUser(), createUser(), createUser(), createUser({ isRoot: true }),
]);
const role1 = await createRole({ name: 'admin', isAdministrator: true });
const role2 = await createRole({ name: 'moderator', isModerator: true });
const role3 = await createRole({ name: 'normal' });
await Promise.all([
assignRole({ userId: adminUser1.id, roleId: role1.id }),
assignRole({ userId: rootUser.id, roleId: role1.id }),
assignRole({ userId: modeUser1.id, roleId: role2.id }),
assignRole({ userId: normalUser1.id, roleId: role3.id }),
]);
const result = await roleService.getModeratorIds({
includeAdmins: true,
includeRoot: true,
excludeExpire: false,
});
expect(result).toEqual([adminUser1.id, modeUser1.id, rootUser.id]);
});
test('root has moderator role(expire)', async () => {
const [adminUser1, modeUser1, normalUser1, rootUser] = await Promise.all([
createUser(), createUser(), createUser(), createUser({ isRoot: true }),
]);
const role1 = await createRole({ name: 'admin', isAdministrator: true });
const role2 = await createRole({ name: 'moderator', isModerator: true });
const role3 = await createRole({ name: 'normal' });
await Promise.all([
assignRole({ userId: adminUser1.id, roleId: role1.id }),
assignRole({ userId: modeUser1.id, roleId: role2.id, expiresAt: new Date(Date.now() - 1000) }),
assignRole({ userId: rootUser.id, roleId: role2.id, expiresAt: new Date(Date.now() - 1000) }),
assignRole({ userId: normalUser1.id, roleId: role3.id }),
]);
const result = await roleService.getModeratorIds({
includeAdmins: false,
includeRoot: true,
excludeExpire: true,
});
expect(result).toEqual([rootUser.id]);
});
}); });
describe('conditional role', () => { describe('conditional role', () => {

View File

@ -0,0 +1,379 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { jest } from '@jest/globals';
import { Test, TestingModule } from '@nestjs/testing';
import * as lolex from '@sinonjs/fake-timers';
import { addHours, addSeconds, subDays, subHours, subSeconds } from 'date-fns';
import { CheckModeratorsActivityProcessorService } from '@/queue/processors/CheckModeratorsActivityProcessorService.js';
import { MiSystemWebhook, MiUser, MiUserProfile, UserProfilesRepository, UsersRepository } from '@/models/_.js';
import { IdService } from '@/core/IdService.js';
import { RoleService } from '@/core/RoleService.js';
import { GlobalModule } from '@/GlobalModule.js';
import { MetaService } from '@/core/MetaService.js';
import { DI } from '@/di-symbols.js';
import { QueueLoggerService } from '@/queue/QueueLoggerService.js';
import { EmailService } from '@/core/EmailService.js';
import { SystemWebhookService } from '@/core/SystemWebhookService.js';
import { AnnouncementService } from '@/core/AnnouncementService.js';
const baseDate = new Date(Date.UTC(2000, 11, 15, 12, 0, 0));
describe('CheckModeratorsActivityProcessorService', () => {
let app: TestingModule;
let clock: lolex.InstalledClock;
let service: CheckModeratorsActivityProcessorService;
// --------------------------------------------------------------------------------------
let usersRepository: UsersRepository;
let userProfilesRepository: UserProfilesRepository;
let idService: IdService;
let roleService: jest.Mocked<RoleService>;
let announcementService: jest.Mocked<AnnouncementService>;
let emailService: jest.Mocked<EmailService>;
let systemWebhookService: jest.Mocked<SystemWebhookService>;
let systemWebhook1: MiSystemWebhook;
let systemWebhook2: MiSystemWebhook;
let systemWebhook3: MiSystemWebhook;
// --------------------------------------------------------------------------------------
async function createUser(data: Partial<MiUser> = {}, profile: Partial<MiUserProfile> = {}): Promise<MiUser> {
const id = idService.gen();
const user = await usersRepository
.insert({
id: id,
username: `user_${id}`,
usernameLower: `user_${id}`.toLowerCase(),
...data,
})
.then(x => usersRepository.findOneByOrFail(x.identifiers[0]));
await userProfilesRepository.insert({
userId: user.id,
...profile,
});
return user;
}
function crateSystemWebhook(data: Partial<MiSystemWebhook> = {}): MiSystemWebhook {
return {
id: idService.gen(),
isActive: true,
updatedAt: new Date(),
latestSentAt: null,
latestStatus: null,
name: 'test',
url: 'https://example.com',
secret: 'test',
on: [],
...data,
};
}
function mockModeratorRole(users: MiUser[]) {
roleService.getModerators.mockReset();
roleService.getModerators.mockResolvedValue(users);
}
// --------------------------------------------------------------------------------------
beforeAll(async () => {
app = await Test
.createTestingModule({
imports: [
GlobalModule,
],
providers: [
CheckModeratorsActivityProcessorService,
IdService,
{
provide: RoleService, useFactory: () => ({ getModerators: jest.fn() }),
},
{
provide: MetaService, useFactory: () => ({ fetch: jest.fn() }),
},
{
provide: AnnouncementService, useFactory: () => ({ create: jest.fn() }),
},
{
provide: EmailService, useFactory: () => ({ sendEmail: jest.fn() }),
},
{
provide: SystemWebhookService, useFactory: () => ({
fetchActiveSystemWebhooks: jest.fn(),
enqueueSystemWebhook: jest.fn(),
}),
},
{
provide: QueueLoggerService, useFactory: () => ({
logger: ({
createSubLogger: () => ({
info: jest.fn(),
warn: jest.fn(),
succ: jest.fn(),
}),
}),
}),
},
],
})
.compile();
usersRepository = app.get(DI.usersRepository);
userProfilesRepository = app.get(DI.userProfilesRepository);
service = app.get(CheckModeratorsActivityProcessorService);
idService = app.get(IdService);
roleService = app.get(RoleService) as jest.Mocked<RoleService>;
announcementService = app.get(AnnouncementService) as jest.Mocked<AnnouncementService>;
emailService = app.get(EmailService) as jest.Mocked<EmailService>;
systemWebhookService = app.get(SystemWebhookService) as jest.Mocked<SystemWebhookService>;
app.enableShutdownHooks();
});
beforeEach(async () => {
clock = lolex.install({
now: new Date(baseDate),
shouldClearNativeTimers: true,
});
systemWebhook1 = crateSystemWebhook({ on: ['inactiveModeratorsWarning'] });
systemWebhook2 = crateSystemWebhook({ on: ['inactiveModeratorsWarning', 'inactiveModeratorsInvitationOnlyChanged'] });
systemWebhook3 = crateSystemWebhook({ on: ['abuseReport'] });
emailService.sendEmail.mockReturnValue(Promise.resolve());
announcementService.create.mockReturnValue(Promise.resolve({} as never));
systemWebhookService.fetchActiveSystemWebhooks.mockResolvedValue([systemWebhook1, systemWebhook2, systemWebhook3]);
systemWebhookService.enqueueSystemWebhook.mockReturnValue(Promise.resolve({} as never));
});
afterEach(async () => {
clock.uninstall();
await usersRepository.delete({});
await userProfilesRepository.delete({});
roleService.getModerators.mockReset();
announcementService.create.mockReset();
emailService.sendEmail.mockReset();
systemWebhookService.enqueueSystemWebhook.mockReset();
});
afterAll(async () => {
await app.close();
});
// --------------------------------------------------------------------------------------
describe('evaluateModeratorsInactiveDays', () => {
test('[isModeratorsInactive] inactiveなモデレーターがいても他のモデレーターがアクティブなら"運営が非アクティブ"としてみなされない', async () => {
const [user1, user2, user3, user4] = await Promise.all([
// 期限よりも1秒新しいタイミングでアクティブ化セーフ
createUser({ lastActiveDate: subDays(addSeconds(baseDate, 1), 7) }),
// 期限ちょうどにアクティブ化(セーフ)
createUser({ lastActiveDate: subDays(baseDate, 7) }),
// 期限よりも1秒古いタイミングでアクティブ化アウト
createUser({ lastActiveDate: subDays(subSeconds(baseDate, 1), 7) }),
// 対象外
createUser({ lastActiveDate: null }),
]);
mockModeratorRole([user1, user2, user3, user4]);
const result = await service.evaluateModeratorsInactiveDays();
expect(result.isModeratorsInactive).toBe(false);
expect(result.inactiveModerators).toEqual([user3]);
});
test('[isModeratorsInactive] 全員非アクティブなら"運営が非アクティブ"としてみなされる', async () => {
const [user1, user2] = await Promise.all([
// 期限よりも1秒古いタイミングでアクティブ化アウト
createUser({ lastActiveDate: subDays(subSeconds(baseDate, 1), 7) }),
// 対象外
createUser({ lastActiveDate: null }),
]);
mockModeratorRole([user1, user2]);
const result = await service.evaluateModeratorsInactiveDays();
expect(result.isModeratorsInactive).toBe(true);
expect(result.inactiveModerators).toEqual([user1]);
});
test('[remainingTime] 猶予まで24時間ある場合、猶予1日として計算される', async () => {
const [user1, user2] = await Promise.all([
createUser({ lastActiveDate: subDays(baseDate, 8) }),
// 猶予はこのユーザ基準で計算される想定。
// 期限まで残り24時間->猶予1日として計算されるはずである
createUser({ lastActiveDate: subDays(baseDate, 6) }),
]);
mockModeratorRole([user1, user2]);
const result = await service.evaluateModeratorsInactiveDays();
expect(result.isModeratorsInactive).toBe(false);
expect(result.inactiveModerators).toEqual([user1]);
expect(result.remainingTime.asDays).toBe(1);
expect(result.remainingTime.asHours).toBe(24);
});
test('[remainingTime] 猶予まで25時間ある場合、猶予1日として計算される', async () => {
const [user1, user2] = await Promise.all([
createUser({ lastActiveDate: subDays(baseDate, 8) }),
// 猶予はこのユーザ基準で計算される想定。
// 期限まで残り25時間->猶予1日として計算されるはずである
createUser({ lastActiveDate: subDays(addHours(baseDate, 1), 6) }),
]);
mockModeratorRole([user1, user2]);
const result = await service.evaluateModeratorsInactiveDays();
expect(result.isModeratorsInactive).toBe(false);
expect(result.inactiveModerators).toEqual([user1]);
expect(result.remainingTime.asDays).toBe(1);
expect(result.remainingTime.asHours).toBe(25);
});
test('[remainingTime] 猶予まで23時間ある場合、猶予0日として計算される', async () => {
const [user1, user2] = await Promise.all([
createUser({ lastActiveDate: subDays(baseDate, 8) }),
// 猶予はこのユーザ基準で計算される想定。
// 期限まで残り23時間->猶予0日として計算されるはずである
createUser({ lastActiveDate: subDays(subHours(baseDate, 1), 6) }),
]);
mockModeratorRole([user1, user2]);
const result = await service.evaluateModeratorsInactiveDays();
expect(result.isModeratorsInactive).toBe(false);
expect(result.inactiveModerators).toEqual([user1]);
expect(result.remainingTime.asDays).toBe(0);
expect(result.remainingTime.asHours).toBe(23);
});
test('[remainingTime] 期限ちょうどの場合、猶予0日として計算される', async () => {
const [user1, user2] = await Promise.all([
createUser({ lastActiveDate: subDays(baseDate, 8) }),
// 猶予はこのユーザ基準で計算される想定。
// 期限ちょうど->猶予0日として計算されるはずである
createUser({ lastActiveDate: subDays(baseDate, 7) }),
]);
mockModeratorRole([user1, user2]);
const result = await service.evaluateModeratorsInactiveDays();
expect(result.isModeratorsInactive).toBe(false);
expect(result.inactiveModerators).toEqual([user1]);
expect(result.remainingTime.asDays).toBe(0);
expect(result.remainingTime.asHours).toBe(0);
});
test('[remainingTime] 期限より1時間超過している場合、猶予-1日として計算される', async () => {
const [user1, user2] = await Promise.all([
createUser({ lastActiveDate: subDays(baseDate, 8) }),
// 猶予はこのユーザ基準で計算される想定。
// 期限より1時間超過->猶予-1日として計算されるはずである
createUser({ lastActiveDate: subDays(subHours(baseDate, 1), 7) }),
]);
mockModeratorRole([user1, user2]);
const result = await service.evaluateModeratorsInactiveDays();
expect(result.isModeratorsInactive).toBe(true);
expect(result.inactiveModerators).toEqual([user1, user2]);
expect(result.remainingTime.asDays).toBe(-1);
expect(result.remainingTime.asHours).toBe(-1);
});
test('[remainingTime] 期限より25時間超過している場合、猶予-2日として計算される', async () => {
const [user1, user2] = await Promise.all([
createUser({ lastActiveDate: subDays(baseDate, 10) }),
// 猶予はこのユーザ基準で計算される想定。
// 期限より1時間超過->猶予-1日として計算されるはずである
createUser({ lastActiveDate: subDays(subHours(baseDate, 25), 7) }),
]);
mockModeratorRole([user1, user2]);
const result = await service.evaluateModeratorsInactiveDays();
expect(result.isModeratorsInactive).toBe(true);
expect(result.inactiveModerators).toEqual([user1, user2]);
expect(result.remainingTime.asDays).toBe(-2);
expect(result.remainingTime.asHours).toBe(-25);
});
});
describe('notifyInactiveModeratorsWarning', () => {
test('[notification + mail] 通知はモデレータ全員に発信され、メールはメールアドレスが存在+認証済みの場合のみ', async () => {
const [user1, user2, user3, user4, root] = await Promise.all([
createUser({}, { email: 'user1@example.com', emailVerified: true }),
createUser({}, { email: 'user2@example.com', emailVerified: false }),
createUser({}, { email: null, emailVerified: false }),
createUser({}, { email: 'user4@example.com', emailVerified: true }),
createUser({ isRoot: true }, { email: 'root@example.com', emailVerified: true }),
]);
mockModeratorRole([user1, user2, user3, root]);
await service.notifyInactiveModeratorsWarning({ time: 1, asDays: 0, asHours: 0 });
expect(emailService.sendEmail).toHaveBeenCalledTimes(2);
expect(emailService.sendEmail.mock.calls[0][0]).toBe('user1@example.com');
expect(emailService.sendEmail.mock.calls[1][0]).toBe('root@example.com');
});
test('[systemWebhook] "inactiveModeratorsWarning"が有効なSystemWebhookに対して送信される', async () => {
const [user1] = await Promise.all([
createUser({}, { email: 'user1@example.com', emailVerified: true }),
]);
mockModeratorRole([user1]);
await service.notifyInactiveModeratorsWarning({ time: 1, asDays: 0, asHours: 0 });
expect(systemWebhookService.enqueueSystemWebhook).toHaveBeenCalledTimes(2);
expect(systemWebhookService.enqueueSystemWebhook.mock.calls[0][0]).toEqual(systemWebhook1);
expect(systemWebhookService.enqueueSystemWebhook.mock.calls[1][0]).toEqual(systemWebhook2);
});
});
describe('notifyChangeToInvitationOnly', () => {
test('[notification + mail] 通知はモデレータ全員に発信され、メールはメールアドレスが存在+認証済みの場合のみ', async () => {
const [user1, user2, user3, user4, root] = await Promise.all([
createUser({}, { email: 'user1@example.com', emailVerified: true }),
createUser({}, { email: 'user2@example.com', emailVerified: false }),
createUser({}, { email: null, emailVerified: false }),
createUser({}, { email: 'user4@example.com', emailVerified: true }),
createUser({ isRoot: true }, { email: 'root@example.com', emailVerified: true }),
]);
mockModeratorRole([user1, user2, user3, root]);
await service.notifyChangeToInvitationOnly();
expect(announcementService.create).toHaveBeenCalledTimes(4);
expect(announcementService.create.mock.calls[0][0].userId).toBe(user1.id);
expect(announcementService.create.mock.calls[1][0].userId).toBe(user2.id);
expect(announcementService.create.mock.calls[2][0].userId).toBe(user3.id);
expect(announcementService.create.mock.calls[3][0].userId).toBe(root.id);
expect(emailService.sendEmail).toHaveBeenCalledTimes(2);
expect(emailService.sendEmail.mock.calls[0][0]).toBe('user1@example.com');
expect(emailService.sendEmail.mock.calls[1][0]).toBe('root@example.com');
});
test('[systemWebhook] "inactiveModeratorsInvitationOnlyChanged"が有効なSystemWebhookに対して送信される', async () => {
const [user1] = await Promise.all([
createUser({}, { email: 'user1@example.com', emailVerified: true }),
]);
mockModeratorRole([user1]);
await service.notifyChangeToInvitationOnly();
expect(systemWebhookService.enqueueSystemWebhook).toHaveBeenCalledTimes(1);
expect(systemWebhookService.enqueueSystemWebhook.mock.calls[0][0]).toEqual(systemWebhook2);
});
});
});

View File

@ -56,7 +56,7 @@ const props = withDefaults(defineProps<{
--size: 38px; --size: 38px;
&.colored { &.colored {
color: var(--accent); color: var(--MI_THEME-accent);
} }
&.inline { &.inline {

View File

@ -31,17 +31,17 @@ defineProps<{
display: flex; display: flex;
align-items: center; align-items: center;
width: 100%; width: 100%;
padding: var(--margin); padding: var(--MI-margin);
margin-top: 4px; margin-top: 4px;
border: 1px solid var(--inputBorder); border: 1px solid var(--MI_THEME-inputBorder);
border-radius: var(--radius); border-radius: var(--MI-radius);
background-color: var(--panel); background-color: var(--MI_THEME-panel);
transition: background-color .1s, border-color .1s; transition: background-color .1s, border-color .1s;
&:hover { &:hover {
text-decoration: none; text-decoration: none;
border-color: var(--inputBorderHover); border-color: var(--MI_THEME-inputBorderHover);
background-color: var(--buttonHoverBg); background-color: var(--MI_THEME-buttonHoverBg);
} }
} }

View File

@ -36,7 +36,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div :class="$style.indicators"> <div :class="$style.indicators">
<div v-if="['image/gif', 'image/apng'].includes(image.type)" :class="$style.indicator">GIF</div> <div v-if="['image/gif', 'image/apng'].includes(image.type)" :class="$style.indicator">GIF</div>
<div v-if="image.comment" :class="$style.indicator">ALT</div> <div v-if="image.comment" :class="$style.indicator">ALT</div>
<div v-if="image.isSensitive" :class="$style.indicator" style="color: var(--warn);" :title="i18n.ts.sensitive"><i class="ti ti-eye-exclamation"></i></div> <div v-if="image.isSensitive" :class="$style.indicator" style="color: var(--MI_THEME-warn);" :title="i18n.ts.sensitive"><i class="ti ti-eye-exclamation"></i></div>
</div> </div>
<i v-if="!hide" class="ti ti-eye-off" :class="$style.hide" @click.stop="hide = true"></i> <i v-if="!hide" class="ti ti-eye-off" :class="$style.hide" @click.stop="hide = true"></i>
</div> </div>
@ -94,8 +94,8 @@ async function onclick(ev: MouseEvent) {
display: block; display: block;
position: absolute; position: absolute;
border-radius: 6px; border-radius: 6px;
background-color: var(--fg); background-color: var(--MI_THEME-fg);
color: var(--accentLighten); color: var(--MI_THEME-accentLighten);
font-size: 12px; font-size: 12px;
opacity: .5; opacity: .5;
padding: 5px 8px; padding: 5px 8px;
@ -114,19 +114,19 @@ async function onclick(ev: MouseEvent) {
.visible { .visible {
position: relative; position: relative;
//box-shadow: 0 0 0 1px var(--divider) inset; //box-shadow: 0 0 0 1px var(--MI_THEME-divider) inset;
background: var(--bg); background: var(--MI_THEME-bg);
background-size: 16px 16px; background-size: 16px 16px;
} }
html[data-color-scheme=dark] .visible { html[data-color-scheme=dark] .visible {
--c: rgb(255 255 255 / 2%); --c: rgb(255 255 255 / 2%);
background-image: linear-gradient(45deg, var(--c) 16.67%, var(--bg) 16.67%, var(--bg) 50%, var(--c) 50%, var(--c) 66.67%, var(--bg) 66.67%, var(--bg) 100%); background-image: linear-gradient(45deg, var(--c) 16.67%, var(--MI_THEME-bg) 16.67%, var(--MI_THEME-bg) 50%, var(--c) 50%, var(--c) 66.67%, var(--MI_THEME-bg) 66.67%, var(--MI_THEME-bg) 100%);
} }
html[data-color-scheme=light] .visible { html[data-color-scheme=light] .visible {
--c: rgb(0 0 0 / 2%); --c: rgb(0 0 0 / 2%);
background-image: linear-gradient(45deg, var(--c) 16.67%, var(--bg) 16.67%, var(--bg) 50%, var(--c) 50%, var(--c) 66.67%, var(--bg) 66.67%, var(--bg) 100%); background-image: linear-gradient(45deg, var(--c) 16.67%, var(--MI_THEME-bg) 16.67%, var(--MI_THEME-bg) 50%, var(--c) 50%, var(--c) 66.67%, var(--MI_THEME-bg) 66.67%, var(--MI_THEME-bg) 100%);
} }
.imageContainer { .imageContainer {
@ -150,10 +150,10 @@ html[data-color-scheme=light] .visible {
} }
.indicator { .indicator {
/* Hardcode to black because either --bg or --fg makes it hard to read in dark/light mode */ /* Hardcode to black because either --MI_THEME-bg or --MI_THEME-fg makes it hard to read in dark/light mode */
background-color: black; background-color: black;
border-radius: 6px; border-radius: 6px;
color: var(--accentLighten); color: var(--MI_THEME-accentLighten);
display: inline-block; display: inline-block;
font-weight: bold; font-weight: bold;
font-size: 0.8em; font-size: 0.8em;

View File

@ -29,9 +29,9 @@ defineProps<{
width: 100%; width: 100%;
height: auto; height: auto;
aspect-ratio: 16 / 9; aspect-ratio: 16 / 9;
padding: var(--margin); padding: var(--MI-margin);
border: 1px solid var(--divider); border: 1px solid var(--MI_THEME-divider);
border-radius: var(--radius); border-radius: var(--MI-radius);
background-color: #000; background-color: #000;
&:hover { &:hover {
@ -49,7 +49,7 @@ defineProps<{
} }
.videoOverlayPlayButton { .videoOverlayPlayButton {
background: var(--accent); background: var(--MI_THEME-accent);
color: #fff; color: #fff;
padding: 1rem; padding: 1rem;
border-radius: 99rem; border-radius: 99rem;

View File

@ -27,7 +27,7 @@ const canonical = props.host === localHost ? `@${props.username}` : `@${props.us
const url = `/${canonical}`; const url = `/${canonical}`;
const bg = tinycolor(getComputedStyle(document.documentElement).getPropertyValue('--mention')); const bg = tinycolor(getComputedStyle(document.documentElement).getPropertyValue('--MI_THEME-mention'));
bg.setAlpha(0.1); bg.setAlpha(0.1);
const bgCss = bg.toRgbString(); const bgCss = bg.toRgbString();
</script> </script>
@ -37,7 +37,7 @@ const bgCss = bg.toRgbString();
display: inline-block; display: inline-block;
padding: 4px 8px 4px 4px; padding: 4px 8px 4px 4px;
border-radius: 999px; border-radius: 999px;
color: var(--mention); color: var(--MI_THEME-mention);
} }
.host { .host {

View File

@ -26,8 +26,8 @@ const QUOTE_STYLE = `
display: block; display: block;
margin: 8px; margin: 8px;
padding: 6px 0 6px 12px; padding: 6px 0 6px 12px;
color: var(--fg); color: var(--MI_THEME-fg);
border-left: solid 3px var(--fg); border-left: solid 3px var(--MI_THEME-fg);
opacity: 0.7; opacity: 0.7;
`.split('\n').join(' '); `.split('\n').join(' ');
@ -251,7 +251,7 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
} }
case 'border': { case 'border': {
let color = validColor(token.props.args.color); let color = validColor(token.props.args.color);
color = color ? `#${color}` : 'var(--accent)'; color = color ? `#${color}` : 'var(--MI_THEME-accent)';
let b_style = token.props.args.style; let b_style = token.props.args.style;
if ( if (
typeof b_style !== 'string' || typeof b_style !== 'string' ||
@ -284,7 +284,7 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
const child = token.children[0]; const child = token.children[0];
const unixtime = parseInt(child.type === 'text' ? child.props.text : ''); const unixtime = parseInt(child.type === 'text' ? child.props.text : '');
return h('span', { return h('span', {
style: 'display: inline-block; font-size: 90%; border: solid 1px var(--divider); border-radius: 999px; padding: 4px 10px 4px 6px;', style: 'display: inline-block; font-size: 90%; border: solid 1px var(--MI_THEME-divider); border-radius: 999px; padding: 4px 10px 4px 6px;',
}, [ }, [
h('i', { h('i', {
class: 'ti ti-clock', class: 'ti ti-clock',
@ -355,7 +355,7 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
return [h(EmA, { return [h(EmA, {
key: Math.random(), key: Math.random(),
to: isNote ? `/tags/${encodeURIComponent(token.props.hashtag)}` : `/user-tags/${encodeURIComponent(token.props.hashtag)}`, to: isNote ? `/tags/${encodeURIComponent(token.props.hashtag)}` : `/user-tags/${encodeURIComponent(token.props.hashtag)}`,
style: 'color:var(--hashtag);', style: 'color:var(--MI_THEME-hashtag);',
}, `#${token.props.hashtag}`)]; }, `#${token.props.hashtag}`)];
} }

View File

@ -108,6 +108,8 @@ SPDX-License-Identifier: AGPL-3.0-only
import { computed, inject, ref, shallowRef } from 'vue'; import { computed, inject, ref, shallowRef } from 'vue';
import * as mfm from 'mfm-js'; import * as mfm from 'mfm-js';
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import { shouldCollapsed } from '@@/js/collapsed.js';
import { url } from '@@/js/config.js';
import I18n from '@/components/I18n.vue'; import I18n from '@/components/I18n.vue';
import EmNoteSub from '@/components/EmNoteSub.vue'; import EmNoteSub from '@/components/EmNoteSub.vue';
import EmNoteHeader from '@/components/EmNoteHeader.vue'; import EmNoteHeader from '@/components/EmNoteHeader.vue';
@ -123,8 +125,6 @@ import EmUserName from '@/components/EmUserName.vue';
import EmTime from '@/components/EmTime.vue'; import EmTime from '@/components/EmTime.vue';
import { userPage } from '@/utils.js'; import { userPage } from '@/utils.js';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { shouldCollapsed } from '@@/js/collapsed.js';
import { url } from '@@/js/config.js';
function getAppearNote(note: Misskey.entities.Note) { function getAppearNote(note: Misskey.entities.Note) {
return Misskey.note.isPureRenote(note) ? note.renote : note; return Misskey.note.isPureRenote(note) ? note.renote : note;
@ -164,14 +164,8 @@ const isDeleted = ref(false);
font-size: 1.05em; font-size: 1.05em;
overflow: clip; overflow: clip;
contain: content; contain: content;
content-visibility: auto;
// contain-intrinsic-size: 0 150px;
//
// contain-intrinsic-size
//
// ()
//content-visibility: auto;
//contain-intrinsic-size: 0 128px;
&:focus-visible { &:focus-visible {
outline: none; outline: none;
@ -189,8 +183,8 @@ const isDeleted = ref(false);
margin: auto; margin: auto;
width: calc(100% - 8px); width: calc(100% - 8px);
height: calc(100% - 8px); height: calc(100% - 8px);
border: dashed 2px var(--focus); border: dashed 2px var(--MI_THEME-focus);
border-radius: var(--radius); border-radius: var(--MI-radius);
box-sizing: border-box; box-sizing: border-box;
} }
} }
@ -212,9 +206,9 @@ const isDeleted = ref(false);
right: 12px; right: 12px;
padding: 0 4px; padding: 0 4px;
margin-bottom: 0 !important; margin-bottom: 0 !important;
background: var(--popup); background: var(--MI_THEME-popup);
border-radius: 8px; border-radius: 8px;
box-shadow: 0px 4px 32px var(--shadow); box-shadow: 0px 4px 32px var(--MI_THEME-shadow);
} }
.footerButton { .footerButton {
@ -259,7 +253,7 @@ const isDeleted = ref(false);
padding: 16px 32px 8px 32px; padding: 16px 32px 8px 32px;
line-height: 28px; line-height: 28px;
white-space: pre; white-space: pre;
color: var(--renote); color: var(--MI_THEME-renote);
& + .article { & + .article {
padding-top: 8px; padding-top: 8px;
@ -356,7 +350,7 @@ const isDeleted = ref(false);
width: 58px; width: 58px;
height: 58px; height: 58px;
position: sticky !important; position: sticky !important;
top: calc(22px + var(--stickyTop, 0px)); top: calc(22px + var(--MI-stickyTop, 0px));
left: 0; left: 0;
} }
@ -377,12 +371,12 @@ const isDeleted = ref(false);
width: 100%; width: 100%;
margin-top: 14px; margin-top: 14px;
position: sticky; position: sticky;
bottom: calc(var(--stickyBottom, 0px) + 14px); bottom: calc(var(--MI-stickyBottom, 0px) + 14px);
} }
.showLessLabel { .showLessLabel {
display: inline-block; display: inline-block;
background: var(--popup); background: var(--MI_THEME-popup);
padding: 6px 10px; padding: 6px 10px;
font-size: 0.8em; font-size: 0.8em;
border-radius: 999px; border-radius: 999px;
@ -403,16 +397,16 @@ const isDeleted = ref(false);
z-index: 2; z-index: 2;
width: 100%; width: 100%;
height: 64px; height: 64px;
background: linear-gradient(0deg, var(--panel), color(from var(--panel) srgb r g b / 0)); background: linear-gradient(0deg, var(--MI_THEME-panel), color(from var(--MI_THEME-panel) srgb r g b / 0));
&:hover > .collapsedLabel { &:hover > .collapsedLabel {
background: var(--panelHighlight); background: var(--MI_THEME-panelHighlight);
} }
} }
.collapsedLabel { .collapsedLabel {
display: inline-block; display: inline-block;
background: var(--panel); background: var(--MI_THEME-panel);
padding: 6px 10px; padding: 6px 10px;
font-size: 0.8em; font-size: 0.8em;
border-radius: 999px; border-radius: 999px;
@ -424,13 +418,13 @@ const isDeleted = ref(false);
} }
.replyIcon { .replyIcon {
color: var(--accent); color: var(--MI_THEME-accent);
margin-right: 0.5em; margin-right: 0.5em;
} }
.translation { .translation {
border: solid 0.5px var(--divider); border: solid 0.5px var(--MI_THEME-divider);
border-radius: var(--radius); border-radius: var(--MI-radius);
padding: 12px; padding: 12px;
margin-top: 8px; margin-top: 8px;
} }
@ -449,7 +443,7 @@ const isDeleted = ref(false);
.quoteNote { .quoteNote {
padding: 16px; padding: 16px;
border: dashed 1px var(--renote); border: dashed 1px var(--MI_THEME-renote);
border-radius: 8px; border-radius: 8px;
overflow: clip; overflow: clip;
} }
@ -473,7 +467,7 @@ const isDeleted = ref(false);
} }
&:hover { &:hover {
color: var(--fgHighlighted); color: var(--MI_THEME-fgHighlighted);
} }
} }
@ -550,7 +544,7 @@ const isDeleted = ref(false);
margin: 0 10px 0 0; margin: 0 10px 0 0;
width: 46px; width: 46px;
height: 46px; height: 46px;
top: calc(14px + var(--stickyTop, 0px)); top: calc(14px + var(--MI-stickyTop, 0px));
} }
} }

View File

@ -195,7 +195,7 @@ const collapsed = ref(appearNote.value.cw == null && isLong);
padding: 16px 32px 8px 32px; padding: 16px 32px 8px 32px;
line-height: 28px; line-height: 28px;
white-space: pre; white-space: pre;
color: var(--renote); color: var(--MI_THEME-renote);
} }
.renoteAvatar { .renoteAvatar {
@ -281,7 +281,7 @@ const collapsed = ref(appearNote.value.cw == null && isLong);
padding: 4px 6px; padding: 4px 6px;
font-size: 80%; font-size: 80%;
line-height: 1; line-height: 1;
border: solid 0.5px var(--divider); border: solid 0.5px var(--MI_THEME-divider);
border-radius: 4px; border-radius: 4px;
} }
@ -323,14 +323,14 @@ const collapsed = ref(appearNote.value.cw == null && isLong);
} }
.noteReplyTarget { .noteReplyTarget {
color: var(--accent); color: var(--MI_THEME-accent);
margin-right: 0.5em; margin-right: 0.5em;
} }
.rn { .rn {
margin-left: 4px; margin-left: 4px;
font-style: oblique; font-style: oblique;
color: var(--renote); color: var(--MI_THEME-renote);
} }
.reactionOmitted { .reactionOmitted {
@ -350,7 +350,7 @@ const collapsed = ref(appearNote.value.cw == null && isLong);
.quoteNote { .quoteNote {
padding: 16px; padding: 16px;
border: dashed 1px var(--renote); border: dashed 1px var(--MI_THEME-renote);
border-radius: 8px; border-radius: 8px;
overflow: clip; overflow: clip;
} }
@ -364,12 +364,12 @@ const collapsed = ref(appearNote.value.cw == null && isLong);
width: 100%; width: 100%;
margin-top: 14px; margin-top: 14px;
position: sticky; position: sticky;
bottom: calc(var(--stickyBottom, 0px) + 14px); bottom: calc(var(--MI-stickyBottom, 0px) + 14px);
} }
.showLessLabel { .showLessLabel {
display: inline-block; display: inline-block;
background: var(--popup); background: var(--MI_THEME-popup);
padding: 6px 10px; padding: 6px 10px;
font-size: 0.8em; font-size: 0.8em;
border-radius: 999px; border-radius: 999px;
@ -390,16 +390,16 @@ const collapsed = ref(appearNote.value.cw == null && isLong);
z-index: 2; z-index: 2;
width: 100%; width: 100%;
height: 64px; height: 64px;
background: linear-gradient(0deg, var(--panel), var(--X15)); background: linear-gradient(0deg, var(--MI_THEME-panel), var(--MI_THEME-X15));
&:hover > .collapsedLabel { &:hover > .collapsedLabel {
background: var(--panelHighlight); background: var(--MI_THEME-panelHighlight);
} }
} }
.collapsedLabel { .collapsedLabel {
display: inline-block; display: inline-block;
background: var(--panel); background: var(--MI_THEME-panel);
padding: 6px 10px; padding: 6px 10px;
font-size: 0.8em; font-size: 0.8em;
border-radius: 999px; border-radius: 999px;
@ -422,7 +422,7 @@ const collapsed = ref(appearNote.value.cw == null && isLong);
} }
&:hover { &:hover {
color: var(--fgHighlighted); color: var(--MI_THEME-fgHighlighted);
} }
} }
@ -438,7 +438,7 @@ const collapsed = ref(appearNote.value.cw == null && isLong);
opacity: 0.7; opacity: 0.7;
&.reacted { &.reacted {
color: var(--accent); color: var(--MI_THEME-accent);
} }
} }

View File

@ -72,7 +72,7 @@ defineProps<{
margin: 0 .5em 0 0; margin: 0 .5em 0 0;
padding: 1px 6px; padding: 1px 6px;
font-size: 80%; font-size: 80%;
border: solid 0.5px var(--divider); border: solid 0.5px var(--MI_THEME-divider);
border-radius: 3px; border-radius: 3px;
} }

View File

@ -53,7 +53,7 @@ const showContent = ref(false);
height: 34px; height: 34px;
border-radius: 8px; border-radius: 8px;
position: sticky !important; position: sticky !important;
top: calc(16px + var(--stickyTop, 0px)); top: calc(16px + var(--MI-stickyTop, 0px));
left: 0; left: 0;
} }

View File

@ -123,7 +123,7 @@ if (props.detail) {
} }
.reply, .more { .reply, .more {
border-left: solid 0.5px var(--divider); border-left: solid 0.5px var(--MI_THEME-divider);
margin-top: 10px; margin-top: 10px;
} }
@ -144,7 +144,7 @@ if (props.detail) {
.muted { .muted {
text-align: center; text-align: center;
padding: 8px !important; padding: 8px !important;
border: 1px solid var(--divider); border: 1px solid var(--MI_THEME-divider);
margin: 8px 8px 0 8px; margin: 8px 8px 0 8px;
border-radius: 8px; border-radius: 8px;
} }

View File

@ -43,10 +43,10 @@ defineExpose({
<style lang="scss" module> <style lang="scss" module>
.root { .root {
background: var(--panel); background: var(--MI_THEME-panel);
} }
.note { .note {
border-bottom: 0.5px solid var(--divider); border-bottom: 0.5px solid var(--MI_THEME-divider);
} }
</style> </style>

View File

@ -9,7 +9,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<li v-for="(choice, i) in poll.choices" :key="i" :class="$style.choice"> <li v-for="(choice, i) in poll.choices" :key="i" :class="$style.choice">
<div :class="$style.bg" :style="{ 'width': `${choice.votes / total * 100}%` }"></div> <div :class="$style.bg" :style="{ 'width': `${choice.votes / total * 100}%` }"></div>
<span :class="$style.fg"> <span :class="$style.fg">
<template v-if="choice.isVoted"><i class="ti ti-check" style="margin-right: 4px; color: var(--accent);"></i></template> <template v-if="choice.isVoted"><i class="ti ti-check" style="margin-right: 4px; color: var(--MI_THEME-accent);"></i></template>
<EmMfm :text="choice.text" :plain="true"/> <EmMfm :text="choice.text" :plain="true"/>
<span style="margin-left: 4px; opacity: 0.7;">({{ i18n.tsx._poll.votesCount({ n: choice.votes }) }})</span> <span style="margin-left: 4px; opacity: 0.7;">({{ i18n.tsx._poll.votesCount({ n: choice.votes }) }})</span>
</span> </span>
@ -52,8 +52,8 @@ const total = computed(() => sum(props.poll.choices.map(x => x.votes)));
position: relative; position: relative;
margin: 4px 0; margin: 4px 0;
padding: 4px; padding: 4px;
//border: solid 0.5px var(--divider); //border: solid 0.5px var(--MI_THEME-divider);
background: var(--accentedBg); background: var(--MI_THEME-accentedBg);
border-radius: 4px; border-radius: 4px;
overflow: clip; overflow: clip;
} }
@ -63,8 +63,8 @@ const total = computed(() => sum(props.poll.choices.map(x => x.votes)));
top: 0; top: 0;
left: 0; left: 0;
height: 100%; height: 100%;
background: var(--accent); background: var(--MI_THEME-accent);
background: linear-gradient(90deg,var(--buttonGradateA),var(--buttonGradateB)); background: linear-gradient(90deg,var(--MI_THEME-buttonGradateA),var(--MI_THEME-buttonGradateB));
transition: width 1s ease; transition: width 1s ease;
} }
@ -72,11 +72,11 @@ const total = computed(() => sum(props.poll.choices.map(x => x.votes)));
position: relative; position: relative;
display: inline-block; display: inline-block;
padding: 3px 5px; padding: 3px 5px;
background: var(--panel); background: var(--MI_THEME-panel);
border-radius: 3px; border-radius: 3px;
} }
.info { .info {
color: var(--fg); color: var(--MI_THEME-fg);
} }
</style> </style>

View File

@ -38,7 +38,7 @@ const props = defineProps<{
justify-content: center; justify-content: center;
&.canToggle { &.canToggle {
background: var(--buttonBg); background: var(--MI_THEME-buttonBg);
&:hover { &:hover {
background: rgba(0, 0, 0, 0.1); background: rgba(0, 0, 0, 0.1);
@ -72,12 +72,12 @@ const props = defineProps<{
} }
&.reacted, &.reacted:hover { &.reacted, &.reacted:hover {
background: var(--accentedBg); background: var(--MI_THEME-accentedBg);
color: var(--accent); color: var(--MI_THEME-accent);
box-shadow: 0 0 0 1px var(--accent) inset; box-shadow: 0 0 0 1px var(--MI_THEME-accent) inset;
> .count { > .count {
color: var(--accent); color: var(--MI_THEME-accent);
} }
> .icon { > .icon {

View File

@ -65,11 +65,11 @@ const collapsed = ref(isLong);
left: 0; left: 0;
width: 100%; width: 100%;
height: 64px; height: 64px;
background: linear-gradient(0deg, var(--panel), color(from var(--panel) srgb r g b / 0)); background: linear-gradient(0deg, var(--MI_THEME-panel), color(from var(--MI_THEME-panel) srgb r g b / 0));
> .fadeLabel { > .fadeLabel {
display: inline-block; display: inline-block;
background: var(--panel); background: var(--MI_THEME-panel);
padding: 6px 10px; padding: 6px 10px;
font-size: 0.8em; font-size: 0.8em;
border-radius: 999px; border-radius: 999px;
@ -78,7 +78,7 @@ const collapsed = ref(isLong);
&:hover { &:hover {
> .fadeLabel { > .fadeLabel {
background: var(--panelHighlight); background: var(--MI_THEME-panelHighlight);
} }
} }
} }
@ -87,25 +87,25 @@ const collapsed = ref(isLong);
.reply { .reply {
margin-right: 6px; margin-right: 6px;
color: var(--accent); color: var(--MI_THEME-accent);
} }
.rp { .rp {
margin-left: 4px; margin-left: 4px;
font-style: oblique; font-style: oblique;
color: var(--renote); color: var(--MI_THEME-renote);
} }
.showLess { .showLess {
width: 100%; width: 100%;
margin-top: 14px; margin-top: 14px;
position: sticky; position: sticky;
bottom: calc(var(--stickyBottom, 0px) + 14px); bottom: calc(var(--MI-stickyBottom, 0px) + 14px);
} }
.showLessLabel { .showLessLabel {
display: inline-block; display: inline-block;
background: var(--popup); background: var(--MI_THEME-popup);
padding: 6px 10px; padding: 6px 10px;
font-size: 0.8em; font-size: 0.8em;
border-radius: 999px; border-radius: 999px;

View File

@ -98,10 +98,10 @@ if (!invalid && props.origin === null && (props.mode === 'relative' || props.mod
<style lang="scss" module> <style lang="scss" module>
.old1 { .old1 {
color: var(--warn); color: var(--MI_THEME-warn);
} }
.old1.old2 { .old1.old2 {
color: var(--error); color: var(--MI_THEME-error);
} }
</style> </style>

View File

@ -20,7 +20,7 @@ withDefaults(defineProps<{
<style module lang="scss"> <style module lang="scss">
.timelineRoot { .timelineRoot {
background-color: var(--panel); background-color: var(--MI_THEME-panel);
height: 100%; height: 100%;
max-height: var(--embedMaxHeight, none); max-height: var(--embedMaxHeight, none);
display: flex; display: flex;
@ -29,7 +29,7 @@ withDefaults(defineProps<{
.header { .header {
flex-shrink: 0; flex-shrink: 0;
border-bottom: 1px solid var(--divider); border-bottom: 1px solid var(--MI_THEME-divider);
} }
.body { .body {

View File

@ -100,7 +100,7 @@ function top(ev: MouseEvent) {
display: flex; display: flex;
min-width: 0; min-width: 0;
align-items: center; align-items: center;
gap: var(--margin); gap: var(--MI-margin);
overflow: hidden; overflow: hidden;
.headerClipIconRoot { .headerClipIconRoot {
@ -110,8 +110,8 @@ function top(ev: MouseEvent) {
line-height: 32px; line-height: 32px;
font-size: 14px; font-size: 14px;
text-align: center; text-align: center;
background-color: var(--accentedBg); background-color: var(--MI_THEME-accentedBg);
color: var(--accent); color: var(--MI_THEME-accent);
border-radius: 50%; border-radius: 50%;
} }

View File

@ -47,6 +47,6 @@ if (note.value?.url != null || note.value?.uri != null) {
<style lang="scss" module> <style lang="scss" module>
.noteEmbedRoot { .noteEmbedRoot {
background-color: var(--panel); background-color: var(--MI_THEME-panel);
} }
</style> </style>

View File

@ -83,7 +83,7 @@ function top(ev: MouseEvent) {
display: flex; display: flex;
min-width: 0; min-width: 0;
align-items: center; align-items: center;
gap: var(--margin); gap: var(--MI-margin);
overflow: hidden; overflow: hidden;
.headerClipIconRoot { .headerClipIconRoot {
@ -93,8 +93,8 @@ function top(ev: MouseEvent) {
line-height: 32px; line-height: 32px;
font-size: 14px; font-size: 14px;
text-align: center; text-align: center;
background-color: var(--accentedBg); background-color: var(--MI_THEME-accentedBg);
color: var(--accent); color: var(--MI_THEME-accent);
border-radius: 50%; border-radius: 50%;
} }

View File

@ -117,7 +117,7 @@ function top(ev: MouseEvent) {
display: flex; display: flex;
min-width: 0; min-width: 0;
align-items: center; align-items: center;
gap: var(--margin); gap: var(--MI-margin);
overflow: hidden; overflow: hidden;
.avatarLink { .avatarLink {

View File

@ -7,18 +7,18 @@
*/ */
:root { :root {
--radius: 12px; --MI-radius: 12px;
--marginFull: 14px; --MI-marginFull: 14px;
--marginHalf: 10px; --MI-marginHalf: 10px;
--margin: var(--marginFull); --MI-margin: var(--MI-marginFull);
} }
html { html {
background-color: transparent; background-color: transparent;
color-scheme: light dark; color-scheme: light dark;
color: var(--fg); color: var(--MI_THEME-fg);
accent-color: var(--accent); accent-color: var(--MI_THEME-accent);
overflow: clip; overflow: clip;
overflow-wrap: break-word; overflow-wrap: break-word;
font-family: 'Hiragino Maru Gothic Pro', "BIZ UDGothic", Roboto, HelveticaNeue, Arial, sans-serif; font-family: 'Hiragino Maru Gothic Pro', "BIZ UDGothic", Roboto, HelveticaNeue, Arial, sans-serif;
@ -29,7 +29,7 @@ html {
-webkit-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;
&, * { &, * {
scrollbar-color: var(--scrollbarHandle) transparent; scrollbar-color: var(--MI_THEME-scrollbarHandle) transparent;
scrollbar-width: thin; scrollbar-width: thin;
&::-webkit-scrollbar { &::-webkit-scrollbar {
@ -42,14 +42,14 @@ html {
} }
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
background: var(--scrollbarHandle); background: var(--MI_THEME-scrollbarHandle);
&:hover { &:hover {
background: var(--scrollbarHandleHover); background: var(--MI_THEME-scrollbarHandleHover);
} }
&:active { &:active {
background: var(--accent); background: var(--MI_THEME-accent);
} }
} }
} }
@ -93,7 +93,7 @@ rt {
} }
:focus-visible { :focus-visible {
outline: var(--focus) solid 2px; outline: var(--MI_THEME-focus) solid 2px;
outline-offset: -2px; outline-offset: -2px;
&:hover { &:hover {
@ -151,38 +151,38 @@ rt {
._buttonGray { ._buttonGray {
@extend ._button; @extend ._button;
background: var(--buttonBg); background: var(--MI_THEME-buttonBg);
&:not(:disabled):hover { &:not(:disabled):hover {
background: var(--buttonHoverBg); background: var(--MI_THEME-buttonHoverBg);
} }
} }
._buttonPrimary { ._buttonPrimary {
@extend ._button; @extend ._button;
color: var(--fgOnAccent); color: var(--MI_THEME-fgOnAccent);
background: var(--accent); background: var(--MI_THEME-accent);
&:not(:disabled):hover { &:not(:disabled):hover {
background: hsl(from var(--accent) h s calc(l + 5)); background: hsl(from var(--MI_THEME-accent) h s calc(l + 5));
} }
&:not(:disabled):active { &:not(:disabled):active {
background: hsl(from var(--accent) h s calc(l - 5)); background: hsl(from var(--MI_THEME-accent) h s calc(l - 5));
} }
} }
._buttonGradate { ._buttonGradate {
@extend ._buttonPrimary; @extend ._buttonPrimary;
color: var(--fgOnAccent); color: var(--MI_THEME-fgOnAccent);
background: linear-gradient(90deg, var(--buttonGradateA), var(--buttonGradateB)); background: linear-gradient(90deg, var(--MI_THEME-buttonGradateA), var(--MI_THEME-buttonGradateB));
&:not(:disabled):hover { &:not(:disabled):hover {
background: linear-gradient(90deg, hsl(from var(--accent) h s calc(l + 5)), hsl(from var(--accent) h s calc(l + 5))); background: linear-gradient(90deg, hsl(from var(--MI_THEME-accent) h s calc(l + 5)), hsl(from var(--MI_THEME-accent) h s calc(l + 5)));
} }
&:not(:disabled):active { &:not(:disabled):active {
background: linear-gradient(90deg, hsl(from var(--accent) h s calc(l + 5)), hsl(from var(--accent) h s calc(l + 5))); background: linear-gradient(90deg, hsl(from var(--MI_THEME-accent) h s calc(l + 5)), hsl(from var(--MI_THEME-accent) h s calc(l + 5)));
} }
} }
@ -199,13 +199,13 @@ rt {
} }
._help { ._help {
color: var(--accent); color: var(--MI_THEME-accent);
cursor: help; cursor: help;
} }
._textButton { ._textButton {
@extend ._button; @extend ._button;
color: var(--accent); color: var(--MI_THEME-accent);
&:focus-visible { &:focus-visible {
outline-offset: 2px; outline-offset: 2px;
@ -217,13 +217,13 @@ rt {
} }
._panel { ._panel {
background: var(--panel); background: var(--MI_THEME-panel);
border-radius: var(--radius); border-radius: var(--MI-radius);
overflow: clip; overflow: clip;
} }
._margin { ._margin {
margin: var(--margin) 0; margin: var(--MI-margin) 0;
} }
._gaps_m { ._gaps_m {
@ -241,7 +241,7 @@ rt {
._gaps { ._gaps {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: var(--margin); gap: var(--MI-margin);
} }
._buttons { ._buttons {
@ -263,24 +263,24 @@ rt {
padding: 10px; padding: 10px;
box-sizing: border-box; box-sizing: border-box;
text-align: center; text-align: center;
border: solid 0.5px var(--divider); border: solid 0.5px var(--MI_THEME-divider);
border-radius: var(--radius); border-radius: var(--MI-radius);
&:active { &:active {
border-color: var(--accent); border-color: var(--MI_THEME-accent);
} }
} }
._popup { ._popup {
background: var(--popup); background: var(--MI_THEME-popup);
border-radius: var(--radius); border-radius: var(--MI-radius);
contain: content; contain: content;
} }
._acrylic { ._acrylic {
background: var(--acrylicPanel); background: var(--MI_THEME-acrylicPanel);
-webkit-backdrop-filter: var(--blur, blur(15px)); -webkit-backdrop-filter: var(--MI-blur, blur(15px));
backdrop-filter: var(--blur, blur(15px)); backdrop-filter: var(--MI-blur, blur(15px));
} }
._fullinfo { ._fullinfo {
@ -296,7 +296,7 @@ rt {
} }
._link { ._link {
color: var(--link); color: var(--MI_THEME-link);
} }
._caption { ._caption {

View File

@ -61,7 +61,7 @@ export function applyTheme(theme: Theme, persist = true) {
} }
for (const [k, v] of Object.entries(props)) { for (const [k, v] of Object.entries(props)) {
document.documentElement.style.setProperty(`--${k}`, v.toString()); document.documentElement.style.setProperty(`--MI_THEME-${k}`, v.toString());
} }
// iframeを正常に透過させるために、cssのcolor-schemeは `light dark;` 固定にしてある。style.scss参照 // iframeを正常に透過させるために、cssのcolor-schemeは `light dark;` 固定にしてある。style.scss参照

View File

@ -88,14 +88,14 @@ onUnmounted(() => {
<style lang="scss" module> <style lang="scss" module>
.rootForEmbedPage { .rootForEmbedPage {
box-sizing: border-box; box-sizing: border-box;
border: 1px solid var(--divider); border: 1px solid var(--MI_THEME-divider);
background-color: var(--bg); background-color: var(--MI_THEME-bg);
overflow: hidden; overflow: hidden;
position: relative; position: relative;
height: auto; height: auto;
&.rounded { &.rounded {
border-radius: var(--radius); border-radius: var(--MI-radius);
} }
&.noBorder { &.noBorder {

View File

@ -30,7 +30,7 @@
panelHeaderBg: ':lighten<3<@panel', panelHeaderBg: ':lighten<3<@panel',
panelHeaderFg: '@fg', panelHeaderFg: '@fg',
panelHeaderDivider: 'rgba(0, 0, 0, 0)', panelHeaderDivider: 'rgba(0, 0, 0, 0)',
panelBorder: '" solid 1px var(--divider)', panelBorder: '" solid 1px var(--MI_THEME-divider)',
acrylicPanel: ':alpha<0.5<@panel', acrylicPanel: ':alpha<0.5<@panel',
windowHeader: ':alpha<0.85<@panel', windowHeader: ':alpha<0.85<@panel',
popup: ':lighten<3<@panel', popup: ':lighten<3<@panel',
@ -67,7 +67,6 @@
switchOnFg: '@accent', switchOnFg: '@accent',
inputBorder: 'rgba(255, 255, 255, 0.1)', inputBorder: 'rgba(255, 255, 255, 0.1)',
inputBorderHover: 'rgba(255, 255, 255, 0.2)', inputBorderHover: 'rgba(255, 255, 255, 0.2)',
listItemHoverBg: 'rgba(255, 255, 255, 0.03)',
driveFolderBg: ':alpha<0.3<@accent', driveFolderBg: ':alpha<0.3<@accent',
wallpaperOverlay: 'rgba(0, 0, 0, 0.5)', wallpaperOverlay: 'rgba(0, 0, 0, 0.5)',
badge: '#31b1ce', badge: '#31b1ce',

View File

@ -30,7 +30,7 @@
panelHeaderBg: ':lighten<3<@panel', panelHeaderBg: ':lighten<3<@panel',
panelHeaderFg: '@fg', panelHeaderFg: '@fg',
panelHeaderDivider: 'rgba(0, 0, 0, 0)', panelHeaderDivider: 'rgba(0, 0, 0, 0)',
panelBorder: '" solid 1px var(--divider)', panelBorder: '" solid 1px var(--MI_THEME-divider)',
acrylicPanel: ':alpha<0.5<@panel', acrylicPanel: ':alpha<0.5<@panel',
windowHeader: ':alpha<0.85<@panel', windowHeader: ':alpha<0.85<@panel',
popup: ':lighten<3<@panel', popup: ':lighten<3<@panel',
@ -67,7 +67,6 @@
switchOnFg: '@fgOnAccent', switchOnFg: '@fgOnAccent',
inputBorder: 'rgba(0, 0, 0, 0.1)', inputBorder: 'rgba(0, 0, 0, 0.1)',
inputBorderHover: 'rgba(0, 0, 0, 0.2)', inputBorderHover: 'rgba(0, 0, 0, 0.2)',
listItemHoverBg: 'rgba(0, 0, 0, 0.03)',
driveFolderBg: ':alpha<0.3<@accent', driveFolderBg: ':alpha<0.3<@accent',
wallpaperOverlay: 'rgba(255, 255, 255, 0.5)', wallpaperOverlay: 'rgba(255, 255, 255, 0.5)',
badge: '#31b1ce', badge: '#31b1ce',

View File

@ -36,7 +36,7 @@
dateLabelFg: '@fg', dateLabelFg: '@fg',
inputBorder: 'rgba(255, 255, 255, 0.1)', inputBorder: 'rgba(255, 255, 255, 0.1)',
inputBorderHover: 'rgba(255, 255, 255, 0.2)', inputBorderHover: 'rgba(255, 255, 255, 0.2)',
panelBorder: '" solid 1px var(--divider)', panelBorder: '" solid 1px var(--MI_THEME-divider)',
accentDarken: ':darken<10<@accent', accentDarken: ':darken<10<@accent',
acrylicPanel: ':alpha<0.5<@panel', acrylicPanel: ':alpha<0.5<@panel',
navIndicator: '@accent', navIndicator: '@accent',
@ -50,7 +50,6 @@
htmlThemeColor: '@bg', htmlThemeColor: '@bg',
fgOnWhite: '@accent', fgOnWhite: '@accent',
panelHighlight: ':lighten<3<@panel', panelHighlight: ':lighten<3<@panel',
listItemHoverBg: 'rgba(255, 255, 255, 0.03)',
scrollbarHandle: 'rgba(255, 255, 255, 0.2)', scrollbarHandle: 'rgba(255, 255, 255, 0.2)',
wallpaperOverlay: 'rgba(0, 0, 0, 0.5)', wallpaperOverlay: 'rgba(0, 0, 0, 0.5)',
panelHeaderDivider: 'rgba(0, 0, 0, 0)', panelHeaderDivider: 'rgba(0, 0, 0, 0)',

Some files were not shown because too many files have changed in this diff Show More