Merge branch 'develop' into mkjs-n

This commit is contained in:
tamaina 2023-05-29 13:02:41 +00:00
commit d647df7f63
116 changed files with 2386 additions and 1892 deletions

View file

@ -38,6 +38,8 @@
- fix:ロールタイムラインにて全ての投稿が流れてしまう問題の修正 - fix:ロールタイムラインにて全ての投稿が流れてしまう問題の修正
### Server ### Server
- bullをbull-mqにアップグレードし、ジョブキューのパフォーマンスを改善
- ストリーミングのパフォーマンスを改善
- Fix: お知らせの画像URLを空にできない問題を修正 - Fix: お知らせの画像URLを空にできない問題を修正
## 13.12.2 ## 13.12.2

View file

@ -2,6 +2,7 @@
_lang_: "العربية" _lang_: "العربية"
headlineMisskey: "شبكة مرتبطة بالملاحظات" headlineMisskey: "شبكة مرتبطة بالملاحظات"
introMisskey: "اهلا بك! ميسكي هو منصة تدوين مصغر لا مركزية ومفتوحة المصدر.\nيمكنك مشاركة \"ملاحظات\" عن ما يجري حولك، وإخبار الجميع عن نفسك 📡\nتسمح لك \"الانفعالات\" بتعبير عن شعورك حول ملاحظات الآخرين 👍\nاكتشف عالمًا جديدًا 🚀" introMisskey: "اهلا بك! ميسكي هو منصة تدوين مصغر لا مركزية ومفتوحة المصدر.\nيمكنك مشاركة \"ملاحظات\" عن ما يجري حولك، وإخبار الجميع عن نفسك 📡\nتسمح لك \"الانفعالات\" بتعبير عن شعورك حول ملاحظات الآخرين 👍\nاكتشف عالمًا جديدًا 🚀"
poweredByMisskeyDescription: "{name} هو إحدى الخِدمات التي تستخدم المنصة مفتوحة المصدر <b>ميسكي</b> (يشار إليه كمثيل ميسكي)"
monthAndDay: "{day}/{month}" monthAndDay: "{day}/{month}"
search: "البحث" search: "البحث"
notifications: "الإشعارات" notifications: "الإشعارات"
@ -49,6 +50,7 @@ deleteAndEdit: "إزالة وإعادة الصياغة"
deleteAndEditConfirm: "أمتأكد من حذف الملاحظة؟ ستفقد كل مشاركاتها، والتفاعلات، والردود عليها." deleteAndEditConfirm: "أمتأكد من حذف الملاحظة؟ ستفقد كل مشاركاتها، والتفاعلات، والردود عليها."
addToList: "أضفه إلى قائمة" addToList: "أضفه إلى قائمة"
sendMessage: "أرسل رسالة" sendMessage: "أرسل رسالة"
copyRSS: "انسخ رابط RSS"
copyUsername: "انسخ اسم المستخدم" copyUsername: "انسخ اسم المستخدم"
searchUser: "ابحث عن مستخدمين" searchUser: "ابحث عن مستخدمين"
reply: "رد" reply: "رد"
@ -102,6 +104,8 @@ renoted: "أُعيد نشره"
cantRenote: "لا يمكن إعادة نشر الملاحظة" cantRenote: "لا يمكن إعادة نشر الملاحظة"
cantReRenote: "لا يمكنك إعادة نشر ملاحظة معاد نشرها" cantReRenote: "لا يمكنك إعادة نشر ملاحظة معاد نشرها"
quote: "اقتبس" quote: "اقتبس"
inChannelRenote: "إعادة نشر في قناة"
inChannelQuote: "اقتباس في قناة"
pinnedNote: "ملاحظة مدبسة" pinnedNote: "ملاحظة مدبسة"
pinned: "دبّسها على الصفحة الشخصية" pinned: "دبّسها على الصفحة الشخصية"
you: "أنت" you: "أنت"
@ -119,6 +123,8 @@ unmarkAsSensitive: "ألغ تعيينه كمحتوى حساس"
enterFileName: "ادخل اسم الملف" enterFileName: "ادخل اسم الملف"
mute: "اكتم" mute: "اكتم"
unmute: "إلغاء الكتم" unmute: "إلغاء الكتم"
renoteMute: "اكتم إعادة النشر"
renoteUnmute: "ارفع الكتم عن إعادة النشر"
block: "احجب" block: "احجب"
unblock: "إلغاء الحجب" unblock: "إلغاء الحجب"
suspend: "علِق" suspend: "علِق"
@ -141,6 +147,7 @@ emojiUrl: "رابط الإيموجي"
addEmoji: "إضافة إيموجي" addEmoji: "إضافة إيموجي"
settingGuide: "الإعدادات المستحسنة" settingGuide: "الإعدادات المستحسنة"
cacheRemoteFiles: "خزن مؤقتا الملفات البعيدة" cacheRemoteFiles: "خزن مؤقتا الملفات البعيدة"
cacheRemoteFilesDescription: "إذا عُطل هذا الإعداد، ستُحمل الملفات من المثيل البعيد، هذا سيقلل من المساحة المستغلة على القرص لكن سيزيد حجم تدفق البيانات وهذا لأن الصور المصغرة لن تولّد."
flagAsBot: "علّمه كحساب آلي" flagAsBot: "علّمه كحساب آلي"
flagAsBotDescription: "فعّل هذا الخيار إذا كان هذا الحساب يُدار عبر برمجية. إذا فُعل فسيكون بمثابة علامة للمطورين الآخرين لتجنب سلاسل لا متناهية من التفاعل بين حسابات الآلية وضبط أنظمة ميسكي للتعامل مع هذا الحساب كآلي." flagAsBotDescription: "فعّل هذا الخيار إذا كان هذا الحساب يُدار عبر برمجية. إذا فُعل فسيكون بمثابة علامة للمطورين الآخرين لتجنب سلاسل لا متناهية من التفاعل بين حسابات الآلية وضبط أنظمة ميسكي للتعامل مع هذا الحساب كآلي."
flagAsCat: "علّم هذا الحساب كحساب قط" flagAsCat: "علّم هذا الحساب كحساب قط"
@ -253,6 +260,7 @@ startMessaging: "ابدأ محادثة"
nUsersRead: "قرأه {n}" nUsersRead: "قرأه {n}"
agreeTo: "اوافق على {0}" agreeTo: "اوافق على {0}"
agree: "أقبل" agree: "أقبل"
agreeBelow: "أقبل ما يلي"
basicNotesBeforeCreateAccount: "ملاحظات مهمة" basicNotesBeforeCreateAccount: "ملاحظات مهمة"
termsOfService: "شروط الخدمة" termsOfService: "شروط الخدمة"
start: "البداية" start: "البداية"
@ -362,6 +370,7 @@ antennaExcludeKeywords: "الكلمات المفتاحية المستثناة"
antennaKeywordsDescription: "افصل بينهم بمسافة لاستخدام معامل \"و\" أو بسطر لاستخدام معامل \"أو\"" antennaKeywordsDescription: "افصل بينهم بمسافة لاستخدام معامل \"و\" أو بسطر لاستخدام معامل \"أو\""
notifyAntenna: "نبهني بصول ملاحظات جديدة" notifyAntenna: "نبهني بصول ملاحظات جديدة"
withFileAntenna: "ملاحظات تحوي ملفات فقط" withFileAntenna: "ملاحظات تحوي ملفات فقط"
enableServiceworker: "فعّل إرسال الإشعارات للمتصفح"
antennaUsersDescription: "اكتب اسم مستخدم لكل سطر" antennaUsersDescription: "اكتب اسم مستخدم لكل سطر"
caseSensitive: "حساسية حالة الأحرف" caseSensitive: "حساسية حالة الأحرف"
withReplies: "بالردود" withReplies: "بالردود"
@ -391,6 +400,7 @@ moderation: "الإشراف"
nUsersMentioned: "{n} مستخدمين أُشير إليهم" nUsersMentioned: "{n} مستخدمين أُشير إليهم"
securityKey: "مفتاح الأمان" securityKey: "مفتاح الأمان"
lastUsed: "آخر استخدام" lastUsed: "آخر استخدام"
lastUsedAt: "آخر استخدام: {t}"
unregister: "إلغاء التسجيل" unregister: "إلغاء التسجيل"
passwordLessLogin: "لِج مِن دون كلمة سرية" passwordLessLogin: "لِج مِن دون كلمة سرية"
resetPassword: "أعد تعيين كلمتك السرية" resetPassword: "أعد تعيين كلمتك السرية"
@ -441,6 +451,7 @@ or: "أو"
language: "اللغة" language: "اللغة"
uiLanguage: "لغة واجهة المستخدم" uiLanguage: "لغة واجهة المستخدم"
aboutX: "عن {x}" aboutX: "عن {x}"
emojiStyle: "نمط الوجوه التعبيرية"
noHistory: "السجل فارغ" noHistory: "السجل فارغ"
signinHistory: "تاريخ تسجيل الدخول" signinHistory: "تاريخ تسجيل الدخول"
doing: "انتظر لحظة" doing: "انتظر لحظة"
@ -451,6 +462,7 @@ createAccount: "أنشئ حسابًا"
existingAccount: "الحسابات الموجودة" existingAccount: "الحسابات الموجودة"
regenerate: "أعِد التوليد" regenerate: "أعِد التوليد"
fontSize: "حجم الخط" fontSize: "حجم الخط"
limitTo: "سقفهُ لـ{x}"
noFollowRequests: "ليس لديك طلبات متابعة معلقة" noFollowRequests: "ليس لديك طلبات متابعة معلقة"
openImageInNewTab: "إفتح الصورة بصفحة جديدة" openImageInNewTab: "إفتح الصورة بصفحة جديدة"
dashboard: "لوحة التحكم" dashboard: "لوحة التحكم"
@ -479,6 +491,7 @@ objectStorageUseProxyDesc: "عطل هذا الخيار إذا لم ترد است
serverLogs: "سجلات الخادم" serverLogs: "سجلات الخادم"
deleteAll: "حذف الكل" deleteAll: "حذف الكل"
showFixedPostForm: "أظهر نموذج الكتابة في أعلى الصفحة" showFixedPostForm: "أظهر نموذج الكتابة في أعلى الصفحة"
showFixedPostFormInChannel: "أظهر نموذج الكتابة في أعلى الخط الزمني (قنوات)"
newNoteRecived: "هناك ملاحظات جديدة" newNoteRecived: "هناك ملاحظات جديدة"
sounds: "الرنات" sounds: "الرنات"
sound: "الرنات" sound: "الرنات"
@ -514,6 +527,7 @@ userSilenced: "كُتم هذا المستخدم."
yourAccountSuspendedTitle: "هذا الحساب معلق" yourAccountSuspendedTitle: "هذا الحساب معلق"
yourAccountSuspendedDescription: "عُلق الحساب بسبب انتهاك شروط خدمة المثيل و ما شابه. إذا أردت معرفة التفصيل تواصل مع مدير المثيل. رجاءً لا تنشئ حساب جديد." yourAccountSuspendedDescription: "عُلق الحساب بسبب انتهاك شروط خدمة المثيل و ما شابه. إذا أردت معرفة التفصيل تواصل مع مدير المثيل. رجاءً لا تنشئ حساب جديد."
accountDeleted: "حُذف الحساب" accountDeleted: "حُذف الحساب"
accountDeletedDescription: "حُذف هذا الحساب."
menu: "القائمة" menu: "القائمة"
divider: "فاصل" divider: "فاصل"
addItem: "إضافة عنصر" addItem: "إضافة عنصر"
@ -539,6 +553,7 @@ author: "الكاتب"
leaveConfirm: "لديك تغييرات غير محفوظة. أتريد المتابعة دون حفظها؟" leaveConfirm: "لديك تغييرات غير محفوظة. أتريد المتابعة دون حفظها؟"
manage: "إدارة " manage: "إدارة "
plugins: "الإضافات" plugins: "الإضافات"
preferencesBackups: "النُسخ الاحتياطية للإعدادات"
useFullReactionPicker: "استخدم الحجم الكامل لمنتقي التفاعلات" useFullReactionPicker: "استخدم الحجم الكامل لمنتقي التفاعلات"
width: "العرض" width: "العرض"
height: "الإرتفاع" height: "الإرتفاع"
@ -648,6 +663,7 @@ contact: "التواصل"
useSystemFont: "استخدم الخط الافتراضية للنظام" useSystemFont: "استخدم الخط الافتراضية للنظام"
clips: "مشابك" clips: "مشابك"
experimentalFeatures: "ميّزات اختبارية" experimentalFeatures: "ميّزات اختبارية"
experimental: "اختباري"
developer: "المطور" developer: "المطور"
makeExplorable: "أظهر الحساب في صفحة \"استكشاف\"" makeExplorable: "أظهر الحساب في صفحة \"استكشاف\""
makeExplorableDescription: "بتعطيل هذا الخيار لن يظهر حسابك في صفحة \"استكشاف\"" makeExplorableDescription: "بتعطيل هذا الخيار لن يظهر حسابك في صفحة \"استكشاف\""
@ -669,6 +685,7 @@ accentColor: "طابع لوني"
textColor: "لون النص" textColor: "لون النص"
saveAs: "احفظ كـ..." saveAs: "احفظ كـ..."
advanced: "متقدم" advanced: "متقدم"
advancedSettings: "إعدادات متقدمة"
value: "القيمة" value: "القيمة"
createdAt: "أُنشئ في" createdAt: "أُنشئ في"
updatedAt: "حُدّث في" updatedAt: "حُدّث في"
@ -733,6 +750,7 @@ popularPosts: "المشاركات المتداولة"
shareWithNote: "شاركه في ملاحظة" shareWithNote: "شاركه في ملاحظة"
ads: "الإعلانات" ads: "الإعلانات"
expiration: "ينتهي استطلاع الرأي في" expiration: "ينتهي استطلاع الرأي في"
startingperiod: "ابدأ"
memo: "تذكير" memo: "تذكير"
priority: "الأولوية" priority: "الأولوية"
high: "عالية" high: "عالية"
@ -763,6 +781,7 @@ lastCommunication: "آخر تواصل"
resolved: "عولج" resolved: "عولج"
unresolved: "لم يعالج" unresolved: "لم يعالج"
breakFollow: "إلغاء الاشتراك" breakFollow: "إلغاء الاشتراك"
breakFollowConfirm: "أمتأكد من إزالة المتابِع ؟"
itsOn: "مفعّل" itsOn: "مفعّل"
itsOff: "معطّل" itsOff: "معطّل"
emailRequiredForSignup: "عنوان البريد الإلكتروني إلزامي للتسجيل" emailRequiredForSignup: "عنوان البريد الإلكتروني إلزامي للتسجيل"
@ -777,6 +796,7 @@ muteThread: "اكتم النقاش"
unmuteThread: "ارفع الكتم عن النقاش" unmuteThread: "ارفع الكتم عن النقاش"
ffVisibility: "مرئية المتابِعين/المتابَعين" ffVisibility: "مرئية المتابِعين/المتابَعين"
ffVisibilityDescription: "يسمح لك بتحديد من يمكنهم رؤية متابِعيك ومتابَعيك." ffVisibilityDescription: "يسمح لك بتحديد من يمكنهم رؤية متابِعيك ومتابَعيك."
continueThread: "اعرض بقية النقاش"
deleteAccountConfirm: "سيحذف حسابك نهائيًا، أتريد المتابعة؟" deleteAccountConfirm: "سيحذف حسابك نهائيًا، أتريد المتابعة؟"
incorrectPassword: "كلمة السر خاطئة." incorrectPassword: "كلمة السر خاطئة."
voteConfirm: "متيقِّن من تصويتك لـ {choice}؟" voteConfirm: "متيقِّن من تصويتك لـ {choice}؟"
@ -798,25 +818,127 @@ tenMinutes: "10 دقائق"
oneHour: "ساعة" oneHour: "ساعة"
oneDay: "يوم" oneDay: "يوم"
oneWeek: "أسبوع" oneWeek: "أسبوع"
oneMonth: "شهر"
failedToFetchAccountInformation: "تعذر جلب معلومات الحساب" failedToFetchAccountInformation: "تعذر جلب معلومات الحساب"
cropNo: "استخدمها كما هي"
file: "الملفات" file: "الملفات"
recentNHours: "آخر {n} ساعة"
recentNDays: "آخر {n} أيام"
noEmailServerWarning: "خادم البريد غير مضبوط."
thereIsUnresolvedAbuseReportWarning: "توجد بلاغات غير معالجة."
recommended: "مقترح"
driveCapOverrideLabel: "غيّر حجم قرص التخزين لهذا المستخدم"
driveCapOverrideCaption: "أعد الحجم إلى القيمة الافتراضية بإدخال 0 أو أقل."
requireAdminForView: "لاستعراض هذه الصفحة وجب عليك الولوج كمدير."
typeToConfirm: "أدخل {x} للتأكيد"
deleteAccount: "احذف الحساب"
document: "التوثيق"
numberOfPageCache: "عدد الصفحات المخزنة مؤقتًا"
logoutConfirm: "أتريد الخروج؟"
lastActiveDate: "آخر استخدام"
statusbar: "شريط الحالة"
pleaseSelect: "حدد خيارًا"
reverse: "اقلب" reverse: "اقلب"
colored: "ملوّن" colored: "ملوّن"
label: "التسمية" label: "التسمية"
type: "نوع"
speed: "سرعة"
slow: "بطيء"
fast: "سريع"
sensitiveMediaDetection: "التعرف على المحتوى الحساس"
localOnly: "المحلي فقط" localOnly: "المحلي فقط"
failedToUpload: "فشل الرفع"
cannotUploadBecauseInappropriate: "تعذر رفع الملف لوجود محتوى حساس فيه."
cannotUploadBecauseNoFreeSpace: "تعذر رفع الملف لنقص مساحة التخزين."
cannotUploadBecauseExceedsFileSizeLimit: "تعذر رفع الملف بسبب تجاوز حجمه للحد المسموح"
beta: "بيتا"
navbar: "شريط التنقل"
shuffle: "خلط"
account: "الحسابات" account: "الحسابات"
move: "أنقل"
pushNotification: "إرسال الإشعارات"
subscribePushNotification: "فعّل إرسال الإشعارات"
unsubscribePushNotification: "عطل إرسال الإشعارات"
pushNotificationAlreadySubscribed: "إرسال الإشعارات مفعل سلفًا"
pushNotificationNotSupported: "متصفحك لا يدعم إرسال الإشعارات أو المثيل لا يدعمها."
sendPushNotificationReadMessage: "احذف الإشعارات فور قراءتها"
sendPushNotificationReadMessageCaption: "هذا قد يزيد من معدل استهلاك الطاقة لجهازك."
caption: "التعليق التوضيحي"
tools: "أدوات"
cannotLoad: "تعذر التحميل" cannotLoad: "تعذر التحميل"
like: "أعجبني" like: "أعجبني"
unlike: "ألغِ الإعجاب"
show: "المظهر" show: "المظهر"
neverShow: "لا تظهره مجددًا"
didYouLikeMisskey: "هل أعجبك ميسكي؟"
roles: "الأدوار"
role: "الدور"
noRole: "لم يُعثر على دور"
normalUser: "مستخدم عادي"
undefined: "غير معرّف"
color: "اللون" color: "اللون"
manageCustomEmojis: "إدارة الإيموجي المخصصة"
cannotPerformTemporary: "غير متاح مؤقتاً"
permissionDeniedError: "رُفضة العملية"
preset: "إعدادات مسبقة"
selectFromPresets: "اختر من الإعدادات المسبقة"
achievements: "الإنجازات"
gotInvalidResponseError: "استجابة غير متوقعة من الخادم"
gotInvalidResponseErrorDescription: "يتعذر الوصول إلى الخادم أوأنه يُصان، رجاءً حاول لاحقًا."
thisPostMayBeAnnoying: "هذا قد يزعج الآخرين."
thisPostMayBeAnnoyingHome: "أنشر في الخط الزمني الرئيس"
thisPostMayBeAnnoyingCancel: "ألغِ"
internalServerError: "خطأ داخلي في الخادم"
internalServerErrorDescription: "واجه الخادم خطأ غي متوقع."
copyErrorInfo: "انسخ تفاصيل الخطأ"
joinThisServer: "سجل في هذا المثيل"
exploreOtherServers: "اعثر على مثيل آخر"
disableFederationOk: "عطّل"
invitationRequiredToRegister: "هذا المثيل للمدعوين فقط. لتسجيل فيه تحتاج رمزًا صالحًا."
postToTheChannel: "انشر في قناة"
cannotBeChangedLater: "لا يمكن تغييره لاحقًا."
reactionAcceptance: "قبول التفاعلات"
rolesAssignedToMe: "الأدوار المسندة إلي"
resetPasswordConfirm: "هل تريد إعادة تعيين كلمة السر؟"
noteIdOrUrl: "معرف الملاحظة أو رابطها"
video: "فيديو"
videos: "فيديوهات"
accountMigration: "ترحيل الحساب"
accountMoved: "نقل هذا المستخدم حسابه:"
accountMovedShort: "رُحل هذا الحساب."
operationForbidden: "عملية ممنوعة"
forceShowAds: "أظهر الإعلانات التجارية دائما"
vertical: "عمودي"
horizontal: "جانبي" horizontal: "جانبي"
position: "الموضع"
serverRules: "قوانين الخادم"
pleaseConfirmBelowBeforeSignup: "رجاءً وافق على ما يلي قبل التسجيل."
pleaseAgreeAllToContinue: "للمتابعة وافق على الحقول أعلاه."
continue: "متابعة"
preservedUsernames: "أسماء المستخدمين المحجوزة"
preservedUsernamesDescription: "قائمة بأسماء المستخدمين المحجوزة كلٌ في سطر. لن يُقبل التسجيل بهذه الأسماء وستبقى محصورة على التسجيل اليدوي بواسطة المديرين. لن يتأثر المستخدمون الذين يملكون هذه الأسماء سلفًا."
archive: "الأرشيف"
youFollowing: "متابَع" youFollowing: "متابَع"
options: "خيارات"
_role: _role:
new: "دور جديد"
edit: "حرر الأدوار"
name: "اسم الدور"
description: "وصف الدور"
permission: "أذونات الدور"
assignTarget: "نوع الإسناد"
options: "خيارات"
policies: "السياسة العامة"
priority: "الأولوية" priority: "الأولوية"
_priority: _priority:
low: "منخفضة" low: "منخفضة"
middle: "متوسط" middle: "متوسط"
high: "عالية" high: "عالية"
_options:
canManageCustomEmojis: "إدارة الإيموجي المخصصة"
_condition:
isLocal: "مستخدم محلي"
isRemote: "مستخدم بعيد"
_emailUnavailable: _emailUnavailable:
used: "هذا البريد الإلكتروني مستخدم" used: "هذا البريد الإلكتروني مستخدم"
format: "صيغة البريد الإلكتروني غير صالحة" format: "صيغة البريد الإلكتروني غير صالحة"
@ -1064,6 +1186,7 @@ _widgets:
onlineUsers: "المتّصلون" onlineUsers: "المتّصلون"
jobQueue: "قائمة الانتظار" jobQueue: "قائمة الانتظار"
serverMetric: "إحصائيات الخادم" serverMetric: "إحصائيات الخادم"
userList: "قائمة المستخدمين"
_userList: _userList:
chooseList: "اختر قائمة" chooseList: "اختر قائمة"
_cw: _cw:
@ -1127,6 +1250,7 @@ _profile:
changeBanner: "غيّر اللافتة" changeBanner: "غيّر اللافتة"
_exportOrImport: _exportOrImport:
allNotes: "كل الملاحظات" allNotes: "كل الملاحظات"
favoritedNotes: " الملاحظات المفضلة"
followingList: "المتابَعون" followingList: "المتابَعون"
muteList: "المستخدمون المكتومون" muteList: "المستخدمون المكتومون"
blockingList: "المستخدمون المحجوبون" blockingList: "المستخدمون المحجوبون"
@ -1145,6 +1269,8 @@ _charts:
notesTotal: "إجمالي الملاحظات" notesTotal: "إجمالي الملاحظات"
filesIncDec: "تباين عدد الملفات" filesIncDec: "تباين عدد الملفات"
filesTotal: "العدد الإجمالي للملفات" filesTotal: "العدد الإجمالي للملفات"
storageUsageIncDec: "التباين في استغلال مساحة التخزين"
storageUsageTotal: "اجمالي مساحة التخزين المستغلة"
_instanceCharts: _instanceCharts:
requests: "الطلبات" requests: "الطلبات"
users: "تباين عدد المستخدمين" users: "تباين عدد المستخدمين"
@ -1264,3 +1390,5 @@ _deck:
_webhookSettings: _webhookSettings:
name: "الإسم" name: "الإسم"
active: "مفعّل" active: "مفعّل"
_events:
reaction: "عند تلقي تفاعل"

View file

@ -52,6 +52,8 @@ addToList: "Zu Liste hinzufügen"
sendMessage: "Nachricht senden" sendMessage: "Nachricht senden"
copyRSS: "RSS kopieren" copyRSS: "RSS kopieren"
copyUsername: "Benutzernamen kopieren" copyUsername: "Benutzernamen kopieren"
copyUserId: "Benutzer-ID kopieren"
copyNoteId: "Notiz-ID kopieren"
searchUser: "Nach einem Benutzer suchen" searchUser: "Nach einem Benutzer suchen"
reply: "Antworten" reply: "Antworten"
loadMore: "Mehr laden" loadMore: "Mehr laden"
@ -790,6 +792,7 @@ noMaintainerInformationWarning: "Betreiberinformationen sind nicht konfiguriert.
noBotProtectionWarning: "Schutz vor Bots ist nicht konfiguriert." noBotProtectionWarning: "Schutz vor Bots ist nicht konfiguriert."
configure: "Konfigurieren" configure: "Konfigurieren"
postToGallery: "Neuen Galeriebeitrag erstellen" postToGallery: "Neuen Galeriebeitrag erstellen"
postToHashtag: "Mit diesem Hashtag senden"
gallery: "Galerie" gallery: "Galerie"
recentPosts: "Neue Beiträge" recentPosts: "Neue Beiträge"
popularPosts: "Beliebte Beiträge" popularPosts: "Beliebte Beiträge"
@ -823,6 +826,7 @@ translatedFrom: "Aus {x} übersetzt"
accountDeletionInProgress: "Die Löschung deines Benutzerkontos ist momentan in Bearbeitung." accountDeletionInProgress: "Die Löschung deines Benutzerkontos ist momentan in Bearbeitung."
usernameInfo: "Ein Name, durch den dein Benutzerkonto auf diesem Server identifiziert werden kann. Du kannst das Alphabet (a~z, A~Z), Ziffern (0~9) oder Unterstriche (_) verwenden. Benutzernamen können später nicht geändert werden." usernameInfo: "Ein Name, durch den dein Benutzerkonto auf diesem Server identifiziert werden kann. Du kannst das Alphabet (a~z, A~Z), Ziffern (0~9) oder Unterstriche (_) verwenden. Benutzernamen können später nicht geändert werden."
aiChanMode: "Ai-Modus" aiChanMode: "Ai-Modus"
devMode: "Entwicklermodus"
keepCw: "Inhaltswarnungen beibehalten" keepCw: "Inhaltswarnungen beibehalten"
pubSub: "Pub/Sub Benutzerkonten" pubSub: "Pub/Sub Benutzerkonten"
lastCommunication: "Letzte Kommunikation" lastCommunication: "Letzte Kommunikation"
@ -832,6 +836,8 @@ breakFollow: "Follower entfernen"
breakFollowConfirm: "Diesen Follower wirklich entfernen?" breakFollowConfirm: "Diesen Follower wirklich entfernen?"
itsOn: "Eingeschaltet" itsOn: "Eingeschaltet"
itsOff: "Ausgeschaltet" itsOff: "Ausgeschaltet"
on: "An"
off: "Aus"
emailRequiredForSignup: "Angabe einer Email-Adresse als benötigt markieren" emailRequiredForSignup: "Angabe einer Email-Adresse als benötigt markieren"
unread: "Ungelesen" unread: "Ungelesen"
filter: "Filter" filter: "Filter"
@ -986,6 +992,8 @@ cannotBeChangedLater: "Kann später nicht mehr geändert werden."
reactionAcceptance: "Reaktionsannahme" reactionAcceptance: "Reaktionsannahme"
likeOnly: "Nur \"Gefällt mir\"" likeOnly: "Nur \"Gefällt mir\""
likeOnlyForRemote: "Nur \"Gefällt mir\" für fremde Instanzen" likeOnlyForRemote: "Nur \"Gefällt mir\" für fremde Instanzen"
nonSensitiveOnly: "Keine Sensitiven"
nonSensitiveOnlyForLocalLikeOnlyForRemote: "Keine Sensitiven (Nur \"Gefällt mir\" von fremden Instanzen)"
rolesAssignedToMe: "Mir zugewiesene Rollen" rolesAssignedToMe: "Mir zugewiesene Rollen"
resetPasswordConfirm: "Wirklich Passwort zurücksetzen?" resetPasswordConfirm: "Wirklich Passwort zurücksetzen?"
sensitiveWords: "Sensible Wörter" sensitiveWords: "Sensible Wörter"
@ -1043,6 +1051,15 @@ preventAiLearning: "Verwendung in machinellem Lernen (Generative bzw. Prediktive
preventAiLearningDescription: "Fordert Crawler auf, gepostetes Text- oder Bildmaterial usw. nicht in Datensätzen für maschinelles Lernen (Generative bzw. Prediktive AI/KI) zu verwenden. Dies wird durch das Hinzufügen einer \"noai\"-Flag in der HTML-Antwort des jeweiligen Inhalts erreicht. Da diese Flag jedoch ignoriert werden kann, ist eine vollständige Verhinderung hierdurch nicht möglich." preventAiLearningDescription: "Fordert Crawler auf, gepostetes Text- oder Bildmaterial usw. nicht in Datensätzen für maschinelles Lernen (Generative bzw. Prediktive AI/KI) zu verwenden. Dies wird durch das Hinzufügen einer \"noai\"-Flag in der HTML-Antwort des jeweiligen Inhalts erreicht. Da diese Flag jedoch ignoriert werden kann, ist eine vollständige Verhinderung hierdurch nicht möglich."
options: "Optionen" options: "Optionen"
specifyUser: "Spezifischer Benutzer" specifyUser: "Spezifischer Benutzer"
failedToPreviewUrl: "Vorschau nicht anzeigbar"
update: "Aktualisieren"
rolesThatCanBeUsedThisEmojiAsReaction: "Rollen, die dieses Emoji als Reaktion verwenden können"
rolesThatCanBeUsedThisEmojiAsReactionEmptyDescription: "Sind keine Rollen angegeben, kann jeder dieses Emoji als Reaktion verwenden."
rolesThatCanBeUsedThisEmojiAsReactionPublicRoleWarn: "Diese Rollen müssen öffentlich sein."
cancelReactionConfirm: "Möchtest du deine Reaktion wirklich löschen?"
changeReactionConfirm: "Möchtest du deine Reaktion wirklich ändern?"
later: "Später"
goToMisskey: "Zu Misskey"
_initialAccountSetting: _initialAccountSetting:
accountCreated: "Dein Konto wurde erfolgreich erstellt!" accountCreated: "Dein Konto wurde erfolgreich erstellt!"
letsStartAccountSetup: "Lass uns nun dein Konto einrichten." letsStartAccountSetup: "Lass uns nun dein Konto einrichten."
@ -1057,6 +1074,7 @@ _initialAccountSetting:
haveFun: "Viel Spaß mit {name}!" haveFun: "Viel Spaß mit {name}!"
ifYouNeedLearnMore: "Besuche {link}, falls du mehr über {name} (Misskey) lernen möchtest." ifYouNeedLearnMore: "Besuche {link}, falls du mehr über {name} (Misskey) lernen möchtest."
skipAreYouSure: "Die Kontoeinrichtung wirklich überspringen?" skipAreYouSure: "Die Kontoeinrichtung wirklich überspringen?"
laterAreYouSure: "Die Kontoeinrichtung wirklich später erledigen?"
_serverRules: _serverRules:
description: "Eine Reihe von Regeln, die vor der Registrierung angezeigt werden. Eine Zusammenfassung der Nutzungsbedingungen anzuzeigen ist empfohlen." description: "Eine Reihe von Regeln, die vor der Registrierung angezeigt werden. Eine Zusammenfassung der Nutzungsbedingungen anzuzeigen ist empfohlen."
_accountMigration: _accountMigration:

View file

@ -52,6 +52,8 @@ addToList: "Add to list"
sendMessage: "Send a message" sendMessage: "Send a message"
copyRSS: "Copy RSS" copyRSS: "Copy RSS"
copyUsername: "Copy username" copyUsername: "Copy username"
copyUserId: "Copy user ID"
copyNoteId: "Copy note ID"
searchUser: "Search for a user" searchUser: "Search for a user"
reply: "Reply" reply: "Reply"
loadMore: "Load more" loadMore: "Load more"
@ -790,6 +792,7 @@ noMaintainerInformationWarning: "Maintainer information is not configured."
noBotProtectionWarning: "Bot protection is not configured." noBotProtectionWarning: "Bot protection is not configured."
configure: "Configure" configure: "Configure"
postToGallery: "Create new gallery post" postToGallery: "Create new gallery post"
postToHashtag: "Post to this hashtag"
gallery: "Gallery" gallery: "Gallery"
recentPosts: "Recent posts" recentPosts: "Recent posts"
popularPosts: "Popular posts" popularPosts: "Popular posts"
@ -823,6 +826,7 @@ translatedFrom: "Translated from {x}"
accountDeletionInProgress: "Account deletion is currently in progress" accountDeletionInProgress: "Account deletion is currently in progress"
usernameInfo: "A name that identifies your account from others on this server. You can use the alphabet (a~z, A~Z), digits (0~9) or underscores (_). Usernames cannot be changed later." usernameInfo: "A name that identifies your account from others on this server. You can use the alphabet (a~z, A~Z), digits (0~9) or underscores (_). Usernames cannot be changed later."
aiChanMode: "Ai Mode" aiChanMode: "Ai Mode"
devMode: "Developer mode"
keepCw: "Keep content warnings" keepCw: "Keep content warnings"
pubSub: "Pub/Sub Accounts" pubSub: "Pub/Sub Accounts"
lastCommunication: "Last communication" lastCommunication: "Last communication"
@ -832,6 +836,8 @@ breakFollow: "Remove follower"
breakFollowConfirm: "Really remove this follower?" breakFollowConfirm: "Really remove this follower?"
itsOn: "Enabled" itsOn: "Enabled"
itsOff: "Disabled" itsOff: "Disabled"
on: "On"
off: "Off"
emailRequiredForSignup: "Require email address for sign-up" emailRequiredForSignup: "Require email address for sign-up"
unread: "Unread" unread: "Unread"
filter: "Filter" filter: "Filter"
@ -986,6 +992,8 @@ cannotBeChangedLater: "This cannot be changed later."
reactionAcceptance: "Reaction Acceptance" reactionAcceptance: "Reaction Acceptance"
likeOnly: "Only likes" likeOnly: "Only likes"
likeOnlyForRemote: "Only likes for remote instances" likeOnlyForRemote: "Only likes for remote instances"
nonSensitiveOnly: "Non-sensitive only"
nonSensitiveOnlyForLocalLikeOnlyForRemote: "Non-sensitive only (Only likes from remote)"
rolesAssignedToMe: "Roles assigned to me" rolesAssignedToMe: "Roles assigned to me"
resetPasswordConfirm: "Really reset your password?" resetPasswordConfirm: "Really reset your password?"
sensitiveWords: "Sensitive words" sensitiveWords: "Sensitive words"
@ -1043,6 +1051,15 @@ preventAiLearning: "Reject usage in Machine Learning (Generative AI)"
preventAiLearningDescription: "Requests crawlers to not use posted text or image material etc. in machine learning (Predictive / Generative AI) data sets. This is achieved by adding a \"noai\" HTML-Response flag to the respective content. A complete prevention can however not be achieved through this flag, as it may simply be ignored." preventAiLearningDescription: "Requests crawlers to not use posted text or image material etc. in machine learning (Predictive / Generative AI) data sets. This is achieved by adding a \"noai\" HTML-Response flag to the respective content. A complete prevention can however not be achieved through this flag, as it may simply be ignored."
options: "Options" options: "Options"
specifyUser: "Specific user" specifyUser: "Specific user"
failedToPreviewUrl: "Could not preview"
update: "Update"
rolesThatCanBeUsedThisEmojiAsReaction: "Roles that can use this emoji as reaction"
rolesThatCanBeUsedThisEmojiAsReactionEmptyDescription: "If no roles are specified, anyone can use this emoji as reaction."
rolesThatCanBeUsedThisEmojiAsReactionPublicRoleWarn: "These roles must be public."
cancelReactionConfirm: "Really delete your reaction?"
changeReactionConfirm: "Really change your reaction?"
later: "Later"
goToMisskey: "To Misskey"
_initialAccountSetting: _initialAccountSetting:
accountCreated: "Your account was successfully created!" accountCreated: "Your account was successfully created!"
letsStartAccountSetup: "For starters, let's set up your profile." letsStartAccountSetup: "For starters, let's set up your profile."
@ -1057,6 +1074,7 @@ _initialAccountSetting:
haveFun: "Enjoy {name}!" haveFun: "Enjoy {name}!"
ifYouNeedLearnMore: "If you'd like to learn more about how to use {name} (Misskey), please visit {link}." ifYouNeedLearnMore: "If you'd like to learn more about how to use {name} (Misskey), please visit {link}."
skipAreYouSure: "Really skip profile setup?" skipAreYouSure: "Really skip profile setup?"
laterAreYouSure: "Really do profile setup later?"
_serverRules: _serverRules:
description: "A set of rules to be displayed before registration. Setting a summary of the Terms of Service is recommended." description: "A set of rules to be displayed before registration. Setting a summary of the Terms of Service is recommended."
_accountMigration: _accountMigration:

View file

@ -20,6 +20,7 @@ noNotes: "No hay notas"
noNotifications: "No hay notificaciones" noNotifications: "No hay notificaciones"
instance: "Instancia" instance: "Instancia"
settings: "Configuración" settings: "Configuración"
notificationSettings: "Configurar las notificaciones"
basicSettings: "Configuración Básica" basicSettings: "Configuración Básica"
otherSettings: "Configuración avanzada" otherSettings: "Configuración avanzada"
openInWindow: "Abrir en una ventana" openInWindow: "Abrir en una ventana"
@ -262,8 +263,10 @@ noMoreHistory: "El historial se ha acabado"
startMessaging: "Iniciar chat" startMessaging: "Iniciar chat"
nUsersRead: "Leído por {n} personas" nUsersRead: "Leído por {n} personas"
agreeTo: "De acuerdo con {0}" agreeTo: "De acuerdo con {0}"
agree: "De acuerdo."
agreeBelow: "Estoy de acuerdo con lo siguiente" agreeBelow: "Estoy de acuerdo con lo siguiente"
basicNotesBeforeCreateAccount: "Notas básicas" basicNotesBeforeCreateAccount: "Notas básicas"
termsOfService: "Términos y condiciones"
start: "Comenzar" start: "Comenzar"
home: "Inicio" home: "Inicio"
remoteUserCaution: "Para el usuario remoto, la información está incompleta" remoteUserCaution: "Para el usuario remoto, la información está incompleta"
@ -473,6 +476,8 @@ createAccount: "Crear cuenta"
existingAccount: "Cuenta existente" existingAccount: "Cuenta existente"
regenerate: "Regenerar" regenerate: "Regenerar"
fontSize: "Tamaño de la letra" fontSize: "Tamaño de la letra"
mediaListWithOneImageAppearance: "Altura de la lista de medios con una sola imagen."
limitTo: "{x} hasta un máximo de"
noFollowRequests: "No hay solicitudes de seguimiento" noFollowRequests: "No hay solicitudes de seguimiento"
openImageInNewTab: "Abrir imagen en nueva pestaña" openImageInNewTab: "Abrir imagen en nueva pestaña"
dashboard: "Panel de control" dashboard: "Panel de control"
@ -555,6 +560,7 @@ accountDeletedDescription: "Esta cuenta ha sido borrada."
menu: "Menú" menu: "Menú"
divider: "Divisor" divider: "Divisor"
addItem: "Agregar elemento" addItem: "Agregar elemento"
rearrange: "Ordenar"
relays: "Relés" relays: "Relés"
addRelay: "Agregar relé" addRelay: "Agregar relé"
inboxUrl: "Inbox URL" inboxUrl: "Inbox URL"
@ -698,6 +704,8 @@ contact: "Contacto"
useSystemFont: "Utilizar la tipografía por defecto del sistema" useSystemFont: "Utilizar la tipografía por defecto del sistema"
clips: "Clip" clips: "Clip"
experimentalFeatures: "Características experimentales" experimentalFeatures: "Características experimentales"
experimental: "Función experimental"
thisIsExperimentalFeature: "Se trata de una función experimental. Las especificaciones pueden cambiar o puede que no funcione correctamente."
developer: "Desarrolladores" developer: "Desarrolladores"
makeExplorable: "Hacer visible la cuenta en \"Explorar\"" makeExplorable: "Hacer visible la cuenta en \"Explorar\""
makeExplorableDescription: "Si desactiva esta opción, su cuenta no aparecerá en la sección \"Explorar\"." makeExplorableDescription: "Si desactiva esta opción, su cuenta no aparecerá en la sección \"Explorar\"."
@ -991,9 +999,12 @@ largeNoteReactions: "Agrandar las reacciones de las notas"
noteIdOrUrl: "ID o URL de la nota" noteIdOrUrl: "ID o URL de la nota"
accountMigration: "Migración de cuenta" accountMigration: "Migración de cuenta"
accountMoved: "Este usuario se ha mudado a una nueva cuenta:" accountMoved: "Este usuario se ha mudado a una nueva cuenta:"
accountMovedShort: "Esta cuenta ha sido migrada."
horizontal: "Horizontal" horizontal: "Horizontal"
youFollowing: "Siguiendo" youFollowing: "Siguiendo"
options: "Opción" options: "Opción"
_initialAccountSetting:
accountCreated: "¡La cuenta ha sido creada!"
_accountMigration: _accountMigration:
moveFrom: "Trasladar de otra cuenta a ésta" moveFrom: "Trasladar de otra cuenta a ésta"
moveFromLabel: "Cuenta desde la que se realiza el traslado:" moveFromLabel: "Cuenta desde la que se realiza el traslado:"
@ -1174,6 +1185,8 @@ _achievements:
_client30min: _client30min:
title: "Un descansito" title: "Un descansito"
description: "30 minutos dedicados a Misskey" description: "30 minutos dedicados a Misskey"
_client60min:
title: "Viendo mucho Misskey."
_noteDeletedWithin1min: _noteDeletedWithin1min:
title: "Ah... Mejor no..." title: "Ah... Mejor no..."
description: "Borrar una nota antes que de pase 1 minuto" description: "Borrar una nota antes que de pase 1 minuto"

View file

@ -908,12 +908,14 @@ neverShow: "Ne plus afficher"
remindMeLater: "Peut-être plus tard" remindMeLater: "Peut-être plus tard"
roles: "Rôles" roles: "Rôles"
role: "Rôles" role: "Rôles"
noRole: "Aucun rôle"
normalUser: "Simple utilisateur·rice" normalUser: "Simple utilisateur·rice"
assign: "Attribuer" assign: "Attribuer"
color: "Couleur" color: "Couleur"
manageCustomEmojis: "Gestion des émojis personnalisés" manageCustomEmojis: "Gestion des émojis personnalisés"
preset: "Préréglage" preset: "Préréglage"
selectFromPresets: "Sélectionner à partir des préréglages" selectFromPresets: "Sélectionner à partir des préréglages"
thisPostMayBeAnnoying: "Cette note peut gêner d'autres personnes."
thisPostMayBeAnnoyingCancel: "Annuler" thisPostMayBeAnnoyingCancel: "Annuler"
license: "Licence" license: "Licence"
video: "Vidéo" video: "Vidéo"
@ -921,6 +923,7 @@ videos: "Vidéos"
dataSaver: "Économiseur de données" dataSaver: "Économiseur de données"
accountMigration: "Migration de compte" accountMigration: "Migration de compte"
accountMoved: "Cet·te utilisateur·rice a migré son compte vers :" accountMoved: "Cet·te utilisateur·rice a migré son compte vers :"
addMemo: "Ajouter un mémo"
notificationDisplay: "Style des notifications" notificationDisplay: "Style des notifications"
leftTop: "En haut à gauche" leftTop: "En haut à gauche"
rightTop: "En haut à droite" rightTop: "En haut à droite"
@ -935,6 +938,8 @@ _achievements:
_notes1: _notes1:
description: "Publiez votre première note" description: "Publiez votre première note"
flavor: "Passez un bon moment avec Misskey !" flavor: "Passez un bon moment avec Misskey !"
_notes100:
title: "Beaucoup de notes"
_notes100000: _notes100000:
title: "ALL YOUR NOTE ARE BELONG TO US" title: "ALL YOUR NOTE ARE BELONG TO US"
_login3: _login3:
@ -985,6 +990,8 @@ _achievements:
title: "Joyeux Anniversaire !" title: "Joyeux Anniversaire !"
_loggedInOnNewYearsDay: _loggedInOnNewYearsDay:
title: "Bonne année !" title: "Bonne année !"
_cookieClicked:
flavor: "Attendez une minute, vous êtes sur le mauvais site web ?"
_role: _role:
assignTarget: "Attribuer" assignTarget: "Attribuer"
priority: "Priorité" priority: "Priorité"

View file

@ -20,6 +20,7 @@ noNotes: "Tidak ada catatan"
noNotifications: "Tidak ada pemberitahuan" noNotifications: "Tidak ada pemberitahuan"
instance: "Instansi" instance: "Instansi"
settings: "Pengaturan" settings: "Pengaturan"
notificationSettings: "Atur Notifikasi"
basicSettings: "Pengaturan umum" basicSettings: "Pengaturan umum"
otherSettings: "Pengaturan lainnya" otherSettings: "Pengaturan lainnya"
openInWindow: "Buka di jendela" openInWindow: "Buka di jendela"
@ -261,8 +262,10 @@ noMoreHistory: "Tidak ada sejarah lagi"
startMessaging: "Mulai mengirim pesan" startMessaging: "Mulai mengirim pesan"
nUsersRead: "Dibaca oleh {n}" nUsersRead: "Dibaca oleh {n}"
agreeTo: "Saya setuju kepada {0}" agreeTo: "Saya setuju kepada {0}"
agree: "Setuju"
agreeBelow: "Saya setuju dengan di bawah ini" agreeBelow: "Saya setuju dengan di bawah ini"
basicNotesBeforeCreateAccount: "Catatan penting" basicNotesBeforeCreateAccount: "Catatan penting"
termsOfService: "Syarat dan ketentuan"
start: "Mulai" start: "Mulai"
home: "Beranda" home: "Beranda"
remoteUserCaution: "Informasi ini mungkin tidak mutakhir, karena pengguna ini berasal dari instansi luar." remoteUserCaution: "Informasi ini mungkin tidak mutakhir, karena pengguna ini berasal dari instansi luar."

View file

@ -8,7 +8,7 @@ search: "探す"
notifications: "通知" notifications: "通知"
username: "ユーザー名" username: "ユーザー名"
password: "パスワード" password: "パスワード"
forgotPassword: "パスワード忘れてもうた" forgotPassword: "パスワード忘れん?"
fetchingAsApObject: "今ちと連合に照会しとるで" fetchingAsApObject: "今ちと連合に照会しとるで"
ok: "ええで" ok: "ええで"
gotIt: "ほい" gotIt: "ほい"

View file

@ -505,7 +505,7 @@ objectStoragePrefixDesc: "이 Prefix 의 디렉토리 아래에 파일이 저장
objectStorageEndpoint: "Endpoint" objectStorageEndpoint: "Endpoint"
objectStorageEndpointDesc: "AWS S3의 경우 공란, 다른 서비스의 경우 각 서비스의 가이드에 맞게 endpoint를 설정해주세요. '<host>' 혹은 '<host>:<port>' 와 같이 지정합니다." objectStorageEndpointDesc: "AWS S3의 경우 공란, 다른 서비스의 경우 각 서비스의 가이드에 맞게 endpoint를 설정해주세요. '<host>' 혹은 '<host>:<port>' 와 같이 지정합니다."
objectStorageRegion: "Region" objectStorageRegion: "Region"
objectStorageRegionDesc: "'xx-east-1'와 같이 region을 지정해주세요. 사용하는 서비스에 region 개념이 없는 경우, 비워 두거나 'us-east-1'으로 설정해 주세요." objectStorageRegionDesc: "'xx-east-1'와 같이 region을 지정해주세요. 사용하는 서비스에 region 개념이 없는 경우 'us-east-1'으로 설정해 주세요. AWS 설정 파일 또는 환경 변수를 참조할 경우에는 비워주세요."
objectStorageUseSSL: "SSL 사용" objectStorageUseSSL: "SSL 사용"
objectStorageUseSSLDesc: "API 호출시 HTTPS 를 사용하지 않는 경우 OFF 로 설정해 주세요" objectStorageUseSSLDesc: "API 호출시 HTTPS 를 사용하지 않는 경우 OFF 로 설정해 주세요"
objectStorageUseProxy: "연결에 프록시를 사용" objectStorageUseProxy: "연결에 프록시를 사용"
@ -990,6 +990,7 @@ rolesAssignedToMe: "나에게 할당된 역할"
resetPasswordConfirm: "비밀번호를 재설정하시겠습니까?" resetPasswordConfirm: "비밀번호를 재설정하시겠습니까?"
sensitiveWords: "민감한 단어" sensitiveWords: "민감한 단어"
sensitiveWordsDescription: "설정한 단어가 포함된 노트의 공개 범위를 '홈'으로 강제합니다. 개행으로 구분하여 여러 개를 지정할 수 있습니다." sensitiveWordsDescription: "설정한 단어가 포함된 노트의 공개 범위를 '홈'으로 강제합니다. 개행으로 구분하여 여러 개를 지정할 수 있습니다."
sensitiveWordsDescription2: "공백으로 구분하면 AND 지정이 되며, 키워드를 슬래시로 둘러싸면 정규 표현식이 됩니다."
notesSearchNotAvailable: "노트 검색을 이용하실 수 없습니다." notesSearchNotAvailable: "노트 검색을 이용하실 수 없습니다."
license: "라이선스" license: "라이선스"
unfavoriteConfirm: "즐겨찾기를 해제하시겠습니까?" unfavoriteConfirm: "즐겨찾기를 해제하시겠습니까?"
@ -1038,12 +1039,16 @@ thisChannelArchived: "이 채널은 아카이브되었습니다."
displayOfNote: "노트 표시" displayOfNote: "노트 표시"
initialAccountSetting: "초기 설정" initialAccountSetting: "초기 설정"
youFollowing: "팔로잉" youFollowing: "팔로잉"
preventAiLearning: "기계학습(생성형 AI)으로의 사용을 거부"
preventAiLearningDescription: "외부의 문장 생성 AI나 이미지 생성 AI에 대해 제출한 노트나 이미지 등의 콘텐츠를 학습의 대상으로 사용하지 않도록 요구합니다. 다만, 이 요구사항을 지킬 의무는 없기 때문에 학습을 완전히 방지하는 것은 아닙니다."
options: "옵션" options: "옵션"
specifyUser: "사용자 지정"
_initialAccountSetting: _initialAccountSetting:
accountCreated: "계정 생성이 완료되었습니다!" accountCreated: "계정 생성이 완료되었습니다!"
letsStartAccountSetup: "계정의 초기 설정을 진행합니다." letsStartAccountSetup: "계정의 초기 설정을 진행합니다."
letsFillYourProfile: "우선 나의 프로필을 설정해 보아요." letsFillYourProfile: "우선 나의 프로필을 설정해 보아요."
profileSetting: "프로필 설정" profileSetting: "프로필 설정"
privacySetting: "\n프라이버시설정"
theseSettingsCanEditLater: "이 설정들은 나중에도 변경할 수 있습니다." theseSettingsCanEditLater: "이 설정들은 나중에도 변경할 수 있습니다."
youCanEditMoreSettingsInSettingsPageLater: "이 외에도 '설정' 페이지에서 다양한 설정을 나의 입맛에 맛게 조절할 수 있습니다. 꼭 확인해 보세요!" youCanEditMoreSettingsInSettingsPageLater: "이 외에도 '설정' 페이지에서 다양한 설정을 나의 입맛에 맛게 조절할 수 있습니다. 꼭 확인해 보세요!"
followUsers: "관심사가 맞는 유저를 팔로우하여 타임라인을 가꾸어 봅시다." followUsers: "관심사가 맞는 유저를 팔로우하여 타임라인을 가꾸어 봅시다."
@ -1491,7 +1496,7 @@ _menuDisplay:
hide: "숨기기" hide: "숨기기"
_wordMute: _wordMute:
muteWords: "뮤트할 단어" muteWords: "뮤트할 단어"
muteWordsDescription: "공백으로 구분하는 경우 AND, 줄바꿈으로 구분하는 경우 OR로 지정됩니다" muteWordsDescription: "공백으로 구분하는 경우 AND, 줄바꿈으로 구분하는 경우 OR로 지정됩니다."
muteWordsDescription2: "정규 표현식을 사용하려면 키워드를 빗금표(/)로 감싸 주세요." muteWordsDescription2: "정규 표현식을 사용하려면 키워드를 빗금표(/)로 감싸 주세요."
softDescription: "지정한 조건의 노트를 타임라인에서 숨깁니다." softDescription: "지정한 조건의 노트를 타임라인에서 숨깁니다."
hardDescription: "지정한 조건의 노트를 타임라인에 추가하지 않습니다. 타임라인에 추가되지 않은 노트는 조건을 변경해도 표시되지 않습니다." hardDescription: "지정한 조건의 노트를 타임라인에 추가하지 않습니다. 타임라인에 추가되지 않은 노트는 조건을 변경해도 표시되지 않습니다."

View file

@ -1,21 +1,27 @@
--- ---
_lang_: "Norsk Bokmål" _lang_: "Norsk Bokmål"
monthAndDay: "{day}-{month}"
search: "Søk" search: "Søk"
notifications: "Varsler" notifications: "Varsler"
username: "Brukernavn" username: "Brukernavn"
password: "Passord" password: "Passord"
forgotPassword: "Glemt passord" forgotPassword: "Glemt passord"
fetchingAsApObject: "Henter fra Fediverse..."
ok: "OK" ok: "OK"
gotIt: "Skjønner" gotIt: "Skjønner"
cancel: "Avbryt" cancel: "Avbryt"
noThankYou: "Avbryt" noThankYou: "Avbryt"
enterUsername: "Skriv inn brukernavn"
noNotifications: "Ingen varsler" noNotifications: "Ingen varsler"
instance: "Server" instance: "Server"
settings: "Innstillinger" settings: "Innstillinger"
notificationSettings: "Varslingsinnstillinger" notificationSettings: "Varslingsinnstillinger"
basicSettings: "Grunnleggende innstillinger"
otherSettings: "Andre innstillinger" otherSettings: "Andre innstillinger"
openInWindow: "Åpne i vindu"
profile: "Profil" profile: "Profil"
timeline: "Tidslinje" timeline: "Tidslinje"
noAccountDescription: "Denne brukeren har ikke skrevet sin bio ennå."
login: "Logg inn" login: "Logg inn"
loggingIn: "Logget inn" loggingIn: "Logget inn"
logout: "Logg ut" logout: "Logg ut"
@ -27,6 +33,9 @@ addUser: "Legg til bruker"
favorite: "Favoritt" favorite: "Favoritt"
favorites: "Favoritter" favorites: "Favoritter"
unfavorite: "Fjern favoritt" unfavorite: "Fjern favoritt"
favorited: "Lagt til i favoritter."
alreadyFavorited: "Allerede lagt til i favoritter."
cantFavorite: "Kunne ikke legge til i favoritter."
pin: "Fest" pin: "Fest"
unpin: "Opphev festing" unpin: "Opphev festing"
copyContent: "Kopier innhold" copyContent: "Kopier innhold"
@ -42,8 +51,16 @@ reply: "Svar"
loadMore: "Vis mer" loadMore: "Vis mer"
showMore: "Vis mer" showMore: "Vis mer"
showLess: "Lukk" showLess: "Lukk"
youGotNewFollower: "fulgte deg"
followRequestAccepted: "Følgeforespørsel akseptert"
importAndExport: "Importer og eksporter"
import: "Importer"
export: "Eksporter"
files: "Filer" files: "Filer"
download: "Nedlastinger" download: "Nedlastinger"
driveFileDeleteConfirm: "Er du sikker på at du vil slette \"{name}\"? Det vil også forsvinne fra alt innhold som bruker det."
unfollowConfirm: "Er du sikker på at du vil slutte å følge {name}?"
importRequested: "Du har bedt om import. Dette kan ta en stund."
lists: "Lister" lists: "Lister"
noLists: "Ingen lister" noLists: "Ingen lister"
following: "Følg" following: "Følg"
@ -51,14 +68,18 @@ followers: "Følgere"
followsYou: "Følger deg" followsYou: "Følger deg"
createList: "Opprett liste" createList: "Opprett liste"
error: "Feil" error: "Feil"
somethingHappened: "En feil har oppstått"
retry: "Prøv igjen" retry: "Prøv igjen"
pageLoadError: "Kunne ikke hente side." pageLoadError: "Kunne ikke hente side."
serverIsDead: "Denne serveren svarer ikke. Vennligst vent en stund og prøv igjen."
enterListName: "Skriv inn et navn på listen"
privacy: "Personvern" privacy: "Personvern"
follow: "Følg" follow: "Følg"
followRequest: "Følgeforespørsel" followRequest: "Følgeforespørsel"
followRequests: "Følgeforespørsel" followRequests: "Følgeforespørsel"
unfollow: "Avfølg" unfollow: "Avfølg"
followRequestPending: "Venter på godkjenning" followRequestPending: "Venter på godkjenning"
enterEmoji: "Skriv inn en emoji"
quote: "Sitat" quote: "Sitat"
pinned: "Fest" pinned: "Fest"
you: "Du" you: "Du"
@ -66,49 +87,90 @@ clickToShow: "Klikk for å vise"
add: "Legg til" add: "Legg til"
reaction: "Reaksjon" reaction: "Reaksjon"
reactions: "Reaksjoner" reactions: "Reaksjoner"
reactionSetting: "Reaksjoner som vises i reaksjonsvelgeren"
reactionSettingDescription2: "Dra for å endre rekkefølgen, klikk for å slette, trykk \"+\" for å legge til."
attachCancel: "Fjern vedlegg"
enterFileName: "Skriv inn filnavn"
mute: "Skjul" mute: "Skjul"
unmute: "Vis" unmute: "Vis"
block: "Blokker" block: "Blokker"
unblock: "Opphev blokkering" unblock: "Opphev blokkering"
suspend: "Suspender"
blockConfirm: "Blokker?" blockConfirm: "Blokker?"
unblockConfirm: "Er du sikker på at du vil oppheve blokkeringen av denne kontoen?"
suspendConfirm: "Er du sikker på at du vil suspendere denne kontoen?"
selectList: "Velg liste" selectList: "Velg liste"
selectChannel: "Velg kanal" selectChannel: "Velg kanal"
selectAntenna: "Velg en antenne"
selectWidget: "Velg en widget"
editWidgets: "Rediger widgeter"
editWidgetsExit: "Ferdig"
emoji: "Emoji" emoji: "Emoji"
emojis: "Emojier" emojis: "Emojier"
addEmoji: "Legg til emoji" addEmoji: "Legg til emoji"
settingGuide: "Anbefalte innstillinger"
flagAsBot: "Merk denne kontoen som en bot"
flagAsBotDescription: "Aktiver dette alternativet hvis denne kontoen styres av et program. Hvis det er aktivert, vil det fungere som et flagg for andre utviklere for å forhindre endeløse interaksjonskjeder med andre roboter og justere Misskeys interne systemer til å behandle denne kontoen som en bot."
flagAsCat: "Merk denne kontoen som en katt"
flagAsCatDescription: "Aktiver dette alternativet for å merke denne kontoen som en katt."
addAccount: "Legg til konto" addAccount: "Legg til konto"
reloadAccountsList: "Last inn kontoliste på nytt"
loginFailed: "Kunne ikke logge inn"
general: "Generelt"
searchWith: "Søk: {q}"
youHaveNoLists: "Du har ingen lister"
followConfirm: "Er du sikker på at du vil følge {name}?"
selectUser: "Velg bruker" selectUser: "Velg bruker"
recipient: "Mottaker"
annotation: "Kommentarer"
federation: "Føderasjon"
instances: "Server" instances: "Server"
registeredAt: "Registrerte seg" registeredAt: "Registrerte seg"
perHour: "Per time" perHour: "Per time"
perDay: "Per dag" perDay: "Per dag"
stopActivityDelivery: "Slutt å sende aktiviteter"
blockThisInstance: "Blokker denne serveren" blockThisInstance: "Blokker denne serveren"
software: "Programvare"
version: "Versjon" version: "Versjon"
withNFiles: "{n} fil(er)"
network: "Nettverk"
statistics: "Statistikk" statistics: "Statistikk"
clearQueue: "Tøm kø" clearQueue: "Tøm kø"
clearQueueConfirmTitle: "Vil du tømme kø?" clearQueueConfirmTitle: "Vil du tømme kø?"
blockedInstances: "Blokkerte severe" blockedInstances: "Blokkerte severe"
blockedInstancesDescription: "Skriv opp vertsnavnene til serverne du vil blokkere, atskilt med linjeskift. Serverne i listen vil ikke lenger kunne kommunisere med denne serveren."
muteAndBlock: "Skjul og blokker" muteAndBlock: "Skjul og blokker"
mutedUsers: "Skjulte brukere" mutedUsers: "Skjulte brukere"
blockedUsers: "Blokkerte brukere" blockedUsers: "Blokkerte brukere"
noUsers: "Det er ingen brukere"
editProfile: "Rediger profil" editProfile: "Rediger profil"
pinLimitExceeded: "Du kan ikke feste flere." pinLimitExceeded: "Du kan ikke feste flere."
done: "Ferdig"
noCustomEmojis: "Ingen emoji" noCustomEmojis: "Ingen emoji"
noJobs: "Det er ingen jobber"
blocked: "Blokkert" blocked: "Blokkert"
suspended: "Suspendert"
all: "Alle" all: "Alle"
notResponding: "Svarer ikke"
changePassword: "Endre passord" changePassword: "Endre passord"
security: "Sikkerhet" security: "Sikkerhet"
newPassword: "Nytt passord" newPassword: "Nytt passord"
newPasswordRetype: "Nytt passord (gjenta)" newPasswordRetype: "Nytt passord (gjenta)"
attachFile: "Legg ved filer"
more: "Mer!" more: "Mer!"
announcements: "Kunngjøringer"
remove: "Slett" remove: "Slett"
removed: "Slettet" removed: "Slettet"
removeAreYouSure: "Er du sikker på at du vil fjerne \"{x}\"?"
deleteAreYouSure: "Er du sikker på at du vil slette \"{x}\"?"
saved: "Lagret" saved: "Lagret"
upload: "Laste opp" upload: "Laste opp"
explore: "Utforsk" explore: "Utforsk"
messageRead: "Lest" messageRead: "Lest"
agree: "Jeg godtar" agree: "Jeg godtar"
termsOfService: "Vilkår for bruk"
home: "Hjem" home: "Hjem"
activity: "Aktivitet"
images: "Bilder" images: "Bilder"
image: "Bilder" image: "Bilder"
birthday: "Bursdag" birthday: "Bursdag"
@ -127,19 +189,42 @@ renameFolder: "Endre mappenavn"
deleteFolder: "Slett mappe" deleteFolder: "Slett mappe"
addFile: "Legg til fil" addFile: "Legg til fil"
emptyFolder: "Denne mappen er tom" emptyFolder: "Denne mappen er tom"
unableToDelete: "Kan ikke slette"
circularReferenceFolder: "Målmappen er en undermappe til mappen du ønsker å flytte."
hasChildFilesOrFolders: "Siden denne mappen ikke er tom, kan den ikke slettes."
copyUrl: "Kopier URL" copyUrl: "Kopier URL"
rename: "Endre navn" rename: "Endre navn"
avatar: "Avatar"
banner: "Banner"
doNothing: "Gjør ingenting" doNothing: "Gjør ingenting"
accept: "Tillatt" accept: "Tillatt"
reject: "Avslå" reject: "Avslå"
instanceName: "Servernavn" instanceName: "Servernavn"
instanceDescription: "Serverbeskrivelse"
thisYear: "I år" thisYear: "I år"
thisMonth: "Måned"
today: "I dag" today: "I dag"
dayX: "{day}"
monthX: "{month}"
yearX: "{year}"
pages: "Sider" pages: "Sider"
integration: "Integrasjon"
enableLocalTimeline: "Aktiver lokal tidslinje"
enableGlobalTimeline: "Aktiver global tidslinje"
disablingTimelinesInfo: "Administratorer og Moderatorer vil alltid ha tilgang til alle tidslinjer, selv om de ikke er aktivert."
registration: "Registrer"
enableRegistration: "Aktiver registrering av nye brukere"
invite: "Inviter"
basicInfo: "Grunnleggende informasjon"
pinnedUsers: "Festete brukrere" pinnedUsers: "Festete brukrere"
pinnedUsersDescription: "Liste over brukernavn atskilt med linjeskift som skal festes i \"Utforsk\" fanen."
pinnedPages: "Festete sider" pinnedPages: "Festete sider"
hcaptcha: "hCaptcha" hcaptcha: "hCaptcha"
enableHcaptcha: "Aktiver hCaptcha"
recaptcha: "reCAPTCHA" recaptcha: "reCAPTCHA"
enableRecaptcha: "Aktiver reCAPTCHA"
turnstile: "Turnstile"
enableTurnstile: "Aktiver Turnstile"
name: "Navn" name: "Navn"
popularUsers: "Populære brukere" popularUsers: "Populære brukere"
exploreUsersCount: "Det finnes {count} brukere" exploreUsersCount: "Det finnes {count} brukere"
@ -149,10 +234,13 @@ aboutMisskey: "Om Misskey"
share: "Del" share: "Del"
help: "Hjelp" help: "Hjelp"
close: "Lukk" close: "Lukk"
invites: "Inviter"
members: "Medlemmer" members: "Medlemmer"
title: "Tittel"
text: "Tekst" text: "Tekst"
next: "Neste" next: "Neste"
retype: "Gjenta" retype: "Gjenta"
invitations: "Inviter"
available: "Tilgjengelig" available: "Tilgjengelig"
unavailable: "Utilgjengelig" unavailable: "Utilgjengelig"
tooShort: "For kort" tooShort: "For kort"
@ -234,6 +322,7 @@ manageAccounts: "Administrer konto"
classic: "Klassisk" classic: "Klassisk"
muteThread: "Skjul denne tråden" muteThread: "Skjul denne tråden"
unmuteThread: "Vis denne tråden" unmuteThread: "Vis denne tråden"
hide: "Skjul"
tablet: "Nettbrett" tablet: "Nettbrett"
auto: "Automatisk" auto: "Automatisk"
size: "Størrelse" size: "Størrelse"
@ -312,10 +401,24 @@ _achievements:
title: "Rett og slett heldig" title: "Rett og slett heldig"
_setNameToSyuilo: _setNameToSyuilo:
description: "Du har satt navnet ditt til \"syuilo\"" description: "Du har satt navnet ditt til \"syuilo\""
_passedSinceAccountCreated1:
title: "Ett års jubileum"
description: "Det har gått ett år siden kontoen din ble opprettet"
_passedSinceAccountCreated2:
title: "To års jubileum"
description: "Det har gått to år siden kontoen din ble opprettet"
_passedSinceAccountCreated3:
title: "Tre års jubileum"
description: "Det har gått tre år siden kontoen din ble opprettet"
_loggedInOnBirthday: _loggedInOnBirthday:
title: "Gratulerer med dagen" title: "Gratulerer med dagen"
description: "Du logget inn på bursdagen din"
_loggedInOnNewYearsDay: _loggedInOnNewYearsDay:
title: "Godt nytt år" title: "Godt nytt år"
description: "Du logget inn på årets første dag"
_cookieClicked:
description: "Du klikket på kjeksen"
flavor: "Er du på riktig nettsted?"
_brainDiver: _brainDiver:
title: "Brain Diver" title: "Brain Diver"
flavor: "Misskey-Misskey La-Tu-Ma" flavor: "Misskey-Misskey La-Tu-Ma"
@ -333,6 +436,9 @@ _ad:
_gallery: _gallery:
like: "Liker!" like: "Liker!"
unlike: "Liker ikke" unlike: "Liker ikke"
_email:
_follow:
title: "fulgte deg"
_preferencesBackups: _preferencesBackups:
saveNew: "Lagre som ny" saveNew: "Lagre som ny"
cannotSave: "Kunne ikke lagre" cannotSave: "Kunne ikke lagre"
@ -351,6 +457,8 @@ _channel:
featured: "Populært" featured: "Populært"
following: "Følger" following: "Følger"
nameAndDescription: "Navn og beskrivelse" nameAndDescription: "Navn og beskrivelse"
_menuDisplay:
hide: "Skjul"
_wordMute: _wordMute:
soft: "Myk" soft: "Myk"
hard: "Hard" hard: "Hard"
@ -397,13 +505,16 @@ _widgets:
calendar: "Kalender" calendar: "Kalender"
trends: "Populært" trends: "Populært"
clock: "Klokke" clock: "Klokke"
activity: "Aktivitet"
photos: "Bilder" photos: "Bilder"
federation: "Føderasjon"
button: "Knapp" button: "Knapp"
aiscriptApp: "AiScript App" aiscriptApp: "AiScript App"
userList: "Brukerliste" userList: "Brukerliste"
_userList: _userList:
chooseList: "Velg liste" chooseList: "Velg liste"
_cw: _cw:
hide: "Skjul"
show: "Vis mer" show: "Vis mer"
_poll: _poll:
noOnlyOneChoice: "Trenger minst to valger." noOnlyOneChoice: "Trenger minst to valger."
@ -431,6 +542,7 @@ _exportOrImport:
blockingList: "Blokker" blockingList: "Blokker"
userLists: "Lister" userLists: "Lister"
_charts: _charts:
federation: "Føderasjon"
filesIncDec: "Forskjell på antall filer" filesIncDec: "Forskjell på antall filer"
_instanceCharts: _instanceCharts:
users: "Forskjell på antall brukere" users: "Forskjell på antall brukere"
@ -442,14 +554,18 @@ _play:
new: "Opprett Play" new: "Opprett Play"
edit: "Rediger Play" edit: "Rediger Play"
featured: "Populært" featured: "Populært"
title: "Tittel"
summary: "Beskrivelse" summary: "Beskrivelse"
_pages: _pages:
invalidNameText: "Pass på at sidetittelen ikke er tom"
like: "Liker" like: "Liker"
unlike: "Liker ikke" unlike: "Liker ikke"
my: "Mine sider" my: "Mine sider"
featured: "Populært" featured: "Populært"
contents: "Innhold" contents: "Innhold"
title: "Tittel"
url: "Side URL" url: "Side URL"
hideTitleWhenPinned: "Skjul sidetittel når festet til profil"
fontSerif: "Serif" fontSerif: "Serif"
fontSansSerif: "Sans Serif" fontSansSerif: "Sans Serif"
selectType: "Velg type" selectType: "Velg type"
@ -459,6 +575,7 @@ _pages:
image: "Bilde" image: "Bilde"
button: "Knapp" button: "Knapp"
_notification: _notification:
youWereFollowed: "fulgte deg"
_types: _types:
follow: "Følg" follow: "Følg"
reply: "Svar" reply: "Svar"

View file

@ -560,6 +560,7 @@ accountDeletedDescription: "Эта учетная запись удалена"
menu: "Меню" menu: "Меню"
divider: "Линия-разделитель" divider: "Линия-разделитель"
addItem: "Добавить элемент" addItem: "Добавить элемент"
rearrange: "Сортировать по"
relays: "Ретрансляторы" relays: "Ретрансляторы"
addRelay: "Добавить ретранслятор" addRelay: "Добавить ретранслятор"
inboxUrl: "URL ящика входящих сообщений" inboxUrl: "URL ящика входящих сообщений"
@ -989,6 +990,7 @@ rolesAssignedToMe: "Мои роли"
resetPasswordConfirm: "Сбросить пароль?" resetPasswordConfirm: "Сбросить пароль?"
sensitiveWords: "Чувствительные слова" sensitiveWords: "Чувствительные слова"
sensitiveWordsDescription: "Установите общедоступный диапазон заметки, содержащей заданное слово, на домашний. Можно сделать несколько настроек, разделив их переносами строк." sensitiveWordsDescription: "Установите общедоступный диапазон заметки, содержащей заданное слово, на домашний. Можно сделать несколько настроек, разделив их переносами строк."
sensitiveWordsDescription2: "Разделение пробелом создаёт спецификацию AND, а разделение косой чертой создаёт регулярное выражение."
notesSearchNotAvailable: "Поиск заметок недоступен" notesSearchNotAvailable: "Поиск заметок недоступен"
license: "Лицензия" license: "Лицензия"
unfavoriteConfirm: "Удалить избранное?" unfavoriteConfirm: "Удалить избранное?"

View file

@ -560,6 +560,7 @@ accountDeletedDescription: "บัญชีนี้ถูกลบไปแล
menu: "เมนู" menu: "เมนู"
divider: "ตัวแบ่ง" divider: "ตัวแบ่ง"
addItem: "เพิ่มรายการ" addItem: "เพิ่มรายการ"
rearrange: "จัดใหม่"
relays: "รีเลย์" relays: "รีเลย์"
addRelay: "เพิ่มรีเลย์" addRelay: "เพิ่มรีเลย์"
inboxUrl: "อินบ็อกซ์ URL" inboxUrl: "อินบ็อกซ์ URL"
@ -1030,6 +1031,7 @@ continue: "ดำเนินการต่อ"
preservedUsernames: "ชื่อผู้ใช้ที่สงวนไว้" preservedUsernames: "ชื่อผู้ใช้ที่สงวนไว้"
preservedUsernamesDescription: "ลิสต์ชื่อผู้ใช้ที่จะสำรองโดยคั่นด้วยการแบ่งบรรทัดนั้น เพราะสิ่งเหล่านี้จะไม่สามารถทำได้ในระหว่างการสร้างบัญชีตามปกติ บัญชีที่มีอยู่แล้วนั้นโดยใช้ชื่อผู้ใช้เหล่านี้จะไม่ได้รับผลกระทบอะไร" preservedUsernamesDescription: "ลิสต์ชื่อผู้ใช้ที่จะสำรองโดยคั่นด้วยการแบ่งบรรทัดนั้น เพราะสิ่งเหล่านี้จะไม่สามารถทำได้ในระหว่างการสร้างบัญชีตามปกติ บัญชีที่มีอยู่แล้วนั้นโดยใช้ชื่อผู้ใช้เหล่านี้จะไม่ได้รับผลกระทบอะไร"
createNoteFromTheFile: "เรียบเรียงโน้ตจากไฟล์นี้" createNoteFromTheFile: "เรียบเรียงโน้ตจากไฟล์นี้"
archive: "เก็บถาวร"
youFollowing: "ติดตามแล้ว" youFollowing: "ติดตามแล้ว"
options: "ตัวเลือกบทบาท" options: "ตัวเลือกบทบาท"
_serverRules: _serverRules:
@ -1329,6 +1331,7 @@ _role:
canInvite: "สร้างรหัสเชิญอินสแตนซ์" canInvite: "สร้างรหัสเชิญอินสแตนซ์"
canManageCustomEmojis: "จัดการอีโมจิแบบกำหนดเอง" canManageCustomEmojis: "จัดการอีโมจิแบบกำหนดเอง"
driveCapacity: "ความจุของไดรฟ์" driveCapacity: "ความจุของไดรฟ์"
alwaysMarkNsfw: "ทำเครื่องหมายไฟล์ว่าเป็น NSFW เสมอ"
pinMax: "จํานวนสูงสุดของโน้ตที่ปักหมุดไว้" pinMax: "จํานวนสูงสุดของโน้ตที่ปักหมุดไว้"
antennaMax: "จำนวนสูงสุดของเสาอากาศ" antennaMax: "จำนวนสูงสุดของเสาอากาศ"
wordMuteMax: "จำนวนอักขระสูงสุดที่อนุญาตในการปิดเสียงคำ" wordMuteMax: "จำนวนอักขระสูงสุดที่อนุญาตในการปิดเสียงคำ"
@ -1580,6 +1583,12 @@ _time:
minute: "นาที" minute: "นาที"
hour: "ชั่วโมง" hour: "ชั่วโมง"
day: "วัน" day: "วัน"
_timelineTutorial:
title: "วิธีใช้งาน Misskey"
step3_1: "เสร็จสิ้นการโพสต์โน้ตย่อแรกของคุณแล้วอย่างงั้นหรอ?"
step3_2: "ไชโย! ตอนนี้โน้ตย่อแรกของคุณได้ปรากฏบนไทม์ไลน์ของคุณแล้วนะ"
step4_1: "คุณยังสามารถแนบ \"ปฏิกิริยา\" ไปกับโน้ตได้อีกด้วยนะค่ะ"
step4_2: "หากต้องการแนบการแสดงความรู้สึก ให้กดเครื่องหมาย \"+\" บนโน้ตแล้วเลือกอิโมจิที่คุณต้องการแสดงความรู้สึกที่ตนเองชอบได้เลย"
_2fa: _2fa:
alreadyRegistered: "คุณได้ลงทะเบียนอุปกรณ์ยืนยันตัวตนแบบ 2 ชั้นแล้ว" alreadyRegistered: "คุณได้ลงทะเบียนอุปกรณ์ยืนยันตัวตนแบบ 2 ชั้นแล้ว"
registerTOTP: "ลงทะเบียนแอพตัวตรวจสอบสิทธิ์" registerTOTP: "ลงทะเบียนแอพตัวตรวจสอบสิทธิ์"

View file

@ -560,6 +560,7 @@ accountDeletedDescription: "此帐户已经被删除。"
menu: "菜单" menu: "菜单"
divider: "分割线" divider: "分割线"
addItem: "添加项目" addItem: "添加项目"
rearrange: "排序方式"
relays: "中继" relays: "中继"
addRelay: "添加中继" addRelay: "添加中继"
inboxUrl: "Inbox URL" inboxUrl: "Inbox URL"
@ -989,6 +990,7 @@ rolesAssignedToMe: "指派给自己的角色"
resetPasswordConfirm: "确定重置密码?" resetPasswordConfirm: "确定重置密码?"
sensitiveWords: "敏感词" sensitiveWords: "敏感词"
sensitiveWordsDescription: "将包含设置词的帖子的可见范围设置为首页。可以通过用换行符分隔来设置多个。" sensitiveWordsDescription: "将包含设置词的帖子的可见范围设置为首页。可以通过用换行符分隔来设置多个。"
sensitiveWordsDescription2: "用空格分割关键词作为AND格式用斜线包裹关键字来构成正则表达式。"
notesSearchNotAvailable: "帖子检索不可用" notesSearchNotAvailable: "帖子检索不可用"
license: "许可信息" license: "许可信息"
unfavoriteConfirm: "确定要取消收藏吗?" unfavoriteConfirm: "确定要取消收藏吗?"
@ -1028,28 +1030,49 @@ pleaseConfirmBelowBeforeSignup: "在这个服务器上注册账号前,请确
pleaseAgreeAllToContinue: "必须全部勾选「同意」才能够继续。" pleaseAgreeAllToContinue: "必须全部勾选「同意」才能够继续。"
continue: "继续" continue: "继续"
preservedUsernames: "保留的用户名" preservedUsernames: "保留的用户名"
preservedUsernamesDescription: "列出需要保留的用户名,使用换行来作为分割。被指定的用户名在建立账户时无法使用,但由管理员所创建的账户不受该限制。此外,现有的账户也不会受到影响。"
createNoteFromTheFile: "从文件创建帖子" createNoteFromTheFile: "从文件创建帖子"
archive: "归档"
channelArchiveConfirmTitle: "要将{name}归档吗?"
channelArchiveConfirmDescription: "归档后,在频道列表与搜索结果中不会显示,也无法发布新的贴文。"
thisChannelArchived: "该频道已被归档。"
displayOfNote: "显示帖子"
initialAccountSetting: "初始设置"
youFollowing: "正在关注" youFollowing: "正在关注"
preventAiLearning: "拒绝接受生成式AI的学习"
preventAiLearningDescription: "要求文章生成AI或图像生成AI不能够以发布的帖子和图像等内容作为学习对象。这是通过在HTML响应中包含noai标志来实现的这不能完全阻止AI学习你的发布内容并不是所有AI都会遵守这类请求。"
options: "选项" options: "选项"
specifyUser: "用户指定"
_initialAccountSetting: _initialAccountSetting:
accountCreated: "账户创建完成了!" accountCreated: "账户创建完成了!"
letsStartAccountSetup: "来进行帐户的初始设置吧。" letsStartAccountSetup: "来进行帐户的初始设置吧。"
letsFillYourProfile: "首先,来设定你的个人档案吧!" letsFillYourProfile: "首先,来设定你的个人档案吧!"
profileSetting: "个人资料设置" profileSetting: "个人资料设置"
privacySetting: "隐私设置"
theseSettingsCanEditLater: "也可以在稍后修改这里的设置。" theseSettingsCanEditLater: "也可以在稍后修改这里的设置。"
youCanEditMoreSettingsInSettingsPageLater: "还可以在「设置」页面进行其它各种设置,稍后就来确认一下看看吧。"
followUsers: "为了建立属于你自己的时间线,试着去关注你感兴趣的用户吧。"
pushNotificationDescription: "启用推送通知的话,就可以在设备上受到来自{name}的通知了。"
initialAccountSettingCompleted: "初始设定已经完成了!"
haveFun: "希望{name}在这里玩得开心!"
ifYouNeedLearnMore: "关于{name}(Misskey)的使用方法,详见{link}。"
skipAreYouSure: "要跳过初始设置吗?"
_serverRules: _serverRules:
description: "在新用户注册前显示服务器的简单规则。推荐显示服务条款的主要内容。" description: "在新用户注册前显示服务器的简单规则。推荐显示服务条款的主要内容。"
_accountMigration: _accountMigration:
moveFrom: "从别的账号迁移到此账户" moveFrom: "从别的账号迁移到此账户"
moveFromSub: "为另一个账户建立别名"
moveFromLabel: "迁移前的账户" moveFromLabel: "迁移前的账户"
moveFromDescription: "如果迁移时需要继承其他账户的关注者,请在此创造别名。此操作需要在实行迁移之前完成!请如已下输入需要迁移的账户:@person@instance.com" moveFromDescription: "如果迁移时需要继承其他账户的关注者,请在此创造别名。此操作需要在实行迁移之前完成!请如已下输入需要迁移的账户:@person@instance.com"
moveTo: "把这个账户迁移到新的账户" moveTo: "把这个账户迁移到新的账户"
moveToLabel: "迁移后的账户" moveToLabel: "迁移后的账户"
moveCannotBeUndone: "一旦迁移账户,就无法撤销。" moveCannotBeUndone: "一旦迁移账户,就无法撤销。"
moveAccountDescription: "此操作无法取消。请先确认您已在迁移后的账户上,为此账户创造了别名。创造别名后,请如以下输入您的迁移后的账户:@person@instance.com" moveAccountDescription: "此操作无法取消。请先确认您已在迁移后的账户上,为此账户创造了别名。创造别名后,请如以下输入您的迁移后的账户:@person@instance.com"
moveAccountHowTo: "要进行账户迁移,请现在目标账户中为此账户建立一个别名。\n建立别名后请像这样输入目标账户@username@server.example.com"
startMigration: "迁移" startMigration: "迁移"
migrationConfirm: "确定要把此账户迁移到{account}吗?一旦确定后,此操作无法取消,此账户也无法以原来的状态使用。\n同时请确认迁移后的账户已创造别名。" migrationConfirm: "确定要把此账户迁移到{account}吗?一旦确定后,此操作无法取消,此账户也无法以原来的状态使用。\n同时请确认迁移后的账户已创造别名。"
movedAndCannotBeUndone: "该账户已被迁移。\n迁移操作无法撤销。" movedAndCannotBeUndone: "该账户已被迁移。\n迁移操作无法撤销。"
postMigrationNote: "这个账户的关注会在迁移操作后的24小时后解除。该账户的「关注中」和「关注者」皆会变为0。由于不会解除关注关系你的关注者仍然可以继续查看该账户发补给关注者的帖子。"
movedTo: "迁移后的账户" movedTo: "迁移后的账户"
_achievements: _achievements:
earnedAt: "达成时间" earnedAt: "达成时间"
@ -1331,6 +1354,7 @@ _role:
canInvite: "发放服务器邀请码" canInvite: "发放服务器邀请码"
canManageCustomEmojis: "管理自定义表情符号" canManageCustomEmojis: "管理自定义表情符号"
driveCapacity: "网盘容量" driveCapacity: "网盘容量"
alwaysMarkNsfw: "总是将文件标记为NSFW"
pinMax: "帖子置顶数量限制" pinMax: "帖子置顶数量限制"
antennaMax: "可创建的最大天线数量" antennaMax: "可创建的最大天线数量"
wordMuteMax: "屏蔽词的字数限制" wordMuteMax: "屏蔽词的字数限制"
@ -1583,8 +1607,15 @@ _time:
hour: "小时" hour: "小时"
day: "日" day: "日"
_timelineTutorial: _timelineTutorial:
title: "Misskey的使用方法"
step1_1: "这个画面是「时间线」。{name}的投稿会按照帖子的发布时间顺序来显示。"
step1_2: "时间线有许多种类,比如在「首页时间线」中展现的是你关注的人的贴文;而在「本地时间线」中展现的是{name}里全部用户的贴文。"
step2_1: "那么接下来,试着写一些什么东西来发布吧!你可以通过点击屏幕上的铅笔图标来打开投稿页面。"
step2_2: "第一次发布的帖子内容,建议包含自我介绍,以及「开始使用{name}了」。"
step3_1: "将想说的话发出去了吗?" step3_1: "将想说的话发出去了吗?"
step3_2: "太棒了!现在你可以在你的时间线中看到刚刚发布的帖子了。" step3_2: "太棒了!现在你可以在你的时间线中看到刚刚发布的帖子了。"
step4_1: "试着对帖子使用「回应」吧!"
step4_2: "在他人的帖子上按下「+」图标,即可选择想要的表情来进行「回应」。"
_2fa: _2fa:
alreadyRegistered: "此设备已被注册" alreadyRegistered: "此设备已被注册"
registerTOTP: "开始设置认证应用" registerTOTP: "开始设置认证应用"

View file

@ -52,6 +52,8 @@ addToList: "加入至清單"
sendMessage: "發送訊息" sendMessage: "發送訊息"
copyRSS: "複製RSS" copyRSS: "複製RSS"
copyUsername: "複製使用者名稱" copyUsername: "複製使用者名稱"
copyUserId: "複製使用者ID"
copyNoteId: "複製貼文ID"
searchUser: "搜尋使用者" searchUser: "搜尋使用者"
reply: "回覆" reply: "回覆"
loadMore: "載入更多" loadMore: "載入更多"
@ -790,6 +792,7 @@ noMaintainerInformationWarning: "尚未設定管理員信息。"
noBotProtectionWarning: "尚未設定Bot防護。" noBotProtectionWarning: "尚未設定Bot防護。"
configure: "設定" configure: "設定"
postToGallery: "發佈到相簿" postToGallery: "發佈到相簿"
postToHashtag: "以此主題標籤發布"
gallery: "相簿" gallery: "相簿"
recentPosts: "最新貼文" recentPosts: "最新貼文"
popularPosts: "熱門的貼文" popularPosts: "熱門的貼文"
@ -823,6 +826,7 @@ translatedFrom: "從 {x} 翻譯"
accountDeletionInProgress: "正在刪除帳戶" accountDeletionInProgress: "正在刪除帳戶"
usernameInfo: "在伺服器上您的帳戶是唯一的識別名稱。您可以使用字母 (a ~ z, A ~ Z)、數字 (0 ~ 9) 和下底線 (_)。之後帳戶名是不能更改的。" usernameInfo: "在伺服器上您的帳戶是唯一的識別名稱。您可以使用字母 (a ~ z, A ~ Z)、數字 (0 ~ 9) 和下底線 (_)。之後帳戶名是不能更改的。"
aiChanMode: "小藍模式" aiChanMode: "小藍模式"
devMode: "開發者模式"
keepCw: "保持CW" keepCw: "保持CW"
pubSub: "Pub/Sub 帳戶" pubSub: "Pub/Sub 帳戶"
lastCommunication: "最近的通信" lastCommunication: "最近的通信"
@ -832,6 +836,8 @@ breakFollow: "解除追隨者"
breakFollowConfirm: "確定要取消被追隨嗎?" breakFollowConfirm: "確定要取消被追隨嗎?"
itsOn: "已開啟" itsOn: "已開啟"
itsOff: "已關閉" itsOff: "已關閉"
on: "開啟"
off: "關閉"
emailRequiredForSignup: "註冊帳戶需要電子郵件地址" emailRequiredForSignup: "註冊帳戶需要電子郵件地址"
unread: "未讀" unread: "未讀"
filter: "篩選" filter: "篩選"
@ -986,6 +992,8 @@ cannotBeChangedLater: "之後不能變更。"
reactionAcceptance: "接受表情反應" reactionAcceptance: "接受表情反應"
likeOnly: "僅限讚" likeOnly: "僅限讚"
likeOnlyForRemote: "遠端僅限讚" likeOnlyForRemote: "遠端僅限讚"
nonSensitiveOnly: "僅限非敏感"
nonSensitiveOnlyForLocalLikeOnlyForRemote: "僅限非敏感(遠端僅限按讚)"
rolesAssignedToMe: "指派給自己的角色" rolesAssignedToMe: "指派給自己的角色"
resetPasswordConfirm: "重設密碼?" resetPasswordConfirm: "重設密碼?"
sensitiveWords: "敏感詞" sensitiveWords: "敏感詞"
@ -1039,14 +1047,20 @@ thisChannelArchived: "這個頻道已被封存。"
displayOfNote: "顯示貼文" displayOfNote: "顯示貼文"
initialAccountSetting: "初始設定" initialAccountSetting: "初始設定"
youFollowing: "追隨中" youFollowing: "追隨中"
preventAiLearning: "拒絕接受產生式AI的學習" preventAiLearning: "拒絕接受生成式AI的訓練"
preventAiLearningDescription: "要求外部的文章生AI或圖像生AI不以發布的貼文和圖像等內容為學習對象。這是透過在HTML響應中包含noai旗標來實現的但不能完全防止AI的學習因為這要看該AI是否遵守這個要求。" preventAiLearningDescription: "要求外部的文章成式AI或圖像生成式AI不以發布的貼文和圖像等內容為學習對象。這是透過在HTML響應中包含noai旗標來實現的但不能完全防止AI的學習因為這要看該AI是否遵守這個要求。"
options: "選項" options: "選項"
specifyUser: "指定使用者"
failedToPreviewUrl: "無法預覽"
update: "更新"
rolesThatCanBeUsedThisEmojiAsReaction: "可以當成反應使用的角色"
rolesThatCanBeUsedThisEmojiAsReactionEmptyDescription: "如果是未指定角色的情況,則任何人都可以被當成反應來使用。"
_initialAccountSetting: _initialAccountSetting:
accountCreated: "帳戶已建立完成!" accountCreated: "帳戶已建立完成!"
letsStartAccountSetup: "來進行帳戶的初始設定吧。" letsStartAccountSetup: "來進行帳戶的初始設定吧。"
letsFillYourProfile: "首先,來設定您的個人檔案吧。" letsFillYourProfile: "首先,來設定您的個人檔案吧。"
profileSetting: "個人檔案設定" profileSetting: "個人檔案設定"
privacySetting: "隱私設定"
theseSettingsCanEditLater: "這裡的設定可以在之後變更。" theseSettingsCanEditLater: "這裡的設定可以在之後變更。"
youCanEditMoreSettingsInSettingsPageLater: "除此之外,還可以在「設定」頁面進行各種設定。之後請確認看看。" youCanEditMoreSettingsInSettingsPageLater: "除此之外,還可以在「設定」頁面進行各種設定。之後請確認看看。"
followUsers: "為了構築時間軸,試著追蹤您感興趣的使用者吧。" followUsers: "為了構築時間軸,試著追蹤您感興趣的使用者吧。"

View file

@ -1,6 +1,6 @@
{ {
"name": "misskey", "name": "misskey",
"version": "13.13.0-beta.3", "version": "13.13.0-beta.4",
"codename": "nasubi", "codename": "nasubi",
"repository": { "repository": {
"type": "git", "type": "git",

View file

@ -35,6 +35,7 @@
"@swc/core-win32-x64-msvc": "1.3.56", "@swc/core-win32-x64-msvc": "1.3.56",
"@tensorflow/tfjs": "4.4.0", "@tensorflow/tfjs": "4.4.0",
"@tensorflow/tfjs-node": "4.4.0", "@tensorflow/tfjs-node": "4.4.0",
"bufferutil": "^4.0.7",
"slacc-android-arm-eabi": "0.0.9", "slacc-android-arm-eabi": "0.0.9",
"slacc-android-arm64": "0.0.9", "slacc-android-arm64": "0.0.9",
"slacc-darwin-arm64": "0.0.9", "slacc-darwin-arm64": "0.0.9",
@ -46,7 +47,8 @@
"slacc-linux-arm64-musl": "0.0.9", "slacc-linux-arm64-musl": "0.0.9",
"slacc-linux-x64-gnu": "0.0.9", "slacc-linux-x64-gnu": "0.0.9",
"slacc-win32-arm64-msvc": "0.0.9", "slacc-win32-arm64-msvc": "0.0.9",
"slacc-win32-x64-msvc": "0.0.9" "slacc-win32-x64-msvc": "0.0.9",
"utf-8-validate": "^6.0.3"
}, },
"dependencies": { "dependencies": {
"@aws-sdk/client-s3": "3.321.1", "@aws-sdk/client-s3": "3.321.1",
@ -76,7 +78,7 @@
"autwh": "0.1.0", "autwh": "0.1.0",
"bcryptjs": "2.4.3", "bcryptjs": "2.4.3",
"blurhash": "2.0.5", "blurhash": "2.0.5",
"bull": "4.10.4", "bullmq": "3.14.1",
"cacheable-lookup": "6.1.0", "cacheable-lookup": "6.1.0",
"cbor": "8.1.0", "cbor": "8.1.0",
"chalk": "5.2.0", "chalk": "5.2.0",
@ -157,7 +159,6 @@
"uuid": "9.0.0", "uuid": "9.0.0",
"vary": "1.1.2", "vary": "1.1.2",
"web-push": "3.6.1", "web-push": "3.6.1",
"websocket": "1.0.34",
"ws": "8.13.0", "ws": "8.13.0",
"xev": "3.0.2" "xev": "3.0.2"
}, },
@ -167,7 +168,6 @@
"@types/accepts": "1.3.5", "@types/accepts": "1.3.5",
"@types/archiver": "5.3.2", "@types/archiver": "5.3.2",
"@types/bcryptjs": "2.4.2", "@types/bcryptjs": "2.4.2",
"@types/bull": "4.10.0",
"@types/cbor": "6.0.0", "@types/cbor": "6.0.0",
"@types/color-convert": "2.0.0", "@types/color-convert": "2.0.0",
"@types/content-disposition": "0.5.5", "@types/content-disposition": "0.5.5",

View file

@ -100,7 +100,7 @@ export class GlobalModule implements OnApplicationShutdown {
@Inject(DI.redisForSub) private redisForSub: Redis.Redis, @Inject(DI.redisForSub) private redisForSub: Redis.Redis,
) {} ) {}
async onApplicationShutdown(signal: string): Promise<void> { public async dispose(): Promise<void> {
if (process.env.NODE_ENV === 'test') { if (process.env.NODE_ENV === 'test') {
// XXX: // XXX:
// Shutting down the existing connections causes errors on Jest as // Shutting down the existing connections causes errors on Jest as
@ -116,4 +116,8 @@ export class GlobalModule implements OnApplicationShutdown {
this.redisForSub.disconnect(), this.redisForSub.disconnect(),
]); ]);
} }
async onApplicationShutdown(signal: string): Promise<void> {
await this.dispose();
}
} }

View file

@ -190,6 +190,6 @@ function tryCreateUrl(url: string) {
try { try {
return new URL(url); return new URL(url);
} catch (e) { } catch (e) {
throw `url="${url}" is not a valid URL.`; throw new Error(`url="${url}" is not a valid URL.`);
} }
} }

View file

@ -55,11 +55,6 @@ export class AntennaService implements OnApplicationShutdown {
this.redisForSub.on('message', this.onRedisMessage); this.redisForSub.on('message', this.onRedisMessage);
} }
@bindThis
public onApplicationShutdown(signal?: string | undefined) {
this.redisForSub.off('message', this.onRedisMessage);
}
@bindThis @bindThis
private async onRedisMessage(_: string, data: string): Promise<void> { private async onRedisMessage(_: string, data: string): Promise<void> {
const obj = JSON.parse(data); const obj = JSON.parse(data);
@ -196,4 +191,14 @@ export class AntennaService implements OnApplicationShutdown {
return this.antennas; return this.antennas;
} }
@bindThis
public dispose(): void {
this.redisForSub.off('message', this.onRedisMessage);
}
@bindThis
public onApplicationShutdown(signal?: string | undefined): void {
this.dispose();
}
} }

View file

@ -166,7 +166,12 @@ export class CacheService implements OnApplicationShutdown {
} }
@bindThis @bindThis
public onApplicationShutdown(signal?: string | undefined) { public dispose(): void {
this.redisForSub.off('message', this.onMessage); this.redisForSub.off('message', this.onMessage);
} }
@bindThis
public onApplicationShutdown(signal?: string | undefined): void {
this.dispose();
}
} }

View file

@ -30,7 +30,7 @@ export class CaptchaService {
}, { throwErrorWhenResponseNotOk: false }); }, { throwErrorWhenResponseNotOk: false });
if (!res.ok) { if (!res.ok) {
throw `${res.status}`; throw new Error(`${res.status}`);
} }
return await res.json() as CaptchaResponse; return await res.json() as CaptchaResponse;
@ -39,48 +39,48 @@ export class CaptchaService {
@bindThis @bindThis
public async verifyRecaptcha(secret: string, response: string | null | undefined): Promise<void> { public async verifyRecaptcha(secret: string, response: string | null | undefined): Promise<void> {
if (response == null) { if (response == null) {
throw 'recaptcha-failed: no response provided'; throw new Error('recaptcha-failed: no response provided');
} }
const result = await this.getCaptchaResponse('https://www.recaptcha.net/recaptcha/api/siteverify', secret, response).catch(err => { const result = await this.getCaptchaResponse('https://www.recaptcha.net/recaptcha/api/siteverify', secret, response).catch(err => {
throw `recaptcha-request-failed: ${err}`; throw new Error(`recaptcha-request-failed: ${err}`);
}); });
if (result.success !== true) { if (result.success !== true) {
const errorCodes = result['error-codes'] ? result['error-codes'].join(', ') : ''; const errorCodes = result['error-codes'] ? result['error-codes'].join(', ') : '';
throw `recaptcha-failed: ${errorCodes}`; throw new Error(`recaptcha-failed: ${errorCodes}`);
} }
} }
@bindThis @bindThis
public async verifyHcaptcha(secret: string, response: string | null | undefined): Promise<void> { public async verifyHcaptcha(secret: string, response: string | null | undefined): Promise<void> {
if (response == null) { if (response == null) {
throw 'hcaptcha-failed: no response provided'; throw new Error('hcaptcha-failed: no response provided');
} }
const result = await this.getCaptchaResponse('https://hcaptcha.com/siteverify', secret, response).catch(err => { const result = await this.getCaptchaResponse('https://hcaptcha.com/siteverify', secret, response).catch(err => {
throw `hcaptcha-request-failed: ${err}`; throw new Error(`hcaptcha-request-failed: ${err}`);
}); });
if (result.success !== true) { if (result.success !== true) {
const errorCodes = result['error-codes'] ? result['error-codes'].join(', ') : ''; const errorCodes = result['error-codes'] ? result['error-codes'].join(', ') : '';
throw `hcaptcha-failed: ${errorCodes}`; throw new Error(`hcaptcha-failed: ${errorCodes}`);
} }
} }
@bindThis @bindThis
public async verifyTurnstile(secret: string, response: string | null | undefined): Promise<void> { public async verifyTurnstile(secret: string, response: string | null | undefined): Promise<void> {
if (response == null) { if (response == null) {
throw 'turnstile-failed: no response provided'; throw new Error('turnstile-failed: no response provided');
} }
const result = await this.getCaptchaResponse('https://challenges.cloudflare.com/turnstile/v0/siteverify', secret, response).catch(err => { const result = await this.getCaptchaResponse('https://challenges.cloudflare.com/turnstile/v0/siteverify', secret, response).catch(err => {
throw `turnstile-request-failed: ${err}`; throw new Error(`turnstile-request-failed: ${err}`);
}); });
if (result.success !== true) { if (result.success !== true) {
const errorCodes = result['error-codes'] ? result['error-codes'].join(', ') : ''; const errorCodes = result['error-codes'] ? result['error-codes'].join(', ') : '';
throw `turnstile-failed: ${errorCodes}`; throw new Error(`turnstile-failed: ${errorCodes}`);
} }
} }
} }

View file

@ -116,14 +116,14 @@ export class FetchInstanceMetadataService {
const wellknown = await this.httpRequestService.getJson('https://' + instance.host + '/.well-known/nodeinfo') const wellknown = await this.httpRequestService.getJson('https://' + instance.host + '/.well-known/nodeinfo')
.catch(err => { .catch(err => {
if (err.statusCode === 404) { if (err.statusCode === 404) {
throw 'No nodeinfo provided'; throw new Error('No nodeinfo provided');
} else { } else {
throw err.statusCode ?? err.message; throw err.statusCode ?? err.message;
} }
}) as Record<string, unknown>; }) as Record<string, unknown>;
if (wellknown.links == null || !Array.isArray(wellknown.links)) { if (wellknown.links == null || !Array.isArray(wellknown.links)) {
throw 'No wellknown links'; throw new Error('No wellknown links');
} }
const links = wellknown.links as any[]; const links = wellknown.links as any[];
@ -134,7 +134,7 @@ export class FetchInstanceMetadataService {
const link = lnik2_1 ?? lnik2_0 ?? lnik1_0; const link = lnik2_1 ?? lnik2_0 ?? lnik1_0;
if (link == null) { if (link == null) {
throw 'No nodeinfo link provided'; throw new Error('No nodeinfo link provided');
} }
const info = await this.httpRequestService.getJson(link.href) const info = await this.httpRequestService.getJson(link.href)

View file

@ -120,8 +120,13 @@ export class MetaService implements OnApplicationShutdown {
} }
@bindThis @bindThis
public onApplicationShutdown(signal?: string | undefined) { public dispose(): void {
clearInterval(this.intervalId); clearInterval(this.intervalId);
this.redisForSub.off('message', this.onMessage); this.redisForSub.off('message', this.onMessage);
} }
@bindThis
public onApplicationShutdown(signal?: string | undefined): void {
this.dispose();
}
} }

View file

@ -510,7 +510,7 @@ export class NoteCreateService implements OnApplicationShutdown {
if (data.poll && data.poll.expiresAt) { if (data.poll && data.poll.expiresAt) {
const delay = data.poll.expiresAt.getTime() - Date.now(); const delay = data.poll.expiresAt.getTime() - Date.now();
this.queueService.endedPollNotificationQueue.add({ this.queueService.endedPollNotificationQueue.add(note.id, {
noteId: note.id, noteId: note.id,
}, { }, {
delay, delay,
@ -790,7 +790,13 @@ export class NoteCreateService implements OnApplicationShutdown {
return mentionedUsers; return mentionedUsers;
} }
onApplicationShutdown(signal?: string | undefined) { @bindThis
public dispose(): void {
this.#shutdownController.abort(); this.#shutdownController.abort();
} }
@bindThis
public onApplicationShutdown(signal?: string | undefined): void {
this.dispose();
}
} }

View file

@ -122,7 +122,13 @@ export class NoteReadService implements OnApplicationShutdown {
} }
} }
onApplicationShutdown(signal?: string | undefined): void { @bindThis
public dispose(): void {
this.#shutdownController.abort(); this.#shutdownController.abort();
} }
@bindThis
public onApplicationShutdown(signal?: string | undefined): void {
this.dispose();
}
} }

View file

@ -152,7 +152,13 @@ export class NotificationService implements OnApplicationShutdown {
*/ */
} }
onApplicationShutdown(signal?: string | undefined): void { @bindThis
public dispose(): void {
this.#shutdownController.abort(); this.#shutdownController.abort();
} }
@bindThis
public onApplicationShutdown(signal?: string | undefined): void {
this.dispose();
}
} }

View file

@ -1,42 +1,11 @@
import { setTimeout } from 'node:timers/promises'; import { setTimeout } from 'node:timers/promises';
import { Inject, Module, OnApplicationShutdown } from '@nestjs/common'; import { Inject, Module, OnApplicationShutdown } from '@nestjs/common';
import Bull from 'bull'; import * as Bull from 'bullmq';
import { DI } from '@/di-symbols.js'; import { DI } from '@/di-symbols.js';
import type { Config } from '@/config.js'; import type { Config } from '@/config.js';
import { QUEUE, baseQueueOptions } from '@/queue/const.js';
import type { Provider } from '@nestjs/common'; import type { Provider } from '@nestjs/common';
import type { DeliverJobData, InboxJobData, DbJobData, ObjectStorageJobData, EndedPollNotificationJobData, WebhookDeliverJobData, RelationshipJobData, DbJobMap } from '../queue/types.js'; import type { DeliverJobData, InboxJobData, EndedPollNotificationJobData, WebhookDeliverJobData, RelationshipJobData } from '../queue/types.js';
function q<T>(config: Config, name: string, limitPerSec = -1) {
return new Bull<T>(name, {
redis: {
port: config.redisForJobQueue.port,
host: config.redisForJobQueue.host,
family: config.redisForJobQueue.family == null ? 0 : config.redisForJobQueue.family,
password: config.redisForJobQueue.pass,
db: config.redisForJobQueue.db ?? 0,
},
prefix: config.redisForJobQueue.prefix ? `${config.redisForJobQueue.prefix}:queue` : 'queue',
limiter: limitPerSec > 0 ? {
max: limitPerSec,
duration: 1000,
} : undefined,
settings: {
backoffStrategies: {
apBackoff,
},
},
});
}
// ref. https://github.com/misskey-dev/misskey/pull/7635#issue-971097019
function apBackoff(attemptsMade: number, err: Error) {
const baseDelay = 60 * 1000; // 1min
const maxBackoff = 8 * 60 * 60 * 1000; // 8hours
let backoff = (Math.pow(2, attemptsMade) - 1) * baseDelay;
backoff = Math.min(backoff, maxBackoff);
backoff += Math.round(backoff * Math.random() * 0.2);
return backoff;
}
export type SystemQueue = Bull.Queue<Record<string, unknown>>; export type SystemQueue = Bull.Queue<Record<string, unknown>>;
export type EndedPollNotificationQueue = Bull.Queue<EndedPollNotificationJobData>; export type EndedPollNotificationQueue = Bull.Queue<EndedPollNotificationJobData>;
@ -49,49 +18,49 @@ export type WebhookDeliverQueue = Bull.Queue<WebhookDeliverJobData>;
const $system: Provider = { const $system: Provider = {
provide: 'queue:system', provide: 'queue:system',
useFactory: (config: Config) => q(config, 'system'), useFactory: (config: Config) => new Bull.Queue(QUEUE.SYSTEM, baseQueueOptions(config, QUEUE.SYSTEM)),
inject: [DI.config], inject: [DI.config],
}; };
const $endedPollNotification: Provider = { const $endedPollNotification: Provider = {
provide: 'queue:endedPollNotification', provide: 'queue:endedPollNotification',
useFactory: (config: Config) => q(config, 'endedPollNotification'), useFactory: (config: Config) => new Bull.Queue(QUEUE.ENDED_POLL_NOTIFICATION, baseQueueOptions(config, QUEUE.ENDED_POLL_NOTIFICATION)),
inject: [DI.config], inject: [DI.config],
}; };
const $deliver: Provider = { const $deliver: Provider = {
provide: 'queue:deliver', provide: 'queue:deliver',
useFactory: (config: Config) => q(config, 'deliver', config.deliverJobPerSec ?? 128), useFactory: (config: Config) => new Bull.Queue(QUEUE.DELIVER, baseQueueOptions(config, QUEUE.DELIVER)),
inject: [DI.config], inject: [DI.config],
}; };
const $inbox: Provider = { const $inbox: Provider = {
provide: 'queue:inbox', provide: 'queue:inbox',
useFactory: (config: Config) => q(config, 'inbox', config.inboxJobPerSec ?? 16), useFactory: (config: Config) => new Bull.Queue(QUEUE.INBOX, baseQueueOptions(config, QUEUE.INBOX)),
inject: [DI.config], inject: [DI.config],
}; };
const $db: Provider = { const $db: Provider = {
provide: 'queue:db', provide: 'queue:db',
useFactory: (config: Config) => q(config, 'db'), useFactory: (config: Config) => new Bull.Queue(QUEUE.DB, baseQueueOptions(config, QUEUE.DB)),
inject: [DI.config], inject: [DI.config],
}; };
const $relationship: Provider = { const $relationship: Provider = {
provide: 'queue:relationship', provide: 'queue:relationship',
useFactory: (config: Config) => q(config, 'relationship', config.relashionshipJobPerSec ?? 64), useFactory: (config: Config) => new Bull.Queue(QUEUE.RELATIONSHIP, baseQueueOptions(config, QUEUE.RELATIONSHIP)),
inject: [DI.config], inject: [DI.config],
}; };
const $objectStorage: Provider = { const $objectStorage: Provider = {
provide: 'queue:objectStorage', provide: 'queue:objectStorage',
useFactory: (config: Config) => q(config, 'objectStorage'), useFactory: (config: Config) => new Bull.Queue(QUEUE.OBJECT_STORAGE, baseQueueOptions(config, QUEUE.OBJECT_STORAGE)),
inject: [DI.config], inject: [DI.config],
}; };
const $webhookDeliver: Provider = { const $webhookDeliver: Provider = {
provide: 'queue:webhookDeliver', provide: 'queue:webhookDeliver',
useFactory: (config: Config) => q(config, 'webhookDeliver', 64), useFactory: (config: Config) => new Bull.Queue(QUEUE.WEBHOOK_DELIVER, baseQueueOptions(config, QUEUE.WEBHOOK_DELIVER)),
inject: [DI.config], inject: [DI.config],
}; };
@ -131,7 +100,7 @@ export class QueueModule implements OnApplicationShutdown {
@Inject('queue:webhookDeliver') public webhookDeliverQueue: WebhookDeliverQueue, @Inject('queue:webhookDeliver') public webhookDeliverQueue: WebhookDeliverQueue,
) {} ) {}
async onApplicationShutdown(signal: string): Promise<void> { public async dispose(): Promise<void> {
if (process.env.NODE_ENV === 'test') { if (process.env.NODE_ENV === 'test') {
// XXX: // XXX:
// Shutting down the existing connections causes errors on Jest as // Shutting down the existing connections causes errors on Jest as
@ -151,4 +120,8 @@ export class QueueModule implements OnApplicationShutdown {
this.webhookDeliverQueue.close(), this.webhookDeliverQueue.close(),
]); ]);
} }
async onApplicationShutdown(signal: string): Promise<void> {
await this.dispose();
}
} }

View file

@ -1,6 +1,5 @@
import { Inject, Injectable } from '@nestjs/common'; import { Inject, Injectable } from '@nestjs/common';
import { v4 as uuid } from 'uuid'; import { v4 as uuid } from 'uuid';
import Bull from 'bull';
import type { IActivity } from '@/core/activitypub/type.js'; import type { IActivity } from '@/core/activitypub/type.js';
import type { DriveFile } from '@/models/entities/DriveFile.js'; import type { DriveFile } from '@/models/entities/DriveFile.js';
import type { Webhook, webhookEventTypes } from '@/models/entities/Webhook.js'; import type { Webhook, webhookEventTypes } from '@/models/entities/Webhook.js';
@ -11,6 +10,7 @@ import type { Antenna } from '@/server/api/endpoints/i/import-antennas.js';
import type { DbQueue, DeliverQueue, EndedPollNotificationQueue, InboxQueue, ObjectStorageQueue, RelationshipQueue, SystemQueue, WebhookDeliverQueue } from './QueueModule.js'; import type { DbQueue, DeliverQueue, EndedPollNotificationQueue, InboxQueue, ObjectStorageQueue, RelationshipQueue, SystemQueue, WebhookDeliverQueue } from './QueueModule.js';
import type { DbJobData, RelationshipJobData, ThinUser } from '../queue/types.js'; import type { DbJobData, RelationshipJobData, ThinUser } from '../queue/types.js';
import type httpSignature from '@peertube/http-signature'; import type httpSignature from '@peertube/http-signature';
import type * as Bull from 'bullmq';
@Injectable() @Injectable()
export class QueueService { export class QueueService {
@ -26,7 +26,43 @@ export class QueueService {
@Inject('queue:relationship') public relationshipQueue: RelationshipQueue, @Inject('queue:relationship') public relationshipQueue: RelationshipQueue,
@Inject('queue:objectStorage') public objectStorageQueue: ObjectStorageQueue, @Inject('queue:objectStorage') public objectStorageQueue: ObjectStorageQueue,
@Inject('queue:webhookDeliver') public webhookDeliverQueue: WebhookDeliverQueue, @Inject('queue:webhookDeliver') public webhookDeliverQueue: WebhookDeliverQueue,
) {} ) {
this.systemQueue.add('tickCharts', {
}, {
repeat: { pattern: '55 * * * *' },
removeOnComplete: true,
});
this.systemQueue.add('resyncCharts', {
}, {
repeat: { pattern: '0 0 * * *' },
removeOnComplete: true,
});
this.systemQueue.add('cleanCharts', {
}, {
repeat: { pattern: '0 0 * * *' },
removeOnComplete: true,
});
this.systemQueue.add('aggregateRetention', {
}, {
repeat: { pattern: '0 0 * * *' },
removeOnComplete: true,
});
this.systemQueue.add('clean', {
}, {
repeat: { pattern: '0 0 * * *' },
removeOnComplete: true,
});
this.systemQueue.add('checkExpiredMutings', {
}, {
repeat: { pattern: '*/5 * * * *' },
removeOnComplete: true,
});
}
@bindThis @bindThis
public deliver(user: ThinUser, content: IActivity | null, to: string | null, isSharedInbox: boolean) { public deliver(user: ThinUser, content: IActivity | null, to: string | null, isSharedInbox: boolean) {
@ -42,11 +78,10 @@ export class QueueService {
isSharedInbox, isSharedInbox,
}; };
return this.deliverQueue.add(data, { return this.deliverQueue.add(to, data, {
attempts: this.config.deliverJobMaxAttempts ?? 12, attempts: this.config.deliverJobMaxAttempts ?? 12,
timeout: 1 * 60 * 1000, // 1min
backoff: { backoff: {
type: 'apBackoff', type: 'custom',
}, },
removeOnComplete: true, removeOnComplete: true,
removeOnFail: true, removeOnFail: true,
@ -60,11 +95,10 @@ export class QueueService {
signature, signature,
}; };
return this.inboxQueue.add(data, { return this.inboxQueue.add('', data, {
attempts: this.config.inboxJobMaxAttempts ?? 8, attempts: this.config.inboxJobMaxAttempts ?? 8,
timeout: 5 * 60 * 1000, // 5min
backoff: { backoff: {
type: 'apBackoff', type: 'custom',
}, },
removeOnComplete: true, removeOnComplete: true,
removeOnFail: true, removeOnFail: true,
@ -212,7 +246,7 @@ export class QueueService {
private generateToDbJobData<T extends 'importFollowingToDb' | 'importBlockingToDb', D extends DbJobData<T>>(name: T, data: D): { private generateToDbJobData<T extends 'importFollowingToDb' | 'importBlockingToDb', D extends DbJobData<T>>(name: T, data: D): {
name: string, name: string,
data: D, data: D,
opts: Bull.JobOptions, opts: Bull.JobsOptions,
} { } {
return { return {
name, name,
@ -299,10 +333,10 @@ export class QueueService {
} }
@bindThis @bindThis
private generateRelationshipJobData(name: 'follow' | 'unfollow' | 'block' | 'unblock', data: RelationshipJobData, opts: Bull.JobOptions = {}): { private generateRelationshipJobData(name: 'follow' | 'unfollow' | 'block' | 'unblock', data: RelationshipJobData, opts: Bull.JobsOptions = {}): {
name: string, name: string,
data: RelationshipJobData, data: RelationshipJobData,
opts: Bull.JobOptions, opts: Bull.JobsOptions,
} { } {
return { return {
name, name,
@ -351,11 +385,10 @@ export class QueueService {
eventId: uuid(), eventId: uuid(),
}; };
return this.webhookDeliverQueue.add(data, { return this.webhookDeliverQueue.add(webhook.id, data, {
attempts: 4, attempts: 4,
timeout: 1 * 60 * 1000, // 1min
backoff: { backoff: {
type: 'apBackoff', type: 'custom',
}, },
removeOnComplete: true, removeOnComplete: true,
removeOnFail: true, removeOnFail: true,
@ -367,11 +400,11 @@ export class QueueService {
this.deliverQueue.once('cleaned', (jobs, status) => { this.deliverQueue.once('cleaned', (jobs, status) => {
//deliverLogger.succ(`Cleaned ${jobs.length} ${status} jobs`); //deliverLogger.succ(`Cleaned ${jobs.length} ${status} jobs`);
}); });
this.deliverQueue.clean(0, 'delayed'); this.deliverQueue.clean(0, Infinity, 'delayed');
this.inboxQueue.once('cleaned', (jobs, status) => { this.inboxQueue.once('cleaned', (jobs, status) => {
//inboxLogger.succ(`Cleaned ${jobs.length} ${status} jobs`); //inboxLogger.succ(`Cleaned ${jobs.length} ${status} jobs`);
}); });
this.inboxQueue.clean(0, 'delayed'); this.inboxQueue.clean(0, Infinity, 'delayed');
} }
} }

View file

@ -433,7 +433,12 @@ export class RoleService implements OnApplicationShutdown {
} }
@bindThis @bindThis
public onApplicationShutdown(signal?: string | undefined) { public dispose(): void {
this.redisForSub.off('message', this.onMessage); this.redisForSub.off('message', this.onMessage);
} }
@bindThis
public onApplicationShutdown(signal?: string | undefined): void {
this.dispose();
}
} }

View file

@ -81,7 +81,12 @@ export class WebhookService implements OnApplicationShutdown {
} }
@bindThis @bindThis
public onApplicationShutdown(signal?: string | undefined) { public dispose(): void {
this.redisForSub.off('message', this.onMessage); this.redisForSub.off('message', this.onMessage);
} }
@bindThis
public onApplicationShutdown(signal?: string | undefined): void {
this.dispose();
}
} }

View file

@ -94,7 +94,7 @@ class LdSignature {
@bindThis @bindThis
private getLoader() { private getLoader() {
return async (url: string): Promise<any> => { return async (url: string): Promise<any> => {
if (!url.match('^https?\:\/\/')) throw `Invalid URL ${url}`; if (!url.match('^https?\:\/\/')) throw new Error(`Invalid URL ${url}`);
if (this.preLoad) { if (this.preLoad) {
if (url in CONTEXTS) { if (url in CONTEXTS) {
@ -126,7 +126,7 @@ class LdSignature {
timeout: this.loderTimeout, timeout: this.loderTimeout,
}, { throwErrorWhenResponseNotOk: false }).then(res => { }, { throwErrorWhenResponseNotOk: false }).then(res => {
if (!res.ok) { if (!res.ok) {
throw `${res.status} ${res.statusText}`; throw new Error(`${res.status} ${res.statusText}`);
} else { } else {
return res.json(); return res.json();
} }

View file

@ -18,6 +18,7 @@ import { PollService } from '@/core/PollService.js';
import { StatusError } from '@/misc/status-error.js'; import { StatusError } from '@/misc/status-error.js';
import { UtilityService } from '@/core/UtilityService.js'; import { UtilityService } from '@/core/UtilityService.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { checkHttps } from '@/misc/check-https.js';
import { getOneApId, getApId, getOneApHrefNullable, validPost, isEmoji, getApType } from '../type.js'; import { getOneApId, getApId, getOneApHrefNullable, validPost, isEmoji, getApType } from '../type.js';
// eslint-disable-next-line @typescript-eslint/consistent-type-imports // eslint-disable-next-line @typescript-eslint/consistent-type-imports
import { ApLoggerService } from '../ApLoggerService.js'; import { ApLoggerService } from '../ApLoggerService.js';
@ -32,7 +33,6 @@ import { ApQuestionService } from './ApQuestionService.js';
import { ApImageService } from './ApImageService.js'; import { ApImageService } from './ApImageService.js';
import type { Resolver } from '../ApResolverService.js'; import type { Resolver } from '../ApResolverService.js';
import type { IObject, IPost } from '../type.js'; import type { IObject, IPost } from '../type.js';
import { checkHttps } from '@/misc/check-https.js';
@Injectable() @Injectable()
export class ApNoteService { export class ApNoteService {
@ -230,7 +230,7 @@ export class ApNoteService {
quote = results.filter((x): x is { status: 'ok', res: Note | null } => x.status === 'ok').map(x => x.res).find(x => x); quote = results.filter((x): x is { status: 'ok', res: Note | null } => x.status === 'ok').map(x => x.res).find(x => x);
if (!quote) { if (!quote) {
if (results.some(x => x.status === 'temperror')) { if (results.some(x => x.status === 'temperror')) {
throw 'quote resolve failed'; throw new Error('quote resolve failed');
} }
} }
} }
@ -311,7 +311,7 @@ export class ApNoteService {
// ブロックしてたら中断 // ブロックしてたら中断
const meta = await this.metaService.fetch(); const meta = await this.metaService.fetch();
if (this.utilityService.isBlockedHost(meta.blockedHosts, this.utilityService.extractDbHost(uri))) throw { statusCode: 451 }; if (this.utilityService.isBlockedHost(meta.blockedHosts, this.utilityService.extractDbHost(uri))) throw new StatusError('blocked host', 451);
const unlock = await this.appLockService.getApLock(uri); const unlock = await this.appLockService.getApLock(uri);

View file

@ -60,7 +60,8 @@ export class ChartManagementService implements OnApplicationShutdown {
}, 1000 * 60 * 20); }, 1000 * 60 * 20);
} }
async onApplicationShutdown(signal: string): Promise<void> { @bindThis
public async dispose(): Promise<void> {
clearInterval(this.saveIntervalId); clearInterval(this.saveIntervalId);
if (process.env.NODE_ENV !== 'test') { if (process.env.NODE_ENV !== 'test') {
await Promise.all( await Promise.all(
@ -68,4 +69,9 @@ export class ChartManagementService implements OnApplicationShutdown {
); );
} }
} }
@bindThis
async onApplicationShutdown(signal: string): Promise<void> {
await this.dispose();
}
} }

View file

@ -34,7 +34,12 @@ export class JanitorService implements OnApplicationShutdown {
} }
@bindThis @bindThis
public onApplicationShutdown(signal?: string | undefined) { public dispose(): void {
clearInterval(this.intervalId); clearInterval(this.intervalId);
} }
@bindThis
public onApplicationShutdown(signal?: string | undefined): void {
this.dispose();
}
} }

View file

@ -1,7 +1,11 @@
import { Injectable } from '@nestjs/common'; import { Inject, Injectable } from '@nestjs/common';
import Xev from 'xev'; import Xev from 'xev';
import * as Bull from 'bullmq';
import { QueueService } from '@/core/QueueService.js'; import { QueueService } from '@/core/QueueService.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { DI } from '@/di-symbols.js';
import type { Config } from '@/config.js';
import { QUEUE, baseQueueOptions } from '@/queue/const.js';
import type { OnApplicationShutdown } from '@nestjs/common'; import type { OnApplicationShutdown } from '@nestjs/common';
const ev = new Xev(); const ev = new Xev();
@ -13,6 +17,9 @@ export class QueueStatsService implements OnApplicationShutdown {
private intervalId: NodeJS.Timer; private intervalId: NodeJS.Timer;
constructor( constructor(
@Inject(DI.config)
private config: Config,
private queueService: QueueService, private queueService: QueueService,
) { ) {
} }
@ -31,11 +38,14 @@ export class QueueStatsService implements OnApplicationShutdown {
let activeDeliverJobs = 0; let activeDeliverJobs = 0;
let activeInboxJobs = 0; let activeInboxJobs = 0;
this.queueService.deliverQueue.on('global:active', () => { const deliverQueueEvents = new Bull.QueueEvents(QUEUE.DELIVER, baseQueueOptions(this.config, QUEUE.DELIVER));
const inboxQueueEvents = new Bull.QueueEvents(QUEUE.INBOX, baseQueueOptions(this.config, QUEUE.INBOX));
deliverQueueEvents.on('active', () => {
activeDeliverJobs++; activeDeliverJobs++;
}); });
this.queueService.inboxQueue.on('global:active', () => { inboxQueueEvents.on('active', () => {
activeInboxJobs++; activeInboxJobs++;
}); });
@ -73,7 +83,12 @@ export class QueueStatsService implements OnApplicationShutdown {
} }
@bindThis @bindThis
public onApplicationShutdown(signal?: string | undefined) { public dispose(): void {
clearInterval(this.intervalId); clearInterval(this.intervalId);
} }
@bindThis
public onApplicationShutdown(signal?: string | undefined): void {
this.dispose();
}
} }

View file

@ -63,9 +63,14 @@ export class ServerStatsService implements OnApplicationShutdown {
} }
@bindThis @bindThis
public onApplicationShutdown(signal?: string | undefined) { public dispose(): void {
clearInterval(this.intervalId); clearInterval(this.intervalId);
} }
@bindThis
public onApplicationShutdown(signal?: string | undefined): void {
this.dispose();
}
} }
// CPU STAT // CPU STAT

View file

@ -21,7 +21,7 @@ function getNoise(): string {
export function genAid(date: Date): string { export function genAid(date: Date): string {
const t = date.getTime(); const t = date.getTime();
if (isNaN(t)) throw 'Failed to create AID: Invalid Date'; if (isNaN(t)) throw new Error('Failed to create AID: Invalid Date');
counter++; counter++;
return getTime(t) + getNoise(); return getTime(t) + getNoise();
} }

View file

@ -5,7 +5,8 @@ const dateTimeIntervals = {
}; };
export function dateUTC(time: number[]): Date { export function dateUTC(time: number[]): Date {
const d = time.length === 2 ? Date.UTC(time[0], time[1]) const d =
time.length === 2 ? Date.UTC(time[0], time[1])
: time.length === 3 ? Date.UTC(time[0], time[1], time[2]) : time.length === 3 ? Date.UTC(time[0], time[1], time[2])
: time.length === 4 ? Date.UTC(time[0], time[1], time[2], time[3]) : time.length === 4 ? Date.UTC(time[0], time[1], time[2], time[3])
: time.length === 5 ? Date.UTC(time[0], time[1], time[2], time[3], time[4]) : time.length === 5 ? Date.UTC(time[0], time[1], time[2], time[3], time[4])
@ -13,7 +14,7 @@ export function dateUTC(time: number[]): Date {
: time.length === 7 ? Date.UTC(time[0], time[1], time[2], time[3], time[4], time[5], time[6]) : time.length === 7 ? Date.UTC(time[0], time[1], time[2], time[3], time[4], time[5], time[6])
: null; : null;
if (!d) throw 'wrong number of arguments'; if (!d) throw new Error('wrong number of arguments');
return new Date(d); return new Date(d);
} }

View file

@ -1,10 +1,9 @@
import { Inject, Injectable } from '@nestjs/common'; import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common';
import * as Bull from 'bullmq';
import type { Config } from '@/config.js'; 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 { QueueService } from '@/core/QueueService.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { getJobInfo } from './get-job-info.js';
import { WebhookDeliverProcessorService } from './processors/WebhookDeliverProcessorService.js'; import { WebhookDeliverProcessorService } from './processors/WebhookDeliverProcessorService.js';
import { EndedPollNotificationProcessorService } from './processors/EndedPollNotificationProcessorService.js'; import { EndedPollNotificationProcessorService } from './processors/EndedPollNotificationProcessorService.js';
import { DeliverProcessorService } from './processors/DeliverProcessorService.js'; import { DeliverProcessorService } from './processors/DeliverProcessorService.js';
@ -35,17 +34,51 @@ import { CheckExpiredMutingsProcessorService } from './processors/CheckExpiredMu
import { CleanProcessorService } from './processors/CleanProcessorService.js'; import { CleanProcessorService } from './processors/CleanProcessorService.js';
import { AggregateRetentionProcessorService } from './processors/AggregateRetentionProcessorService.js'; import { AggregateRetentionProcessorService } from './processors/AggregateRetentionProcessorService.js';
import { QueueLoggerService } from './QueueLoggerService.js'; import { QueueLoggerService } from './QueueLoggerService.js';
import { QUEUE, baseQueueOptions } from './const.js';
// ref. https://github.com/misskey-dev/misskey/pull/7635#issue-971097019
function httpRelatedBackoff(attemptsMade: number) {
const baseDelay = 60 * 1000; // 1min
const maxBackoff = 8 * 60 * 60 * 1000; // 8hours
let backoff = (Math.pow(2, attemptsMade) - 1) * baseDelay;
backoff = Math.min(backoff, maxBackoff);
backoff += Math.round(backoff * Math.random() * 0.2);
return backoff;
}
function getJobInfo(job: Bull.Job | undefined, increment = false): string {
if (job == null) return '-';
const age = Date.now() - job.timestamp;
const formated = age > 60000 ? `${Math.floor(age / 1000 / 60)}m`
: age > 10000 ? `${Math.floor(age / 1000)}s`
: `${age}ms`;
// onActiveとかonCompletedのattemptsMadeがなぜか0始まりなのでインクリメントする
const currentAttempts = job.attemptsMade + (increment ? 1 : 0);
const maxAttempts = job.opts ? job.opts.attempts : 0;
return `id=${job.id} attempts=${currentAttempts}/${maxAttempts} age=${formated}`;
}
@Injectable() @Injectable()
export class QueueProcessorService { export class QueueProcessorService implements OnApplicationShutdown {
private logger: Logger; private logger: Logger;
private systemQueueWorker: Bull.Worker;
private dbQueueWorker: Bull.Worker;
private deliverQueueWorker: Bull.Worker;
private inboxQueueWorker: Bull.Worker;
private webhookDeliverQueueWorker: Bull.Worker;
private relationshipQueueWorker: Bull.Worker;
private objectStorageQueueWorker: Bull.Worker;
private endedPollNotificationQueueWorker: Bull.Worker;
constructor( constructor(
@Inject(DI.config) @Inject(DI.config)
private config: Config, private config: Config,
private queueLoggerService: QueueLoggerService, private queueLoggerService: QueueLoggerService,
private queueService: QueueService,
private webhookDeliverProcessorService: WebhookDeliverProcessorService, private webhookDeliverProcessorService: WebhookDeliverProcessorService,
private endedPollNotificationProcessorService: EndedPollNotificationProcessorService, private endedPollNotificationProcessorService: EndedPollNotificationProcessorService,
private deliverProcessorService: DeliverProcessorService, private deliverProcessorService: DeliverProcessorService,
@ -77,10 +110,7 @@ export class QueueProcessorService {
private cleanProcessorService: CleanProcessorService, private cleanProcessorService: CleanProcessorService,
) { ) {
this.logger = this.queueLoggerService.logger; this.logger = this.queueLoggerService.logger;
}
@bindThis
public start() {
function renderError(e: Error): any { function renderError(e: Error): any {
if (e) { // 何故かeがundefinedで来ることがある if (e) { // 何故かeがundefinedで来ることがある
return { return {
@ -97,146 +127,232 @@ export class QueueProcessorService {
} }
} }
const systemLogger = this.logger.createSubLogger('system'); //#region system
const deliverLogger = this.logger.createSubLogger('deliver'); this.systemQueueWorker = new Bull.Worker(QUEUE.SYSTEM, (job) => {
const webhookLogger = this.logger.createSubLogger('webhook'); switch (job.name) {
const inboxLogger = this.logger.createSubLogger('inbox'); case 'tickCharts': return this.tickChartsProcessorService.process();
const dbLogger = this.logger.createSubLogger('db'); case 'resyncCharts': return this.resyncChartsProcessorService.process();
const relationshipLogger = this.logger.createSubLogger('relationship'); case 'cleanCharts': return this.cleanChartsProcessorService.process();
const objectStorageLogger = this.logger.createSubLogger('objectStorage'); case 'aggregateRetention': return this.aggregateRetentionProcessorService.process();
case 'checkExpiredMutings': return this.checkExpiredMutingsProcessorService.process();
case 'clean': return this.cleanProcessorService.process();
default: throw new Error(`unrecognized job type ${job.name} for system`);
}
}, {
...baseQueueOptions(this.config, QUEUE.SYSTEM),
autorun: false,
});
this.queueService.systemQueue const systemLogger = this.logger.createSubLogger('system');
.on('waiting', (jobId) => systemLogger.debug(`waiting id=${jobId}`))
this.systemQueueWorker
.on('active', (job) => systemLogger.debug(`active id=${job.id}`)) .on('active', (job) => systemLogger.debug(`active id=${job.id}`))
.on('completed', (job, result) => systemLogger.debug(`completed(${result}) id=${job.id}`)) .on('completed', (job, result) => systemLogger.debug(`completed(${result}) id=${job.id}`))
.on('failed', (job, err) => systemLogger.warn(`failed(${err}) id=${job.id}`, { job, e: renderError(err) })) .on('failed', (job, err) => systemLogger.warn(`failed(${err}) id=${job ? job.id : '-'}`, { job, e: renderError(err) }))
.on('error', (job: any, err: Error) => systemLogger.error(`error ${err}`, { job, e: renderError(err) })) .on('error', (err: Error) => systemLogger.error(`error ${err}`, { e: renderError(err) }))
.on('stalled', (job) => systemLogger.warn(`stalled id=${job.id}`)); .on('stalled', (jobId) => systemLogger.warn(`stalled id=${jobId}`));
//#endregion
this.queueService.deliverQueue //#region db
.on('waiting', (jobId) => deliverLogger.debug(`waiting id=${jobId}`)) this.dbQueueWorker = new Bull.Worker(QUEUE.DB, (job) => {
.on('active', (job) => deliverLogger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`)) switch (job.name) {
.on('completed', (job, result) => deliverLogger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`)) case 'deleteDriveFiles': return this.deleteDriveFilesProcessorService.process(job);
.on('failed', (job, err) => deliverLogger.warn(`failed(${err}) ${getJobInfo(job)} to=${job.data.to}`)) case 'exportCustomEmojis': return this.exportCustomEmojisProcessorService.process(job);
.on('error', (job: any, err: Error) => deliverLogger.error(`error ${err}`, { job, e: renderError(err) })) case 'exportNotes': return this.exportNotesProcessorService.process(job);
.on('stalled', (job) => deliverLogger.warn(`stalled ${getJobInfo(job)} to=${job.data.to}`)); case 'exportFavorites': return this.exportFavoritesProcessorService.process(job);
case 'exportFollowing': return this.exportFollowingProcessorService.process(job);
case 'exportMuting': return this.exportMutingProcessorService.process(job);
case 'exportBlocking': return this.exportBlockingProcessorService.process(job);
case 'exportUserLists': return this.exportUserListsProcessorService.process(job);
case 'exportAntennas': return this.exportAntennasProcessorService.process(job);
case 'importFollowing': return this.importFollowingProcessorService.process(job);
case 'importFollowingToDb': return this.importFollowingProcessorService.processDb(job);
case 'importMuting': return this.importMutingProcessorService.process(job);
case 'importBlocking': return this.importBlockingProcessorService.process(job);
case 'importBlockingToDb': return this.importBlockingProcessorService.processDb(job);
case 'importUserLists': return this.importUserListsProcessorService.process(job);
case 'importCustomEmojis': return this.importCustomEmojisProcessorService.process(job);
case 'importAntennas': return this.importAntennasProcessorService.process(job);
case 'deleteAccount': return this.deleteAccountProcessorService.process(job);
default: throw new Error(`unrecognized job type ${job.name} for db`);
}
}, {
...baseQueueOptions(this.config, QUEUE.DB),
autorun: false,
});
this.queueService.inboxQueue const dbLogger = this.logger.createSubLogger('db');
.on('waiting', (jobId) => inboxLogger.debug(`waiting id=${jobId}`))
.on('active', (job) => inboxLogger.debug(`active ${getJobInfo(job, true)}`))
.on('completed', (job, result) => inboxLogger.debug(`completed(${result}) ${getJobInfo(job, true)}`))
.on('failed', (job, err) => inboxLogger.warn(`failed(${err}) ${getJobInfo(job)} activity=${job.data.activity ? job.data.activity.id : 'none'}`, { job, e: renderError(err) }))
.on('error', (job: any, err: Error) => inboxLogger.error(`error ${err}`, { job, e: renderError(err) }))
.on('stalled', (job) => inboxLogger.warn(`stalled ${getJobInfo(job)} activity=${job.data.activity ? job.data.activity.id : 'none'}`));
this.queueService.dbQueue this.dbQueueWorker
.on('waiting', (jobId) => dbLogger.debug(`waiting id=${jobId}`))
.on('active', (job) => dbLogger.debug(`active id=${job.id}`)) .on('active', (job) => dbLogger.debug(`active id=${job.id}`))
.on('completed', (job, result) => dbLogger.debug(`completed(${result}) id=${job.id}`)) .on('completed', (job, result) => dbLogger.debug(`completed(${result}) id=${job.id}`))
.on('failed', (job, err) => dbLogger.warn(`failed(${err}) id=${job.id}`, { job, e: renderError(err) })) .on('failed', (job, err) => dbLogger.warn(`failed(${err}) id=${job ? job.id : '-'}`, { job, e: renderError(err) }))
.on('error', (job: any, err: Error) => dbLogger.error(`error ${err}`, { job, e: renderError(err) })) .on('error', (err: Error) => dbLogger.error(`error ${err}`, { e: renderError(err) }))
.on('stalled', (job) => dbLogger.warn(`stalled id=${job.id}`)); .on('stalled', (jobId) => dbLogger.warn(`stalled id=${jobId}`));
//#endregion
this.queueService.relationshipQueue //#region deliver
.on('waiting', (jobId) => relationshipLogger.debug(`waiting id=${jobId}`)) this.deliverQueueWorker = new Bull.Worker(QUEUE.DELIVER, (job) => this.deliverProcessorService.process(job), {
.on('active', (job) => relationshipLogger.debug(`active id=${job.id}`)) ...baseQueueOptions(this.config, QUEUE.DELIVER),
.on('completed', (job, result) => relationshipLogger.debug(`completed(${result}) id=${job.id}`)) autorun: false,
.on('failed', (job, err) => relationshipLogger.warn(`failed(${err}) id=${job.id}`, { job, e: renderError(err) })) concurrency: this.config.deliverJobConcurrency ?? 128,
.on('error', (job: any, err: Error) => relationshipLogger.error(`error ${err}`, { job, e: renderError(err) })) limiter: {
.on('stalled', (job) => relationshipLogger.warn(`stalled id=${job.id}`)); max: this.config.deliverJobPerSec ?? 128,
duration: 1000,
},
settings: {
backoffStrategy: httpRelatedBackoff,
},
});
this.queueService.objectStorageQueue const deliverLogger = this.logger.createSubLogger('deliver');
.on('waiting', (jobId) => objectStorageLogger.debug(`waiting id=${jobId}`))
.on('active', (job) => objectStorageLogger.debug(`active id=${job.id}`))
.on('completed', (job, result) => objectStorageLogger.debug(`completed(${result}) id=${job.id}`))
.on('failed', (job, err) => objectStorageLogger.warn(`failed(${err}) id=${job.id}`, { job, e: renderError(err) }))
.on('error', (job: any, err: Error) => objectStorageLogger.error(`error ${err}`, { job, e: renderError(err) }))
.on('stalled', (job) => objectStorageLogger.warn(`stalled id=${job.id}`));
this.queueService.webhookDeliverQueue this.deliverQueueWorker
.on('waiting', (jobId) => webhookLogger.debug(`waiting id=${jobId}`)) .on('active', (job) => deliverLogger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`))
.on('completed', (job, result) => deliverLogger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`))
.on('failed', (job, err) => deliverLogger.warn(`failed(${err}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`))
.on('error', (err: Error) => deliverLogger.error(`error ${err}`, { e: renderError(err) }))
.on('stalled', (jobId) => deliverLogger.warn(`stalled id=${jobId}`));
//#endregion
//#region inbox
this.inboxQueueWorker = new Bull.Worker(QUEUE.INBOX, (job) => this.inboxProcessorService.process(job), {
...baseQueueOptions(this.config, QUEUE.INBOX),
autorun: false,
concurrency: this.config.inboxJobConcurrency ?? 16,
limiter: {
max: this.config.inboxJobPerSec ?? 16,
duration: 1000,
},
settings: {
backoffStrategy: httpRelatedBackoff,
},
});
const inboxLogger = this.logger.createSubLogger('inbox');
this.inboxQueueWorker
.on('active', (job) => inboxLogger.debug(`active ${getJobInfo(job, true)}`))
.on('completed', (job, result) => inboxLogger.debug(`completed(${result}) ${getJobInfo(job, true)}`))
.on('failed', (job, err) => inboxLogger.warn(`failed(${err}) ${getJobInfo(job)} activity=${job ? (job.data.activity ? job.data.activity.id : 'none') : '-'}`, { job, e: renderError(err) }))
.on('error', (err: Error) => inboxLogger.error(`error ${err}`, { e: renderError(err) }))
.on('stalled', (jobId) => inboxLogger.warn(`stalled id=${jobId}`));
//#endregion
//#region webhook deliver
this.webhookDeliverQueueWorker = new Bull.Worker(QUEUE.WEBHOOK_DELIVER, (job) => this.webhookDeliverProcessorService.process(job), {
...baseQueueOptions(this.config, QUEUE.WEBHOOK_DELIVER),
autorun: false,
concurrency: 64,
limiter: {
max: 64,
duration: 1000,
},
settings: {
backoffStrategy: httpRelatedBackoff,
},
});
const webhookLogger = this.logger.createSubLogger('webhook');
this.webhookDeliverQueueWorker
.on('active', (job) => webhookLogger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`)) .on('active', (job) => webhookLogger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`))
.on('completed', (job, result) => webhookLogger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`)) .on('completed', (job, result) => webhookLogger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`))
.on('failed', (job, err) => webhookLogger.warn(`failed(${err}) ${getJobInfo(job)} to=${job.data.to}`)) .on('failed', (job, err) => webhookLogger.warn(`failed(${err}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`))
.on('error', (job: any, err: Error) => webhookLogger.error(`error ${err}`, { job, e: renderError(err) })) .on('error', (err: Error) => webhookLogger.error(`error ${err}`, { e: renderError(err) }))
.on('stalled', (job) => webhookLogger.warn(`stalled ${getJobInfo(job)} to=${job.data.to}`)); .on('stalled', (jobId) => webhookLogger.warn(`stalled id=${jobId}`));
//#endregion
this.queueService.systemQueue.add('tickCharts', { //#region relationship
this.relationshipQueueWorker = new Bull.Worker(QUEUE.RELATIONSHIP, (job) => {
switch (job.name) {
case 'follow': return this.relationshipProcessorService.processFollow(job);
case 'unfollow': return this.relationshipProcessorService.processUnfollow(job);
case 'block': return this.relationshipProcessorService.processBlock(job);
case 'unblock': return this.relationshipProcessorService.processUnblock(job);
default: throw new Error(`unrecognized job type ${job.name} for relationship`);
}
}, { }, {
repeat: { cron: '55 * * * *' }, ...baseQueueOptions(this.config, QUEUE.RELATIONSHIP),
removeOnComplete: true, autorun: false,
concurrency: this.config.relashionshipJobConcurrency ?? 16,
limiter: {
max: this.config.relashionshipJobPerSec ?? 64,
duration: 1000,
},
}); });
this.queueService.systemQueue.add('resyncCharts', { const relationshipLogger = this.logger.createSubLogger('relationship');
this.relationshipQueueWorker
.on('active', (job) => relationshipLogger.debug(`active id=${job.id}`))
.on('completed', (job, result) => relationshipLogger.debug(`completed(${result}) id=${job.id}`))
.on('failed', (job, err) => relationshipLogger.warn(`failed(${err}) id=${job ? job.id : '-'}`, { job, e: renderError(err) }))
.on('error', (err: Error) => relationshipLogger.error(`error ${err}`, { e: renderError(err) }))
.on('stalled', (jobId) => relationshipLogger.warn(`stalled id=${jobId}`));
//#endregion
//#region object storage
this.objectStorageQueueWorker = new Bull.Worker(QUEUE.OBJECT_STORAGE, (job) => {
switch (job.name) {
case 'deleteFile': return this.deleteFileProcessorService.process(job);
case 'cleanRemoteFiles': return this.cleanRemoteFilesProcessorService.process(job);
default: throw new Error(`unrecognized job type ${job.name} for objectStorage`);
}
}, { }, {
repeat: { cron: '0 0 * * *' }, ...baseQueueOptions(this.config, QUEUE.OBJECT_STORAGE),
removeOnComplete: true, autorun: false,
concurrency: 16,
}); });
this.queueService.systemQueue.add('cleanCharts', { const objectStorageLogger = this.logger.createSubLogger('objectStorage');
}, {
repeat: { cron: '0 0 * * *' }, this.objectStorageQueueWorker
removeOnComplete: true, .on('active', (job) => objectStorageLogger.debug(`active id=${job.id}`))
.on('completed', (job, result) => objectStorageLogger.debug(`completed(${result}) id=${job.id}`))
.on('failed', (job, err) => objectStorageLogger.warn(`failed(${err}) id=${job ? job.id : '-'}`, { job, e: renderError(err) }))
.on('error', (err: Error) => objectStorageLogger.error(`error ${err}`, { e: renderError(err) }))
.on('stalled', (jobId) => objectStorageLogger.warn(`stalled id=${jobId}`));
//#endregion
//#region ended poll notification
this.endedPollNotificationQueueWorker = new Bull.Worker(QUEUE.ENDED_POLL_NOTIFICATION, (job) => this.endedPollNotificationProcessorService.process(job), {
...baseQueueOptions(this.config, QUEUE.ENDED_POLL_NOTIFICATION),
autorun: false,
}); });
//#endregion
this.queueService.systemQueue.add('aggregateRetention', {
}, {
repeat: { cron: '0 0 * * *' },
removeOnComplete: true,
});
this.queueService.systemQueue.add('clean', {
}, {
repeat: { cron: '0 0 * * *' },
removeOnComplete: true,
});
this.queueService.systemQueue.add('checkExpiredMutings', {
}, {
repeat: { cron: '*/5 * * * *' },
removeOnComplete: true,
});
this.queueService.deliverQueue.process(this.config.deliverJobConcurrency ?? 128, (job) => this.deliverProcessorService.process(job));
this.queueService.inboxQueue.process(this.config.inboxJobConcurrency ?? 16, (job) => this.inboxProcessorService.process(job));
this.queueService.endedPollNotificationQueue.process((job, done) => this.endedPollNotificationProcessorService.process(job, done));
this.queueService.webhookDeliverQueue.process(64, (job) => this.webhookDeliverProcessorService.process(job));
this.queueService.dbQueue.process('deleteDriveFiles', (job, done) => this.deleteDriveFilesProcessorService.process(job, done));
this.queueService.dbQueue.process('exportCustomEmojis', (job, done) => this.exportCustomEmojisProcessorService.process(job, done));
this.queueService.dbQueue.process('exportNotes', (job, done) => this.exportNotesProcessorService.process(job, done));
this.queueService.dbQueue.process('exportFavorites', (job, done) => this.exportFavoritesProcessorService.process(job, done));
this.queueService.dbQueue.process('exportFollowing', (job, done) => this.exportFollowingProcessorService.process(job, done));
this.queueService.dbQueue.process('exportMuting', (job, done) => this.exportMutingProcessorService.process(job, done));
this.queueService.dbQueue.process('exportBlocking', (job, done) => this.exportBlockingProcessorService.process(job, done));
this.queueService.dbQueue.process('exportUserLists', (job, done) => this.exportUserListsProcessorService.process(job, done));
this.queueService.dbQueue.process('exportAntennas', (job, done) => this.exportAntennasProcessorService.process(job, done));
this.queueService.dbQueue.process('importFollowing', (job, done) => this.importFollowingProcessorService.process(job, done));
this.queueService.dbQueue.process('importFollowingToDb', (job) => this.importFollowingProcessorService.processDb(job));
this.queueService.dbQueue.process('importMuting', (job, done) => this.importMutingProcessorService.process(job, done));
this.queueService.dbQueue.process('importBlocking', (job, done) => this.importBlockingProcessorService.process(job, done));
this.queueService.dbQueue.process('importBlockingToDb', (job) => this.importBlockingProcessorService.processDb(job));
this.queueService.dbQueue.process('importUserLists', (job, done) => this.importUserListsProcessorService.process(job, done));
this.queueService.dbQueue.process('importCustomEmojis', (job, done) => this.importCustomEmojisProcessorService.process(job, done));
this.queueService.dbQueue.process('importAntennas', (job, done) => this.importAntennasProcessorService.process(job, done));
this.queueService.dbQueue.process('deleteAccount', (job) => this.deleteAccountProcessorService.process(job));
this.queueService.objectStorageQueue.process('deleteFile', 16, (job) => this.deleteFileProcessorService.process(job));
this.queueService.objectStorageQueue.process('cleanRemoteFiles', 16, (job, done) => this.cleanRemoteFilesProcessorService.process(job, done));
{
const maxJobs = this.config.relashionshipJobConcurrency ?? 16;
this.queueService.relationshipQueue.process('follow', maxJobs, (job) => this.relationshipProcessorService.processFollow(job));
this.queueService.relationshipQueue.process('unfollow', maxJobs, (job) => this.relationshipProcessorService.processUnfollow(job));
this.queueService.relationshipQueue.process('block', maxJobs, (job) => this.relationshipProcessorService.processBlock(job));
this.queueService.relationshipQueue.process('unblock', maxJobs, (job) => this.relationshipProcessorService.processUnblock(job));
} }
this.queueService.systemQueue.process('tickCharts', (job, done) => this.tickChartsProcessorService.process(job, done)); @bindThis
this.queueService.systemQueue.process('resyncCharts', (job, done) => this.resyncChartsProcessorService.process(job, done)); public async start(): Promise<void> {
this.queueService.systemQueue.process('cleanCharts', (job, done) => this.cleanChartsProcessorService.process(job, done)); await Promise.all([
this.queueService.systemQueue.process('aggregateRetention', (job, done) => this.aggregateRetentionProcessorService.process(job, done)); this.systemQueueWorker.run(),
this.queueService.systemQueue.process('checkExpiredMutings', (job, done) => this.checkExpiredMutingsProcessorService.process(job, done)); this.dbQueueWorker.run(),
this.queueService.systemQueue.process('clean', (job, done) => this.cleanProcessorService.process(job, done)); this.deliverQueueWorker.run(),
this.inboxQueueWorker.run(),
this.webhookDeliverQueueWorker.run(),
this.relationshipQueueWorker.run(),
this.objectStorageQueueWorker.run(),
this.endedPollNotificationQueueWorker.run(),
]);
}
@bindThis
public async stop(): Promise<void> {
await Promise.all([
this.systemQueueWorker.close(),
this.dbQueueWorker.close(),
this.deliverQueueWorker.close(),
this.inboxQueueWorker.close(),
this.webhookDeliverQueueWorker.close(),
this.relationshipQueueWorker.close(),
this.objectStorageQueueWorker.close(),
this.endedPollNotificationQueueWorker.close(),
]);
}
@bindThis
public async onApplicationShutdown(signal?: string | undefined): Promise<void> {
await this.stop();
} }
} }

View file

@ -0,0 +1,26 @@
import { Config } from '@/config.js';
import type * as Bull from 'bullmq';
export const QUEUE = {
DELIVER: 'deliver',
INBOX: 'inbox',
SYSTEM: 'system',
ENDED_POLL_NOTIFICATION: 'endedPollNotification',
DB: 'db',
RELATIONSHIP: 'relationship',
OBJECT_STORAGE: 'objectStorage',
WEBHOOK_DELIVER: 'webhookDeliver',
};
export function baseQueueOptions(config: Config, queueName: typeof QUEUE[keyof typeof QUEUE]): Bull.QueueOptions {
return {
connection: {
port: config.redisForJobQueue.port,
host: config.redisForJobQueue.host,
family: config.redisForJobQueue.family == null ? 0 : config.redisForJobQueue.family,
password: config.redisForJobQueue.pass,
db: config.redisForJobQueue.db ?? 0,
},
prefix: config.redisForJobQueue.prefix ? `${config.redisForJobQueue.prefix}:queue:${queueName}` : `queue:${queueName}`,
};
}

View file

@ -1,15 +0,0 @@
import Bull from 'bull';
export function getJobInfo(job: Bull.Job, increment = false) {
const age = Date.now() - job.timestamp;
const formated = age > 60000 ? `${Math.floor(age / 1000 / 60)}m`
: age > 10000 ? `${Math.floor(age / 1000)}s`
: `${age}ms`;
// onActiveとかonCompletedのattemptsMadeがなぜか0始まりなのでインクリメントする
const currentAttempts = job.attemptsMade + (increment ? 1 : 0);
const maxAttempts = job.opts ? job.opts.attempts : 0;
return `id=${job.id} attempts=${currentAttempts}/${maxAttempts} age=${formated}`;
}

View file

@ -9,7 +9,7 @@ import { deepClone } from '@/misc/clone.js';
import { IdService } from '@/core/IdService.js'; import { IdService } from '@/core/IdService.js';
import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js'; import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js';
import { QueueLoggerService } from '../QueueLoggerService.js'; import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull'; import type * as Bull from 'bullmq';
@Injectable() @Injectable()
export class AggregateRetentionProcessorService { export class AggregateRetentionProcessorService {
@ -32,7 +32,7 @@ export class AggregateRetentionProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<Record<string, unknown>>, done: () => void): Promise<void> { public async process(): Promise<void> {
this.logger.info('Aggregating retention...'); this.logger.info('Aggregating retention...');
const now = new Date(); const now = new Date();
@ -62,7 +62,6 @@ export class AggregateRetentionProcessorService {
} catch (err) { } catch (err) {
if (isDuplicateKeyValueError(err)) { if (isDuplicateKeyValueError(err)) {
this.logger.succ('Skip because it has already been processed by another worker.'); this.logger.succ('Skip because it has already been processed by another worker.');
done();
return; return;
} }
throw err; throw err;
@ -88,6 +87,5 @@ export class AggregateRetentionProcessorService {
} }
this.logger.succ('Retention aggregated.'); this.logger.succ('Retention aggregated.');
done();
} }
} }

View file

@ -7,7 +7,7 @@ import type Logger from '@/logger.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { UserMutingService } from '@/core/UserMutingService.js'; import { UserMutingService } from '@/core/UserMutingService.js';
import { QueueLoggerService } from '../QueueLoggerService.js'; import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull'; import type * as Bull from 'bullmq';
@Injectable() @Injectable()
export class CheckExpiredMutingsProcessorService { export class CheckExpiredMutingsProcessorService {
@ -27,7 +27,7 @@ export class CheckExpiredMutingsProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<Record<string, unknown>>, done: () => void): Promise<void> { public async process(): Promise<void> {
this.logger.info('Checking expired mutings...'); this.logger.info('Checking expired mutings...');
const expired = await this.mutingsRepository.createQueryBuilder('muting') const expired = await this.mutingsRepository.createQueryBuilder('muting')
@ -41,6 +41,5 @@ export class CheckExpiredMutingsProcessorService {
} }
this.logger.succ('All expired mutings checked.'); this.logger.succ('All expired mutings checked.');
done();
} }
} }

View file

@ -16,7 +16,7 @@ import PerUserDriveChart from '@/core/chart/charts/per-user-drive.js';
import ApRequestChart from '@/core/chart/charts/ap-request.js'; import ApRequestChart from '@/core/chart/charts/ap-request.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js'; import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull'; import type * as Bull from 'bullmq';
@Injectable() @Injectable()
export class CleanChartsProcessorService { export class CleanChartsProcessorService {
@ -45,7 +45,7 @@ export class CleanChartsProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<Record<string, unknown>>, done: () => void): Promise<void> { public async process(): Promise<void> {
this.logger.info('Clean charts...'); this.logger.info('Clean charts...');
await Promise.all([ await Promise.all([
@ -64,6 +64,5 @@ export class CleanChartsProcessorService {
]); ]);
this.logger.succ('All charts successfully cleaned.'); this.logger.succ('All charts successfully cleaned.');
done();
} }
} }

View file

@ -7,7 +7,7 @@ import type Logger from '@/logger.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { IdService } from '@/core/IdService.js'; import { IdService } from '@/core/IdService.js';
import { QueueLoggerService } from '../QueueLoggerService.js'; import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull'; import type * as Bull from 'bullmq';
@Injectable() @Injectable()
export class CleanProcessorService { export class CleanProcessorService {
@ -36,7 +36,7 @@ export class CleanProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<Record<string, unknown>>, done: () => void): Promise<void> { public async process(): Promise<void> {
this.logger.info('Cleaning...'); this.logger.info('Cleaning...');
this.userIpsRepository.delete({ this.userIpsRepository.delete({
@ -72,6 +72,5 @@ export class CleanProcessorService {
} }
this.logger.succ('Cleaned.'); this.logger.succ('Cleaned.');
done();
} }
} }

View file

@ -5,9 +5,9 @@ import type { DriveFilesRepository } from '@/models/index.js';
import type { Config } from '@/config.js'; import type { Config } from '@/config.js';
import type Logger from '@/logger.js'; import type Logger from '@/logger.js';
import { DriveService } from '@/core/DriveService.js'; import { DriveService } from '@/core/DriveService.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type * as Bull from 'bullmq';
@Injectable() @Injectable()
export class CleanRemoteFilesProcessorService { export class CleanRemoteFilesProcessorService {
@ -27,7 +27,7 @@ export class CleanRemoteFilesProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<Record<string, unknown>>, done: () => void): Promise<void> { public async process(job: Bull.Job<Record<string, unknown>>): Promise<void> {
this.logger.info('Deleting cached remote files...'); this.logger.info('Deleting cached remote files...');
let deletedCount = 0; let deletedCount = 0;
@ -47,7 +47,7 @@ export class CleanRemoteFilesProcessorService {
}); });
if (files.length === 0) { if (files.length === 0) {
job.progress(100); job.updateProgress(100);
break; break;
} }
@ -62,10 +62,9 @@ export class CleanRemoteFilesProcessorService {
isLink: false, isLink: false,
}); });
job.progress(deletedCount / total); job.updateProgress(deletedCount / total);
} }
this.logger.succ('All cached remote files has been deleted.'); this.logger.succ('All cached remote files has been deleted.');
done();
} }
} }

View file

@ -8,10 +8,10 @@ import { DriveService } from '@/core/DriveService.js';
import type { DriveFile } from '@/models/entities/DriveFile.js'; import type { DriveFile } from '@/models/entities/DriveFile.js';
import type { Note } from '@/models/entities/Note.js'; import type { Note } from '@/models/entities/Note.js';
import { EmailService } from '@/core/EmailService.js'; import { EmailService } from '@/core/EmailService.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull';
import type { DbUserDeleteJobData } from '../types.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type * as Bull from 'bullmq';
import type { DbUserDeleteJobData } from '../types.js';
@Injectable() @Injectable()
export class DeleteAccountProcessorService { export class DeleteAccountProcessorService {

View file

@ -5,10 +5,10 @@ import type { UsersRepository, DriveFilesRepository } from '@/models/index.js';
import type { Config } from '@/config.js'; import type { Config } from '@/config.js';
import type Logger from '@/logger.js'; import type Logger from '@/logger.js';
import { DriveService } from '@/core/DriveService.js'; import { DriveService } from '@/core/DriveService.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull';
import type { DbJobDataWithUser } from '../types.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type * as Bull from 'bullmq';
import type { DbJobDataWithUser } from '../types.js';
@Injectable() @Injectable()
export class DeleteDriveFilesProcessorService { export class DeleteDriveFilesProcessorService {
@ -31,12 +31,11 @@ export class DeleteDriveFilesProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<DbJobDataWithUser>, done: () => void): Promise<void> { public async process(job: Bull.Job<DbJobDataWithUser>): Promise<void> {
this.logger.info(`Deleting drive files of ${job.data.user.id} ...`); this.logger.info(`Deleting drive files of ${job.data.user.id} ...`);
const user = await this.usersRepository.findOneBy({ id: job.data.user.id }); const user = await this.usersRepository.findOneBy({ id: job.data.user.id });
if (user == null) { if (user == null) {
done();
return; return;
} }
@ -56,7 +55,7 @@ export class DeleteDriveFilesProcessorService {
}); });
if (files.length === 0) { if (files.length === 0) {
job.progress(100); job.updateProgress(100);
break; break;
} }
@ -71,10 +70,9 @@ export class DeleteDriveFilesProcessorService {
userId: user.id, userId: user.id,
}); });
job.progress(deletedCount / total); job.updateProgress(deletedCount / total);
} }
this.logger.succ(`All drive files (${deletedCount}) of ${user.id} has been deleted.`); this.logger.succ(`All drive files (${deletedCount}) of ${user.id} has been deleted.`);
done();
} }
} }

View file

@ -3,10 +3,10 @@ import { DI } from '@/di-symbols.js';
import type { Config } from '@/config.js'; import type { Config } from '@/config.js';
import type Logger from '@/logger.js'; import type Logger from '@/logger.js';
import { DriveService } from '@/core/DriveService.js'; import { DriveService } from '@/core/DriveService.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull';
import type { ObjectStorageFileJobData } from '../types.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type * as Bull from 'bullmq';
import type { ObjectStorageFileJobData } from '../types.js';
@Injectable() @Injectable()
export class DeleteFileProcessorService { export class DeleteFileProcessorService {

View file

@ -1,4 +1,5 @@
import { Inject, Injectable } from '@nestjs/common'; import { Inject, Injectable } from '@nestjs/common';
import * as Bull from 'bullmq';
import { DI } from '@/di-symbols.js'; import { DI } from '@/di-symbols.js';
import type { DriveFilesRepository, InstancesRepository } from '@/models/index.js'; import type { DriveFilesRepository, InstancesRepository } from '@/models/index.js';
import type { Config } from '@/config.js'; import type { Config } from '@/config.js';
@ -16,7 +17,6 @@ import { StatusError } from '@/misc/status-error.js';
import { UtilityService } from '@/core/UtilityService.js'; import { UtilityService } from '@/core/UtilityService.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js'; import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull';
import type { DeliverJobData } from '../types.js'; import type { DeliverJobData } from '../types.js';
@Injectable() @Injectable()
@ -121,15 +121,13 @@ export class DeliverProcessorService {
isSuspended: true, isSuspended: true,
}); });
}); });
return `${host} is gone`; throw new Bull.UnrecoverableError(`${host} is gone`);
} }
// HTTPステータスコード4xxはクライアントエラーであり、それはつまり throw new Bull.UnrecoverableError(`${res.statusCode} ${res.statusMessage}`);
// 何回再送しても成功することはないということなのでエラーにはしないでおく
return `${res.statusCode} ${res.statusMessage}`;
} }
// 5xx etc. // 5xx etc.
throw `${res.statusCode} ${res.statusMessage}`; throw new Error(`${res.statusCode} ${res.statusMessage}`);
} else { } else {
// DNS error, socket error, timeout ... // DNS error, socket error, timeout ...
throw res; throw res;

View file

@ -6,7 +6,7 @@ import type Logger from '@/logger.js';
import { NotificationService } from '@/core/NotificationService.js'; import { NotificationService } from '@/core/NotificationService.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js'; import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull'; import type * as Bull from 'bullmq';
import type { EndedPollNotificationJobData } from '../types.js'; import type { EndedPollNotificationJobData } from '../types.js';
@Injectable() @Injectable()
@ -30,10 +30,9 @@ export class EndedPollNotificationProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<EndedPollNotificationJobData>, done: () => void): Promise<void> { public async process(job: Bull.Job<EndedPollNotificationJobData>): Promise<void> {
const note = await this.notesRepository.findOneBy({ id: job.data.noteId }); const note = await this.notesRepository.findOneBy({ id: job.data.noteId });
if (note == null || !note.hasPoll) { if (note == null || !note.hasPoll) {
done();
return; return;
} }
@ -51,7 +50,5 @@ export class EndedPollNotificationProcessorService {
noteId: note.id, noteId: note.id,
}); });
} }
done();
} }
} }

View file

@ -12,7 +12,7 @@ import { createTemp } from '@/misc/create-temp.js';
import { UtilityService } from '@/core/UtilityService.js'; import { UtilityService } from '@/core/UtilityService.js';
import { QueueLoggerService } from '../QueueLoggerService.js'; import { QueueLoggerService } from '../QueueLoggerService.js';
import type { DBExportAntennasData } from '../types.js'; import type { DBExportAntennasData } from '../types.js';
import type Bull from 'bull'; import type * as Bull from 'bullmq';
@Injectable() @Injectable()
export class ExportAntennasProcessorService { export class ExportAntennasProcessorService {
@ -39,10 +39,9 @@ export class ExportAntennasProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<DBExportAntennasData>, done: () => void): Promise<void> { public async process(job: Bull.Job<DBExportAntennasData>): Promise<void> {
const user = await this.usersRepository.findOneBy({ id: job.data.user.id }); const user = await this.usersRepository.findOneBy({ id: job.data.user.id });
if (user == null) { if (user == null) {
done();
return; return;
} }
const [path, cleanup] = await createTemp(); const [path, cleanup] = await createTemp();
@ -96,7 +95,6 @@ export class ExportAntennasProcessorService {
this.logger.succ('Exported to: ' + driveFile.id); this.logger.succ('Exported to: ' + driveFile.id);
} finally { } finally {
cleanup(); cleanup();
done();
} }
} }
} }

View file

@ -9,10 +9,10 @@ import type Logger from '@/logger.js';
import { DriveService } from '@/core/DriveService.js'; import { DriveService } from '@/core/DriveService.js';
import { createTemp } from '@/misc/create-temp.js'; import { createTemp } from '@/misc/create-temp.js';
import { UtilityService } from '@/core/UtilityService.js'; import { UtilityService } from '@/core/UtilityService.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull';
import type { DbJobDataWithUser } from '../types.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type * as Bull from 'bullmq';
import type { DbJobDataWithUser } from '../types.js';
@Injectable() @Injectable()
export class ExportBlockingProcessorService { export class ExportBlockingProcessorService {
@ -36,12 +36,11 @@ export class ExportBlockingProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<DbJobDataWithUser>, done: () => void): Promise<void> { public async process(job: Bull.Job<DbJobDataWithUser>): Promise<void> {
this.logger.info(`Exporting blocking of ${job.data.user.id} ...`); this.logger.info(`Exporting blocking of ${job.data.user.id} ...`);
const user = await this.usersRepository.findOneBy({ id: job.data.user.id }); const user = await this.usersRepository.findOneBy({ id: job.data.user.id });
if (user == null) { if (user == null) {
done();
return; return;
} }
@ -69,7 +68,7 @@ export class ExportBlockingProcessorService {
}); });
if (blockings.length === 0) { if (blockings.length === 0) {
job.progress(100); job.updateProgress(100);
break; break;
} }
@ -99,7 +98,7 @@ export class ExportBlockingProcessorService {
blockerId: user.id, blockerId: user.id,
}); });
job.progress(exportedCount / total); job.updateProgress(exportedCount / total);
} }
stream.end(); stream.end();
@ -112,7 +111,5 @@ export class ExportBlockingProcessorService {
} finally { } finally {
cleanup(); cleanup();
} }
done();
} }
} }

View file

@ -13,7 +13,7 @@ import { createTemp, createTempDir } from '@/misc/create-temp.js';
import { DownloadService } from '@/core/DownloadService.js'; import { DownloadService } from '@/core/DownloadService.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js'; import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull'; import type * as Bull from 'bullmq';
@Injectable() @Injectable()
export class ExportCustomEmojisProcessorService { export class ExportCustomEmojisProcessorService {
@ -37,12 +37,11 @@ export class ExportCustomEmojisProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job, done: () => void): Promise<void> { public async process(job: Bull.Job): Promise<void> {
this.logger.info('Exporting custom emojis ...'); this.logger.info('Exporting custom emojis ...');
const user = await this.usersRepository.findOneBy({ id: job.data.user.id }); const user = await this.usersRepository.findOneBy({ id: job.data.user.id });
if (user == null) { if (user == null) {
done();
return; return;
} }
@ -117,6 +116,7 @@ export class ExportCustomEmojisProcessorService {
metaStream.end(); metaStream.end();
// Create archive // Create archive
await new Promise<void>(async (resolve) => {
const [archivePath, archiveCleanup] = await createTemp(); const [archivePath, archiveCleanup] = await createTemp();
const archiveStream = fs.createWriteStream(archivePath); const archiveStream = fs.createWriteStream(archivePath);
const archive = archiver('zip', { const archive = archiver('zip', {
@ -131,10 +131,11 @@ export class ExportCustomEmojisProcessorService {
this.logger.succ(`Exported to: ${driveFile.id}`); this.logger.succ(`Exported to: ${driveFile.id}`);
cleanup(); cleanup();
archiveCleanup(); archiveCleanup();
done(); resolve();
}); });
archive.pipe(archiveStream); archive.pipe(archiveStream);
archive.directory(path, false); archive.directory(path, false);
archive.finalize(); archive.finalize();
});
} }
} }

View file

@ -12,7 +12,7 @@ import type { Poll } from '@/models/entities/Poll.js';
import type { Note } from '@/models/entities/Note.js'; import type { Note } from '@/models/entities/Note.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js'; import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull'; import type * as Bull from 'bullmq';
import type { DbJobDataWithUser } from '../types.js'; import type { DbJobDataWithUser } from '../types.js';
@Injectable() @Injectable()
@ -42,12 +42,11 @@ export class ExportFavoritesProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<DbJobDataWithUser>, done: () => void): Promise<void> { public async process(job: Bull.Job<DbJobDataWithUser>): Promise<void> {
this.logger.info(`Exporting favorites of ${job.data.user.id} ...`); this.logger.info(`Exporting favorites of ${job.data.user.id} ...`);
const user = await this.usersRepository.findOneBy({ id: job.data.user.id }); const user = await this.usersRepository.findOneBy({ id: job.data.user.id });
if (user == null) { if (user == null) {
done();
return; return;
} }
@ -91,7 +90,7 @@ export class ExportFavoritesProcessorService {
}) as (NoteFavorite & { note: Note & { user: User } })[]; }) as (NoteFavorite & { note: Note & { user: User } })[];
if (favorites.length === 0) { if (favorites.length === 0) {
job.progress(100); job.updateProgress(100);
break; break;
} }
@ -112,7 +111,7 @@ export class ExportFavoritesProcessorService {
userId: user.id, userId: user.id,
}); });
job.progress(exportedFavoritesCount / total); job.updateProgress(exportedFavoritesCount / total);
} }
await write(']'); await write(']');
@ -127,8 +126,6 @@ export class ExportFavoritesProcessorService {
} finally { } finally {
cleanup(); cleanup();
} }
done();
} }
} }

View file

@ -10,10 +10,10 @@ import { DriveService } from '@/core/DriveService.js';
import { createTemp } from '@/misc/create-temp.js'; import { createTemp } from '@/misc/create-temp.js';
import type { Following } from '@/models/entities/Following.js'; import type { Following } from '@/models/entities/Following.js';
import { UtilityService } from '@/core/UtilityService.js'; import { UtilityService } from '@/core/UtilityService.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull';
import type { DbExportFollowingData } from '../types.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type * as Bull from 'bullmq';
import type { DbExportFollowingData } from '../types.js';
@Injectable() @Injectable()
export class ExportFollowingProcessorService { export class ExportFollowingProcessorService {
@ -40,12 +40,11 @@ export class ExportFollowingProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<DbExportFollowingData>, done: () => void): Promise<void> { public async process(job: Bull.Job<DbExportFollowingData>): Promise<void> {
this.logger.info(`Exporting following of ${job.data.user.id} ...`); this.logger.info(`Exporting following of ${job.data.user.id} ...`);
const user = await this.usersRepository.findOneBy({ id: job.data.user.id }); const user = await this.usersRepository.findOneBy({ id: job.data.user.id });
if (user == null) { if (user == null) {
done();
return; return;
} }
@ -116,7 +115,5 @@ export class ExportFollowingProcessorService {
} finally { } finally {
cleanup(); cleanup();
} }
done();
} }
} }

View file

@ -9,10 +9,10 @@ import type Logger from '@/logger.js';
import { DriveService } from '@/core/DriveService.js'; import { DriveService } from '@/core/DriveService.js';
import { createTemp } from '@/misc/create-temp.js'; import { createTemp } from '@/misc/create-temp.js';
import { UtilityService } from '@/core/UtilityService.js'; import { UtilityService } from '@/core/UtilityService.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull';
import type { DbJobDataWithUser } from '../types.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type * as Bull from 'bullmq';
import type { DbJobDataWithUser } from '../types.js';
@Injectable() @Injectable()
export class ExportMutingProcessorService { export class ExportMutingProcessorService {
@ -39,12 +39,11 @@ export class ExportMutingProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<DbJobDataWithUser>, done: () => void): Promise<void> { public async process(job: Bull.Job<DbJobDataWithUser>): Promise<void> {
this.logger.info(`Exporting muting of ${job.data.user.id} ...`); this.logger.info(`Exporting muting of ${job.data.user.id} ...`);
const user = await this.usersRepository.findOneBy({ id: job.data.user.id }); const user = await this.usersRepository.findOneBy({ id: job.data.user.id });
if (user == null) { if (user == null) {
done();
return; return;
} }
@ -73,7 +72,7 @@ export class ExportMutingProcessorService {
}); });
if (mutes.length === 0) { if (mutes.length === 0) {
job.progress(100); job.updateProgress(100);
break; break;
} }
@ -103,7 +102,7 @@ export class ExportMutingProcessorService {
muterId: user.id, muterId: user.id,
}); });
job.progress(exportedCount / total); job.updateProgress(exportedCount / total);
} }
stream.end(); stream.end();
@ -116,7 +115,5 @@ export class ExportMutingProcessorService {
} finally { } finally {
cleanup(); cleanup();
} }
done();
} }
} }

View file

@ -12,7 +12,7 @@ import type { Poll } from '@/models/entities/Poll.js';
import type { Note } from '@/models/entities/Note.js'; import type { Note } from '@/models/entities/Note.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js'; import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull'; import type * as Bull from 'bullmq';
import type { DbJobDataWithUser } from '../types.js'; import type { DbJobDataWithUser } from '../types.js';
@Injectable() @Injectable()
@ -39,12 +39,11 @@ export class ExportNotesProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<DbJobDataWithUser>, done: () => void): Promise<void> { public async process(job: Bull.Job<DbJobDataWithUser>): Promise<void> {
this.logger.info(`Exporting notes of ${job.data.user.id} ...`); this.logger.info(`Exporting notes of ${job.data.user.id} ...`);
const user = await this.usersRepository.findOneBy({ id: job.data.user.id }); const user = await this.usersRepository.findOneBy({ id: job.data.user.id });
if (user == null) { if (user == null) {
done();
return; return;
} }
@ -87,7 +86,7 @@ export class ExportNotesProcessorService {
}) as Note[]; }) as Note[];
if (notes.length === 0) { if (notes.length === 0) {
job.progress(100); job.updateProgress(100);
break; break;
} }
@ -108,7 +107,7 @@ export class ExportNotesProcessorService {
userId: user.id, userId: user.id,
}); });
job.progress(exportedNotesCount / total); job.updateProgress(exportedNotesCount / total);
} }
await write(']'); await write(']');
@ -123,8 +122,6 @@ export class ExportNotesProcessorService {
} finally { } finally {
cleanup(); cleanup();
} }
done();
} }
} }

View file

@ -9,10 +9,10 @@ import type Logger from '@/logger.js';
import { DriveService } from '@/core/DriveService.js'; import { DriveService } from '@/core/DriveService.js';
import { createTemp } from '@/misc/create-temp.js'; import { createTemp } from '@/misc/create-temp.js';
import { UtilityService } from '@/core/UtilityService.js'; import { UtilityService } from '@/core/UtilityService.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull';
import type { DbJobDataWithUser } from '../types.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type * as Bull from 'bullmq';
import type { DbJobDataWithUser } from '../types.js';
@Injectable() @Injectable()
export class ExportUserListsProcessorService { export class ExportUserListsProcessorService {
@ -39,12 +39,11 @@ export class ExportUserListsProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<DbJobDataWithUser>, done: () => void): Promise<void> { public async process(job: Bull.Job<DbJobDataWithUser>): Promise<void> {
this.logger.info(`Exporting user lists of ${job.data.user.id} ...`); this.logger.info(`Exporting user lists of ${job.data.user.id} ...`);
const user = await this.usersRepository.findOneBy({ id: job.data.user.id }); const user = await this.usersRepository.findOneBy({ id: job.data.user.id });
if (user == null) { if (user == null) {
done();
return; return;
} }
@ -92,7 +91,5 @@ export class ExportUserListsProcessorService {
} finally { } finally {
cleanup(); cleanup();
} }
done();
} }
} }

View file

@ -8,7 +8,7 @@ import { DI } from '@/di-symbols.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js'; import { QueueLoggerService } from '../QueueLoggerService.js';
import { DBAntennaImportJobData } from '../types.js'; import { DBAntennaImportJobData } from '../types.js';
import type Bull from 'bull'; import type * as Bull from 'bullmq';
const validate = new Ajv().compile({ const validate = new Ajv().compile({
type: 'object', type: 'object',
@ -59,7 +59,7 @@ export class ImportAntennasProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<DBAntennaImportJobData>, done: () => void): Promise<void> { public async process(job: Bull.Job<DBAntennaImportJobData>): Promise<void> {
const now = new Date(); const now = new Date();
try { try {
for (const antenna of job.data.antenna) { for (const antenna of job.data.antenna) {
@ -89,8 +89,6 @@ export class ImportAntennasProcessorService {
} }
} catch (err: any) { } catch (err: any) {
this.logger.error(err); this.logger.error(err);
} finally {
done();
} }
} }
} }

View file

@ -7,11 +7,11 @@ import * as Acct from '@/misc/acct.js';
import { RemoteUserResolveService } from '@/core/RemoteUserResolveService.js'; import { RemoteUserResolveService } from '@/core/RemoteUserResolveService.js';
import { DownloadService } from '@/core/DownloadService.js'; import { DownloadService } from '@/core/DownloadService.js';
import { UtilityService } from '@/core/UtilityService.js'; import { UtilityService } from '@/core/UtilityService.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull';
import type { DbUserImportJobData, DbUserImportToDbJobData } from '../types.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueService } from '@/core/QueueService.js'; import { QueueService } from '@/core/QueueService.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type * as Bull from 'bullmq';
import type { DbUserImportJobData, DbUserImportToDbJobData } from '../types.js';
@Injectable() @Injectable()
export class ImportBlockingProcessorService { export class ImportBlockingProcessorService {
@ -34,12 +34,11 @@ export class ImportBlockingProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<DbUserImportJobData>, done: () => void): Promise<void> { public async process(job: Bull.Job<DbUserImportJobData>): Promise<void> {
this.logger.info(`Importing blocking of ${job.data.user.id} ...`); this.logger.info(`Importing blocking of ${job.data.user.id} ...`);
const user = await this.usersRepository.findOneBy({ id: job.data.user.id }); const user = await this.usersRepository.findOneBy({ id: job.data.user.id });
if (user == null) { if (user == null) {
done();
return; return;
} }
@ -47,7 +46,6 @@ export class ImportBlockingProcessorService {
id: job.data.fileId, id: job.data.fileId,
}); });
if (file == null) { if (file == null) {
done();
return; return;
} }
@ -56,7 +54,6 @@ export class ImportBlockingProcessorService {
this.queueService.createImportBlockingToDbJob({ id: user.id }, targets); this.queueService.createImportBlockingToDbJob({ id: user.id }, targets);
this.logger.succ('Import jobs created'); this.logger.succ('Import jobs created');
done();
} }
@bindThis @bindThis
@ -85,7 +82,7 @@ export class ImportBlockingProcessorService {
} }
if (target == null) { if (target == null) {
throw `Unable to resolve user: @${username}@${host}`; throw new Error(`Unable to resolve user: @${username}@${host}`);
} }
// skip myself // skip myself

View file

@ -12,7 +12,7 @@ import { DriveService } from '@/core/DriveService.js';
import { DownloadService } from '@/core/DownloadService.js'; import { DownloadService } from '@/core/DownloadService.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js'; import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull'; import type * as Bull from 'bullmq';
import type { DbUserImportJobData } from '../types.js'; import type { DbUserImportJobData } from '../types.js';
// TODO: 名前衝突時の動作を選べるようにする // TODO: 名前衝突時の動作を選べるようにする
@ -45,14 +45,13 @@ export class ImportCustomEmojisProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<DbUserImportJobData>, done: () => void): Promise<void> { public async process(job: Bull.Job<DbUserImportJobData>): Promise<void> {
this.logger.info('Importing custom emojis ...'); this.logger.info('Importing custom emojis ...');
const file = await this.driveFilesRepository.findOneBy({ const file = await this.driveFilesRepository.findOneBy({
id: job.data.fileId, id: job.data.fileId,
}); });
if (file == null) { if (file == null) {
done();
return; return;
} }
@ -116,7 +115,6 @@ export class ImportCustomEmojisProcessorService {
cleanup(); cleanup();
this.logger.succ('Imported'); this.logger.succ('Imported');
done();
}); });
unzipStream.pipe(extractor); unzipStream.pipe(extractor);
this.logger.succ(`Unzipping to ${outputPath}`); this.logger.succ(`Unzipping to ${outputPath}`);

View file

@ -7,11 +7,11 @@ import * as Acct from '@/misc/acct.js';
import { RemoteUserResolveService } from '@/core/RemoteUserResolveService.js'; import { RemoteUserResolveService } from '@/core/RemoteUserResolveService.js';
import { DownloadService } from '@/core/DownloadService.js'; import { DownloadService } from '@/core/DownloadService.js';
import { UtilityService } from '@/core/UtilityService.js'; import { UtilityService } from '@/core/UtilityService.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull';
import type { DbUserImportJobData, DbUserImportToDbJobData } from '../types.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueService } from '@/core/QueueService.js'; import { QueueService } from '@/core/QueueService.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type * as Bull from 'bullmq';
import type { DbUserImportJobData, DbUserImportToDbJobData } from '../types.js';
@Injectable() @Injectable()
export class ImportFollowingProcessorService { export class ImportFollowingProcessorService {
@ -34,12 +34,11 @@ export class ImportFollowingProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<DbUserImportJobData>, done: () => void): Promise<void> { public async process(job: Bull.Job<DbUserImportJobData>): Promise<void> {
this.logger.info(`Importing following of ${job.data.user.id} ...`); this.logger.info(`Importing following of ${job.data.user.id} ...`);
const user = await this.usersRepository.findOneBy({ id: job.data.user.id }); const user = await this.usersRepository.findOneBy({ id: job.data.user.id });
if (user == null) { if (user == null) {
done();
return; return;
} }
@ -47,7 +46,6 @@ export class ImportFollowingProcessorService {
id: job.data.fileId, id: job.data.fileId,
}); });
if (file == null) { if (file == null) {
done();
return; return;
} }
@ -56,7 +54,6 @@ export class ImportFollowingProcessorService {
this.queueService.createImportFollowingToDbJob({ id: user.id }, targets); this.queueService.createImportFollowingToDbJob({ id: user.id }, targets);
this.logger.succ('Import jobs created'); this.logger.succ('Import jobs created');
done();
} }
@bindThis @bindThis
@ -85,7 +82,7 @@ export class ImportFollowingProcessorService {
} }
if (target == null) { if (target == null) {
throw `Unable to resolve user: @${username}@${host}`; throw new Error(`Unable to resolve user: @${username}@${host}`);
} }
// skip myself // skip myself

View file

@ -9,10 +9,10 @@ import { RemoteUserResolveService } from '@/core/RemoteUserResolveService.js';
import { DownloadService } from '@/core/DownloadService.js'; import { DownloadService } from '@/core/DownloadService.js';
import { UserMutingService } from '@/core/UserMutingService.js'; import { UserMutingService } from '@/core/UserMutingService.js';
import { UtilityService } from '@/core/UtilityService.js'; import { UtilityService } from '@/core/UtilityService.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull';
import type { DbUserImportJobData } from '../types.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type * as Bull from 'bullmq';
import type { DbUserImportJobData } from '../types.js';
@Injectable() @Injectable()
export class ImportMutingProcessorService { export class ImportMutingProcessorService {
@ -38,12 +38,11 @@ export class ImportMutingProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<DbUserImportJobData>, done: () => void): Promise<void> { public async process(job: Bull.Job<DbUserImportJobData>): Promise<void> {
this.logger.info(`Importing muting of ${job.data.user.id} ...`); this.logger.info(`Importing muting of ${job.data.user.id} ...`);
const user = await this.usersRepository.findOneBy({ id: job.data.user.id }); const user = await this.usersRepository.findOneBy({ id: job.data.user.id });
if (user == null) { if (user == null) {
done();
return; return;
} }
@ -51,7 +50,6 @@ export class ImportMutingProcessorService {
id: job.data.fileId, id: job.data.fileId,
}); });
if (file == null) { if (file == null) {
done();
return; return;
} }
@ -83,7 +81,7 @@ export class ImportMutingProcessorService {
} }
if (target == null) { if (target == null) {
throw `cannot resolve user: @${username}@${host}`; throw new Error(`cannot resolve user: @${username}@${host}`);
} }
// skip myself // skip myself
@ -98,6 +96,5 @@ export class ImportMutingProcessorService {
} }
this.logger.succ('Imported'); this.logger.succ('Imported');
done();
} }
} }

View file

@ -12,7 +12,7 @@ import { IdService } from '@/core/IdService.js';
import { UtilityService } from '@/core/UtilityService.js'; import { UtilityService } from '@/core/UtilityService.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js'; import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull'; import type * as Bull from 'bullmq';
import type { DbUserImportJobData } from '../types.js'; import type { DbUserImportJobData } from '../types.js';
@Injectable() @Injectable()
@ -46,12 +46,11 @@ export class ImportUserListsProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<DbUserImportJobData>, done: () => void): Promise<void> { public async process(job: Bull.Job<DbUserImportJobData>): Promise<void> {
this.logger.info(`Importing user lists of ${job.data.user.id} ...`); this.logger.info(`Importing user lists of ${job.data.user.id} ...`);
const user = await this.usersRepository.findOneBy({ id: job.data.user.id }); const user = await this.usersRepository.findOneBy({ id: job.data.user.id });
if (user == null) { if (user == null) {
done();
return; return;
} }
@ -59,7 +58,6 @@ export class ImportUserListsProcessorService {
id: job.data.fileId, id: job.data.fileId,
}); });
if (file == null) { if (file == null) {
done();
return; return;
} }
@ -109,6 +107,5 @@ export class ImportUserListsProcessorService {
} }
this.logger.succ('Imported'); this.logger.succ('Imported');
done();
} }
} }

View file

@ -1,8 +1,8 @@
import { URL } from 'node:url'; import { URL } from 'node:url';
import { Inject, Injectable } from '@nestjs/common'; import { Inject, Injectable } from '@nestjs/common';
import httpSignature from '@peertube/http-signature'; import httpSignature from '@peertube/http-signature';
import * as Bull from 'bullmq';
import { DI } from '@/di-symbols.js'; import { DI } from '@/di-symbols.js';
import type { InstancesRepository, DriveFilesRepository } from '@/models/index.js';
import type { Config } from '@/config.js'; import type { Config } from '@/config.js';
import type Logger from '@/logger.js'; import type Logger from '@/logger.js';
import { MetaService } from '@/core/MetaService.js'; import { MetaService } from '@/core/MetaService.js';
@ -23,10 +23,8 @@ import { LdSignatureService } from '@/core/activitypub/LdSignatureService.js';
import { ApInboxService } from '@/core/activitypub/ApInboxService.js'; import { ApInboxService } from '@/core/activitypub/ApInboxService.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js'; import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull';
import type { InboxJobData } from '../types.js'; import type { InboxJobData } from '../types.js';
// ユーザーのinboxにアクティビティが届いた時の処理
@Injectable() @Injectable()
export class InboxProcessorService { export class InboxProcessorService {
private logger: Logger; private logger: Logger;
@ -35,12 +33,6 @@ export class InboxProcessorService {
@Inject(DI.config) @Inject(DI.config)
private config: Config, private config: Config,
@Inject(DI.instancesRepository)
private instancesRepository: InstancesRepository,
@Inject(DI.driveFilesRepository)
private driveFilesRepository: DriveFilesRepository,
private utilityService: UtilityService, private utilityService: UtilityService,
private metaService: MetaService, private metaService: MetaService,
private apInboxService: ApInboxService, private apInboxService: ApInboxService,
@ -96,21 +88,21 @@ export class InboxProcessorService {
// 対象が4xxならスキップ // 対象が4xxならスキップ
if (err instanceof StatusError) { if (err instanceof StatusError) {
if (err.isClientError) { if (err.isClientError) {
return `skip: Ignored deleted actors on both ends ${activity.actor} - ${err.statusCode}`; throw new Bull.UnrecoverableError(`skip: Ignored deleted actors on both ends ${activity.actor} - ${err.statusCode}`);
} }
throw `Error in actor ${activity.actor} - ${err.statusCode ?? err}`; throw new Error(`Error in actor ${activity.actor} - ${err.statusCode ?? err}`);
} }
} }
} }
// それでもわからなければ終了 // それでもわからなければ終了
if (authUser == null) { if (authUser == null) {
return 'skip: failed to resolve user'; throw new Bull.UnrecoverableError('skip: failed to resolve user');
} }
// publicKey がなくても終了 // publicKey がなくても終了
if (authUser.key == null) { if (authUser.key == null) {
return 'skip: failed to resolve user publicKey'; throw new Bull.UnrecoverableError('skip: failed to resolve user publicKey');
} }
// HTTP-Signatureの検証 // HTTP-Signatureの検証
@ -121,7 +113,7 @@ export class InboxProcessorService {
// 一致しなくても、でもLD-Signatureがありそうならそっちも見る // 一致しなくても、でもLD-Signatureがありそうならそっちも見る
if (activity.signature) { if (activity.signature) {
if (activity.signature.type !== 'RsaSignature2017') { if (activity.signature.type !== 'RsaSignature2017') {
return `skip: unsupported LD-signature type ${activity.signature.type}`; throw new Bull.UnrecoverableError(`skip: unsupported LD-signature type ${activity.signature.type}`);
} }
// activity.signature.creator: https://example.oom/users/user#main-key // activity.signature.creator: https://example.oom/users/user#main-key
@ -134,32 +126,32 @@ export class InboxProcessorService {
// keyIdからLD-Signatureのユーザーを取得 // keyIdからLD-Signatureのユーザーを取得
authUser = await this.apDbResolverService.getAuthUserFromKeyId(activity.signature.creator); authUser = await this.apDbResolverService.getAuthUserFromKeyId(activity.signature.creator);
if (authUser == null) { if (authUser == null) {
return 'skip: LD-Signatureのユーザーが取得できませんでした'; throw new Bull.UnrecoverableError('skip: LD-Signatureのユーザーが取得できませんでした');
} }
if (authUser.key == null) { if (authUser.key == null) {
return 'skip: LD-SignatureのユーザーはpublicKeyを持っていませんでした'; throw new Bull.UnrecoverableError('skip: LD-SignatureのユーザーはpublicKeyを持っていませんでした');
} }
// LD-Signature検証 // LD-Signature検証
const ldSignature = this.ldSignatureService.use(); const ldSignature = this.ldSignatureService.use();
const verified = await ldSignature.verifyRsaSignature2017(activity, authUser.key.keyPem).catch(() => false); const verified = await ldSignature.verifyRsaSignature2017(activity, authUser.key.keyPem).catch(() => false);
if (!verified) { if (!verified) {
return 'skip: LD-Signatureの検証に失敗しました'; throw new Bull.UnrecoverableError('skip: LD-Signatureの検証に失敗しました');
} }
// もう一度actorチェック // もう一度actorチェック
if (authUser.user.uri !== activity.actor) { if (authUser.user.uri !== activity.actor) {
return `skip: LD-Signature user(${authUser.user.uri}) !== activity.actor(${activity.actor})`; throw new Bull.UnrecoverableError(`skip: LD-Signature user(${authUser.user.uri}) !== activity.actor(${activity.actor})`);
} }
// ブロックしてたら中断 // ブロックしてたら中断
const ldHost = this.utilityService.extractDbHost(authUser.user.uri); const ldHost = this.utilityService.extractDbHost(authUser.user.uri);
if (this.utilityService.isBlockedHost(meta.blockedHosts, ldHost)) { if (this.utilityService.isBlockedHost(meta.blockedHosts, ldHost)) {
return `Blocked request: ${ldHost}`; throw new Bull.UnrecoverableError(`Blocked request: ${ldHost}`);
} }
} else { } else {
return `skip: http-signature verification failed and no LD-Signature. keyId=${signature.keyId}`; throw new Bull.UnrecoverableError(`skip: http-signature verification failed and no LD-Signature. keyId=${signature.keyId}`);
} }
} }
@ -168,7 +160,7 @@ export class InboxProcessorService {
const signerHost = this.utilityService.extractDbHost(authUser.user.uri!); const signerHost = this.utilityService.extractDbHost(authUser.user.uri!);
const activityIdHost = this.utilityService.extractDbHost(activity.id); const activityIdHost = this.utilityService.extractDbHost(activity.id);
if (signerHost !== activityIdHost) { if (signerHost !== activityIdHost) {
return `skip: signerHost(${signerHost}) !== activity.id host(${activityIdHost}`; throw new Bull.UnrecoverableError(`skip: signerHost(${signerHost}) !== activity.id host(${activityIdHost}`);
} }
} }

View file

@ -1,5 +1,5 @@
import { Inject, Injectable } from '@nestjs/common'; import { Inject, Injectable } from '@nestjs/common';
import type Bull from 'bull'; import type * as Bull from 'bullmq';
import { UserFollowingService } from '@/core/UserFollowingService.js'; import { UserFollowingService } from '@/core/UserFollowingService.js';
import { UserBlockingService } from '@/core/UserBlockingService.js'; import { UserBlockingService } from '@/core/UserBlockingService.js';

View file

@ -15,7 +15,7 @@ import PerUserDriveChart from '@/core/chart/charts/per-user-drive.js';
import ApRequestChart from '@/core/chart/charts/ap-request.js'; import ApRequestChart from '@/core/chart/charts/ap-request.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js'; import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull'; import type * as Bull from 'bullmq';
@Injectable() @Injectable()
export class ResyncChartsProcessorService { export class ResyncChartsProcessorService {
@ -43,7 +43,7 @@ export class ResyncChartsProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<Record<string, unknown>>, done: () => void): Promise<void> { public async process(): Promise<void> {
this.logger.info('Resync charts...'); this.logger.info('Resync charts...');
// TODO: ユーザーごとのチャートも更新する // TODO: ユーザーごとのチャートも更新する
@ -55,6 +55,5 @@ export class ResyncChartsProcessorService {
]); ]);
this.logger.succ('All charts successfully resynced.'); this.logger.succ('All charts successfully resynced.');
done();
} }
} }

View file

@ -16,7 +16,7 @@ import PerUserDriveChart from '@/core/chart/charts/per-user-drive.js';
import ApRequestChart from '@/core/chart/charts/ap-request.js'; import ApRequestChart from '@/core/chart/charts/ap-request.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js'; import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull'; import type * as Bull from 'bullmq';
@Injectable() @Injectable()
export class TickChartsProcessorService { export class TickChartsProcessorService {
@ -45,7 +45,7 @@ export class TickChartsProcessorService {
} }
@bindThis @bindThis
public async process(job: Bull.Job<Record<string, unknown>>, done: () => void): Promise<void> { public async process(): Promise<void> {
this.logger.info('Tick charts...'); this.logger.info('Tick charts...');
await Promise.all([ await Promise.all([
@ -64,6 +64,5 @@ export class TickChartsProcessorService {
]); ]);
this.logger.succ('All charts successfully ticked.'); this.logger.succ('All charts successfully ticked.');
done();
} }
} }

View file

@ -1,4 +1,5 @@
import { Inject, Injectable } from '@nestjs/common'; import { Inject, Injectable } from '@nestjs/common';
import * as Bull from 'bullmq';
import { DI } from '@/di-symbols.js'; import { DI } from '@/di-symbols.js';
import type { WebhooksRepository } from '@/models/index.js'; import type { WebhooksRepository } from '@/models/index.js';
import type { Config } from '@/config.js'; import type { Config } from '@/config.js';
@ -7,7 +8,6 @@ import { HttpRequestService } from '@/core/HttpRequestService.js';
import { StatusError } from '@/misc/status-error.js'; import { StatusError } from '@/misc/status-error.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { QueueLoggerService } from '../QueueLoggerService.js'; import { QueueLoggerService } from '../QueueLoggerService.js';
import type Bull from 'bull';
import type { WebhookDeliverJobData } from '../types.js'; import type { WebhookDeliverJobData } from '../types.js';
@Injectable() @Injectable()
@ -66,11 +66,11 @@ export class WebhookDeliverProcessorService {
if (res instanceof StatusError) { if (res instanceof StatusError) {
// 4xx // 4xx
if (res.isClientError) { if (res.isClientError) {
return `${res.statusCode} ${res.statusMessage}`; throw new Bull.UnrecoverableError(`${res.statusCode} ${res.statusMessage}`);
} }
// 5xx etc. // 5xx etc.
throw `${res.statusCode} ${res.statusMessage}`; throw new Error(`${res.statusCode} ${res.statusMessage}`);
} else { } else {
// DNS error, socket error, timeout ... // DNS error, socket error, timeout ...
throw res; throw res;

View file

@ -194,7 +194,7 @@ export class ServerService implements OnApplicationShutdown {
fastify.register(this.clientServerService.createServer); fastify.register(this.clientServerService.createServer);
this.streamingApiServerService.attachStreamingApi(fastify.server); this.streamingApiServerService.attach(fastify.server);
fastify.server.on('error', err => { fastify.server.on('error', err => {
switch ((err as any).code) { switch ((err as any).code) {
@ -222,7 +222,14 @@ export class ServerService implements OnApplicationShutdown {
await fastify.ready(); await fastify.ready();
} }
async onApplicationShutdown(signal: string): Promise<void> { @bindThis
public async dispose(): Promise<void> {
await this.streamingApiServerService.detach();
await this.#fastify.close(); await this.#fastify.close();
} }
@bindThis
async onApplicationShutdown(signal: string): Promise<void> {
await this.dispose();
}
} }

View file

@ -363,7 +363,12 @@ export class ApiCallService implements OnApplicationShutdown {
} }
@bindThis @bindThis
public onApplicationShutdown(signal?: string | undefined) { public dispose(): void {
clearInterval(this.userIpHistoriesClearIntervalId); clearInterval(this.userIpHistoriesClearIntervalId);
} }
@bindThis
public onApplicationShutdown(signal?: string | undefined): void {
this.dispose();
}
} }

View file

@ -36,7 +36,7 @@ export class AuthenticateService {
} }
@bindThis @bindThis
public async authenticate(token: string | null | undefined): Promise<[LocalUser | null | undefined, AccessToken | null | undefined]> { public async authenticate(token: string | null | undefined): Promise<[LocalUser | null, AccessToken | null]> {
if (token == null) { if (token == null) {
return [null, null]; return [null, null];
} }

View file

@ -1,23 +1,25 @@
import { EventEmitter } from 'events'; import { EventEmitter } from 'events';
import { Inject, Injectable } from '@nestjs/common'; import { Inject, Injectable } from '@nestjs/common';
import * as Redis from 'ioredis'; import * as Redis from 'ioredis';
import * as websocket from 'websocket'; import * as WebSocket from 'ws';
import { DI } from '@/di-symbols.js'; import { DI } from '@/di-symbols.js';
import type { UsersRepository, BlockingsRepository, ChannelFollowingsRepository, FollowingsRepository, MutingsRepository, UserProfilesRepository, RenoteMutingsRepository } from '@/models/index.js'; import type { UsersRepository, AccessToken } from '@/models/index.js';
import type { Config } from '@/config.js'; import type { Config } from '@/config.js';
import { NoteReadService } from '@/core/NoteReadService.js'; import { NoteReadService } from '@/core/NoteReadService.js';
import { GlobalEventService } from '@/core/GlobalEventService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js';
import { NotificationService } from '@/core/NotificationService.js'; import { NotificationService } from '@/core/NotificationService.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { CacheService } from '@/core/CacheService.js'; import { CacheService } from '@/core/CacheService.js';
import { AuthenticateService } from './AuthenticateService.js'; import { LocalUser } from '@/models/entities/User';
import { AuthenticateService, AuthenticationError } from './AuthenticateService.js';
import MainStreamConnection from './stream/index.js'; import MainStreamConnection from './stream/index.js';
import { ChannelsService } from './stream/ChannelsService.js'; import { ChannelsService } from './stream/ChannelsService.js';
import type { ParsedUrlQuery } from 'querystring';
import type * as http from 'node:http'; import type * as http from 'node:http';
@Injectable() @Injectable()
export class StreamingApiServerService { export class StreamingApiServerService {
#wss: WebSocket.WebSocketServer;
constructor( constructor(
@Inject(DI.config) @Inject(DI.config)
private config: Config, private config: Config,
@ -28,24 +30,6 @@ export class StreamingApiServerService {
@Inject(DI.usersRepository) @Inject(DI.usersRepository)
private usersRepository: UsersRepository, private usersRepository: UsersRepository,
@Inject(DI.followingsRepository)
private followingsRepository: FollowingsRepository,
@Inject(DI.mutingsRepository)
private mutingsRepository: MutingsRepository,
@Inject(DI.renoteMutingsRepository)
private renoteMutingsRepository: RenoteMutingsRepository,
@Inject(DI.blockingsRepository)
private blockingsRepository: BlockingsRepository,
@Inject(DI.channelFollowingsRepository)
private channelFollowingsRepository: ChannelFollowingsRepository,
@Inject(DI.userProfilesRepository)
private userProfilesRepository: UserProfilesRepository,
private cacheService: CacheService, private cacheService: CacheService,
private noteReadService: NoteReadService, private noteReadService: NoteReadService,
private authenticateService: AuthenticateService, private authenticateService: AuthenticateService,
@ -55,25 +39,65 @@ export class StreamingApiServerService {
} }
@bindThis @bindThis
public attachStreamingApi(server: http.Server) { public attach(server: http.Server): void {
// Init websocket server this.#wss = new WebSocket.WebSocketServer({
const ws = new websocket.server({ noServer: true,
httpServer: server,
}); });
ws.on('request', async (request) => { server.on('upgrade', async (request, socket, head) => {
const q = request.resourceURL.query as ParsedUrlQuery; if (request.url == null) {
socket.write('HTTP/1.1 400 Bad Request\r\n\r\n');
// TODO: トークンが間違ってるなどしてauthenticateに失敗したら socket.destroy();
// コネクション切断するなりエラーメッセージ返すなりする
// (現状はエラーがキャッチされておらずサーバーのログに流れて邪魔なので)
const [user, miapp] = await this.authenticateService.authenticate(q.i as string);
if (user?.isSuspended) {
request.reject(400);
return; return;
} }
const q = new URL(request.url, `http://${request.headers.host}`).searchParams;
let user: LocalUser | null = null;
let app: AccessToken | null = null;
try {
[user, app] = await this.authenticateService.authenticate(q.get('i'));
} catch (e) {
if (e instanceof AuthenticationError) {
socket.write('HTTP/1.1 401 Unauthorized\r\n\r\n');
} else {
socket.write('HTTP/1.1 500 Internal Server Error\r\n\r\n');
}
socket.destroy();
return;
}
if (user?.isSuspended) {
socket.write('HTTP/1.1 403 Forbidden\r\n\r\n');
socket.destroy();
return;
}
const stream = new MainStreamConnection(
this.channelsService,
this.noteReadService,
this.notificationService,
this.cacheService,
user, app,
);
await stream.init();
this.#wss.handleUpgrade(request, socket, head, (ws) => {
this.#wss.emit('connection', ws, request, {
stream, user, app,
});
});
});
this.#wss.on('connection', async (connection: WebSocket.WebSocket, request: http.IncomingMessage, ctx: {
stream: MainStreamConnection,
user: LocalUser | null;
app: AccessToken | null
}) => {
const { stream, user, app } = ctx;
const ev = new EventEmitter(); const ev = new EventEmitter();
async function onRedisMessage(_: string, data: string): Promise<void> { async function onRedisMessage(_: string, data: string): Promise<void> {
@ -83,19 +107,7 @@ export class StreamingApiServerService {
this.redisForSub.on('message', onRedisMessage); this.redisForSub.on('message', onRedisMessage);
const main = new MainStreamConnection( await stream.listen(ev, connection);
this.channelsService,
this.noteReadService,
this.notificationService,
this.cacheService,
ev, user, miapp,
);
await main.init();
const connection = request.accept();
main.init2(connection);
const intervalId = user ? setInterval(() => { const intervalId = user ? setInterval(() => {
this.usersRepository.update(user.id, { this.usersRepository.update(user.id, {
@ -110,16 +122,23 @@ export class StreamingApiServerService {
connection.once('close', () => { connection.once('close', () => {
ev.removeAllListeners(); ev.removeAllListeners();
main.dispose(); stream.dispose();
this.redisForSub.off('message', onRedisMessage); this.redisForSub.off('message', onRedisMessage);
if (intervalId) clearInterval(intervalId); if (intervalId) clearInterval(intervalId);
}); });
connection.on('message', async (data) => { connection.on('message', async (data) => {
if (data.type === 'utf8' && data.utf8Data === 'ping') { if (data.toString() === 'ping') {
connection.send('pong'); connection.send('pong');
} }
}); });
}); });
} }
@bindThis
public detach(): Promise<void> {
return new Promise((resolve) => {
this.#wss.close(() => resolve());
});
}
} }

View file

@ -21,7 +21,7 @@ export default class extends Endpoint<'admin/relays/add'> {
) { ) {
super(async (ps, me) => { super(async (ps, me) => {
try { try {
if (new URL(ps.inbox).protocol !== 'https:') throw 'https only'; if (new URL(ps.inbox).protocol !== 'https:') throw new Error('https only');
} catch { } catch {
throw new ApiError(this.meta.errors.invalidUrl); throw new ApiError(this.meta.errors.invalidUrl);
} }

View file

@ -82,14 +82,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
try { try {
if (ps.tag) { if (ps.tag) {
if (!safeForSql(normalizeForSearch(ps.tag))) throw 'Injection'; if (!safeForSql(normalizeForSearch(ps.tag))) throw new Error('Injection');
query.andWhere(`'{"${normalizeForSearch(ps.tag)}"}' <@ note.tags`); query.andWhere(`'{"${normalizeForSearch(ps.tag)}"}' <@ note.tags`);
} else { } else {
query.andWhere(new Brackets(qb => { query.andWhere(new Brackets(qb => {
for (const tags of ps.query!) { for (const tags of ps.query!) {
qb.orWhere(new Brackets(qb => { qb.orWhere(new Brackets(qb => {
for (const tag of tags) { for (const tag of tags) {
if (!safeForSql(normalizeForSearch(tag))) throw 'Injection'; if (!safeForSql(normalizeForSearch(tag))) throw new Error('Injection');
qb.andWhere(`'{"${normalizeForSearch(tag)}"}' <@ note.tags`); qb.andWhere(`'{"${normalizeForSearch(tag)}"}' <@ note.tags`);
} }
})); }));

View file

@ -34,7 +34,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
private redisClient: Redis.Redis, private redisClient: Redis.Redis,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
if (process.env.NODE_ENV !== 'test') throw 'NODE_ENV is not a test'; if (process.env.NODE_ENV !== 'test') throw new Error('NODE_ENV is not a test');
await redisClient.flushdb(); await redisClient.flushdb();
await resetDb(this.db); await resetDb(this.db);

View file

@ -1,3 +1,4 @@
import * as WebSocket from 'ws';
import type { User } from '@/models/entities/User.js'; import type { User } from '@/models/entities/User.js';
import type { AccessToken } from '@/models/entities/AccessToken.js'; import type { AccessToken } from '@/models/entities/AccessToken.js';
import type { Packed } from 'misskey-js'; import type { Packed } from 'misskey-js';
@ -7,7 +8,6 @@ import { bindThis } from '@/decorators.js';
import { CacheService } from '@/core/CacheService.js'; import { CacheService } from '@/core/CacheService.js';
import { UserProfile } from '@/models/index.js'; import { UserProfile } from '@/models/index.js';
import type { ChannelsService } from './ChannelsService.js'; import type { ChannelsService } from './ChannelsService.js';
import type * as websocket from 'websocket';
import type { EventEmitter } from 'events'; import type { EventEmitter } from 'events';
import type Channel from './channel.js'; import type Channel from './channel.js';
import type { StreamEventEmitter, StreamMessages } from './types.js'; import type { StreamEventEmitter, StreamMessages } from './types.js';
@ -18,7 +18,7 @@ import type { StreamEventEmitter, StreamMessages } from './types.js';
export default class Connection { export default class Connection {
public user?: User; public user?: User;
public token?: AccessToken; public token?: AccessToken;
private wsConnection: websocket.connection; private wsConnection: WebSocket.WebSocket;
public subscriber: StreamEventEmitter; public subscriber: StreamEventEmitter;
private channels: Channel[] = []; private channels: Channel[] = [];
private subscribingNotes: any = {}; private subscribingNotes: any = {};
@ -37,11 +37,9 @@ export default class Connection {
private notificationService: NotificationService, private notificationService: NotificationService,
private cacheService: CacheService, private cacheService: CacheService,
subscriber: EventEmitter,
user: User | null | undefined, user: User | null | undefined,
token: AccessToken | null | undefined, token: AccessToken | null | undefined,
) { ) {
this.subscriber = subscriber;
if (user) this.user = user; if (user) this.user = user;
if (token) this.token = token; if (token) this.token = token;
} }
@ -70,12 +68,16 @@ export default class Connection {
if (this.user != null) { if (this.user != null) {
await this.fetch(); await this.fetch();
if (!this.fetchIntervalId) {
this.fetchIntervalId = setInterval(this.fetch, 1000 * 10); this.fetchIntervalId = setInterval(this.fetch, 1000 * 10);
} }
} }
}
@bindThis @bindThis
public async init2(wsConnection: websocket.connection) { public async listen(subscriber: EventEmitter, wsConnection: WebSocket.WebSocket) {
this.subscriber = subscriber;
this.wsConnection = wsConnection; this.wsConnection = wsConnection;
this.wsConnection.on('message', this.onWsConnectionMessage); this.wsConnection.on('message', this.onWsConnectionMessage);
@ -88,14 +90,11 @@ export default class Connection {
* *
*/ */
@bindThis @bindThis
private async onWsConnectionMessage(data: websocket.Message) { private async onWsConnectionMessage(data: WebSocket.RawData) {
if (data.type !== 'utf8') return;
if (data.utf8Data == null) return;
let obj: Record<string, any>; let obj: Record<string, any>;
try { try {
obj = JSON.parse(data.utf8Data); obj = JSON.parse(data.toString());
} catch (e) { } catch (e) {
return; return;
} }

View file

@ -52,11 +52,7 @@ export class MockResolver extends Resolver {
const r = this._rs.get(value); const r = this._rs.get(value);
if (!r) { if (!r) {
throw { throw new Error('Not registed for mock');
name: 'StatusError',
statusCode: 404,
message: 'Not registed for mock',
};
} }
const object = JSON.parse(r.content); const object = JSON.parse(r.content);

View file

@ -482,7 +482,7 @@ export async function testPaginationConsistency<Entity extends { id: string, cre
} }
export async function initTestDb(justBorrow = false, initEntities?: any[]) { export async function initTestDb(justBorrow = false, initEntities?: any[]) {
if (process.env.NODE_ENV !== 'test') throw 'NODE_ENV is not a test'; if (process.env.NODE_ENV !== 'test') throw new Error('NODE_ENV is not a test');
const db = new DataSource({ const db = new DataSource({
type: 'postgres', type: 'postgres',

View file

@ -56,6 +56,7 @@ module.exports = {
'vue/require-v-for-key': 'warn', 'vue/require-v-for-key': 'warn',
'vue/no-unused-components': 'warn', 'vue/no-unused-components': 'warn',
'vue/no-unused-vars': 'warn', 'vue/no-unused-vars': 'warn',
'vue/no-dupe-keys': 'warn',
'vue/valid-v-for': 'warn', 'vue/valid-v-for': 'warn',
'vue/return-in-computed-property': 'warn', 'vue/return-in-computed-property': 'warn',
'vue/no-setup-props-destructure': 'warn', 'vue/no-setup-props-destructure': 'warn',

View file

@ -70,40 +70,40 @@
"typescript": "5.0.4", "typescript": "5.0.4",
"uuid": "9.0.0", "uuid": "9.0.0",
"vanilla-tilt": "1.8.0", "vanilla-tilt": "1.8.0",
"vite": "4.3.8", "vite": "4.3.9",
"vue": "3.3.4", "vue": "3.3.4",
"vue-plyr": "7.0.0", "vue-plyr": "7.0.0",
"vue-prism-editor": "2.0.0-alpha.2", "vue-prism-editor": "2.0.0-alpha.2",
"vuedraggable": "next" "vuedraggable": "next"
}, },
"devDependencies": { "devDependencies": {
"@storybook/addon-actions": "7.0.15", "@storybook/addon-actions": "7.0.18",
"@storybook/addon-essentials": "7.0.15", "@storybook/addon-essentials": "7.0.18",
"@storybook/addon-interactions": "7.0.15", "@storybook/addon-interactions": "7.0.18",
"@storybook/addon-links": "7.0.15", "@storybook/addon-links": "7.0.18",
"@storybook/addon-storysource": "7.0.15", "@storybook/addon-storysource": "7.0.18",
"@storybook/addons": "7.0.15", "@storybook/addons": "7.0.18",
"@storybook/blocks": "7.0.15", "@storybook/blocks": "7.0.18",
"@storybook/core-events": "7.0.15", "@storybook/core-events": "7.0.18",
"@storybook/jest": "0.1.0", "@storybook/jest": "0.1.0",
"@storybook/manager-api": "7.0.15", "@storybook/manager-api": "7.0.18",
"@storybook/preview-api": "7.0.15", "@storybook/preview-api": "7.0.18",
"@storybook/react": "7.0.15", "@storybook/react": "7.0.18",
"@storybook/react-vite": "7.0.15", "@storybook/react-vite": "7.0.18",
"@storybook/testing-library": "0.1.0", "@storybook/testing-library": "0.1.0",
"@storybook/theming": "7.0.15", "@storybook/theming": "7.0.18",
"@storybook/types": "7.0.15", "@storybook/types": "7.0.18",
"@storybook/vue3": "7.0.15", "@storybook/vue3": "7.0.18",
"@storybook/vue3-vite": "7.0.15", "@storybook/vue3-vite": "7.0.18",
"@testing-library/jest-dom": "5.16.5", "@testing-library/jest-dom": "5.16.5",
"@testing-library/vue": "7.0.0", "@testing-library/vue": "7.0.0",
"@types/escape-regexp": "0.0.1", "@types/escape-regexp": "0.0.1",
"@types/estree": "1.0.1", "@types/estree": "1.0.1",
"@types/gulp": "4.0.10", "@types/gulp": "4.0.10",
"@types/gulp-rename": "2.0.2", "@types/gulp-rename": "2.0.2",
"@types/matter-js": "0.18.4", "@types/matter-js": "0.18.5",
"@types/micromatch": "4.0.2", "@types/micromatch": "4.0.2",
"@types/node": "20.2.3", "@types/node": "20.2.5",
"@types/punycode": "2.1.0", "@types/punycode": "2.1.0",
"@types/sanitize-html": "2.9.0", "@types/sanitize-html": "2.9.0",
"@types/seedrandom": "3.0.5", "@types/seedrandom": "3.0.5",
@ -123,7 +123,7 @@
"cypress": "12.13.0", "cypress": "12.13.0",
"eslint": "8.40.0", "eslint": "8.40.0",
"eslint-plugin-import": "2.27.5", "eslint-plugin-import": "2.27.5",
"eslint-plugin-vue": "9.14.0", "eslint-plugin-vue": "9.14.1",
"fast-glob": "3.2.12", "fast-glob": "3.2.12",
"happy-dom": "9.19.2", "happy-dom": "9.19.2",
"micromatch": "3.1.10", "micromatch": "3.1.10",
@ -133,7 +133,7 @@
"react": "18.2.0", "react": "18.2.0",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"start-server-and-test": "2.0.0", "start-server-and-test": "2.0.0",
"storybook": "7.0.15", "storybook": "7.0.18",
"storybook-addon-misskey-theme": "github:misskey-dev/storybook-addon-misskey-theme", "storybook-addon-misskey-theme": "github:misskey-dev/storybook-addon-misskey-theme",
"summaly": "github:misskey-dev/summaly", "summaly": "github:misskey-dev/summaly",
"vite-plugin-turbosnap": "1.0.2", "vite-plugin-turbosnap": "1.0.2",

View file

@ -1,7 +1,6 @@
<template> <template>
<div <div
class="ncvczrfv" :class="[$style.root, { [$style.isSelected]: isSelected }]"
:class="{ isSelected }"
draggable="true" draggable="true"
:title="title" :title="title"
@click="onClick" @click="onClick"
@ -9,25 +8,27 @@
@dragstart="onDragstart" @dragstart="onDragstart"
@dragend="onDragend" @dragend="onDragend"
> >
<div v-if="$i?.avatarId == file.id" class="label"> <div style="pointer-events: none;">
<img src="/client-assets/label.svg"/> <div v-if="$i?.avatarId == file.id" :class="[$style.label]">
<p>{{ i18n.ts.avatar }}</p> <img :class="$style.labelImg" src="/client-assets/label.svg"/>
<p :class="$style.labelText">{{ i18n.ts.avatar }}</p>
</div> </div>
<div v-if="$i?.bannerId == file.id" class="label"> <div v-if="$i?.bannerId == file.id" :class="[$style.label]">
<img src="/client-assets/label.svg"/> <img :class="$style.labelImg" src="/client-assets/label.svg"/>
<p>{{ i18n.ts.banner }}</p> <p :class="$style.labelText">{{ i18n.ts.banner }}</p>
</div> </div>
<div v-if="file.isSensitive" class="label red"> <div v-if="file.isSensitive" :class="[$style.label, $style.red]">
<img src="/client-assets/label-red.svg"/> <img :class="$style.labelImg" src="/client-assets/label-red.svg"/>
<p>{{ i18n.ts.nsfw }}</p> <p :class="$style.labelText">{{ i18n.ts.nsfw }}</p>
</div> </div>
<MkDriveFileThumbnail class="thumbnail" :file="file" fit="contain"/> <MkDriveFileThumbnail :class="$style.thumbnail" :file="file" fit="contain"/>
<p class="name"> <p :class="$style.name">
<span>{{ file.name.lastIndexOf('.') != -1 ? file.name.substr(0, file.name.lastIndexOf('.')) : file.name }}</span> <span>{{ file.name.lastIndexOf('.') != -1 ? file.name.substr(0, file.name.lastIndexOf('.')) : file.name }}</span>
<span v-if="file.name.lastIndexOf('.') != -1" class="ext">{{ file.name.substr(file.name.lastIndexOf('.')) }}</span> <span v-if="file.name.lastIndexOf('.') != -1" style="opacity: 0.5;">{{ file.name.substr(file.name.lastIndexOf('.')) }}</span>
</p> </p>
</div>
</div> </div>
</template> </template>
@ -88,20 +89,13 @@ function onDragend() {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" module>
.ncvczrfv { .root {
position: relative; position: relative;
padding: 8px 0 0 0; padding: 8px 0 0 0;
min-height: 180px; min-height: 180px;
border-radius: 8px; border-radius: 8px;
&, * {
cursor: pointer; cursor: pointer;
}
> * {
pointer-events: none;
}
&:hover { &:hover {
background: rgba(#000, 0.05); background: rgba(#000, 0.05);
@ -165,8 +159,9 @@ function onDragend() {
color: #fff; color: #fff;
} }
} }
}
> .label { .label {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
@ -201,15 +196,16 @@ function onDragend() {
background: #c12113; background: #c12113;
} }
} }
}
> img { .labelImg {
position: absolute; position: absolute;
z-index: 2; z-index: 2;
top: 0; top: 0;
left: 0; left: 0;
} }
> p { .labelText {
position: absolute; position: absolute;
z-index: 3; z-index: 3;
top: 19px; top: 19px;
@ -220,16 +216,15 @@ function onDragend() {
line-height: 28px; line-height: 28px;
color: #fff; color: #fff;
transform: rotate(-45deg); transform: rotate(-45deg);
} }
}
> .thumbnail { .thumbnail {
width: 110px; width: 110px;
height: 110px; height: 110px;
margin: auto; margin: auto;
} }
> .name { .name {
display: block; display: block;
margin: 4px 0 0 0; margin: 4px 0 0 0;
font-size: 0.8em; font-size: 0.8em;
@ -237,10 +232,5 @@ function onDragend() {
word-break: break-all; word-break: break-all;
color: var(--fg); color: var(--fg);
overflow: hidden; overflow: hidden;
> .ext {
opacity: 0.5;
}
}
} }
</style> </style>

View file

@ -1,7 +1,6 @@
<template> <template>
<div <div
class="rghtznwe" :class="[$style.root, { [$style.draghover]: draghover }]"
:class="{ draghover }"
draggable="true" draggable="true"
:title="title" :title="title"
@click="onClick" @click="onClick"
@ -15,15 +14,15 @@
@dragstart="onDragstart" @dragstart="onDragstart"
@dragend="onDragend" @dragend="onDragend"
> >
<p class="name"> <p :class="$style.name">
<template v-if="hover"><i class="ti ti-folder ti-fw"></i></template> <template v-if="hover"><i :class="$style.icon" class="ti ti-folder ti-fw"></i></template>
<template v-if="!hover"><i class="ti ti-folder ti-fw"></i></template> <template v-if="!hover"><i :class="$style.icon" class="ti ti-folder ti-fw"></i></template>
{{ folder.name }} {{ folder.name }}
</p> </p>
<p v-if="defaultStore.state.uploadFolder == folder.id" class="upload"> <p v-if="defaultStore.state.uploadFolder == folder.id" :class="$style.upload">
{{ i18n.ts.uploadFolder }} {{ i18n.ts.uploadFolder }}
</p> </p>
<button v-if="selectMode" class="checkbox _button" :class="{ checked: isSelected }" @click.prevent.stop="checkboxClicked"></button> <button v-if="selectMode" class="_button" :class="[$style.checkbox, { [$style.checked]: isSelected }]" @click.prevent.stop="checkboxClicked"></button>
</div> </div>
</template> </template>
@ -267,35 +266,14 @@ function onContextmenu(ev: MouseEvent) {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" module>
.rghtznwe { .root {
position: relative; position: relative;
padding: 8px; padding: 8px;
height: 64px; height: 64px;
background: var(--driveFolderBg); background: var(--driveFolderBg);
border-radius: 4px; border-radius: 4px;
&, * {
cursor: pointer; cursor: pointer;
}
*:not(.checkbox) {
pointer-events: none;
}
> .checkbox {
position: absolute;
bottom: 8px;
right: 8px;
width: 16px;
height: 16px;
background: #fff;
border: solid 1px #000;
&.checked {
background: var(--accent);
}
}
&.draghover { &.draghover {
&:after { &:after {
@ -310,24 +288,38 @@ function onContextmenu(ev: MouseEvent) {
border-radius: 4px; border-radius: 4px;
} }
} }
}
> .name { .checkbox {
position: absolute;
bottom: 8px;
right: 8px;
width: 16px;
height: 16px;
background: #fff;
border: solid 1px #000;
&.checked {
background: var(--accent);
}
}
.name {
margin: 0; margin: 0;
font-size: 0.9em; font-size: 0.9em;
color: var(--desktopDriveFolderFg); color: var(--desktopDriveFolderFg);
}
> i { .icon {
margin-right: 4px; margin-right: 4px;
margin-left: 2px; margin-left: 2px;
text-align: left; text-align: left;
} }
}
> .upload { .upload {
margin: 4px 4px; margin: 4px 4px;
font-size: 0.8em; font-size: 0.8em;
text-align: right; text-align: right;
color: var(--desktopDriveFolderFg); color: var(--desktopDriveFolderFg);
}
} }
</style> </style>

View file

@ -1,9 +1,9 @@
<template> <template>
<div class="yfudmmck"> <div :class="$style.root">
<nav> <nav :class="$style.nav">
<div class="path" @contextmenu.prevent.stop="() => {}"> <div :class="$style.navPath" @contextmenu.prevent.stop="() => {}">
<XNavFolder <XNavFolder
:class="{ current: folder == null }" :class="[$style.navPathItem, { [$style.navCurrent]: folder == null }]"
:parentFolder="folder" :parentFolder="folder"
@move="move" @move="move"
@upload="upload" @upload="upload"
@ -11,37 +11,38 @@
@removeFolder="removeFolder" @removeFolder="removeFolder"
/> />
<template v-for="f in hierarchyFolders"> <template v-for="f in hierarchyFolders">
<span class="separator"><i class="ti ti-chevron-right"></i></span> <span :class="[$style.navPathItem, $style.navSeparator]"><i class="ti ti-chevron-right"></i></span>
<XNavFolder <XNavFolder
:folder="f" :folder="f"
:parentFolder="folder" :parentFolder="folder"
:class="[$style.navPathItem]"
@move="move" @move="move"
@upload="upload" @upload="upload"
@removeFile="removeFile" @removeFile="removeFile"
@removeFolder="removeFolder" @removeFolder="removeFolder"
/> />
</template> </template>
<span v-if="folder != null" class="separator"><i class="ti ti-chevron-right"></i></span> <span v-if="folder != null" :class="[$style.navPathItem, $style.navSeparator]"><i class="ti ti-chevron-right"></i></span>
<span v-if="folder != null" class="folder current">{{ folder.name }}</span> <span v-if="folder != null" :class="[$style.navPathItem, $style.navCurrent]">{{ folder.name }}</span>
</div> </div>
<button class="menu _button" @click="showMenu"><i class="ti ti-dots"></i></button> <button class="_button" :class="$style.navMenu" @click="showMenu"><i class="ti ti-dots"></i></button>
</nav> </nav>
<div <div
ref="main" class="main" ref="main"
:class="{ uploading: uploadings.length > 0, fetching }" :class="[$style.main, { [$style.uploading]: uploadings.length > 0, [$style.fetching]: fetching }]"
@dragover.prevent.stop="onDragover" @dragover.prevent.stop="onDragover"
@dragenter="onDragenter" @dragenter="onDragenter"
@dragleave="onDragleave" @dragleave="onDragleave"
@drop.prevent.stop="onDrop" @drop.prevent.stop="onDrop"
@contextmenu.stop="onContextmenu" @contextmenu.stop="onContextmenu"
> >
<div ref="contents" class="contents"> <div ref="contents">
<div v-show="folders.length > 0" ref="foldersContainer" class="folders"> <div v-show="folders.length > 0" ref="foldersContainer" :class="$style.folders">
<XFolder <XFolder
v-for="(f, i) in folders" v-for="(f, i) in folders"
:key="f.id" :key="f.id"
v-anim="i" v-anim="i"
class="folder" :class="$style.folder"
:folder="f" :folder="f"
:selectMode="select === 'folder'" :selectMode="select === 'folder'"
:isSelected="selectedFolders.some(x => x.id === f.id)" :isSelected="selectedFolders.some(x => x.id === f.id)"
@ -54,15 +55,15 @@
@dragend="isDragSource = false" @dragend="isDragSource = false"
/> />
<!-- SEE: https://stackoverflow.com/questions/18744164/flex-box-align-last-row-to-grid --> <!-- SEE: https://stackoverflow.com/questions/18744164/flex-box-align-last-row-to-grid -->
<div v-for="(n, i) in 16" :key="i" class="padding"></div> <div v-for="(n, i) in 16" :key="i" :class="$style.padding"></div>
<MkButton v-if="moreFolders" ref="moreFolders">{{ i18n.ts.loadMore }}</MkButton> <MkButton v-if="moreFolders" ref="moreFolders">{{ i18n.ts.loadMore }}</MkButton>
</div> </div>
<div v-show="files.length > 0" ref="filesContainer" class="files"> <div v-show="files.length > 0" ref="filesContainer" :class="$style.files">
<XFile <XFile
v-for="(file, i) in files" v-for="(file, i) in files"
:key="file.id" :key="file.id"
v-anim="i" v-anim="i"
class="file" :class="$style.file"
:file="file" :file="file"
:selectMode="select === 'file'" :selectMode="select === 'file'"
:isSelected="selectedFiles.some(x => x.id === file.id)" :isSelected="selectedFiles.some(x => x.id === file.id)"
@ -71,19 +72,19 @@
@dragend="isDragSource = false" @dragend="isDragSource = false"
/> />
<!-- SEE: https://stackoverflow.com/questions/18744164/flex-box-align-last-row-to-grid --> <!-- SEE: https://stackoverflow.com/questions/18744164/flex-box-align-last-row-to-grid -->
<div v-for="(n, i) in 16" :key="i" class="padding"></div> <div v-for="(n, i) in 16" :key="i" :class="$style.padding"></div>
<MkButton v-show="moreFiles" ref="loadMoreFiles" @click="fetchMoreFiles">{{ i18n.ts.loadMore }}</MkButton> <MkButton v-show="moreFiles" ref="loadMoreFiles" @click="fetchMoreFiles">{{ i18n.ts.loadMore }}</MkButton>
</div> </div>
<div v-if="files.length == 0 && folders.length == 0 && !fetching" class="empty"> <div v-if="files.length == 0 && folders.length == 0 && !fetching" :class="$style.empty">
<p v-if="draghover">{{ i18n.t('empty-draghover') }}</p> <div v-if="draghover">{{ i18n.t('empty-draghover') }}</div>
<p v-if="!draghover && folder == null"><strong>{{ i18n.ts.emptyDrive }}</strong><br/>{{ i18n.t('empty-drive-description') }}</p> <div v-if="!draghover && folder == null"><strong>{{ i18n.ts.emptyDrive }}</strong><br/>{{ i18n.t('empty-drive-description') }}</div>
<p v-if="!draghover && folder != null">{{ i18n.ts.emptyFolder }}</p> <div v-if="!draghover && folder != null">{{ i18n.ts.emptyFolder }}</div>
</div> </div>
</div> </div>
<MkLoading v-if="fetching"/> <MkLoading v-if="fetching"/>
</div> </div>
<div v-if="draghover" class="dropzone"></div> <div v-if="draghover" :class="$style.dropzone"></div>
<input ref="fileInput" type="file" accept="*/*" multiple tabindex="-1" @change="onChangeFileInput"/> <input ref="fileInput" style="display: none;" type="file" accept="*/*" multiple tabindex="-1" @change="onChangeFileInput"/>
</div> </div>
</template> </template>
@ -658,13 +659,14 @@ onBeforeUnmount(() => {
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" module>
.yfudmmck { .root {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
}
> nav { .nav {
display: flex; display: flex;
z-index: 2; z-index: 2;
width: 100%; width: 100%;
@ -673,33 +675,28 @@ onBeforeUnmount(() => {
overflow: auto; overflow: auto;
font-size: 0.9em; font-size: 0.9em;
box-shadow: 0 1px 0 var(--divider); box-shadow: 0 1px 0 var(--divider);
&, * {
user-select: none; user-select: none;
} }
> .path { .navPath {
display: inline-block; display: inline-block;
vertical-align: bottom; vertical-align: bottom;
line-height: 42px; line-height: 42px;
white-space: nowrap; white-space: nowrap;
}
> * { .navPathItem {
display: inline-block; display: inline-block;
margin: 0; margin: 0;
padding: 0 8px; padding: 0 8px;
line-height: 42px; line-height: 42px;
cursor: pointer; cursor: pointer;
* {
pointer-events: none;
}
&:hover { &:hover {
text-decoration: underline; text-decoration: underline;
} }
&.current { &.navCurrent {
font-weight: bold; font-weight: bold;
cursor: default; cursor: default;
@ -708,86 +705,64 @@ onBeforeUnmount(() => {
} }
} }
&.separator { &.navSeparator {
margin: 0; margin: 0;
padding: 0; padding: 0;
opacity: 0.5; opacity: 0.5;
cursor: default; cursor: default;
}
}
> i { .navMenu {
margin: 0;
}
}
}
}
> .menu {
margin-left: auto; margin-left: auto;
padding: 0 12px; padding: 0 12px;
} }
}
> .main { .main {
flex: 1; flex: 1;
overflow: auto; overflow: auto;
padding: var(--margin); padding: var(--margin);
&, * {
user-select: none; user-select: none;
}
&.fetching { &.fetching {
cursor: wait !important; cursor: wait !important;
* {
pointer-events: none;
}
> .contents {
opacity: 0.5; opacity: 0.5;
} pointer-events: none;
} }
&.uploading { &.uploading {
height: calc(100% - 38px - 100px); height: calc(100% - 38px - 100px);
} }
}
> .contents { .folders,
.files {
> .folders,
> .files {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
}
> .folder, .folder,
> .file { .file {
flex-grow: 1; flex-grow: 1;
width: 128px; width: 128px;
margin: 4px; margin: 4px;
box-sizing: border-box; box-sizing: border-box;
} }
> .padding { .padding {
flex-grow: 1; flex-grow: 1;
pointer-events: none; pointer-events: none;
width: 128px + 8px; width: 128px + 8px;
} }
}
> .empty { .empty {
padding: 16px; padding: 16px;
text-align: center; text-align: center;
pointer-events: none; pointer-events: none;
opacity: 0.5; opacity: 0.5;
}
> p { .dropzone {
margin: 0;
}
}
}
}
> .dropzone {
position: absolute; position: absolute;
left: 0; left: 0;
top: 38px; top: 38px;
@ -795,10 +770,5 @@ onBeforeUnmount(() => {
height: calc(100% - 38px); height: calc(100% - 38px);
border: dashed 2px var(--focus); border: dashed 2px var(--focus);
pointer-events: none; pointer-events: none;
}
> input {
display: none;
}
} }
</style> </style>

View file

@ -1,5 +1,5 @@
<template> <template>
<MkModal ref="modal" :prefer-type="'dialog'" @click="onBgClick" @closed="$emit('closed')"> <MkModal ref="modal" :preferType="'dialog'" @click="onBgClick" @closed="$emit('closed')">
<div ref="rootEl" :class="$style.root" :style="{ width: `${width}px`, height: `min(${height}px, 100%)` }" @keydown="onKeydown"> <div ref="rootEl" :class="$style.root" :style="{ width: `${width}px`, height: `min(${height}px, 100%)` }" @keydown="onKeydown">
<div ref="headerEl" :class="$style.header"> <div ref="headerEl" :class="$style.header">
<button v-if="withOkButton" :class="$style.headerButton" class="_button" @click="$emit('close')"><i class="ti ti-x"></i></button> <button v-if="withOkButton" :class="$style.headerButton" class="_button" @click="$emit('close')"><i class="ti ti-x"></i></button>

View file

@ -4,25 +4,25 @@
v-show="!isDeleted" v-show="!isDeleted"
ref="el" ref="el"
v-hotkey="keymap" v-hotkey="keymap"
class="lxwezrsl" :class="[$style.root, { [$style.renote]: isRenote }]"
:tabindex="!isDeleted ? '-1' : null"
:class="{ renote: isRenote }"
> >
<MkNoteSub v-for="note in conversation" :key="note.id" class="reply-to-more" :note="note"/> <MkNoteSub v-for="note in conversation" :key="note.id" :class="$style.replyToMore" :note="note"/>
<MkNoteSub v-if="appearNote.reply" :note="appearNote.reply" class="reply-to"/> <MkNoteSub v-if="appearNote.reply" :note="appearNote.reply" :class="$style.replyTo"/>
<div v-if="isRenote" class="renote"> <div v-if="isRenote" :class="$style.renote">
<MkAvatar class="avatar" :user="note.user" link preview/> <MkAvatar :class="$style.renoteAvatar" :user="note.user" link preview/>
<i class="ti ti-repeat"></i> <i class="ti ti-repeat" style="margin-right: 4px;"></i>
<span :class="$style.renoteText">
<I18n :src="i18n.ts.renotedBy" tag="span"> <I18n :src="i18n.ts.renotedBy" tag="span">
<template #user> <template #user>
<MkA v-user-preview="note.userId" class="name" :to="userPage(note.user)"> <MkA v-user-preview="note.userId" :class="$style.renoteName" :to="userPage(note.user)">
<MkUserName :user="note.user"/> <MkUserName :user="note.user"/>
</MkA> </MkA>
</template> </template>
</I18n> </I18n>
<div class="info"> </span>
<button ref="renoteTime" class="_button time" @click="showRenoteMenu()"> <div :class="$style.renoteInfo">
<i v-if="isMyRenote" class="ti ti-dots dropdownIcon"></i> <button ref="renoteTime" class="_button" :class="$style.renoteTime" @click="showRenoteMenu()">
<i v-if="isMyRenote" class="ti ti-dots" style="margin-right: 4px;"></i>
<MkTime :time="note.createdAt"/> <MkTime :time="note.createdAt"/>
</button> </button>
<span v-if="note.visibility !== 'public'" style="margin-left: 0.5em;" :title="i18n.ts._visibility[note.visibility]"> <span v-if="note.visibility !== 'public'" style="margin-left: 0.5em;" :title="i18n.ts._visibility[note.visibility]">
@ -33,16 +33,16 @@
<span v-if="note.localOnly" style="margin-left: 0.5em;" :title="i18n.ts._visibility['disableFederation']"><i class="ti ti-rocket-off"></i></span> <span v-if="note.localOnly" style="margin-left: 0.5em;" :title="i18n.ts._visibility['disableFederation']"><i class="ti ti-rocket-off"></i></span>
</div> </div>
</div> </div>
<article class="article" @contextmenu.stop="onContextmenu"> <article :class="$style.note" @contextmenu.stop="onContextmenu">
<header class="header"> <header :class="$style.noteHeader">
<MkAvatar class="avatar" :user="appearNote.user" indicator link preview/> <MkAvatar :class="$style.noteHeaderAvatar" :user="appearNote.user" indicator link preview/>
<div class="body"> <div :class="$style.noteHeaderBody">
<div class="top"> <div>
<MkA v-user-preview="appearNote.user.id" class="name" :to="userPage(appearNote.user)"> <MkA v-user-preview="appearNote.user.id" :class="$style.noteHeaderName" :to="userPage(appearNote.user)">
<MkUserName :nowrap="false" :user="appearNote.user"/> <MkUserName :nowrap="false" :user="appearNote.user"/>
</MkA> </MkA>
<span v-if="appearNote.user.isBot" class="is-bot">bot</span> <span v-if="appearNote.user.isBot" :class="$style.isBot">bot</span>
<div class="info"> <div :class="$style.noteHeaderInfo">
<span v-if="appearNote.visibility !== 'public'" style="margin-left: 0.5em;" :title="i18n.ts._visibility[appearNote.visibility]"> <span v-if="appearNote.visibility !== 'public'" style="margin-left: 0.5em;" :title="i18n.ts._visibility[appearNote.visibility]">
<i v-if="appearNote.visibility === 'home'" class="ti ti-home"></i> <i v-if="appearNote.visibility === 'home'" class="ti ti-home"></i>
<i v-else-if="appearNote.visibility === 'followers'" class="ti ti-lock"></i> <i v-else-if="appearNote.visibility === 'followers'" class="ti ti-lock"></i>
@ -51,84 +51,81 @@
<span v-if="appearNote.localOnly" style="margin-left: 0.5em;" :title="i18n.ts._visibility['disableFederation']"><i class="ti ti-rocket-off"></i></span> <span v-if="appearNote.localOnly" style="margin-left: 0.5em;" :title="i18n.ts._visibility['disableFederation']"><i class="ti ti-rocket-off"></i></span>
</div> </div>
</div> </div>
<div class="username"><MkAcct :user="appearNote.user"/></div> <div :class="$style.noteHeaderUsername"><MkAcct :user="appearNote.user"/></div>
<MkInstanceTicker v-if="showTicker" class="ticker" :instance="appearNote.user.instance"/> <MkInstanceTicker v-if="showTicker" :class="$style.ticker" :instance="appearNote.user.instance"/>
</div> </div>
</header> </header>
<div class="main"> <div :class="$style.noteContent">
<div class="body"> <p v-if="appearNote.cw != null" :class="$style.cw">
<p v-if="appearNote.cw != null" class="cw"> <Mfm v-if="appearNote.cw != ''" style="margin-right: 8px;" :text="appearNote.cw" :author="appearNote.user" :i="$i"/>
<Mfm v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$i"/>
<MkCwButton v-model="showContent" :note="appearNote"/> <MkCwButton v-model="showContent" :note="appearNote"/>
</p> </p>
<div v-show="appearNote.cw == null || showContent" class="content"> <div v-show="appearNote.cw == null || showContent">
<div class="text">
<span v-if="appearNote.isHidden" style="opacity: 0.5">({{ i18n.ts.private }})</span> <span v-if="appearNote.isHidden" style="opacity: 0.5">({{ i18n.ts.private }})</span>
<MkA v-if="appearNote.replyId" class="reply" :to="`/notes/${appearNote.replyId}`"><i class="ti ti-arrow-back-up"></i></MkA> <MkA v-if="appearNote.replyId" :class="$style.noteReplyTarget" :to="`/notes/${appearNote.replyId}`"><i class="ti ti-arrow-back-up"></i></MkA>
<Mfm v-if="appearNote.text" :text="appearNote.text" :author="appearNote.user" :i="$i" :emojiUrls="appearNote.emojis"/> <Mfm v-if="appearNote.text" :text="appearNote.text" :author="appearNote.user" :i="$i" :emojiUrls="appearNote.emojis"/>
<a v-if="appearNote.renote != null" class="rp">RN:</a> <a v-if="appearNote.renote != null" :class="$style.rn">RN:</a>
<div v-if="translating || translation" class="translation"> <div v-if="translating || translation" :class="$style.translation">
<MkLoading v-if="translating" mini/> <MkLoading v-if="translating" mini/>
<div v-else class="translated"> <div v-else>
<b>{{ i18n.t('translatedFrom', { x: translation.sourceLang }) }}: </b> <b>{{ i18n.t('translatedFrom', { x: translation.sourceLang }) }}: </b>
<Mfm :text="translation.text" :author="appearNote.user" :i="$i" :emojiUrls="appearNote.emojis"/> <Mfm :text="translation.text" :author="appearNote.user" :i="$i" :emojiUrls="appearNote.emojis"/>
</div> </div>
</div> </div>
</div> <div v-if="appearNote.files.length > 0" :class="$style.files">
<div v-if="appearNote.files.length > 0" class="files">
<MkMediaList :mediaList="appearNote.files"/> <MkMediaList :mediaList="appearNote.files"/>
</div> </div>
<MkPoll v-if="appearNote.poll" ref="pollViewer" :note="appearNote" class="poll"/> <MkPoll v-if="appearNote.poll" ref="pollViewer" :note="appearNote" :class="$style.poll"/>
<MkUrlPreview v-for="url in urls" :key="url" :url="url" :compact="true" :detail="true" class="url-preview"/> <MkUrlPreview v-for="url in urls" :key="url" :url="url" :compact="true" :detail="true" style="margin-top: 6px;"/>
<div v-if="appearNote.renote" class="renote"><MkNoteSimple :note="appearNote.renote" class="note"/></div> <div v-if="appearNote.renote" :class="$style.quote"><MkNoteSimple :note="appearNote.renote" :class="$style.quoteNote"/></div>
</div> </div>
<MkA v-if="appearNote.channel && !inChannel" class="channel" :to="`/channels/${appearNote.channel.id}`"><i class="ti ti-device-tv"></i> {{ appearNote.channel.name }}</MkA> <MkA v-if="appearNote.channel && !inChannel" :class="$style.channel" :to="`/channels/${appearNote.channel.id}`"><i class="ti ti-device-tv"></i> {{ appearNote.channel.name }}</MkA>
</div> </div>
<footer class="footer"> <footer>
<div class="info"> <div :class="$style.noteFooterInfo">
<MkA class="created-at" :to="notePage(appearNote)"> <MkA :to="notePage(appearNote)">
<MkTime :time="appearNote.createdAt" mode="detail"/> <MkTime :time="appearNote.createdAt" mode="detail"/>
</MkA> </MkA>
</div> </div>
<MkReactionsViewer ref="reactionsViewer" :note="appearNote"/> <MkReactionsViewer ref="reactionsViewer" :note="appearNote"/>
<button class="button _button" @click="reply()"> <button class="_button" :class="$style.noteFooterButton" @click="reply()">
<i class="ti ti-arrow-back-up"></i> <i class="ti ti-arrow-back-up"></i>
<p v-if="appearNote.repliesCount > 0" class="count">{{ appearNote.repliesCount }}</p> <p v-if="appearNote.repliesCount > 0" :class="$style.noteFooterButtonCount">{{ appearNote.repliesCount }}</p>
</button> </button>
<button <button
v-if="canRenote" v-if="canRenote"
ref="renoteButton" ref="renoteButton"
class="button _button" class="_button"
:class="$style.noteFooterButton"
@mousedown="renote()" @mousedown="renote()"
> >
<i class="ti ti-repeat"></i> <i class="ti ti-repeat"></i>
<p v-if="appearNote.renoteCount > 0" class="count">{{ appearNote.renoteCount }}</p> <p v-if="appearNote.renoteCount > 0" :class="$style.noteFooterButtonCount">{{ appearNote.renoteCount }}</p>
</button> </button>
<button v-else class="button _button" disabled> <button v-else class="_button" :class="$style.noteFooterButton" disabled>
<i class="ti ti-ban"></i> <i class="ti ti-ban"></i>
</button> </button>
<button v-if="appearNote.myReaction == null" ref="reactButton" class="button _button" @mousedown="react()"> <button v-if="appearNote.myReaction == null" ref="reactButton" :class="$style.noteFooterButton" class="_button" @mousedown="react()">
<i v-if="appearNote.reactionAcceptance === 'likeOnly'" class="ti ti-heart"></i> <i v-if="appearNote.reactionAcceptance === 'likeOnly'" class="ti ti-heart"></i>
<i v-else class="ti ti-plus"></i> <i v-else class="ti ti-plus"></i>
</button> </button>
<button v-if="appearNote.myReaction != null" ref="reactButton" class="button _button reacted" @click="undoReact(appearNote)"> <button v-if="appearNote.myReaction != null" ref="reactButton" class="_button" :class="[$style.noteFooterButton, $style.reacted]" @click="undoReact(appearNote)">
<i class="ti ti-minus"></i> <i class="ti ti-minus"></i>
</button> </button>
<button v-if="defaultStore.state.showClipButtonInNoteFooter" ref="clipButton" class="button _button" @mousedown="clip()"> <button v-if="defaultStore.state.showClipButtonInNoteFooter" ref="clipButton" class="_button" :class="$style.noteFooterButton" @mousedown="clip()">
<i class="ti ti-paperclip"></i> <i class="ti ti-paperclip"></i>
</button> </button>
<button ref="menuButton" class="button _button" @mousedown="menu()"> <button ref="menuButton" class="_button" :class="$style.noteFooterButton" @mousedown="menu()">
<i class="ti ti-dots"></i> <i class="ti ti-dots"></i>
</button> </button>
</footer> </footer>
</div>
</article> </article>
<MkNoteSub v-for="note in replies" :key="note.id" :note="note" class="reply" :detail="true"/> <MkNoteSub v-for="note in replies" :key="note.id" :note="note" :class="$style.reply" :detail="true"/>
</div> </div>
<div v-else class="_panel muted" @click="muted = false"> <div v-else class="_panel" :class="$style.muted" @click="muted = false">
<I18n :src="i18n.ts.userSaysSomething" tag="small"> <I18n :src="i18n.ts.userSaysSomething" tag="small">
<template #name> <template #name>
<MkA v-user-preview="appearNote.userId" class="name" :to="userPage(appearNote.user)"> <MkA v-user-preview="appearNote.userId" :to="userPage(appearNote.user)">
<MkUserName :user="appearNote.user"/> <MkUserName :user="appearNote.user"/>
</MkA> </MkA>
</template> </template>
@ -438,131 +435,104 @@ if (appearNote.replyId) {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" module>
.lxwezrsl { .root {
position: relative; position: relative;
transition: box-shadow 0.1s ease; transition: box-shadow 0.1s ease;
overflow: clip; overflow: clip;
contain: content; contain: content;
}
&:focus-visible { .replyTo {
outline: none;
&:after {
content: "";
pointer-events: none;
display: block;
position: absolute;
z-index: 10;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
width: calc(100% - 8px);
height: calc(100% - 8px);
border: dashed 1px var(--focus);
border-radius: var(--radius);
box-sizing: border-box;
}
}
&:hover > .article > .main > .footer > .button {
opacity: 1;
}
> .reply-to {
opacity: 0.7; opacity: 0.7;
padding-bottom: 0; padding-bottom: 0;
} }
> .reply-to-more { .replyToMore {
opacity: 0.7; opacity: 0.7;
} }
> .renote { .renote {
display: flex; display: flex;
align-items: center; align-items: center;
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(--renote);
}
> .avatar { .renoteAvatar {
flex-shrink: 0; flex-shrink: 0;
display: inline-block; display: inline-block;
width: 28px; width: 28px;
height: 28px; height: 28px;
margin: 0 8px 0 0; margin: 0 8px 0 0;
border-radius: 6px; border-radius: 6px;
} }
> i { .renoteText {
margin-right: 4px;
}
> span {
overflow: hidden; overflow: hidden;
flex-shrink: 1; flex-shrink: 1;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
}
> .name { .renoteName {
font-weight: bold; font-weight: bold;
} }
}
> .info { .renoteInfo {
margin-left: auto; margin-left: auto;
font-size: 0.9em; font-size: 0.9em;
}
> .time { .renoteTime {
flex-shrink: 0; flex-shrink: 0;
color: inherit; color: inherit;
}
> .dropdownIcon { .renote + .note {
margin-right: 4px;
}
}
}
}
> .renote + .article {
padding-top: 8px; padding-top: 8px;
} }
> .article { .note {
padding: 32px; padding: 32px;
font-size: 1.2em; font-size: 1.2em;
> .header { &:hover > .main > .footer > .button {
opacity: 1;
}
}
.noteHeader {
display: flex; display: flex;
position: relative; position: relative;
margin-bottom: 16px; margin-bottom: 16px;
align-items: center; align-items: center;
}
> .avatar { .noteHeaderAvatar {
display: block; display: block;
flex-shrink: 0; flex-shrink: 0;
width: 58px; width: 58px;
height: 58px; height: 58px;
} }
> .body { .noteHeaderBody {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
padding-left: 16px; padding-left: 16px;
font-size: 0.95em; font-size: 0.95em;
}
> .top { .noteHeaderName {
> .name {
font-weight: bold; font-weight: bold;
line-height: 1.3; line-height: 1.3;
} }
> .is-bot { .isBot {
display: inline-block; display: inline-block;
margin: 0 0.5em; margin: 0 0.5em;
padding: 4px 6px; padding: 4px 6px;
@ -570,93 +540,75 @@ if (appearNote.replyId) {
line-height: 1; line-height: 1;
border: solid 0.5px var(--divider); border: solid 0.5px var(--divider);
border-radius: 4px; border-radius: 4px;
} }
> .info { .noteHeaderInfo {
float: right; float: right;
} }
}
> .username { .noteHeaderUsername {
margin-bottom: 2px; margin-bottom: 2px;
line-height: 1.3; line-height: 1.3;
word-wrap: anywhere; word-wrap: anywhere;
} }
}
}
> .main { .noteContent {
> .body {
container-type: inline-size; container-type: inline-size;
overflow-wrap: break-word;
}
> .cw { .cw {
cursor: default; cursor: default;
display: block; display: block;
margin: 0; margin: 0;
padding: 0; padding: 0;
overflow-wrap: break-word; overflow-wrap: break-word;
}
> .text { .noteReplyTarget {
margin-right: 8px;
}
}
> .content {
> .text {
overflow-wrap: break-word;
> .reply {
color: var(--accent); color: var(--accent);
margin-right: 0.5em; margin-right: 0.5em;
} }
> .rp { .rn {
margin-left: 4px; margin-left: 4px;
font-style: oblique; font-style: oblique;
color: var(--renote); color: var(--renote);
} }
> .translation { .translation {
border: solid 0.5px var(--divider); border: solid 0.5px var(--divider);
border-radius: var(--radius); border-radius: var(--radius);
padding: 12px; padding: 12px;
margin-top: 8px; margin-top: 8px;
} }
}
> .url-preview { .poll {
margin-top: 8px;
}
> .poll {
font-size: 80%; font-size: 80%;
} }
> .renote { .quote {
padding: 8px 0; padding: 8px 0;
}
> .note { .quoteNote {
padding: 16px; padding: 16px;
border: dashed 1px var(--renote); border: dashed 1px var(--renote);
border-radius: 8px; border-radius: 8px;
} }
}
}
> .channel { .channel {
opacity: 0.7; opacity: 0.7;
font-size: 80%; font-size: 80%;
} }
}
> .footer { .noteFooterInfo {
> .info {
margin: 16px 0; margin: 16px 0;
opacity: 0.7; opacity: 0.7;
font-size: 0.9em; font-size: 0.9em;
} }
> .button { .noteFooterButton {
margin: 0; margin: 0;
padding: 8px; padding: 8px;
opacity: 0.7; opacity: 0.7;
@ -668,90 +620,66 @@ if (appearNote.replyId) {
&:hover { &:hover {
color: var(--fgHighlighted); color: var(--fgHighlighted);
} }
}
> .count { .noteFooterButtonCount {
display: inline; display: inline;
margin: 0 0 0 8px; margin: 0 0 0 8px;
opacity: 0.7; opacity: 0.7;
}
&.reacted { &.reacted {
color: var(--accent); color: var(--accent);
} }
} }
}
}
}
> .reply { .reply {
border-top: solid 0.5px var(--divider); border-top: solid 0.5px var(--divider);
}
} }
@container (max-width: 500px) { @container (max-width: 500px) {
.lxwezrsl { .root {
font-size: 0.9em; font-size: 0.9em;
} }
} }
@container (max-width: 450px) { @container (max-width: 450px) {
.lxwezrsl { .renote {
> .renote {
padding: 8px 16px 0 16px; padding: 8px 16px 0 16px;
} }
> .article { .note {
padding: 16px; padding: 16px;
}
> .header { .noteHeaderAvatar {
> .avatar {
width: 50px; width: 50px;
height: 50px; height: 50px;
} }
}
}
}
} }
@container (max-width: 350px) { @container (max-width: 350px) {
.lxwezrsl { .noteFooterButton {
> .article {
> .main {
> .footer {
> .button {
&:not(:last-child) { &:not(:last-child) {
margin-right: 18px; margin-right: 18px;
} }
} }
}
}
}
}
} }
@container (max-width: 300px) { @container (max-width: 300px) {
.lxwezrsl { .root {
font-size: 0.825em; font-size: 0.825em;
}
> .article { .noteHeaderAvatar {
> .header {
> .avatar {
width: 50px; width: 50px;
height: 50px; height: 50px;
} }
}
> .main { .noteFooterButton {
> .footer {
> .button {
&:not(:last-child) { &:not(:last-child) {
margin-right: 12px; margin-right: 12px;
} }
} }
}
}
}
}
} }
.muted { .muted {

View file

@ -25,11 +25,11 @@
</div> </div>
<div v-if="type === 'and' || type === 'or'" :class="$style.values" class="_gaps"> <div v-if="type === 'and' || type === 'or'" :class="$style.values" class="_gaps">
<Sortable v-model="v.values" tag="div" class="_gaps" item-key="id" handle=".drag-handle" :group="{ name: 'roleFormula' }" :animation="150" :swap-threshold="0.5"> <Sortable v-model="v.values" tag="div" class="_gaps" itemKey="id" handle=".drag-handle" :group="{ name: 'roleFormula' }" :animation="150" :swapThreshold="0.5">
<template #item="{element}"> <template #item="{element}">
<div :class="$style.item"> <div :class="$style.item">
<!-- divが無いとエラーになる https://github.com/SortableJS/vue.draggable.next/issues/189 --> <!-- divが無いとエラーになる https://github.com/SortableJS/vue.draggable.next/issues/189 -->
<RolesEditorFormula :model-value="element" draggable @update:model-value="updated => valuesItemUpdated(updated)" @remove="removeItem(element)"/> <RolesEditorFormula :modelValue="element" draggable @update:modelValue="updated => valuesItemUpdated(updated)" @remove="removeItem(element)"/>
</div> </div>
</template> </template>
</Sortable> </Sortable>

View file

@ -2,7 +2,7 @@
<div> <div>
<MkStickyContainer> <MkStickyContainer>
<template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="700"> <MkSpacer :contentMax="700">
<div class="_gaps"> <div class="_gaps">
<div class="_buttons"> <div class="_buttons">
<MkButton primary rounded @click="edit"><i class="ti ti-pencil"></i> {{ i18n.ts.edit }}</MkButton> <MkButton primary rounded @click="edit"><i class="ti ti-pencil"></i> {{ i18n.ts.edit }}</MkButton>
@ -11,9 +11,9 @@
<MkFolder> <MkFolder>
<template #icon><i class="ti ti-info-circle"></i></template> <template #icon><i class="ti ti-info-circle"></i></template>
<template #label>{{ i18n.ts.info }}</template> <template #label>{{ i18n.ts.info }}</template>
<XEditor :model-value="role" readonly/> <XEditor :modelValue="role" readonly/>
</MkFolder> </MkFolder>
<MkFolder v-if="role.target === 'manual'" default-open> <MkFolder v-if="role.target === 'manual'" defaultOpen>
<template #icon><i class="ti ti-users"></i></template> <template #icon><i class="ti ti-users"></i></template>
<template #label>{{ i18n.ts.users }}</template> <template #label>{{ i18n.ts.users }}</template>
<template #suffix>{{ role.usersCount }}</template> <template #suffix>{{ role.usersCount }}</template>

View file

@ -2,7 +2,7 @@
<div> <div>
<MkStickyContainer> <MkStickyContainer>
<template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="700"> <MkSpacer :contentMax="700">
<div class="_gaps"> <div class="_gaps">
<MkFolder> <MkFolder>
<template #label>{{ i18n.ts._role.baseRole }}</template> <template #label>{{ i18n.ts._role.baseRole }}</template>
@ -14,7 +14,7 @@
<MkFolder v-if="matchQuery([i18n.ts._role._options.rateLimitFactor, 'rateLimitFactor'])"> <MkFolder v-if="matchQuery([i18n.ts._role._options.rateLimitFactor, 'rateLimitFactor'])">
<template #label>{{ i18n.ts._role._options.rateLimitFactor }}</template> <template #label>{{ i18n.ts._role._options.rateLimitFactor }}</template>
<template #suffix>{{ Math.floor(policies.rateLimitFactor * 100) }}%</template> <template #suffix>{{ Math.floor(policies.rateLimitFactor * 100) }}%</template>
<MkRange :model-value="policies.rateLimitFactor * 100" :min="30" :max="300" :step="10" :text-converter="(v) => `${v}%`" @update:model-value="v => policies.rateLimitFactor = (v / 100)"> <MkRange :modelValue="policies.rateLimitFactor * 100" :min="30" :max="300" :step="10" :textConverter="(v) => `${v}%`" @update:modelValue="v => policies.rateLimitFactor = (v / 100)">
<template #caption>{{ i18n.ts._role._options.descriptionOfRateLimitFactor }}</template> <template #caption>{{ i18n.ts._role._options.descriptionOfRateLimitFactor }}</template>
</MkRange> </MkRange>
</MkFolder> </MkFolder>
@ -156,13 +156,13 @@
<MkFoldableSection> <MkFoldableSection>
<template #header>Manual roles</template> <template #header>Manual roles</template>
<div class="_gaps_s"> <div class="_gaps_s">
<MkRolePreview v-for="role in roles.filter(x => x.target === 'manual')" :key="role.id" :role="role" :for-moderation="true"/> <MkRolePreview v-for="role in roles.filter(x => x.target === 'manual')" :key="role.id" :role="role" :forModeration="true"/>
</div> </div>
</MkFoldableSection> </MkFoldableSection>
<MkFoldableSection> <MkFoldableSection>
<template #header>Conditional roles</template> <template #header>Conditional roles</template>
<div class="_gaps_s"> <div class="_gaps_s">
<MkRolePreview v-for="role in roles.filter(x => x.target === 'conditional')" :key="role.id" :role="role" :for-moderation="true"/> <MkRolePreview v-for="role in roles.filter(x => x.target === 'conditional')" :key="role.id" :role="role" :forModeration="true"/>
</div> </div>
</MkFoldableSection> </MkFoldableSection>
</div> </div>

View file

@ -1,7 +1,7 @@
<template> <template>
<MkStickyContainer> <MkStickyContainer>
<template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="700" :margin-min="16" :margin-max="32"> <MkSpacer :contentMax="700" :marginMin="16" :marginMax="32">
<FormSuspense :p="init"> <FormSuspense :p="init">
<div class="_gaps_m"> <div class="_gaps_m">
<MkFolder> <MkFolder>
@ -33,7 +33,7 @@
<option value="remote">{{ i18n.ts.remoteOnly }}</option> <option value="remote">{{ i18n.ts.remoteOnly }}</option>
</MkRadios> </MkRadios>
<MkRange v-model="sensitiveMediaDetectionSensitivity" :min="0" :max="4" :step="1" :text-converter="(v) => `${v + 1}`"> <MkRange v-model="sensitiveMediaDetectionSensitivity" :min="0" :max="4" :step="1" :textConverter="(v) => `${v + 1}`">
<template #label>{{ i18n.ts._sensitiveMediaDetection.sensitivity }}</template> <template #label>{{ i18n.ts._sensitiveMediaDetection.sensitivity }}</template>
<template #caption>{{ i18n.ts._sensitiveMediaDetection.sensitivityDescription }}</template> <template #caption>{{ i18n.ts._sensitiveMediaDetection.sensitivityDescription }}</template>
</MkRange> </MkRange>
@ -65,7 +65,7 @@
<div class="_gaps_m"> <div class="_gaps_m">
<span>{{ i18n.ts.activeEmailValidationDescription }}</span> <span>{{ i18n.ts.activeEmailValidationDescription }}</span>
<MkSwitch v-model="enableActiveEmailValidation" @update:model-value="save"> <MkSwitch v-model="enableActiveEmailValidation" @update:modelValue="save">
<template #label>Enable</template> <template #label>Enable</template>
</MkSwitch> </MkSwitch>
</div> </div>
@ -77,7 +77,7 @@
<template v-else #suffix>Disabled</template> <template v-else #suffix>Disabled</template>
<div class="_gaps_m"> <div class="_gaps_m">
<MkSwitch v-model="enableIpLogging" @update:model-value="save"> <MkSwitch v-model="enableIpLogging" @update:modelValue="save">
<template #label>Enable</template> <template #label>Enable</template>
</MkSwitch> </MkSwitch>
</div> </div>

View file

@ -1,7 +1,7 @@
<template> <template>
<MkStickyContainer> <MkStickyContainer>
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="800" :margin-min="16" :margin-max="32"> <MkSpacer :contentMax="800" :marginMin="16" :marginMax="32">
<FormSuspense :p="init" class="_gaps"> <FormSuspense :p="init" class="_gaps">
<MkInput v-model="title"> <MkInput v-model="title">
<template #label>{{ i18n.ts.title }}</template> <template #label>{{ i18n.ts.title }}</template>

View file

@ -1,12 +1,12 @@
<template> <template>
<MkStickyContainer> <MkStickyContainer>
<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template> <template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="1400"> <MkSpacer :contentMax="1400">
<div class="_root"> <div class="_root">
<div v-if="tab === 'explore'"> <div v-if="tab === 'explore'">
<MkFoldableSection class="_margin"> <MkFoldableSection class="_margin">
<template #header><i class="ti ti-clock"></i>{{ i18n.ts.recentPosts }}</template> <template #header><i class="ti ti-clock"></i>{{ i18n.ts.recentPosts }}</template>
<MkPagination v-slot="{items}" :pagination="recentPostsPagination" :disable-auto-load="true"> <MkPagination v-slot="{items}" :pagination="recentPostsPagination" :disableAutoLoad="true">
<div :class="$style.items"> <div :class="$style.items">
<MkGalleryPostPreview v-for="post in items" :key="post.id" :post="post" class="post"/> <MkGalleryPostPreview v-for="post in items" :key="post.id" :post="post" class="post"/>
</div> </div>
@ -14,7 +14,7 @@
</MkFoldableSection> </MkFoldableSection>
<MkFoldableSection class="_margin"> <MkFoldableSection class="_margin">
<template #header><i class="ti ti-comet"></i>{{ i18n.ts.popularPosts }}</template> <template #header><i class="ti ti-comet"></i>{{ i18n.ts.popularPosts }}</template>
<MkPagination v-slot="{items}" :pagination="popularPostsPagination" :disable-auto-load="true"> <MkPagination v-slot="{items}" :pagination="popularPostsPagination" :disableAutoLoad="true">
<div :class="$style.items"> <div :class="$style.items">
<MkGalleryPostPreview v-for="post in items" :key="post.id" :post="post" class="post"/> <MkGalleryPostPreview v-for="post in items" :key="post.id" :post="post" class="post"/>
</div> </div>

View file

@ -1,7 +1,7 @@
<template> <template>
<MkStickyContainer> <MkStickyContainer>
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="1000" :margin-min="16" :margin-max="32"> <MkSpacer :contentMax="1000" :marginMin="16" :marginMax="32">
<div class="_root"> <div class="_root">
<Transition :name="defaultStore.state.animation ? 'fade' : ''" mode="out-in"> <Transition :name="defaultStore.state.animation ? 'fade' : ''" mode="out-in">
<div v-if="post" class="rkxwuolj"> <div v-if="post" class="rkxwuolj">

View file

@ -9,7 +9,7 @@
</template> </template>
<div style="padding: 8px;"> <div style="padding: 8px;">
<MkChart :src="chartSrc" :args="{ user, withoutAll: true }" span="day" :limit="limit" :bar="true" :stacked="true" :detailed="false" :aspect-ratio="5"/> <MkChart :src="chartSrc" :args="{ user, withoutAll: true }" span="day" :limit="limit" :bar="true" :stacked="true" :detailed="false" :aspectRatio="5"/>
</div> </div>
</MkContainer> </MkContainer>
</template> </template>

View file

@ -5,7 +5,8 @@ const dateTimeIntervals = {
}; };
export function dateUTC(time: number[]): Date { export function dateUTC(time: number[]): Date {
const d = time.length === 2 ? Date.UTC(time[0], time[1]) const d =
time.length === 2 ? Date.UTC(time[0], time[1])
: time.length === 3 ? Date.UTC(time[0], time[1], time[2]) : time.length === 3 ? Date.UTC(time[0], time[1], time[2])
: time.length === 4 ? Date.UTC(time[0], time[1], time[2], time[3]) : time.length === 4 ? Date.UTC(time[0], time[1], time[2], time[3])
: time.length === 5 ? Date.UTC(time[0], time[1], time[2], time[3], time[4]) : time.length === 5 ? Date.UTC(time[0], time[1], time[2], time[3], time[4])
@ -13,7 +14,7 @@ export function dateUTC(time: number[]): Date {
: time.length === 7 ? Date.UTC(time[0], time[1], time[2], time[3], time[4], time[5], time[6]) : time.length === 7 ? Date.UTC(time[0], time[1], time[2], time[3], time[4], time[5], time[6])
: null; : null;
if (!d) throw 'wrong number of arguments'; if (!d) throw new Error('wrong number of arguments');
return new Date(d); return new Date(d);
} }

View file

@ -1,14 +1,20 @@
<template> <template>
<span v-if="!fetching" class="nmidsaqw"> <span v-if="!fetching" :class="$style.root">
<template v-if="display === 'marquee'"> <template v-if="display === 'marquee'">
<Transition name="change" mode="default"> <Transition
:enterActiveClass="$style.transition_change_enterActive"
:leaveActiveClass="$style.transition_change_leaveActive"
:enterFromClass="$style.transition_change_enterFrom"
:leaveToClass="$style.transition_change_leaveTo"
mode="default"
>
<MarqueeText :key="key" :duration="marqueeDuration" :reverse="marqueeReverse"> <MarqueeText :key="key" :duration="marqueeDuration" :reverse="marqueeReverse">
<span v-for="instance in instances" :key="instance.id" class="item" :class="{ colored }" :style="{ background: colored ? instance.themeColor : null }"> <span v-for="instance in instances" :key="instance.id" :class="[$style.item, { [$style.colored]: colored }]" :style="{ background: colored ? instance.themeColor : null }">
<img class="icon" :src="getInstanceIcon(instance)" alt=""/> <img :class="$style.icon" :src="getInstanceIcon(instance)" alt=""/>
<MkA :to="`/instance-info/${instance.host}`" class="host _monospace"> <MkA :to="`/instance-info/${instance.host}`" :class="$style.host" class="_monospace">
{{ instance.host }} {{ instance.host }}
</MkA> </MkA>
<span class="divider"></span> <span :class="$style.divider"></span>
</span> </span>
</MarqueeText> </MarqueeText>
</Transition> </Transition>
@ -61,46 +67,47 @@ function getInstanceIcon(instance): string {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" module>
.change-enter-active, .change-leave-active { .transition_change_enterActive,
.transition_change_leaveActive {
position: absolute; position: absolute;
top: 0; top: 0;
transition: all 1s ease; transition: all 1s ease;
} }
.change-enter-from { .transition_change_enterFrom {
opacity: 0; opacity: 0;
transform: translateY(-100%); transform: translateY(-100%);
} }
.change-leave-to { .transition_change_leaveTo {
opacity: 0; opacity: 0;
transform: translateY(100%); transform: translateY(100%);
} }
.nmidsaqw { .root {
display: inline-block; display: inline-block;
position: relative; position: relative;
}
::v-deep(.item) { .item {
display: inline-block; display: inline-block;
vertical-align: bottom; vertical-align: bottom;
margin-right: 5em; margin-right: 5em;
> .icon {
display: inline-block;
height: var(--height);
aspect-ratio: 1;
vertical-align: bottom;
margin-right: 1em;
}
> .host {
vertical-align: bottom;
}
&.colored { &.colored {
padding-right: 1em; padding-right: 1em;
color: #fff; color: #fff;
} }
} }
.icon {
display: inline-block;
height: var(--height);
aspect-ratio: 1;
vertical-align: bottom;
margin-right: 1em;
}
.host {
vertical-align: bottom;
} }
</style> </style>

View file

@ -1,10 +1,16 @@
<template> <template>
<span v-if="!fetching" class="xbhtxfms"> <span v-if="!fetching" :class="$style.root">
<template v-if="display === 'marquee'"> <template v-if="display === 'marquee'">
<Transition name="change" mode="default"> <Transition
:enterActiveClass="$style.transition_change_enterActive"
:leaveActiveClass="$style.transition_change_leaveActive"
:enterFromClass="$style.transition_change_enterFrom"
:leaveToClass="$style.transition_change_leaveTo"
mode="default"
>
<MarqueeText :key="key" :duration="marqueeDuration" :reverse="marqueeReverse"> <MarqueeText :key="key" :duration="marqueeDuration" :reverse="marqueeReverse">
<span v-for="item in items" class="item"> <span v-for="item in items" :class="$style.item">
<a class="link" :href="item.link" rel="nofollow noopener" target="_blank" :title="item.title">{{ item.title }}</a><span class="divider"></span> <a :href="item.link" rel="nofollow noopener" target="_blank" :title="item.title">{{ item.title }}</a><span :class="$style.divider"></span>
</span> </span>
</MarqueeText> </MarqueeText>
</Transition> </Transition>
@ -54,39 +60,40 @@ useInterval(tick, Math.max(5000, props.refreshIntervalSec * 1000), {
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" module>
.change-enter-active, .change-leave-active { .transition_change_enterActive,
.transition_change_leaveActive {
position: absolute; position: absolute;
top: 0; top: 0;
transition: all 1s ease; transition: all 1s ease;
} }
.change-enter-from { .transition_change_enterFrom {
opacity: 0; opacity: 0;
transform: translateY(-100%); transform: translateY(-100%);
} }
.change-leave-to { .transition_change_leaveTo {
opacity: 0; opacity: 0;
transform: translateY(100%); transform: translateY(100%);
} }
.xbhtxfms { .root {
display: inline-block; display: inline-block;
position: relative; position: relative;
}
::v-deep(.item) { .item {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
vertical-align: bottom; vertical-align: bottom;
margin: 0; margin: 0;
}
> .divider { .divider {
display: inline-block; display: inline-block;
width: 0.5px; width: 0.5px;
height: var(--height); height: var(--height);
margin: 0 3em; margin: 0 3em;
background: currentColor; background: currentColor;
opacity: 0.3; opacity: 0.3;
}
}
} }
</style> </style>

View file

@ -1,14 +1,20 @@
<template> <template>
<span v-if="!fetching" class="osdsvwzy"> <span v-if="!fetching" :class="$style.root">
<template v-if="display === 'marquee'"> <template v-if="display === 'marquee'">
<Transition name="change" mode="default"> <Transition
:enterActiveClass="$style.transition_change_enterActive"
:leaveActiveClass="$style.transition_change_leaveActive"
:enterFromClass="$style.transition_change_enterFrom"
:leaveToClass="$style.transition_change_leaveTo"
mode="default"
>
<MarqueeText :key="key" :duration="marqueeDuration" :reverse="marqueeReverse"> <MarqueeText :key="key" :duration="marqueeDuration" :reverse="marqueeReverse">
<span v-for="note in notes" :key="note.id" class="item"> <span v-for="note in notes" :key="note.id" :class="$style.item">
<img class="avatar" :src="note.user.avatarUrl" decoding="async"/> <img :class="$style.avatar" :src="note.user.avatarUrl" decoding="async"/>
<MkA class="text" :to="notePage(note)"> <MkA :class="$style.text" :to="notePage(note)">
<Mfm class="text" :text="getNoteSummary(note)" :plain="true" :nowrap="true"/> <Mfm :text="getNoteSummary(note)" :plain="true" :nowrap="true"/>
</MkA> </MkA>
<span class="divider"></span> <span :class="$style.divider"></span>
</span> </span>
</MarqueeText> </MarqueeText>
</Transition> </Transition>
@ -60,54 +66,53 @@ useInterval(tick, Math.max(5000, props.refreshIntervalSec * 1000), {
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" module>
.change-enter-active, .change-leave-active { .transition_change_enterActive,
.transition_change_leaveActive {
position: absolute; position: absolute;
top: 0; top: 0;
transition: all 1s ease; transition: all 1s ease;
} }
.change-enter-from { .transition_change_enterFrom {
opacity: 0; opacity: 0;
transform: translateY(-100%); transform: translateY(-100%);
} }
.change-leave-to { .transition_change_leaveTo {
opacity: 0; opacity: 0;
transform: translateY(100%); transform: translateY(100%);
} }
.osdsvwzy { .root {
display: inline-block; display: inline-block;
position: relative; position: relative;
}
::v-deep(.item) { .item {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
vertical-align: bottom; vertical-align: bottom;
margin: 0; margin: 0;
}
> .avatar { .avatar {
display: inline-block; display: inline-block;
height: var(--height); height: var(--height);
aspect-ratio: 1; aspect-ratio: 1;
vertical-align: bottom; vertical-align: bottom;
margin-right: 8px; margin-right: 8px;
} }
> .text { .text {
> .text {
display: inline-block; display: inline-block;
vertical-align: bottom; vertical-align: bottom;
} }
}
> .divider { .divider {
display: inline-block; display: inline-block;
width: 0.5px; width: 0.5px;
height: 16px; height: 16px;
margin: 0 3em; margin: 0 3em;
background: currentColor; background: currentColor;
opacity: 0; opacity: 0;
}
}
} }
</style> </style>

View file

@ -330,11 +330,7 @@ async function deleteProfile() {
flex-shrink: 0; flex-shrink: 0;
padding-top: var(--columnGap); padding-top: var(--columnGap);
padding-bottom: var(--columnGap); padding-bottom: var(--columnGap);
padding-right: var(--columnGap);
&:first-of-type {
padding-left: var(--columnGap); padding-left: var(--columnGap);
}
> .column:not(:last-of-type) { > .column:not(:last-of-type) {
margin-bottom: var(--columnGap); margin-bottom: var(--columnGap);

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