Merge v13.0.0-preview5 and more into snug.moe

This commit is contained in:
vib 2023-05-30 11:07:30 +03:00
commit 30cd417380
160 changed files with 952 additions and 4015 deletions

View File

@ -108,11 +108,6 @@ redis:
#deliverJobMaxAttempts: 12
#inboxJobMaxAttempts: 8
# Syslog option
#syslog:
# host: localhost
# port: 514
# Proxy for HTTP/HTTPS outgoing connections
#proxy: http://127.0.0.1:3128

View File

@ -11,6 +11,72 @@ Unreleased changes should not be listed in this file.
Instead, run `git shortlog --format='%h %s' --group=trailer:changelog <last tag>..` to see unreleased changes; replace `<last tag>` with the tag you wish to compare from.
If you are a contributor, please read [CONTRIBUTING.md, section "Changelog Trailer"](./CONTRIBUTING.md#changelog-trailer) on what to do instead.
## 13.0.0-preview5 - 2023-05-23
This release contains 6 breaking changes and 1 security update.
### Security
- client: check input for aiscript
- server: validate filenames and emoji names on emoji import
- server: check URL schema of ActivityPub URIs
- server: check schema for URL previews
- server: update summaly dependency
### Added
- client: impolement filtering and sorting in drive
- client: add "nobody" follower/following visibility
- client: re-add flag to require approval for bot follows
- client: show waveform on audio player
- client: add new deepl languages
- client: add instructions on remote interaction (when signed out)
- client: show follow button when not logged in
- server: show worker mode in process names
- server: drive endpoint to fetch files and folders combined
- activitypub: implement receiving account moves
### Changed
- **BREAKING** server: restructure endpoints related to user administration
- **BREAKING** server: refactor streaming API data structures
- **BREAKING** server: rename configuration environment variables
The environment variables that could be used for configuration which were previously prefixed with `MK_`
are now prefixed with `FK_` instead.
- server: improve error message for invalidating follows
- server: add pagination to file attachment timeline
### Fixed
- **BREAKING** server: properly respect follower/following visibility setting on statistics endpoint
This affects the endpoint `/api/users/stats`.
- improve documentation for `fetch-rss` endpoint
- client: fix authentication error in RSS widget
- client: fix attached files and account switcher combination in new note form
- client: improved module tracker file detection
- client: fix follow requests pagination
- client: Theme creator breaks after creating a theme
- client: replace error UUIDs with error codes
- client: allow opening links in new tab
The usual 3rd button click (usually mouse wheel) or Ctrl+Click should now work to open a link in a new tab.
- client: fix drive item updates inserting duplicate entries
- client: improve error messages for failed uploads
- client: stop unnecessary network congestion by websocket ping mechanism
- server: don't fail if a system user was already created
- server: better matching for MFM mentions
- server: fix rate limit for adding reactions
- server: check instance description length limit
- server: dont error on generating RSS feeds for profiles without public posts
- server: group delivering `Delete` activities to improve performance
- server: fix drive quota for remote users
- server: user deletion race condition (again)
### Removed
- **BREAKING** server: remove unused API parameters `sinceId` and `untilId` from `/api/notes/reactions`.
- **BREAKING** server: remove syslog integration
If you used syslog before, the syslog protocoll will no longer be connected to.
The configuration entries for `syslog` will be ignored, you should remove them if they are set.
- client: remove `driveFolderBg` theme colour
- activitypub: remove `_misskey_content` attribute
- activitypub: remove `_misskey_reaction` attribute
- activitypub: remove `_misskey_votes` attribute
- foundkey-js: remove unused definitions for Ads and detailed instance metadata
## 13.0.0-preview4 - 2023-02-05
This release contains 6 breaking changes, including changes to the configuration file format.

View File

@ -18,12 +18,11 @@ Please note that Emoji may be subject to copyright and you are responsible for c
If you have an image file that you would like to turn into a custom emoji you can import the image as an emoji.
This works just like attaching files to a note:
You can choose to upload a new file, pick a file from your Misskey drive or upload a file from another URL.
You can choose to upload a new file, pick a file from your Foundkey drive or upload a file from another URL.
::: danger
**Warning:**
When you import emoji from your drive, the file will remain inside your drive.
Misskey does not make a copy of this file so if you delete it, the emoji will be broken.
:::
Foundkey does not make a copy of this file so if you delete it, the emoji will be broken.
The emoji will be added to the instance and you will then be able to edit or delete it as usual.
@ -32,10 +31,9 @@ The emoji will be added to the instance and you will then be able to edit or del
Emojis can be imported in bulk as packed ZIP files with a special format.
This ability can be found in the three dots menu in the top right corner of the custom emoji menu.
::: warning
**Warning:**
Bulk emoji import may overwrite existing emoji or otherwise mess up your instance.
Be sure to only import emoji from trusted sources, ideally only ones you exported yourself.
:::
### Packed emoji format
@ -89,10 +87,9 @@ The properties of an emoji can be edited by clicking it in the list of local emo
When you click on a custom emoji, a dialog for editing the properties will open.
This dialog will also allow you to delete an emoji.
::: danger
**Warning:**
When you delete a custom emoji, old notes that contain it will still have the text name of the emoji in it.
The emoji will no longer be rendered correctly.
:::
Note that remote emoji can not be edited or deleted.

View File

@ -38,10 +38,11 @@ cp .config/docker_example.env .config/docker.env
Edit `default.yml` and `docker.env` according to the instructions in the files.
You will need to set the database host to `db` and Redis host to `redis` in order to use the internal container network for these services.
Edit `docker-compose.yml` if necessary. (e.g. if you want to change the port).
If you are using SELinux (eg. you're on Fedora or a RHEL derivative), you'll want to add the `Z` mount flag to the volume mounts to allow the containers to access the contents of those volumes.
Also check out the [Configure Foundkey](./install.md#configure-foundkey) section in the ordinary installation instructions.
## Build and initialize
The following command will build FoundKey and initialize the database.
This will take some time.

View File

@ -78,6 +78,21 @@ There are instructions for setting up [nginx](./nginx.md) for this purpose.
### Changing the default Reaction
You can change the default reaction that is used when an ActivityPub "Like" is received from '👍' to '⭐' by changing the boolean value `meta.useStarForReactionFallback` in the databse respectively.
### Environment variables
There are some behaviour changes which can be accomplished using environment variables.
|variable name|meaning|
|---|---|
|`FK_ONLY_QUEUE`|If set, only the queue processing will be run. The frontend will not be available. Cannot be combined with `FK_ONLY_SERVER` or `FK_DISABLE_CLUSTERING`.|
|`FK_ONLY_SERVER`|If set, only the frontend will be run. Queues will not be processed. Cannot be combined with `FK_ONLY_QUEUE` or `FK_DISABLE_CLUSTERING`.|
|`FK_NO_DAEMONS`|If set, the server statistics and queue statistics will not be run.|
|`FK_DISABLE_CLUSTERING`|If set, all work will be done in a single thread instead of different threads for frontend and queue. (not recommended)|
|`FK_WITH_LOG_TIME`|If set, a timestamp will be appended to all log messages.|
|`FK_SLOW`|If set, all requests will be delayed by 3s. (not recommended, useful for testing)|
|`FK_LOG_LEVEL`|Sets the log level. Messages below the set log level will be suppressed. Available log levels are `quiet` (suppress all), `error`, `warning`, `success`, `info`, `debug`.|
If the `NODE_ENV` environment variable is set to `testing`, then the flags `FK_DISABLE_CLUSTERING` and `FK_NO_DAEMONS` will always be set, and the log level will always be `quiet`.
## Build FoundKey
Build foundkey with the following:
@ -119,7 +134,7 @@ Run `NODE_ENV=production npm start` to launch FoundKey manually. To stop the ser
### Launch with systemd
Run `systemctl --edit --full --force foundkey.service`, and paste the following:
Run `systemctl edit --full --force foundkey.service`, and paste the following:
```ini
[Unit]
@ -129,7 +144,7 @@ Description=FoundKey daemon
Type=simple
User=foundkey
ExecStart=/usr/bin/npm start
WorkingDirectory=/home/foundkey/foundkey
WorkingDirectory=/home/foundkey/FoundKey
Environment="NODE_ENV=production"
TimeoutSec=60
StandardOutput=syslog
@ -163,7 +178,7 @@ command_args="start"
command_user="foundkey"
supervisor="supervise-daemon"
supervise_daemon_args=" -d /home/foundkey/foundkey -e NODE_ENV=\"production\""
supervise_daemon_args=" -d /home/foundkey/FoundKey -e NODE_ENV=\"production\""
pidfile="/run/${RC_SVCNAME}.pid"

View File

@ -20,7 +20,7 @@ cd packages/backend
LINE_NUM="$(npx typeorm migration:show -d ormconfig.js | grep -n nsfwDetection1655368940105 | cut -d ':' -f 1)"
NUM_MIGRATIONS="$(npx typeorm migration:show -d ormconfig.js | tail -n+"$LINE_NUM" | grep '\[X\]' | nl)"
for i in $(seq 1 $NUM_MIGRAIONS); do
for i in $(seq 1 $NUM_MIGRATIONS); do
npx typeorm migration:revert -d ormconfig.js
done
```

View File

@ -32,9 +32,6 @@ signup: "أنشئ حسابًا"
save: "حفظ"
users: "المستخدمون"
addUser: "اضافة مستخدم"
favorite: "أضفها للمفضلة"
favorites: "المفضلات"
unfavorite: "إزالة من المفضلة"
pin: "دبّسها على الصفحة الشخصية"
unpin: "ألغ تدبيسها من ملفك الشخصي"
copyContent: "انسخ المحتوى"
@ -581,7 +578,6 @@ loadRawImages: "حمّل الصور الأصلية بدلًا من المصغر
disableShowingAnimatedImages: "لا تشغّل الصور المتحركة"
verificationEmailSent: "أُرسل بريد التحقق. أنقر على الرابط المضمن لإكمال التحقق."
emailVerified: "تُحقّق من بريدك الإلكتروني"
noteFavoritesCount: "عدد الملاحظات المفضلة"
pageLikesCount: "عدد الصفحات التي أعجبت بها"
pageLikedCount: "عدد صفحاتك المُعجب بها"
contact: "التواصل"

View File

@ -32,9 +32,6 @@ signup: "নিবন্ধন করুন"
save: "সংরক্ষণ"
users: "ব্যবহারকারীগণ"
addUser: "ব্যবহারকারী যোগ করুন"
favorite: "পছন্দ"
favorites: "পছন্দগুলি"
unfavorite: "পছন্দ না"
pin: "পিন করা"
unpin: "পিন সরান"
copyContent: "বিষয়বস্তু কপি করুন"
@ -633,7 +630,6 @@ disableShowingAnimatedImages: "অ্যানিমেটেড চিত্র
verificationEmailSent: "নিশ্চিতকরণ ইমেল পাঠানো হয়েছে। সেটআপ সম্পূর্ণ করতে ইমেল এর\
\ লিঙ্ক অনুসরণ করুন।"
emailVerified: "ইমেইল নিশ্চিত করা হয়েছে"
noteFavoritesCount: "পছন্দ করা নোটের সংখ্যা"
pageLikesCount: "পেজ লাইক করেছেন"
pageLikedCount: "পেজ লাইক পেয়েছেন"
contact: "পরিচিতি সমূহ"

View File

@ -32,9 +32,6 @@ signup: "Registrar-se"
save: "Desar"
users: "Usuaris"
addUser: "Afegir un usuari"
favorite: "Afegir a preferits"
favorites: "Favorits"
unfavorite: "Eliminar dels preferits"
pin: "Fixar al perfil"
unpin: "Para de fixar del perfil"
copyContent: "Copiar el contingut"

View File

@ -32,9 +32,6 @@ signup: "Registrace"
save: "Uložit"
users: "Uživatelé"
addUser: "Přidat uživatele"
favorite: "Oblíbené"
favorites: "Oblíbené"
unfavorite: "Odebrat z oblízených"
pin: "Připnout"
unpin: "Odepnout"
copyContent: "Zkopírovat obsah"

View File

@ -33,9 +33,6 @@ signup: "Registrieren"
save: "Speichern"
users: "Benutzer"
addUser: "Benutzer hinzufügen"
favorite: "Zu Favoriten hinzufügen"
favorites: "Favoriten"
unfavorite: "Aus Favoriten entfernen"
pin: "An dein Profil anheften"
unpin: "Von deinem Profil lösen"
copyContent: "Inhalt kopieren"
@ -654,7 +651,6 @@ disableShowingAnimatedImages: "Animierte Bilder nicht abspielen"
verificationEmailSent: "Eine Bestätigungsmail wurde an deine Email-Adresse versendet.\
\ Besuche den dort enthaltenen Link, um die Verifizierung abzuschließen."
emailVerified: "Email-Adresse bestätigt"
noteFavoritesCount: "Anzahl an als Favorit markierter Notizen"
pageLikesCount: "Anzahl an als \"Gefällt mir\" markierter Seiten"
pageLikedCount: "Anzahl erhaltener \"Gefällt mir\" auf Seiten"
contact: "Kontakt"
@ -820,6 +816,7 @@ _ffVisibility:
public: "Öffentlich"
followers: "Nur für Follower sichtbar"
private: "Privat"
nobody: Niemand (auch nicht du)
_signup:
almostThere: "Fast geschafft"
emailAddressInfo: "Bitte gib deine Email-Adresse ein. Sie wird nicht öffentlich\
@ -1381,7 +1378,7 @@ addTag: Schlagwörter hinzufügen
removeTag: Schlagwörter entfernen
exportAll: Alle exportieren
exportSelected: Gewählte exportieren
federateBlocks: Andere Instanzen mitteilen, wenn ich jemanden blockiere
federateBlocks: Anderen Instanzen mitteilen, wenn ich jemanden blockiere
selectMode: Auswählen
selectAll: Alle auswählen
renoteUnmute: Renotes zeigen

View File

@ -32,9 +32,6 @@ signup: "Sign Up"
save: "Save"
users: "Users"
addUser: "Add a user"
favorite: "Add to favorites"
favorites: "Favorites"
unfavorite: "Remove from favorites"
pin: "Pin to profile"
unpin: "Unpin from profile"
copyContent: "Copy contents"
@ -648,7 +645,6 @@ disableShowingAnimatedImages: "Don't play animated images"
verificationEmailSent: "A verification email has been sent. Please follow the included\
\ link to complete verification."
emailVerified: "Email has been verified"
noteFavoritesCount: "Number of favorite notes"
pageLikesCount: "Number of liked Pages"
pageLikedCount: "Number of received Page likes"
contact: "Contact"
@ -843,6 +839,7 @@ _ffVisibility:
public: "Public"
followers: "Visible to followers only"
private: "Private"
nobody: "Nobody (not even you)"
_signup:
almostThere: "Almost there"
emailAddressInfo: "Please enter your email address. It will not be made public."

View File

@ -33,9 +33,6 @@ signup: "Registrarse"
save: "Guardar"
users: "Usuarios"
addUser: "Agregar usuario"
favorite: "Favorito"
favorites: "Favoritos"
unfavorite: "Quitar de favoritos"
pin: "Fijar"
unpin: "Desfijar"
copyContent: "Copiar contenido"
@ -638,7 +635,6 @@ verificationEmailSent: "Se le ha enviado un correo electrónico de confirmación
\ favor, acceda al enlace proporcionado en el correo electrónico para completar\
\ la configuración."
emailVerified: "Su dirección de correo electrónico ha sido verificada."
noteFavoritesCount: "Número de notas favoritas"
pageLikesCount: "Número de favoritos en la página"
pageLikedCount: "Número de favoritos de su página"
contact: "Contacto"

View File

@ -34,9 +34,6 @@ signup: "Sinscrire"
save: "Enregistrer"
users: "Utilisateur·rice·s"
addUser: "Ajouter un·e utilisateur·rice"
favorite: "Ajouter aux favoris"
favorites: "Favoris"
unfavorite: "Retirer des favoris"
pin: "Épingler sur le profil"
unpin: "Désépingler"
copyContent: "Copier le contenu"
@ -647,7 +644,6 @@ disableShowingAnimatedImages: "Désactiver l'animation des images"
verificationEmailSent: "Un e-mail de vérification a été envoyé. Veuillez accéder au\
\ lien pour compléter la vérification."
emailVerified: "Votre adresse e-mail a été vérifiée"
noteFavoritesCount: "Nombre de notes dans les favoris"
pageLikesCount: "Nombre de pages aimées"
pageLikedCount: "Nombre de vos pages aimées"
contact: "Contact"

View File

@ -32,9 +32,6 @@ signup: "Daftar"
save: "Simpan"
users: "Pengguna"
addUser: "Tambah pengguna"
favorite: "Favorit"
favorites: "Favorit"
unfavorite: "Hapus favorit"
pin: "Sematkan ke profil"
unpin: "Lepas sematan dari profil"
copyContent: "Salin konten"
@ -639,7 +636,6 @@ disableShowingAnimatedImages: "Jangan mainkan gambar bergerak"
verificationEmailSent: "Surel verifikasi telah dikirimkan. Mohon akses tautan yang\
\ telah disertakan untuk menyelesaikan verifikasi."
emailVerified: "Surel telah diverifikasi"
noteFavoritesCount: "Jumlah catatan yang difavoritkan"
pageLikesCount: "Jumlah suka yang diterima Halaman"
pageLikedCount: "Jumlah Halaman yang disukai"
contact: "Kontak"

View File

@ -33,9 +33,6 @@ signup: "Iscriviti"
save: "Salva"
users: "Utente"
addUser: "Aggiungi utente"
favorite: "Preferiti"
favorites: "Preferiti"
unfavorite: "Rimuovi nota dai preferiti"
pin: "Fissa sul profilo"
unpin: "Non fissare sul profilo"
copyContent: "Copia il contenuto"
@ -625,7 +622,6 @@ disableShowingAnimatedImages: "Disabilita le immagini animate"
verificationEmailSent: "Una mail di verifica è stata inviata. Si prega di accedere\
\ al collegamento per compiere la verifica."
emailVerified: "Il tuo indirizzo email è stato verificato"
noteFavoritesCount: "Conteggio note tra i preferiti"
pageLikesCount: "Numero di pagine che ti piacciono"
pageLikedCount: "Numero delle tue pagine che hanno ricevuto \"Mi piace\""
contact: "Contatti"

View File

@ -31,9 +31,6 @@ signup: "新規登録"
save: "保存"
users: "ユーザー"
addUser: "ユーザーを追加"
favorite: "お気に入り"
favorites: "お気に入り"
unfavorite: "お気に入り解除"
pin: "ピン留め"
unpin: "ピン留め解除"
copyContent: "内容をコピー"
@ -587,7 +584,6 @@ loadRawImages: "添付画像のサムネイルをオリジナル画質にする"
disableShowingAnimatedImages: "アニメーション画像を再生しない"
verificationEmailSent: "確認のメールを送信しました。メールに記載されたリンクにアクセスして、設定を完了してください。"
emailVerified: "メールアドレスが確認されました"
noteFavoritesCount: "お気に入りノートの数"
pageLikesCount: "Pageにいいねした数"
pageLikedCount: "Pageにいいねされた数"
contact: "連絡先"

View File

@ -30,9 +30,6 @@ signup: "新規登録"
save: "保存"
users: "ユーザー"
addUser: "ユーザーを追加や"
favorite: "お気に入り"
favorites: "お気に入り"
unfavorite: "やっぱ気に入らん"
pin: "ピン留めしとく"
unpin: "やっぱピン留めせん"
copyContent: "内容をコピー"

View File

@ -27,9 +27,6 @@ signup: "ನೋಂದಣಿ"
save: "ಉಳಿಸಿ"
users: "ಬಳಕೆದಾರ"
addUser: "ಬಳಕೆದಾರರನ್ನು ಸೇರಿಸಿ"
favorite: "ಮೆಚ್ಚಿನ"
favorites: "ಮೆಚ್ಚಿನವುಗಳು"
unfavorite: "ಮೆಚ್ಚುಗೆ ಅಳಿಸು"
pin: "ಪ್ರೊಫ಼ೈಲಿಗೆ ಅಂಟಿಸು"
unpin: "ಪ್ರೊಫ಼ೈಲಿಂದ ಅಂಟುತೆಗೆ"
copyContent: "ವಿಷಯವನ್ನು ನಕಲಿಸು"

View File

@ -1,7 +1,8 @@
---
_lang_: "한국어"
headlineMisskey: "노트로 연결되는 네트워크"
introMisskey: "환영합니다! FoundKey 는 오픈 소스 분산형 마이크로 블로그 서비스입니다.\n\"노트\" 를 작성해서, 지금 일어나고 있는 일을 공유하거나, 당신만의 이야기를 모두에게 발신하세요📡\n\"리액션\" 기능으로, 친구의 노트에 총알같이 반응을 추가할 수도 있습니다👍\n새로운 세계를 탐험해 보세요🚀"
introMisskey: "환영합니다! FoundKey 는 오픈 소스 분산형 마이크로 블로그 서비스입니다.\n\"노트\" 를 작성해서, 지금 일어나고\
\ 있는 일을 공유하거나, 당신만의 이야기를 모두에게 발신하세요\U0001F4E1\n\"리액션\" 기능으로, 친구의 노트에 총알같이 반응을 추가할\
\ 수도 있습니다\U0001F44D\n새로운 세계를 탐험해 보세요\U0001F680"
monthAndDay: "{month}월 {day}일"
search: "검색"
notifications: "알림"
@ -12,7 +13,6 @@ fetchingAsApObject: "연합에서 조회 중"
ok: "OK"
gotIt: "알겠어요"
cancel: "취소"
enterUsername: "유저명 입력"
renotedBy: "{user}님이 Renote"
noNotes: "노트가 없습니다"
noNotifications: "표시할 알림이 없습니다"
@ -28,16 +28,9 @@ login: "로그인"
loggingIn: "로그인 중"
logout: "로그아웃"
signup: "회원 가입"
uploading: "업로드 중"
save: "저장"
users: "유저"
addUser: "유저 추가"
favorite: "즐겨찾기"
favorites: "즐겨찾기"
unfavorite: "즐겨찾기에서 제거"
favorited: "즐겨찾기에 등록했습니다"
alreadyFavorited: "이미 즐겨찾기에 등록되어 있습니다"
cantFavorite: "즐겨찾기에 등록하지 못했습니다"
pin: "프로필에 고정"
unpin: "프로필에서 고정 해제"
copyContent: "내용 복사"
@ -48,7 +41,6 @@ deleteAndEditConfirm: "이 노트를 삭제한 뒤 다시 편집하시겠습니
addToList: "리스트에 추가"
sendMessage: "메시지 보내기"
copyUsername: "유저명 복사"
searchUser: "사용자 검색"
reply: "답글"
loadMore: "더 보기"
showMore: "더 보기"
@ -68,7 +60,6 @@ unfollowConfirm: "{name}님을 언팔로우하시겠습니까?"
exportRequested: "내보내기를 요청하였습니다. 이 작업은 시간이 걸릴 수 있습니다. 내보내기가 완료되면 \"드라이브\"에 추가됩니다."
importRequested: "가져오기를 요청하였습니다. 이 작업에는 시간이 걸릴 수 있습니다."
lists: "리스트"
noLists: "리스트가 없습니다"
note: "노트"
notes: "노트"
following: "팔로잉"
@ -80,7 +71,8 @@ error: "오류"
somethingHappened: "오류가 발생했습니다"
retry: "다시 시도"
pageLoadError: "페이지를 불러오지 못했습니다."
pageLoadErrorDescription: "네트워크 연결 또는 브라우저 캐시로 인해 발생했을 가능성이 높습니다. 캐시를 삭제하거나, 잠시 후 다시 시도해 주세요."
pageLoadErrorDescription: "네트워크 연결 또는 브라우저 캐시로 인해 발생했을 가능성이 높습니다. 캐시를 삭제하거나, 잠시 후\
\ 다시 시도해 주세요."
serverIsDead: "서버로부터 응답이 없습니다. 잠시 후 다시 시도해주세요."
youShouldUpgradeClient: "이 페이지를 표시하려면 새로고침하여 새로운 버전의 클라이언트를 이용해 주십시오."
enterListName: "리스트 이름을 입력"
@ -92,21 +84,15 @@ followRequest: "팔로우 요청"
followRequests: "팔로우 요청"
unfollow: "팔로우 해제"
followRequestPending: "팔로우 허가 대기중"
enterEmoji: "이모지 입력"
renote: "Renote"
unrenote: "Renote 취소"
renoted: "Renote 하였습니다"
cantRenote: "이 게시물은 Renote할 수 없습니다."
cantReRenote: "Renote를 Renote할 수 없습니다."
quote: "인용"
pinnedNote: "고정해놓은 노트"
pinned: "프로필에 고정"
you: "당신"
clickToShow: "클릭하여 보기"
sensitive: "열람주의"
add: "추가"
reaction: "리액션"
reactionSetting: "선택기에 표시할 리액션"
reactionSettingDescription2: "끌어서 순서 변경, 클릭해서 삭제, +를 눌러서 추가할 수 있습니다."
attachCancel: "첨부 취소"
markAsSensitive: "열람주의로 설정"
@ -130,14 +116,13 @@ editWidgetsExit: "편집 종료"
customEmojis: "커스텀 이모지"
emoji: "이모지"
emojis: "이모지"
emojiName: "이모지 이름"
emojiUrl: "이모지 URL"
addEmoji: "이모지 추가"
settingGuide: "추천 설정"
cacheRemoteFiles: "리모트 파일을 캐시"
cacheRemoteFilesDescription: "이 설정을 해지하면 리모트 파일을 캐시하지 않고 해당 파일을 직접 링크하게 됩니다. 그에 따라 서버의 저장 공간을 절약할 수 있지만, 썸네일이 생성되지 않기 때문에 통신량이 증가합니다."
cacheRemoteFilesDescription: "이 설정을 해지하면 리모트 파일을 캐시하지 않고 해당 파일을 직접 링크하게 됩니다. 그에 따라\
\ 서버의 저장 공간을 절약할 수 있지만, 썸네일이 생성되지 않기 때문에 통신량이 증가합니다."
flagAsBot: "나는 봇입니다"
flagAsBotDescription: "이 계정을 자동화된 수단으로 운용할 경우에 활성화해 주세요. 이 플래그를 활성화하면, 다른 봇이 이를 참고하여 봇 끼리의 무한 연쇄 반응을 회피하거나, 이 계정의 시스템 상에서의 취급이 Bot 운영에 최적화되는 등의 변화가 생깁니다."
flagAsBotDescription: "이 계정을 자동화된 수단으로 운용할 경우에 활성화해 주세요. 이 플래그를 활성화하면, 다른 봇이 이를 참고하여\
\ 봇 끼리의 무한 연쇄 반응을 회피하거나, 이 계정의 시스템 상에서의 취급이 Bot 운영에 최적화되는 등의 변화가 생깁니다."
flagAsCat: "나는 고양이다냥"
flagAsCatDescription: "이 계정이 고양이라면 활성화 해주세요."
flagShowTimelineReplies: "타임라인에 노트의 답글을 표시하기"
@ -147,40 +132,32 @@ addAccount: "계정 추가"
loginFailed: "로그인에 실패했습니다"
showOnRemote: "리모트에서 보기"
general: "일반"
wallpaper: "배경"
setWallpaper: "배경화면 설정"
removeWallpaper: "배경 제거"
searchWith: "검색: {q}"
youHaveNoLists: "리스트가 없습니다"
followConfirm: "{name}님을 팔로우 하시겠습니까?"
proxyAccount: "프록시 계정"
proxyAccountDescription: "프록시 계정은 특정 조건 하에서 유저의 리모트 팔로우를 대행하는 계정입니다. 예를 들면, 유저가 리모트 유저를 리스트에 넣었을 때, 리스트에 들어간 유저를 아무도 팔로우한 적이 없다면 액티비티가 인스턴스로 배달되지 않기 때문에, 대신 프록시 계정이 해당 유저를 팔로우하도록 합니다."
proxyAccountDescription: "프록시 계정은 특정 조건 하에서 유저의 리모트 팔로우를 대행하는 계정입니다. 예를 들면, 유저가 리모트\
\ 유저를 리스트에 넣었을 때, 리스트에 들어간 유저를 아무도 팔로우한 적이 없다면 액티비티가 인스턴스로 배달되지 않기 때문에, 대신 프록시 계정이\
\ 해당 유저를 팔로우하도록 합니다."
host: "호스트"
selectUser: "유저 선택"
recipient: "수신인"
annotation: "내용에 대한 주석"
federation: "연합"
instances: "인스턴스"
registeredAt: "등록 날짜"
latestRequestSentAt: "마지막으로 요청을 보낸 시간"
latestRequestReceivedAt: "마지막으로 요청을 받은 시간"
latestStatus: "마지막 상태"
storageUsage: "스토리지 사용량"
charts: "차트"
perHour: "1시간마다"
perDay: "1일마다"
stopActivityDelivery: "액티비티 보내지 않기"
blockThisInstance: "이 인스턴스를 차단"
operations: "작업"
software: "소프트웨어"
version: "버전"
metadata: "메타데이터"
withNFiles: "{n}개의 파일"
monitor: "모니터"
jobQueue: "작업 대기열"
cpuAndMemory: "CPU와 메모리"
network: "네트워크"
disk: "디스크"
instanceInfo: "인스턴스 정보"
statistics: "통계"
clearQueue: "대기열 비우기"
@ -189,7 +166,8 @@ clearQueueConfirmText: "대기열에 남아 있는 노트는 더이상 연합되
clearCachedFiles: "캐시 비우기"
clearCachedFilesConfirm: "캐시된 리모트 파일을 모두 삭제하시겠습니까?"
blockedInstances: "차단된 인스턴스"
blockedInstancesDescription: "차단하려는 인스턴스의 호스트 이름을 줄바꿈으로 구분하여 설정합니다. 차단된 인스턴스는 이 인스턴스와 통신할 수 없게 됩니다."
blockedInstancesDescription: "차단하려는 인스턴스의 호스트 이름을 줄바꿈으로 구분하여 설정합니다. 차단된 인스턴스는 이 인스턴스와\
\ 통신할 수 없게 됩니다."
muteAndBlock: "뮤트 및 차단"
mutedUsers: "뮤트한 유저"
blockedUsers: "차단한 유저"
@ -211,9 +189,6 @@ all: "전체"
subscribing: "구독 중"
publishing: "배포 중"
notResponding: "응답 없음"
instanceFollowing: "인스턴스의 팔로잉"
instanceFollowers: "인스턴스의 팔로워"
instanceUsers: "인스턴스의 유저"
changePassword: "비밀번호 변경"
security: "보안"
retypedNotMatch: "입력이 일치하지 않습니다."
@ -229,7 +204,6 @@ lookup: "조회"
announcements: "공지사항"
imageUrl: "이미지 URL"
remove: "삭제"
removed: "삭제하였습니다"
removeAreYouSure: "\"{x}\" 을(를) 삭제하시겠습니까?"
deleteAreYouSure: "\"{x}\" 을(를) 삭제하시겠습니까?"
resetAreYouSure: "초기화 하시겠습니까?"
@ -237,7 +211,8 @@ saved: "저장하였습니다"
messaging: "대화"
upload: "업로드"
keepOriginalUploading: "원본 이미지를 유지"
keepOriginalUploadingDescription: "이미지를 업로드할 때에 원본을 그대로 유지합니다. 비활성화하면 업로드할 때 브라우저에서 웹 공개용 이미지를 생성합니다."
keepOriginalUploadingDescription: "이미지를 업로드할 때에 원본을 그대로 유지합니다. 비활성화하면 업로드할 때 브라우저에서\
\ 웹 공개용 이미지를 생성합니다."
fromDrive: "드라이브에서"
fromUrl: "URL로부터"
uploadFromUrl: "URL 업로드"
@ -269,7 +244,6 @@ lightThemes: "밝은 테마"
darkThemes: "어두운 테마"
syncDeviceDarkMode: "디바이스의 다크 모드 설정과 동기화"
drive: "드라이브"
fileName: "파일명"
selectFile: "파일 선택"
selectFiles: "파일 선택"
selectFolder: "폴더 선택"
@ -280,8 +254,6 @@ createFolder: "폴더 만들기"
renameFolder: "폴더 이름 바꾸기"
deleteFolder: "폴더 삭제"
addFile: "파일 추가"
emptyDrive: "드라이브가 비어 있습니다"
emptyFolder: "폴더가 비어 있습니다"
unableToDelete: "삭제할 수 없습니다"
inputNewFileName: "바꿀 파일명을 입력해 주세요"
inputNewDescription: "새 캡션을 입력해 주세요"
@ -318,7 +290,6 @@ pages: "페이지"
enableLocalTimeline: "로컬 타임라인 활성화"
enableGlobalTimeline: "글로벌 타임라인 활성화"
disablingTimelinesInfo: "특정 타임라인을 비활성화하더라도 관리자 및 모더레이터는 계속 사용할 수 있습니다."
registration: "등록"
enableRegistration: "신규 회원가입을 활성화"
invite: "초대"
driveCapacityPerLocalAccount: "로컬 유저 한 명당 드라이브 용량"
@ -327,22 +298,12 @@ inMb: "메가바이트 단위"
iconUrl: "아이콘 URL"
bannerUrl: "배너 이미지 URL"
backgroundImageUrl: "배경 이미지 URL"
basicInfo: "기본 정보"
pinnedUsers: "고정된 유저"
pinnedUsersDescription: "\"발견하기\" 페이지 등에 고정하고 싶은 유저를 한 줄에 한 명씩 적습니다."
pinnedPages: "고정한 페이지"
pinnedPagesDescription: "인스턴스의 대문에 고정하고 싶은 페이지의 경로를 한 줄에 하나씩 적습니다."
pinnedClipId: "고정할 클립의 ID"
pinnedNotes: "고정해놓은 노트"
hcaptcha: "hCaptcha"
enableHcaptcha: "hCaptcha 활성화"
hcaptchaSiteKey: "사이트 키"
hcaptchaSecretKey: "시크릿 키"
recaptcha: "reCAPTCHA"
enableRecaptcha: "reCAPTCHA 활성화"
recaptchaSiteKey: "사이트 키"
recaptchaSecretKey: "시크릿 키"
avoidMultiCaptchaConfirm: "여러 Captcha를 사용하는 경우 간섭이 발생할 가능성이 있습니다. 다른 Captcha를 비활성화하시겠습니까? 취소를 눌러 여러 Captcha를 활성화한 상태로 두는 것도 가능합니다."
antennas: "안테나"
manageAntennas: "안테나 관리"
name: "이름"
@ -352,7 +313,6 @@ antennaExcludeKeywords: "제외할 키워드"
antennaKeywordsDescription: "공백으로 구분하는 경우 AND, 줄바꿈으로 구분하는 경우 OR로 지정됩니다"
notifyAntenna: "새로운 노트를 알림"
withFileAntenna: "파일이 첨부된 노트만"
enableServiceworker: "ServiceWorker 사용"
antennaUsersDescription: "유저명을 한 줄에 한 명씩 적습니다"
caseSensitive: "대소문자를 구분"
withReplies: "답글 포함"
@ -367,11 +327,8 @@ popularUsers: "인기 유저"
recentlyUpdatedUsers: "최근 활동한 유저"
recentlyRegisteredUsers: "최근 가입한 유저"
recentlyDiscoveredUsers: "최근 발견한 유저"
exploreUsersCount: "{count}명의 유저가 있습니다"
exploreFediverse: "연합우주를 탐색"
popularTags: "인기 태그"
userList: "리스트"
about: "정보"
aboutMisskey: "FoundKey에 대하여"
administrator: "관리자"
token: "토큰"
@ -391,7 +348,6 @@ share: "공유"
notFound: "찾을 수 없습니다"
notFoundDescription: "지정한 URL에 해당하는 페이지가 존재하지 않습니다."
uploadFolder: "기본 업로드 위치"
cacheClear: "캐시 지우기"
markAsReadAllNotifications: "모든 알림을 읽은 상태로 표시"
markAsReadAllUnreadNotes: "모든 글을 읽은 상태로 표시"
markAsReadAllTalkMessages: "모든 대화를 읽은 상태로 표시"
@ -422,7 +378,6 @@ noMessagesYet: "아직 대화가 없습니다"
newMessageExists: "새 메시지가 있습니다"
onlyOneFileCanBeAttached: "메시지에 첨부할 수 있는 파일은 하나까지입니다"
signinRequired: "로그인 해주세요"
invitations: "초대"
invitationCode: "초대 코드"
checking: "확인하는 중입니다"
available: "사용 가능합니다"
@ -441,7 +396,6 @@ or: "혹은"
language: "언어"
uiLanguage: "UI 표시 언어"
groupInvited: "그룹에 초대되었습니다"
aboutX: "{x}에 대하여"
useOsNativeEmojis: "OS 기본 이모지를 사용"
disableDrawer: "드로어 메뉴를 사용하지 않기"
youHaveNoGroups: "그룹이 없습니다"
@ -449,47 +403,42 @@ joinOrCreateGroup: "다른 그룹의 초대를 받거나, 직접 새 그룹을
noHistory: "기록이 없습니다"
signinHistory: "로그인 기록"
disableAnimatedMfm: "움직임이 있는 MFM을 비활성화"
doing: "잠시만요"
category: "카테고리"
tags: "태그"
docSource: "이 문서의 소스"
createAccount: "계정 만들기"
existingAccount: "기존 계정"
regenerate: "재생성"
fontSize: "글자 크기"
noFollowRequests: "처리되지 않은 팔로우 요청이 없습니다"
openImageInNewTab: "새 탭에서 이미지 열기"
dashboard: "대시보드"
local: "로컬"
remote: "리모트"
total: "합계"
weekOverWeekChanges: "지난주보다"
dayOverDayChanges: "어제보다"
appearance: "모양"
clientSettings: "클라이언트 설정"
accountSettings: "계정 설정"
numberOfDays: "며칠동안"
hideThisNote: "이 노트를 숨기기"
showFeaturedNotesInTimeline: "타임라인에 추천 노트를 표시"
objectStorage: "오브젝트 스토리지"
useObjectStorage: "오브젝트 스토리지를 사용"
objectStorageBaseUrl: "Base URL"
objectStorageBaseUrlDesc: "오브젝트 (미디어) 참조 URL 을 만들 때 사용되는 URL입니다. CDN 또는 프록시를 사용하는 경우 그 URL을 지정하고, 그 외의 경우 사용할 서비스의 가이드에 따라 공개적으로 액세스 할 수 있는 주소를 지정해 주세요. 예를 들어, AWS S3의 경우 'https://<bucket>.s3.amazonaws.com', GCS등의 경우 'https://storage.googleapis.com/<bucket>' 와 같이 지정합니다."
objectStorageBaseUrlDesc: "오브젝트 (미디어) 참조 URL 을 만들 때 사용되는 URL입니다. CDN 또는 프록시를 사용하는\
\ 경우 그 URL을 지정하고, 그 외의 경우 사용할 서비스의 가이드에 따라 공개적으로 액세스 할 수 있는 주소를 지정해 주세요. 예를 들어,\
\ AWS S3의 경우 'https://<bucket>.s3.amazonaws.com', GCS등의 경우 'https://storage.googleapis.com/<bucket>'\
\ 와 같이 지정합니다."
objectStorageBucket: "Bucket"
objectStorageBucketDesc: "사용 서비스의 bucket명을 지정해주세요."
objectStoragePrefix: "Prefix"
objectStoragePrefixDesc: "이 Prefix 의 디렉토리 아래에 파일이 저장됩니다."
objectStorageEndpoint: "Endpoint"
objectStorageEndpointDesc: "AWS S3의 경우 공란, 다른 서비스의 경우 각 서비스의 가이드에 맞게 endpoint를 설정해주세요. '<host>' 혹은 '<host>:<port>' 와 같이 지정합니다."
objectStorageEndpointDesc: "AWS S3의 경우 공란, 다른 서비스의 경우 각 서비스의 가이드에 맞게 endpoint를 설정해주세요.\
\ '<host>' 혹은 '<host>:<port>' 와 같이 지정합니다."
objectStorageRegion: "Region"
objectStorageRegionDesc: "'xx-east-1'와 같이 region을 지정해주세요. 사용하는 서비스에 region 개념이 없는 경우, 비워 두거나 'us-east-1'으로 설정해 주세요."
objectStorageRegionDesc: "'xx-east-1'와 같이 region을 지정해주세요. 사용하는 서비스에 region 개념이 없는\
\ 경우, 비워 두거나 'us-east-1'으로 설정해 주세요."
objectStorageUseSSL: "SSL 사용"
objectStorageUseSSLDesc: "API 호출시 HTTPS 를 사용하지 않는 경우 OFF 로 설정해 주세요"
objectStorageUseProxy: "연결에 프록시를 사용"
objectStorageUseProxyDesc: "오브젝트 스토리지 API 호출시 프록시를 사용하지 않는 경우 OFF 로 설정해 주세요"
objectStorageSetPublicRead: "업로드할 때 'public-read'를 설정하기"
serverLogs: "서버 로그"
deleteAll: "모두 삭제"
showFixedPostForm: "타임라인 상단에 글 작성란을 표시"
newNoteRecived: "새 노트가 있습니다"
sounds: "소리"
@ -500,7 +449,6 @@ popout: "새 창으로 열기"
volume: "음량"
masterVolume: "마스터 볼륨"
details: "자세히"
chooseEmoji: "이모지 선택"
unableToProcess: "작업을 완료할 수 없습니다"
recentUsed: "최근 사용"
install: "설치"
@ -514,28 +462,27 @@ sort: "정렬"
ascendingOrder: "오름차순"
descendingOrder: "내림차순"
scratchpad: "스크래치 패드"
scratchpadDescription: "스크래치 패드는 AiScript 의 테스트 환경을 제공합니다. FoundKey 와 상호 작용하는 코드를 작성, 실행 및 결과를 확인할 수 있습니다."
scratchpadDescription: "스크래치 패드는 AiScript 의 테스트 환경을 제공합니다. FoundKey 와 상호 작용하는 코드를\
\ 작성, 실행 및 결과를 확인할 수 있습니다."
output: "출력"
script: "스크립트"
updateRemoteUser: "리모트 유저 정보 갱신"
deleteAllFiles: "모든 파일 삭제"
deleteAllFilesConfirm: "모든 파일을 삭제하시겠습니까?"
removeAllFollowing: "모든 팔로잉 해제"
removeAllFollowingDescription: "{host}(으)로부터 모든 팔로잉을 해제합니다. 해당 인스턴스가 더 이상 존재하지 않게 된 경우 등에 실행해 주세요."
removeAllFollowingDescription: "{host}(으)로부터 모든 팔로잉을 해제합니다. 해당 인스턴스가 더 이상 존재하지 않게\
\ 된 경우 등에 실행해 주세요."
userSuspended: "이 계정은 정지된 상태입니다."
userSilenced: "이 계정은 사일런스된 상태입니다."
yourAccountSuspendedTitle: "계정이 정지되었습니다"
yourAccountSuspendedDescription: "이 계정은 서버의 이용 약관을 위반하거나, 기타 다른 이유로 인해 정지되었습니다. 자세한 사항은 관리자에게 문의해 주십시오. 계정을 새로 생성하지 마십시오."
yourAccountSuspendedDescription: "이 계정은 서버의 이용 약관을 위반하거나, 기타 다른 이유로 인해 정지되었습니다. 자세한\
\ 사항은 관리자에게 문의해 주십시오. 계정을 새로 생성하지 마십시오."
menu: "메뉴"
divider: "구분선"
addItem: "항목 추가"
relays: "릴레이"
addRelay: "릴레이 추가"
inboxUrl: "Inbox 주소"
addedRelays: "추가된 릴레이"
serviceworkerInfo: "푸시 알림을 수행하려면 활성화해야 합니다."
deletedNote: "삭제된 노트"
invisibleNote: "비공개 노트"
enableInfiniteScroll: "자동으로 좀 더 보기"
visibility: "공개 범위"
poll: "투표"
@ -545,15 +492,12 @@ disablePlayer: "플레이어 닫기"
themeEditor: "테마 에디터"
description: "설명"
describeFile: "캡션 추가"
enterFileDescription: "캡션 입력"
author: "작성자"
leaveConfirm: "저장하지 않은 변경사항이 있습니다. 취소하시겠습니까?"
manage: "관리"
plugins: "플러그인"
deck: "덱"
undeck: "덱 해제"
useBlurEffectForModal: "모달에 흐림 효과 사용"
useFullReactionPicker: "모든 기능이 포함된 리액션 선택기 사용"
width: "폭"
height: "높이"
large: "크게"
@ -565,7 +509,6 @@ enableAll: "전체 선택"
disableAll: "전체 해제"
tokenRequested: "계정 접근 허용"
pluginTokenRequestedDescription: "이 플러그인은 여기서 설정한 권한을 사용할 수 있게 됩니다."
notificationType: "알림 유형"
edit: "편집"
useStarForReactionFallback: "알 수 없는 리액션 이모지 대신 ★ 사용"
emailServer: "메일 서버"
@ -590,10 +533,7 @@ userSaysSomething: "{name}님이 무언가를 말했습니다"
makeActive: "활성화"
display: "표시"
copy: "복사"
metrics: "통계"
overview: "요약"
logs: "로그"
delayed: "지연"
database: "데이터베이스"
channel: "채널"
create: "생성"
@ -603,11 +543,11 @@ useGlobalSetting: "글로벌 설정을 사용하기"
useGlobalSettingDesc: "활성화하면 계정의 알림 설정이 적용되니다. 비활성화하면 개별적으로 설정할 수 있게 됩니다."
other: "기타"
regenerateLoginToken: "로그인 토큰을 재생성"
regenerateLoginTokenDescription: "로그인할 때 사용되는 내부 토큰을 재생성합니다. 일반적으로 이 작업을 실행할 필요는 없습니다. 이 기능을 사용하면 이 계정으로 로그인한 모든 기기에서 로그아웃됩니다."
regenerateLoginTokenDescription: "로그인할 때 사용되는 내부 토큰을 재생성합니다. 일반적으로 이 작업을 실행할 필요는 없습니다.\
\ 이 기능을 사용하면 이 계정으로 로그인한 모든 기기에서 로그아웃됩니다."
setMultipleBySeparatingWithSpace: "공백으로 구분하여 여러 개 설정할 수 있습니다."
fileIdOrUrl: "파일 ID 또는 URL"
behavior: "동작"
sample: "예시"
abuseReports: "신고"
reportAbuse: "신고"
reportAbuseOf: "{name}을 신고하기"
@ -621,12 +561,8 @@ forwardReportIsAnonymous: "리모트 인스턴스에서는 나의 정보를 볼
send: "전송"
abuseMarkAsResolved: "해결됨으로 표시"
openInNewTab: "새 탭에서 열기"
openInSideView: "사이드뷰로 열기"
defaultNavigationBehaviour: "기본 탐색 동작"
editTheseSettingsMayBreakAccount: "이 설정을 변경하면 계정이 손상될 수 있습니다."
instanceTicker: "노트의 인스턴스 정보"
waitingFor: "{x}을(를) 기다리고 있습니다"
random: "랜덤"
system: "시스템"
switchUi: "UI 전환"
desktop: "데스크탑"
@ -660,16 +596,12 @@ alwaysMarkSensitive: "미디어를 항상 열람 주의로 설정"
loadRawImages: "첨부한 이미지의 썸네일을 원본화질로 표시"
disableShowingAnimatedImages: "움직이는 이미지를 자동으로 재생하지 않음"
verificationEmailSent: "확인 메일을 발송하였습니다. 설정을 완료하려면 메일에 첨부된 링크를 확인해 주세요."
notSet: "설정되지 않음"
emailVerified: "메일 주소가 확인되었습니다."
noteFavoritesCount: "즐겨찾기한 노트 수"
pageLikesCount: "좋아요 한 Page 수"
pageLikedCount: "Page에 받은 좋아요 수"
contact: "연락처"
useSystemFont: "시스템 기본 글꼴을 사용"
clips: "클립"
experimentalFeatures: "실험실"
developer: "개발자"
makeExplorable: "\"발견하기\"에 내 계정 보이기"
makeExplorableDescription: "비활성화하면 \"발견하기\"에 나의 계정을 표시하지 않습니다."
showGapBetweenNotesInTimeline: "타임라인의 노트 사이를 띄워서 표시"
@ -680,28 +612,16 @@ wide: "넓게"
narrow: "좁게"
reloadToApplySetting: "이 설정을 적용하려면 페이지를 새로고침해야 합니다. 바로 새로고침하시겠습니까?"
needReloadToApply: "변경 사항은 새로고침하면 적용됩니다."
showTitlebar: "타이틀 바를 표시하기"
clearCache: "캐시 비우기"
onlineUsersCount: "{n}명이 접속 중"
nUsers: "{n} 유저"
nNotes: "{n} 노트"
myTheme: "내 테마"
backgroundColor: "배경 색"
accentColor: "강조 색상"
textColor: "문자 색"
saveAs: "다른 이름으로 저장"
advanced: "고급"
value: "값"
createdAt: "생성된 날짜"
updatedAt: "수정한 날짜"
saveConfirm: "저장하시겠습니까?"
deleteConfirm: "삭제하시겠습니까?"
invalidValue: "올바른 값이 아닙니다."
registry: "레지스트리"
closeAccount: "계정 폐쇄"
currentVersion: "현재 버전"
latestVersion: "최신 버전"
youAreRunningUpToDateClient: "사용 중인 클라이언트는 최신입니다."
newVersionOfClientAvailable: "새로운 버전의 클라이언트를 이용할 수 있습니다."
usageAmount: "사용량"
capacity: "용량"
@ -710,12 +630,9 @@ editCode: "코드 수정"
apply: "적용"
receiveAnnouncementFromInstance: "이 인스턴스의 알림을 이메일로 수신할게요"
emailNotification: "메일 알림"
publish: "게시"
inChannelSearch: "채널에서 검색"
useReactionPickerForContextMenu: "우클릭하여 리액션 선택기 열기"
typingUsers: "{users} 님이 입력하고 있어요.."
jumpToSpecifiedDate: "특정 날짜로 이동"
showingPastTimeline: "과거의 타임라인을 표시하고 있어요"
clear: "지우기"
markAllAsRead: "모두 읽은 상태로 표시"
goBack: "뒤로"
@ -728,7 +645,6 @@ notSpecifiedMentionWarning: "수신자가 선택되지 않은 멘션이 있어
info: "정보"
userInfo: "유저 정보"
unknown: "알 수 없음"
onlineStatus: "온라인 상태"
hideOnlineStatus: "온라인 상태 숨기기"
hideOnlineStatusDescription: "온라인 상태를 숨기면, 검색과 같은 일부 기능에 영향을 미칠 수 있습니다."
online: "온라인"
@ -749,26 +665,15 @@ switch: "전환"
noMaintainerInformationWarning: "관리자 정보가 설정되어 있지 않습니다."
noBotProtectionWarning: "Bot 방어가 설정되어 있지 않습니다."
configure: "설정하기"
postToGallery: "갤러리에 업로드"
gallery: "갤러리"
recentPosts: "최근 포스트"
popularPosts: "인기 포스트"
shareWithNote: "노트로 공유"
expiration: "기한"
memo: "메모"
priority: "우선순위"
high: "높음"
middle: "보통"
low: "낮음"
emailNotConfiguredWarning: "메일 주소가 설정되어 있지 않습니다."
ratio: "비율"
previewNoteText: "본문 미리보기"
customCss: "CSS 사용자화"
customCssWarn: "이 설정은 기능을 알고 있는 경우에만 사용해야 합니다. 잘못된 값을 입력하면 클라이언트가 정상적으로 작동하지 않을 수 있습니다."
global: "글로벌"
customCssWarn: "이 설정은 기능을 알고 있는 경우에만 사용해야 합니다. 잘못된 값을 입력하면 클라이언트가 정상적으로 작동하지 않을 수\
\ 있습니다."
squareAvatars: "프로필 아이콘을 사각형으로 표시"
sent: "전송"
received: "수신"
searchResult: "검색 결과"
hashtags: "해시태그"
troubleshooting: "문제 해결"
@ -779,7 +684,8 @@ whatIsNew: "패치 정보 보기"
translate: "번역"
translatedFrom: "{x}에서 번역"
accountDeletionInProgress: "계정 삭제 작업을 진행하고 있습니다"
usernameInfo: "서버상에서 계정을 식별하기 위한 이름. 알파벳(a~z, A~Z), 숫자(0~9) 및 언더바(_)를 사용할 수 있습니다. 사용자명은 나중에 변경할 수 없습니다."
usernameInfo: "서버상에서 계정을 식별하기 위한 이름. 알파벳(a~z, A~Z), 숫자(0~9) 및 언더바(_)를 사용할 수 있습니다.\
\ 사용자명은 나중에 변경할 수 없습니다."
keepCw: "CW 유지하기"
pubSub: "Pub/Sub 계정"
lastCommunication: "마지막 통신"
@ -842,8 +748,9 @@ _ffVisibility:
private: "비공개"
_signup:
almostThere: "거의 다 끝났습니다"
emailAddressInfo: "당신이 사용하고 있는 이메일 주소를 입력해 주세요. 이메일 주소는 다른 유저에게 공개되지 않습니다."
emailSent: "입력하신 메일 주소({email})로 확인 메일을 보내드렸습니다. 가입을 완료하시려면 보내드린 메일에 있는 링크로 접속해 주세요."
emailAddressInfo: "당신이 사용하고 있는 이메일 주소를 입력해 주세요. 이메일 주소는 다른 유저에게 공개되지 않습니다."
emailSent: "입력하신 메일 주소({email})로 확인 메일을 보내드렸습니다. 가입을 완료하시려면 보내드린 메일에 있는 링크로 접속해\
\ 주세요."
_accountDelete:
accountDelete: "계정 삭제"
mayTakeTime: "계정 삭제는 서버에 부하를 가하기 때문에, 작성한 콘텐츠나 업로드한 파일의 수가 많으면 완료까지 시간이 걸릴 수 있습니다."
@ -851,18 +758,10 @@ _accountDelete:
requestAccountDelete: "계정 삭제 요청"
started: "삭제 작업이 시작되었습니다."
inProgress: "삭제 진행 중"
_ad:
back: "뒤로"
reduceFrequencyOfThisAd: "이 광고의 표시 빈도 낮추기"
_forgotPassword:
enterEmail: "여기에 계정에 등록한 메일 주소를 입력해 주세요. 입력한 메일 주소로 비밀번호 재설정 링크를 발송합니다."
ifNoEmail: "메일 주소를 등록하지 않은 경우, 관리자에 문의해 주십시오."
contactAdmin: "이 인스턴스에서는 메일 기능이 지원되지 않습니다. 비밀번호를 재설정하려면 관리자에게 문의해 주십시오."
_gallery:
my: "내 갤러리"
liked: "좋아요 한 갤러리"
like: "좋아요!"
unlike: "좋아요 취소"
_email:
_follow:
title: "새로운 팔로워가 있습니다"
@ -871,7 +770,6 @@ _email:
_plugin:
install: "플러그인 설치"
installWarn: "신뢰할 수 없는 플러그인은 설치하지 않는 것이 좋습니다."
manage: "플러그인 관리"
_registry:
scope: "범위"
key: "키"
@ -880,17 +778,16 @@ _registry:
createKey: "키 생성"
_aboutMisskey:
about: "FoundKey는 syuilo에 의해서 2014년부터 개발되어 온 오픈소스 소프트웨어 입니다."
contributors: "주요 기여자"
allContributors: "모든 기여자"
source: "소스 코드"
translation: "FoundKey를 번역하기"
_nsfw:
respect: "열람주의로 설정된 미디어 숨기기"
ignore: "열람 주의 미디어 항상 표시"
force: "미디어 항상 숨기기"
_mfm:
cheatSheet: "MFM 도움말"
intro: "MFM는 FoundKey의 다양한 곳에서 사용할 수 있는 전용 마크업 언어입니다. 여기에서는 MFM에서 사용할 수 있는 구문을 확인할 수 있습니다."
intro: "MFM는 FoundKey의 다양한 곳에서 사용할 수 있는 전용 마크업 언어입니다. 여기에서는 MFM에서 사용할 수 있는 구문을 확인할\
\ 수 있습니다."
dummy: "FoundKey로 연합우주의 세계가 펼쳐집니다"
mention: "멘션"
mentionDescription: "골뱅이표(@) 뒤에 사용자명을 넣어 특정 유저를 나타낼 수 있습니다."
@ -1001,68 +898,6 @@ _theme:
alreadyInstalled: "이미 설치된 테마입니다"
invalid: "테마 형식이 올바르지 않습니다"
make: "테마 만들기"
base: "베이스"
addConstant: "상수 추가"
constant: "상수"
defaultValue: "기본값"
color: "색"
refProp: "프로퍼티를 참조"
refConst: "상수를 참조"
key: "키"
func: "함수"
funcKind: "함수 종류"
argument: "매개변수"
basedProp: "기준으로 할 속성 이름"
alpha: "불투명도"
darken: "어두움"
lighten: "밝음"
inputConstantName: "상수 이름을 입력하세요"
importInfo: "여기에 테마 코드를 붙여 넣어 에디터로 불러올 수 있습니다."
deleteConstantConfirm: "상수 {const}를 삭제하시겠습니까?"
keys:
accent: "강조 색상"
bg: "배경"
fg: "텍스트"
focus: "포커스"
indicator: "인디케이터"
panel: "패널"
shadow: "그림자"
header: "헤더"
navBg: "사이드바 배경"
navFg: "사이드바 텍스트"
navHoverFg: "사이드바 텍스트 (호버)"
navActive: "사이드바 텍스트 (활성)"
navIndicator: "사이드바 인디케이터"
link: "링크"
hashtag: "해시태그"
mention: "멘션"
mentionMe: "나에게 보낸 멘션"
renote: "Renote"
modalBg: "모달 배경"
divider: "구분선"
scrollbarHandle: "스크롤바 핸들"
scrollbarHandleHover: "스크롤바 핸들 (호버)"
dateLabelFg: "날짜 레이블 텍스트"
infoBg: "정보창 배경"
infoFg: "정보창 텍스트"
infoWarnBg: "경고창 배경"
infoWarnFg: "경고창 텍스트"
cwBg: "CW 버튼 배경"
cwFg: "CW 버튼 텍스트"
cwHoverBg: "CW 버튼 배경 (호버)"
toastBg: "알림창 배경"
toastFg: "알림창 텍스트"
buttonBg: "버튼 배경"
buttonHoverBg: "버튼 배경 (호버)"
inputBorder: "입력 필드 테두리"
listItemHoverBg: "리스트 항목 배경 (호버)"
driveFolderBg: "드라이브 폴더 배경"
wallpaperOverlay: "배경화면 오버레이"
badge: "배지"
messageBg: "채팅 배경"
accentDarken: "강조 색상 (어두움)"
accentLighten: "강조 색상 (밝음)"
fgHighlighted: "강조된 텍스트"
_sfx:
note: "새 노트"
noteMy: "내 노트"
@ -1100,7 +935,8 @@ _tutorial:
step4_1: "노트 작성을 끝내셨나요?"
step4_2: "당신의 노트가 타임라인에 표시되어 있다면 성공입니다."
step5_1: "이제, 다른 사람을 팔로우하여 타임라인을 활기차게 만들어보도록 합시다."
step5_2: "{featured}에서 이 인스턴스의 인기 노트를 보실 수 있습니다. {explore}에서는 인기 사용자를 찾을 수 있구요. 마음에 드는 사람을 골라 팔로우해 보세요!"
step5_2: "{featured}에서 이 인스턴스의 인기 노트를 보실 수 있습니다. {explore}에서는 인기 사용자를 찾을 수 있구요.\
\ 마음에 드는 사람을 골라 팔로우해 보세요!"
step5_3: "다른 유저를 팔로우하려면 해당 유저의 아이콘을 클릭하여 프로필 페이지를 띄운 후, 팔로우 버튼을 눌러 주세요."
step5_4: "사용자에 따라 팔로우가 승인될 때까지 시간이 걸릴 수 있습니다."
step6_1: "타임라인에 다른 사용자의 노트가 나타난다면 성공입니다."
@ -1108,7 +944,7 @@ _tutorial:
step6_3: "리액션을 붙이려면, 노트의 \"+\" 버튼을 클릭하고 원하는 이모지를 선택합니다."
step7_1: "이것으로 FoundKey의 기본 튜토리얼을 마치겠습니다. 수고하셨습니다!"
step7_2: "FoundKey에 대해 더 알고 싶으시다면 {help}를 참고해 주세요."
step7_3: "그럼 FoundKey를 즐기세요! 🚀"
step7_3: "그럼 FoundKey를 즐기세요! \U0001F680"
_2fa:
alreadyRegistered: "이미 설정이 완료되었습니다."
registerDevice: "디바이스 등록"
@ -1118,7 +954,8 @@ _2fa:
step2Url: "데스크톱 앱에서는 다음 URL을 입력하세요:"
step3: "앱에 표시된 토큰을 입력하시면 완료됩니다."
step4: "다음 로그인부터는 토큰을 입력해야 합니다."
securityKeyInfo: "FIDO2를 지원하는 하드웨어 보안 키 혹은 디바이스의 지문인식이나 화면잠금 PIN을 이용해서 로그인하도록 설정할 수 있습니다."
securityKeyInfo: "FIDO2를 지원하는 하드웨어 보안 키 혹은 디바이스의 지문인식이나 화면잠금 PIN을 이용해서 로그인하도록 설정할\
\ 수 있습니다."
_permissions:
"read:account": "계정의 정보를 봅니다"
"write:account": "계정의 정보를 변경합니다"
@ -1148,10 +985,6 @@ _permissions:
"write:user-groups": "유저 그룹을 만들거나, 초대하거나, 이름을 변경하거나, 양도하거나, 삭제합니다"
"read:channels": "채널을 보기"
"write:channels": "채널을 추가하거나 삭제합니다"
"read:gallery": "갤러리를 봅니다"
"write:gallery": "갤러리를 추가하거나 삭제합니다"
"read:gallery-likes": "갤러리의 좋아요를 확인합니다"
"write:gallery-likes": "갤러리에 좋아요를 추가하거나 취소합니다"
_auth:
shareAccess: "\"{name}\" 이 계정에 접근하는 것을 허용하시겠습니까?"
shareAccessAsk: "이 애플리케이션이 계정에 접근하는 것을 허용하시겠습니까?"
@ -1328,7 +1161,6 @@ _relayStatus:
accepted: "승인됨"
rejected: "거절됨"
_notification:
fileUploaded: "파일이 업로드되었습니다"
youGotMention: "{name}님이 멘션함"
youGotReply: "{name}님이 답글함"
youGotQuote: "{name}님이 인용함"
@ -1343,7 +1175,6 @@ _notification:
pollEnded: "투표 결과가 발표되었습니다"
emptyPushNotificationMessage: "푸시 알림이 갱신되었습니다"
_types:
all: "전부"
follow: "팔로잉"
mention: "멘션"
reply: "답글"

View File

@ -32,9 +32,6 @@ signup: "Registreren"
save: "Opslaan"
users: "Gebruikers"
addUser: "Toevoegen gebruiker"
favorite: "Favorieten"
favorites: "Toevoegen aan favorieten"
unfavorite: "Verwijderen uit favorieten"
pin: "Vastmaken aan profielpagina"
unpin: "Losmaken van profielpagina"
copyContent: "Kopiëren inhoud"

View File

@ -33,9 +33,6 @@ signup: "Zarejestruj się"
save: "Zapisz"
users: "Użytkownicy"
addUser: "Dodaj użytkownika"
favorite: "Dodaj do ulubionych"
favorites: "Ulubione"
unfavorite: "Usuń z ulubionych"
pin: "Przypnij do profilu"
unpin: "Odepnij z profilu"
copyContent: "Skopiuj zawartość"
@ -604,7 +601,6 @@ disableShowingAnimatedImages: "Nie odtwarzaj animowanych obrazów"
verificationEmailSent: "Wiadomość weryfikacyjna została wysłana. Odwiedź uwzględniony\
\ odnośnik, aby ukończyć weryfikację."
emailVerified: "Adres e-mail został potwierdzony"
noteFavoritesCount: "Liczba polubionych wpisów"
pageLikesCount: "Liczba otrzymanych polubień stron"
pageLikedCount: "Liczba polubionych stron"
contact: "Kontakt"

View File

@ -32,9 +32,6 @@ signup: "Registrar-se"
save: "Guardar"
users: "Usuários"
addUser: "Adicionar usuário"
favorite: "Favoritar"
favorites: "Favoritar"
unfavorite: "Remover dos favoritos"
pin: "Afixar no perfil"
unpin: "Desafixar do perfil"
copyContent: "Copiar conteúdos"

View File

@ -32,9 +32,6 @@ signup: "Înregistrează-te"
save: "Salvează"
users: "Utilizatori"
addUser: "Adăugă utilizator"
favorite: "Adaugă la favorite"
favorites: "Favorite"
unfavorite: "Elimină din favorite"
pin: "Fixează pe profil"
unpin: "Anulati fixare"
copyContent: "Copiază conținutul"

View File

@ -32,9 +32,6 @@ signup: "Регистрация"
save: "Сохранить"
users: "Пользователи"
addUser: "Добавить пользователя"
favorite: "В избранное"
favorites: "Избранное"
unfavorite: "Убрать из избранного"
pin: "Закрепить в профиле"
unpin: "Открепить от профиля"
copyContent: "Скопировать содержимое"
@ -631,7 +628,6 @@ disableShowingAnimatedImages: "Не проигрывать анимацию"
verificationEmailSent: "Вам отправлено письмо для подтверждения. Пройдите, пожалуйста,\
\ по ссылке из письма, чтобы завершить проверку."
emailVerified: "Адрес электронной почты подтверждён."
noteFavoritesCount: "Количество добавленного в избранное"
pageLikesCount: "Количество понравившихся страниц"
pageLikedCount: "Количество страниц, понравившихся другим"
contact: "Как связаться"

View File

@ -32,9 +32,6 @@ signup: "Registrovať"
save: "Uložiť"
users: "Používatelia"
addUser: "Pridať používateľa"
favorite: "Páči sa mi"
favorites: "Obľúbené"
unfavorite: "Nepáči sa mi"
pin: "Pripnúť"
unpin: "Odopnúť"
copyContent: "Kopírovať obsah"
@ -623,7 +620,6 @@ disableShowingAnimatedImages: "Neprehrávať animované obrázky"
verificationEmailSent: "Odoslali sme overovací email. Overenie dokončíte kliknutím\
\ na odkaz v emaili."
emailVerified: "Email overený"
noteFavoritesCount: "Počet obľúbených poznámok"
pageLikesCount: "Počet obľúbených stránok"
pageLikedCount: "Počet prijatých \"páči sa mi\""
contact: "Kontakt"

View File

@ -32,9 +32,6 @@ signup: "Registrera"
save: "Spara"
users: "Användare"
addUser: "Lägg till användare"
favorite: "Lägg till i favoriter"
favorites: "Favoriter"
unfavorite: "Avfavorisera"
pin: "Fäst till profil"
unpin: "Lossa från profil"
copyContent: "Kopiera innehåll"

View File

@ -28,9 +28,6 @@ logout: "Çıkış Yap"
signup: "Kayıt Ol"
users: "Kullanıcı"
addUser: "Kullanıcı Ekle"
favorite: "Favoriler"
favorites: "Favoriler"
unfavorite: "Favorilerden Kaldır"
pin: "Sabitlenmiş"
unpin: "Sabitlemeyi kaldır"
copyContent: "İçeriği kopyala"

View File

@ -32,9 +32,6 @@ signup: "Реєстрація"
save: "Зберегти"
users: "Користувачі"
addUser: "Додати користувача"
favorite: "Обране"
favorites: "Обране"
unfavorite: "Видалити з обраного"
pin: "Закріпити"
unpin: "Відкріпити"
copyContent: "Скопіювати контент"
@ -631,7 +628,6 @@ disableShowingAnimatedImages: "Не програвати анімовані зо
verificationEmailSent: "Електронний лист з підтвердженням відісланий. Будь ласка перейдіть\
\ по посиланню в листі для підтвердження."
emailVerified: "Електронну пошту підтверджено."
noteFavoritesCount: "Кількість улюблених нотаток"
pageLikesCount: "Кількість отриманих вподобань сторінки"
pageLikedCount: "Кількість вподобаних сторінок"
contact: "Контакт"

View File

@ -32,9 +32,6 @@ signup: "Đăng ký"
save: "Lưu"
users: "Người dùng"
addUser: "Thêm người dùng"
favorite: "Thêm vào yêu thích"
favorites: "Lượt thích"
unfavorite: "Bỏ thích"
pin: "Ghim"
unpin: "Bỏ ghim"
copyContent: "Chép nội dung"
@ -628,7 +625,6 @@ disableShowingAnimatedImages: "Không phát ảnh động"
verificationEmailSent: "Một email xác minh đã được gửi. Vui lòng nhấn vào liên kết\
\ đính kèm để hoàn tất xác minh."
emailVerified: "Email đã được xác minh"
noteFavoritesCount: "Số lượng tút yêu thích"
pageLikesCount: "Số lượng trang đã thích"
pageLikedCount: "Số lượng thích trang đã nhận"
contact: "Liên hệ"

View File

@ -30,9 +30,6 @@ signup: "新用户注册"
save: "保存"
users: "用户"
addUser: "添加用户"
favorite: "收藏"
favorites: "收藏"
unfavorite: "取消收藏"
pin: "置顶"
unpin: "取消置顶"
copyContent: "复制内容"
@ -583,7 +580,6 @@ loadRawImages: "添加附件图像的缩略图时使用原始图像质量"
disableShowingAnimatedImages: "不播放动画"
verificationEmailSent: "已发送确认电子邮件。请访问电子邮件中的链接以完成设置。"
emailVerified: "电子邮件地址已验证"
noteFavoritesCount: "收藏的帖子数"
pageLikesCount: "页面点赞次数"
pageLikedCount: "页面被点赞次数"
contact: "联系人"

View File

@ -30,9 +30,6 @@ signup: "註冊"
save: "儲存"
users: "使用者"
addUser: "新增使用者"
favorite: "我的最愛"
favorites: "我的最愛"
unfavorite: "從我的最愛中移除"
pin: "置頂"
unpin: "取消置頂"
copyContent: "複製內容"
@ -582,7 +579,6 @@ loadRawImages: "以原始圖檔顯示附件圖檔的縮圖"
disableShowingAnimatedImages: "不播放動態圖檔"
verificationEmailSent: "已發送驗證電子郵件。請點擊進入電子郵件中的鏈接完成驗證。"
emailVerified: "已成功驗證您的電郵"
noteFavoritesCount: "我的最愛貼文的數目"
pageLikesCount: "頁面被按讚次數"
pageLikedCount: "頁面被按讚次數"
contact: "聯絡人"

View File

@ -1,6 +1,6 @@
{
"name": "foundkey",
"version": "13.0.0-preview4",
"version": "13.0.0-preview5",
"repository": {
"type": "git",
"url": "https://akkoma.dev/FoundKeyGang/FoundKey.git"

View File

@ -0,0 +1,18 @@
export class deletionProgress1673201544000 {
name = 'deletionProgress1673201544000';
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "user" RENAME COLUMN "isDeleted" TO "isDeletedOld"`);
await queryRunner.query(`ALTER TABLE "user" ADD "isDeleted" integer`);
await queryRunner.query(`UPDATE "user" SET "isDeleted" = CASE WHEN "host" IS NULL THEN -1 ELSE 0 END WHERE "isDeletedOld"`);
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "isDeletedOld"`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "user" RENAME COLUMN "isDeleted" TO "isDeletedOld"`);
await queryRunner.query(`ALTER TABLE "user" ADD "isDeleted" boolean NOT NULL DEFAULT false`);
await queryRunner.query(`UPDATE "user" SET "isDeleted" = "isDeletedOld" IS NOT NULL`);
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "isDeletedOld"`);
}
}

View File

@ -0,0 +1,21 @@
export class ffVisibilityNobody1684536337602 {
name = 'ffVisibilityNobody1684536337602';
async up(queryRunner) {
await queryRunner.query(`ALTER TYPE "public"."user_profile_ffvisibility_enum" RENAME TO "user_profile_ffvisibility_enum_old"`);
await queryRunner.query(`CREATE TYPE "public"."user_profile_ffvisibility_enum" AS ENUM('public', 'followers', 'private', 'nobody')`);
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "ffVisibility" DROP DEFAULT`);
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "ffVisibility" TYPE "public"."user_profile_ffvisibility_enum" USING "ffVisibility"::"text"::"public"."user_profile_ffvisibility_enum"`);
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "ffVisibility" SET DEFAULT 'public'`);
await queryRunner.query(`DROP TYPE "public"."user_profile_ffvisibility_enum_old"`);
}
async down(queryRunner) {
await queryRunner.query(`CREATE TYPE "public"."user_profile_ffvisibility_enum_old" AS ENUM('public', 'followers', 'private')`);
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "ffVisibility" DROP DEFAULT`);
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "ffVisibility" TYPE "public"."user_profile_ffvisibility_enum_old" USING "ffVisibility"::"text"::"public"."user_profile_ffvisibility_enum_old"`);
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "ffVisibility" SET DEFAULT 'public'`);
await queryRunner.query(`DROP TYPE "public"."user_profile_ffvisibility_enum"`);
await queryRunner.query(`ALTER TYPE "public"."user_profile_ffvisibility_enum_old" RENAME TO "user_profile_ffvisibility_enum"`);
}
}

View File

@ -0,0 +1,33 @@
export class removeFavourites1685126322423 {
name = 'removeFavourites1685126322423';
async up(queryRunner) {
await queryRunner.query(`
WITH "new_clips" AS (
INSERT INTO "clip" ("id", "createdAt", "userId", "name")
SELECT
LEFT(MD5(RANDOM()::text), 10),
NOW(),
"userId",
'⭐'
FROM "note_favorite"
GROUP BY "userId"
RETURNING "id", "userId"
)
INSERT INTO "clip_note" ("id", "noteId", "clipId")
SELECT
"note_favorite"."id",
"noteId",
"new_clips"."id"
FROM "note_favorite"
JOIN "new_clips" ON "note_favorite"."userId" = "new_clips"."userId"
`);
await queryRunner.query(`DROP TABLE "note_favorite"`);
}
async down(queryRunner) {
// can't revert the migration to clips, can only recreate the database table
await queryRunner.query(`CREATE TABLE "note_favorite" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, CONSTRAINT "PK_af0da35a60b9fa4463a62082b36" PRIMARY KEY ("id"))`);
}
}

View File

@ -1,6 +1,6 @@
{
"name": "backend",
"version": "13.0.0-preview4",
"version": "13.0.0-preview5",
"main": "./index.js",
"private": true,
"type": "module",
@ -67,7 +67,7 @@
"koa-send": "5.0.1",
"koa-slow": "2.1.0",
"koa-views": "7.0.2",
"mfm-js": "0.22.1",
"mfm-js": "0.23.3",
"mime-types": "2.1.35",
"mocha": "10.2.0",
"multer": "1.4.5-lts.1",
@ -100,7 +100,6 @@
"stringz": "2.1.0",
"style-loader": "3.3.1",
"summaly": "2.7.0",
"syslog-pro": "1.0.0",
"systeminformation": "5.11.22",
"tinycolor2": "1.4.2",
"tmp": "0.2.1",
@ -158,7 +157,6 @@
"@types/sinon": "^10.0.13",
"@types/sinonjs__fake-timers": "8.1.2",
"@types/speakeasy": "2.0.7",
"@types/syslog-pro": "^1.0.0",
"@types/tinycolor2": "1.4.3",
"@types/tmp": "0.2.3",
"@types/uuid": "8.3.4",

View File

@ -3,7 +3,7 @@ import chalk from 'chalk';
import Xev from 'xev';
import Logger from '@/services/logger.js';
import { envOption } from '@/env.js';
import { envOption, LOG_LEVELS } from '@/env.js';
// for typeorm
import 'reflect-metadata';
@ -66,7 +66,7 @@ cluster.on('exit', worker => {
});
// Display detail of unhandled promise rejection
if (!envOption.quiet) {
if (envOption.logLevel !== LOG_LEVELS.quiet) {
process.on('unhandledRejection', console.dir);
}

View File

@ -8,10 +8,10 @@ import chalkTemplate from 'chalk-template';
import semver from 'semver';
import Logger from '@/services/logger.js';
import loadConfig from '@/config/load.js';
import { loadConfig } from '@/config/load.js';
import { Config } from '@/config/types.js';
import { showMachineInfo } from '@/misc/show-machine-info.js';
import { envOption } from '@/env.js';
import { envOption, LOG_LEVELS } from '@/env.js';
import { db, initDb } from '@/db/postgre.js';
const _filename = fileURLToPath(import.meta.url);
@ -25,7 +25,7 @@ const bootLogger = logger.createSubLogger('boot', 'magenta', false);
const themeColor = chalk.hex('#86b300');
function greet(): void {
if (!envOption.quiet) {
if (envOption.logLevel !== LOG_LEVELS.quiet) {
//#region FoundKey logo
console.log(themeColor(' ___ _ _ __ '));
console.log(themeColor(' | __|__ _ _ _ _ __| | |/ /___ _ _ '));
@ -41,7 +41,7 @@ function greet(): void {
}
bootLogger.info('Welcome to FoundKey!');
bootLogger.info(`FoundKey v${meta.version}`, null, true);
bootLogger.info(`FoundKey v${meta.version}`, true);
}
/**
@ -59,7 +59,7 @@ export async function masterMain(): Promise<void> {
config = loadConfigBoot();
await connectDb();
} catch (e) {
bootLogger.error('Fatal error occurred during initialization', {}, true);
bootLogger.error('Fatal error occurred during initialization', true);
process.exit(1);
}
@ -69,7 +69,7 @@ export async function masterMain(): Promise<void> {
await spawnWorkers(config.clusterLimits);
}
bootLogger.succ(`Now listening on port ${config.port} on ${config.url}`, null, true);
bootLogger.succ(`Now listening on port ${config.port} on ${config.url}`, true);
if (!envOption.noDaemons) {
import('../daemons/server-stats.js').then(x => x.serverStats());
@ -84,7 +84,7 @@ function showEnvironment(): void {
if (env !== 'production') {
logger.warn('The environment is not in production mode.');
logger.warn('DO NOT USE FOR PRODUCTION PURPOSE!', {}, true);
logger.warn('DO NOT USE FOR PRODUCTION PURPOSE!', true);
}
}
@ -109,7 +109,7 @@ function loadConfigBoot(): Config {
} catch (exception) {
const e = exception as Partial<NodeJS.ErrnoException> | Error;
if ('code' in e && e.code === 'ENOENT') {
configLogger.error('Configuration file not found', {}, true);
configLogger.error('Configuration file not found', true);
process.exit(1);
} else if (e instanceof Error) {
configLogger.error(e.message);
@ -133,7 +133,7 @@ async function connectDb(): Promise<void> {
const v = await db.query('SHOW server_version').then(x => x[0].server_version);
dbLogger.succ(`Connected: v${v}`);
} catch (e) {
dbLogger.error('Cannot connect', {}, true);
dbLogger.error('Cannot connect', true);
dbLogger.error(e as Error | string);
process.exit(1);
}
@ -141,15 +141,24 @@ async function connectDb(): Promise<void> {
async function spawnWorkers(clusterLimits: Required<Config['clusterLimits']>): Promise<void> {
const modes = ['web' as const, 'queue' as const];
const clusters = structuredClone(clusterLimits);
if (envOption.onlyQueue) {
clusters.web = 0;
} else if (envOption.onlyServer) {
clusters.queue = 0;
}
const cpus = os.cpus().length;
for (const mode of modes.filter(mode => clusterLimits[mode] > cpus)) {
for (const mode of modes.filter(mode => clusters[mode] > cpus)) {
bootLogger.warn(`configuration warning: cluster limit for ${mode} exceeds number of cores (${cpus})`);
}
const total = modes.reduce((acc, mode) => acc + clusterLimits[mode], 0);
const total = modes.reduce((acc, mode) => acc + clusters[mode], 0);
const workers = new Array(total);
workers.fill('web', 0, clusterLimits.web);
workers.fill('queue', clusterLimits.web);
workers.fill('web', 0, clusters.web);
workers.fill('queue', clusters.web);
bootLogger.info(`Starting ${total} workers...`);
await Promise.all(workers.map(mode => spawnWorker(mode)));

View File

@ -1,3 +1,3 @@
import load from './load.js';
import { loadConfig } from './load.js';
export default load();
export default loadConfig();

View File

@ -23,7 +23,7 @@ const path = process.env.NODE_ENV === 'test'
? `${dir}/test.yml`
: `${dir}/default.yml`;
export default function load(): Config {
export function loadConfig(): Config {
const meta = JSON.parse(fs.readFileSync(`${_dirname}/../../../../built/meta.json`, 'utf-8'));
const clientManifest = JSON.parse(fs.readFileSync(`${_dirname}/../../../../built/_client_dist_/manifest.json`, 'utf-8'));
let config = yaml.load(fs.readFileSync(path, 'utf-8')) as Source;

View File

@ -59,11 +59,6 @@ export type Source = {
deliverJobMaxAttempts?: number;
inboxJobMaxAttempts?: number;
syslog?: {
host: string;
port: number;
};
mediaProxy?: string;
proxyRemoteFiles?: boolean;
internalStoragePath?: string;

View File

@ -33,7 +33,6 @@ import { UserGroup } from '@/models/entities/user-group.js';
import { UserGroupJoining } from '@/models/entities/user-group-joining.js';
import { UserGroupInvitation } from '@/models/entities/user-group-invitation.js';
import { Hashtag } from '@/models/entities/hashtag.js';
import { NoteFavorite } from '@/models/entities/note-favorite.js';
import { AbuseUserReport } from '@/models/entities/abuse-user-report.js';
import { RegistrationTicket } from '@/models/entities/registration-tickets.js';
import { MessagingMessage } from '@/models/entities/messaging-message.js';
@ -134,7 +133,6 @@ export const entities = [
RenoteMuting,
Blocking,
Note,
NoteFavorite,
NoteReaction,
NoteWatching,
NoteThreadMuting,

View File

@ -1,20 +1,38 @@
const envOption = {
export const LOG_LEVELS = {
quiet: 6,
error: 5,
warning: 4,
success: 3,
info: 2,
debug: 1,
};
export const envOption = {
onlyQueue: false,
onlyServer: false,
noDaemons: false,
disableClustering: false,
verbose: false,
withLogTime: false,
quiet: false,
slow: false,
logLevel: LOG_LEVELS.info,
};
for (const key of Object.keys(envOption) as (keyof typeof envOption)[]) {
if (process.env['MK_' + key.replace(/[A-Z]/g, letter => `_${letter}`).toUpperCase()]) envOption[key] = true;
const value = process.env['FK_' + key.replace(/[A-Z]/g, letter => `_${letter}`).toUpperCase()];
if (value) {
if (key === 'logLevel') {
if (value.toLowerCase() in LOG_LEVELS) {
envOption.logLevel = LOG_LEVELS[value.toLowerCase()];
}
console.log('Unknown log level ' + JSON.stringify(value.toLowerCase()) + ', defaulting to "info"');
} else {
envOption[key] = true;
}
}
}
if (process.env.NODE_ENV === 'test') envOption.disableClustering = true;
if (process.env.NODE_ENV === 'test') envOption.quiet = true;
if (process.env.NODE_ENV === 'test') envOption.noDaemons = true;
export { envOption };
if (process.env.NODE_ENV === 'test') {
envOption.disableClustering = true;
envOption.logLevel = LOG_LEVELS.quiet;
envOption.noDaemons = true;
}

View File

@ -5,8 +5,6 @@ export const kinds = [
'write:blocks',
'read:drive',
'write:drive',
'read:favorites',
'write:favorites',
'read:following',
'write:following',
'read:messaging',

View File

@ -23,7 +23,6 @@ import { packedHashtagSchema } from '@/models/schema/hashtag.js';
import { packedPageSchema } from '@/models/schema/page.js';
import { packedUserGroupSchema } from '@/models/schema/user-group.js';
import { packedUserGroupInvitationSchema } from '@/models/schema/user-group-invitation.js';
import { packedNoteFavoriteSchema } from '@/models/schema/note-favorite.js';
import { packedChannelSchema } from '@/models/schema/channel.js';
import { packedAntennaSchema } from '@/models/schema/antenna.js';
import { packedClipSchema } from '@/models/schema/clip.js';
@ -47,7 +46,6 @@ export const refs = {
MessagingMessage: packedMessagingMessageSchema,
Note: packedNoteSchema,
NoteReaction: packedNoteReactionSchema,
NoteFavorite: packedNoteFavoriteSchema,
Notification: packedNotificationSchema,
DriveFile: packedDriveFileSchema,
DriveFolder: packedDriveFolderSchema,

View File

@ -1,35 +0,0 @@
import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
import { id } from '../id.js';
import { Note } from './note.js';
import { User } from './user.js';
@Entity()
@Index(['userId', 'noteId'], { unique: true })
export class NoteFavorite {
@PrimaryColumn(id())
public id: string;
@Column('timestamp with time zone', {
comment: 'The created date of the NoteFavorite.',
})
public createdAt: Date;
@Index()
@Column(id())
public userId: User['id'];
@ManyToOne(() => User, {
onDelete: 'CASCADE',
})
@JoinColumn()
public user: User | null;
@Column(id())
public noteId: Note['id'];
@ManyToOne(() => Note, {
onDelete: 'CASCADE',
})
@JoinColumn()
public note: Note | null;
}

View File

@ -163,11 +163,11 @@ export class User {
// Indicates the user was deleted by an admin.
// The users' data is not deleted from the database to keep them from reappearing.
// A hard delete of the record may follow if we receive a matching Delete activity.
@Column('boolean', {
default: false,
comment: 'Whether the User is deleted.',
@Column('integer', {
nullable: true,
comment: 'How many delivery jobs are outstanding before the deletion is completed.',
})
public isDeleted: boolean;
public isDeleted: number | null;
@Column('varchar', {
length: 128, array: true, default: '{}',
@ -260,9 +260,3 @@ export interface IRemoteUser extends User {
host: string;
token: null;
}
export type CacheableLocalUser = ILocalUser;
export type CacheableRemoteUser = IRemoteUser;
export type CacheableUser = CacheableLocalUser | CacheableRemoteUser;

View File

@ -29,7 +29,6 @@ import { RenoteMutingRepository } from './repositories/renote-muting.js';
import { BlockingRepository } from './repositories/blocking.js';
import { NoteReactionRepository } from './repositories/note-reaction.js';
import { NotificationRepository } from './repositories/notification.js';
import { NoteFavoriteRepository } from './repositories/note-favorite.js';
import { UserPublickey } from './entities/user-publickey.js';
import { UserKeypair } from './entities/user-keypair.js';
import { AppRepository } from './repositories/app.js';
@ -64,7 +63,6 @@ export const Announcements = db.getRepository(Announcement);
export const AnnouncementReads = db.getRepository(AnnouncementRead);
export const Apps = (AppRepository);
export const Notes = (NoteRepository);
export const NoteFavorites = (NoteFavoriteRepository);
export const NoteWatchings = db.getRepository(NoteWatching);
export const NoteThreadMutings = db.getRepository(NoteThreadMuting);
export const NoteReactions = (NoteReactionRepository);

View File

@ -1,29 +0,0 @@
import { db } from '@/db/postgre.js';
import { NoteFavorite } from '@/models/entities/note-favorite.js';
import { User } from '@/models/entities/user.js';
import { Notes } from '../index.js';
export const NoteFavoriteRepository = db.getRepository(NoteFavorite).extend({
async pack(
src: NoteFavorite['id'] | NoteFavorite,
me?: { id: User['id'] } | null | undefined,
) {
const favorite = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src });
return {
id: favorite.id,
createdAt: favorite.createdAt.toISOString(),
noteId: favorite.noteId,
// may throw error
note: await Notes.pack(favorite.note || favorite.noteId, me),
};
},
packMany(
favorites: any[],
me: { id: User['id'] },
) {
return Promise.allSettled(favorites.map(x => this.pack(x, me)))
.then(promises => promises.flatMap(result => result.status === 'fulfilled' ? [result.value] : []));
},
});

View File

@ -230,6 +230,36 @@ export const UserRepository = db.getRepository(User).extend({
return `${config.url}/identicon/${userId}`;
},
/**
* Determines whether the followers/following of user `user` are visibile to user `me`.
*/
async areFollowersVisibleTo(user: User, me: { id: User['id'] } | null | undefined): Promise<boolean> {
const profile = await UserProfiles.findOneByOrFail({ userId: user.id });
switch (profile.ffVisibility) {
case 'public':
return true;
case 'followers':
if (me == null) {
return false;
} else if (me.id === user.id) {
return true;
} else {
return await Followings.count({
where: {
followerId: me.id,
followeeId: user.id,
},
take: 1,
}).then(n => n > 0);
}
case 'private':
return me?.id === user.id;
case 'nobody':
return false;
}
},
async pack<ExpectsMe extends boolean | null = null, D extends boolean = false>(
src: User['id'] | User,
me?: { id: User['id'] } | null | undefined,
@ -270,15 +300,13 @@ export const UserRepository = db.getRepository(User).extend({
.getMany() : [];
const profile = opts.detail ? await UserProfiles.findOneByOrFail({ userId: user.id }) : null;
const followingCount = profile == null ? null :
(profile.ffVisibility === 'public') || isMe ? user.followingCount :
(profile.ffVisibility === 'followers') && relation?.isFollowing ? user.followingCount :
null;
const ffVisible = await this.areFollowersVisibleTo(user, me);
const followersCount = profile == null ? null :
(profile.ffVisibility === 'public') || isMe ? user.followersCount :
(profile.ffVisibility === 'followers') && relation?.isFollowing ? user.followersCount :
null;
const followingCount = !opts.detail ? null :
ffVisible ? user.followingCount : null;
const followersCount = !opts.detail ? null :
ffVisible ? user.followersCount : null;
const packed = {
id: user.id,
@ -353,7 +381,7 @@ export const UserRepository = db.getRepository(User).extend({
autoAcceptFollowed: profile!.autoAcceptFollowed,
noCrawle: profile!.noCrawle,
isExplorable: user.isExplorable,
isDeleted: user.isDeleted,
isDeleted: user.isDeleted != null,
hideOnlineStatus: user.hideOnlineStatus,
hasUnreadSpecifiedNotes: NoteUnreads.count({
where: { userId: user.id, isSpecified: true },

View File

@ -1,26 +0,0 @@
export const packedNoteFavoriteSchema = {
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
createdAt: {
type: 'string',
optional: false, nullable: false,
format: 'date-time',
},
note: {
type: 'object',
optional: false, nullable: false,
ref: 'Note',
},
noteId: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
},
} as const;

View File

@ -1,11 +1,12 @@
import httpSignature from '@peertube/http-signature';
import { v4 as uuid } from 'uuid';
import Bull from 'bull';
import config from '@/config/index.js';
import { Users } from '@/models/index.js';
import { DriveFile } from '@/models/entities/drive-file.js';
import { Webhook, webhookEventTypes } from '@/models/entities/webhook.js';
import { IActivity } from '@/remote/activitypub/type.js';
import { envOption } from '@/env.js';
import { MINUTE } from '@/const.js';
import processDeliver from './processors/deliver.js';
@ -18,7 +19,7 @@ import { endedPollNotification } from './processors/ended-poll-notification.js';
import { queueLogger } from './logger.js';
import { getJobInfo } from './get-job-info.js';
import { systemQueue, dbQueue, deliverQueue, inboxQueue, objectStorageQueue, endedPollNotificationQueue, webhookDeliverQueue } from './queues.js';
import { ThinUser } from './types.js';
import { DeliverJobData, ThinUser } from './types.js';
function renderError(e: Error): any {
return {
@ -35,44 +36,56 @@ const inboxLogger = queueLogger.createSubLogger('inbox');
const dbLogger = queueLogger.createSubLogger('db');
const objectStorageLogger = queueLogger.createSubLogger('objectStorage');
async function deletionRefCount(job: Bull.Job<DeliverJobData>): Promise<void> {
if (job.data.deletingUserId) {
await Users.decrement({ id: job.data.deletingUserId }, 'isDeleted', 1);
}
}
systemQueue
.on('waiting', (jobId) => systemLogger.debug(`waiting id=${jobId}`))
.on('active', (job) => systemLogger.debug(`active 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('error', (job: any, err: Error) => systemLogger.error(`error ${err}`, { job, e: renderError(err) }))
.on('failed', (job, err) => systemLogger.warn(`failed(${err}) id=${job.id}`))
.on('error', (job: any, err: Error) => systemLogger.error(`error ${err}`))
.on('stalled', (job) => systemLogger.warn(`stalled id=${job.id}`));
deliverQueue
.on('waiting', (jobId) => deliverLogger.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.data.to}`))
.on('error', (job: any, err: Error) => deliverLogger.error(`error ${err}`, { job, e: renderError(err) }))
.on('completed', async (job, result) => {
deliverLogger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`);
await deletionRefCount(job);
})
.on('failed', async (job, err) => {
deliverLogger.warn(`failed(${err}) ${getJobInfo(job)} to=${job.data.to}`);
await deletionRefCount(job);
})
.on('error', (job: any, err: Error) => deliverLogger.error(`error ${err}`))
.on('stalled', (job) => deliverLogger.warn(`stalled ${getJobInfo(job)} to=${job.data.to}`));
inboxQueue
.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('failed', (job, err) => inboxLogger.warn(`failed(${err}) ${getJobInfo(job)} activity=${job.data.activity ? job.data.activity.id : 'none'}`))
.on('error', (job: any, err: Error) => inboxLogger.error(`error ${err}`))
.on('stalled', (job) => inboxLogger.warn(`stalled ${getJobInfo(job)} activity=${job.data.activity ? job.data.activity.id : 'none'}`));
dbQueue
.on('waiting', (jobId) => dbLogger.debug(`waiting id=${jobId}`))
.on('active', (job) => dbLogger.debug(`active 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('error', (job: any, err: Error) => dbLogger.error(`error ${err}`, { job, e: renderError(err) }))
.on('failed', (job, err) => dbLogger.warn(`failed(${err}) id=${job.id}`))
.on('error', (job: any, err: Error) => dbLogger.error(`error ${err}`))
.on('stalled', (job) => dbLogger.warn(`stalled id=${job.id}`));
objectStorageQueue
.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('failed', (job, err) => objectStorageLogger.warn(`failed(${err}) id=${job.id}`))
.on('error', (job: any, err: Error) => objectStorageLogger.error(`error ${err}`))
.on('stalled', (job) => objectStorageLogger.warn(`stalled id=${job.id}`));
webhookDeliverQueue
@ -80,10 +93,10 @@ webhookDeliverQueue
.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('failed', (job, err) => webhookLogger.warn(`failed(${err}) ${getJobInfo(job)} to=${job.data.to}`))
.on('error', (job: any, err: Error) => webhookLogger.error(`error ${err}`, { job, e: renderError(err) }))
.on('error', (job: any, err: Error) => webhookLogger.error(`error ${err}`))
.on('stalled', (job) => webhookLogger.warn(`stalled ${getJobInfo(job)} to=${job.data.to}`));
export function deliver(user: ThinUser, content: unknown, to: string | null) {
export function deliver(user: ThinUser, content: unknown, to: string | null, deletingUserId?: string) {
if (content == null) return null;
if (to == null) return null;
@ -93,6 +106,7 @@ export function deliver(user: ThinUser, content: unknown, to: string | null) {
},
content,
to,
deletingUserId,
};
return deliverQueue.add(data, {
@ -289,8 +303,6 @@ export function webhookDeliver(webhook: Webhook, type: typeof webhookEventTypes[
}
export default function() {
if (envOption.onlyServer) return;
deliverQueue.process(config.deliverJobConcurrency, processDeliver);
inboxQueue.process(config.inboxJobConcurrency, processInbox);
endedPollNotificationQueue.process(endedPollNotification);
@ -326,8 +338,9 @@ export default function() {
}
export function destroy() {
deliverQueue.once('cleaned', (jobs, status) => {
deliverQueue.once('cleaned', async (jobs, status) => {
deliverLogger.succ(`Cleaned ${jobs.length} ${status} jobs`);
await Promise.all(jobs.map(job => deletionRefCount(job)));
});
deliverQueue.clean(0, 'delayed');

View File

@ -46,29 +46,17 @@ export async function deleteAccount(job: Bull.Job<DbUserDeleteJobData>): Promise
}
{ // Delete files
let cursor: DriveFile['id'] | null = null;
const files = await DriveFiles.find({
where: {
userId: user.id,
},
order: {
id: 1,
},
}) as DriveFile[];
while (true) {
const files = await DriveFiles.find({
where: {
userId: user.id,
...(cursor ? { id: MoreThan(cursor) } : {}),
},
take: 10,
order: {
id: 1,
},
}) as DriveFile[];
if (files.length === 0) {
break;
}
cursor = files[files.length - 1].id;
for (const file of files) {
await deleteFileSync(file);
}
for (const file of files) {
await deleteFileSync(file);
}
logger.succ('All of files deleted');

View File

@ -71,7 +71,7 @@ export async function exportCustomEmojis(job: Bull.Job, done: () => void): Promi
try {
await downloadUrl(emoji.originalUrl, emojiPath);
downloaded = true;
} catch (e) { // TODO: 何度か再試行
} catch (e) { // TODO: retry
logger.error(e instanceof Error ? e : new Error(e as string));
}

View File

@ -1,6 +1,6 @@
import Bull from 'bull';
import { In, LessThan } from 'typeorm';
import { AttestationChallenges, AuthSessions, Mutings, Notifications, PasswordResetRequests, Signins } from '@/models/index.js';
import { AttestationChallenges, AuthSessions, Mutings, Notifications, PasswordResetRequests, Signins, Users } from '@/models/index.js';
import { publishUserEvent } from '@/services/stream.js';
import { MINUTE, MONTH } from '@/const.js';
import { queueLogger } from '@/queue/logger.js';
@ -52,6 +52,11 @@ export async function checkExpired(job: Bull.Job<Record<string, unknown>>, done:
createdAt: OlderThan(3 * MONTH),
});
await Users.delete({
// delete users where the deletion status reference count has come down to zero
isDeleted: 0,
});
logger.succ('Deleted expired data.');
done();

View File

@ -12,6 +12,8 @@ export type DeliverJobData = {
content: unknown;
/** inbox URL to deliver */
to: string;
/** set if this job is part of a user deletion, on completion or failure the isDeleted field needs to be decremented */
deletingUserId?: string;
};
export type InboxJobData = {

View File

@ -1,5 +1,5 @@
import promiseLimit from 'promise-limit';
import { CacheableRemoteUser, CacheableUser } from '@/models/entities/user.js';
import { IRemoteUser, User } from '@/models/entities/user.js';
import { unique, concat } from '@/prelude/array.js';
import { resolvePerson } from './models/person.js';
import { Resolver } from './resolver.js';
@ -9,20 +9,20 @@ type Visibility = 'public' | 'home' | 'followers' | 'specified';
type AudienceInfo = {
visibility: Visibility,
mentionedUsers: CacheableUser[],
visibleUsers: CacheableUser[],
mentionedUsers: User[],
visibleUsers: User[],
};
export async function parseAudience(actor: CacheableRemoteUser, to?: ApObject, cc?: ApObject, resolver?: Resolver): Promise<AudienceInfo> {
export async function parseAudience(actor: IRemoteUser, to?: ApObject, cc?: ApObject, resolver?: Resolver): Promise<AudienceInfo> {
const toGroups = groupingAudience(getApIds(to), actor);
const ccGroups = groupingAudience(getApIds(cc), actor);
const others = unique(concat([toGroups.other, ccGroups.other]));
const limit = promiseLimit<CacheableUser | null>(2);
const limit = promiseLimit<User | null>(2);
const mentionedUsers = (await Promise.all(
others.map(id => limit(() => resolvePerson(id, resolver).catch(() => null))),
)).filter((x): x is CacheableUser => x != null);
)).filter((x): x is User => x != null);
if (toGroups.public.length > 0) {
return {
@ -55,7 +55,7 @@ export async function parseAudience(actor: CacheableRemoteUser, to?: ApObject, c
};
}
function groupingAudience(ids: string[], actor: CacheableRemoteUser) {
function groupingAudience(ids: string[], actor: IRemoteUser) {
const groups = {
public: [] as string[],
followers: [] as string[],
@ -85,7 +85,7 @@ function isPublic(id: string) {
].includes(id);
}
function isFollowers(id: string, actor: CacheableRemoteUser) {
function isFollowers(id: string, actor: IRemoteUser) {
return (
id === (actor.followersUri || `${actor.uri}/followers`)
);

View File

@ -1,7 +1,7 @@
import escapeRegexp from 'escape-regexp';
import config from '@/config/index.js';
import { Note } from '@/models/entities/note.js';
import { CacheableUser } from '@/models/entities/user.js';
import { User } from '@/models/entities/user.js';
import { MessagingMessage } from '@/models/entities/messaging-message.js';
import { Notes, MessagingMessages } from '@/models/index.js';
import { uriPersonCache, userByIdCache } from '@/services/user-cache.js';
@ -89,7 +89,7 @@ export class DbResolver {
/**
* AP Person => FoundKey User in DB
*/
public async getUserFromApId(value: string | IObject): Promise<CacheableUser | null> {
public async getUserFromApId(value: string | IObject): Promise<User | null> {
const parsed = parseUri(value);
if (parsed.local) {

View File

@ -88,10 +88,10 @@ export class DeliverManager {
/**
* Execute delivers
*/
public async execute() {
public async execute(deletingUserId?: string) {
if (!Users.isLocalUser(this.actor)) return;
const inboxes = new Set<string>();
let inboxes = new Set<string>();
/*
build inbox list
@ -150,13 +150,17 @@ export class DeliverManager {
)),
);
// deliver
for (const inbox of inboxes) {
// skip instances as indicated
if (instancesToSkip.includes(new URL(inbox).host)) continue;
const filteredInboxes = Array.from(inboxes)
.filter(inbox => !instancesToSkip.includes(new URL(inbox).host));
deliver(this.actor, this.activity, inbox);
if (deletingUserId) {
await Users.update(deletingUserId, {
// set deletion job count for reference counting before queueing jobs
isDeleted: filteredInboxes.length,
});
}
filteredInboxes.forEach(inbox => deliver(this.actor, this.activity, inbox, deletingUserId));
}
}

View File

@ -1,11 +1,11 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { acceptFollowRequest } from '@/services/following/requests/accept.js';
import { relayAccepted } from '@/services/relay.js';
import { IFollow } from '@/remote/activitypub/type.js';
import { DbResolver } from '@/remote/activitypub/db-resolver.js';
export default async (actor: CacheableRemoteUser, activity: IFollow): Promise<string> => {
// ※ activityはこっちから投げたフォローリクエストなので、activity.actorは存在するローカルユーザーである必要がある
export default async (actor: IRemoteUser, activity: IFollow): Promise<string> => {
// activity is a follow request started by this server, so activity.actor must be an existing local user.
const dbResolver = new DbResolver();
const follower = await dbResolver.getUserFromApId(activity.actor);

View File

@ -1,10 +1,10 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { apLogger } from '@/remote/activitypub/logger.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { IAccept, isFollow, getApType } from '@/remote/activitypub/type.js';
import acceptFollow from './follow.js';
export default async (actor: CacheableRemoteUser, activity: IAccept, resolver: Resolver): Promise<string> => {
export default async (actor: IRemoteUser, activity: IAccept, resolver: Resolver): Promise<string> => {
const uri = activity.id || activity;
apLogger.info(`Accept: ${uri}`);

View File

@ -1,10 +1,10 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { addPinned } from '@/services/i/pin.js';
import { resolveNote } from '@/remote/activitypub/models/note.js';
import { IAdd } from '@/remote/activitypub/type.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
export default async (actor: CacheableRemoteUser, activity: IAdd, resolver: Resolver): Promise<void> => {
export default async (actor: IRemoteUser, activity: IAdd, resolver: Resolver): Promise<void> => {
if ('actor' in activity && actor.uri !== activity.actor) {
throw new Error('invalid actor');
}

View File

@ -1,10 +1,10 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { apLogger } from '@/remote/activitypub/logger.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { IAnnounce, getApId } from '@/remote/activitypub/type.js';
import announceNote from './note.js';
export default async (actor: CacheableRemoteUser, activity: IAnnounce, resolver: Resolver): Promise<void> => {
export default async (actor: IRemoteUser, activity: IAnnounce, resolver: Resolver): Promise<void> => {
const uri = getApId(activity);
apLogger.info(`Announce: ${uri}`);

View File

@ -1,5 +1,5 @@
import post from '@/services/note/create.js';
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { extractDbHost } from '@/misc/convert-host.js';
import { getApLock } from '@/misc/app-lock.js';
import { StatusError } from '@/misc/fetch.js';
@ -11,13 +11,9 @@ import { Resolver } from '@/remote/activitypub/resolver.js';
import { IAnnounce, getApId } from '@/remote/activitypub/type.js';
import { shouldBlockInstance } from '@/misc/should-block-instance.js';
export default async function(resolver: Resolver, actor: CacheableRemoteUser, activity: IAnnounce, targetUri: string): Promise<void> {
export default async function(resolver: Resolver, actor: IRemoteUser, activity: IAnnounce, targetUri: string): Promise<void> {
const uri = getApId(activity);
if (actor.isSuspended) {
return;
}
// Cancel if the announced from host is blocked.
if (await shouldBlockInstance(extractDbHost(uri))) return;

View File

@ -1,11 +1,11 @@
import block from '@/services/blocking/create.js';
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { Users } from '@/models/index.js';
import { DbResolver } from '@/remote/activitypub/db-resolver.js';
import { IBlock } from '@/remote/activitypub/type.js';
export default async (actor: CacheableRemoteUser, activity: IBlock): Promise<string> => {
// ※ activity.objectにブロック対象があり、それは存在するローカルユーザーのはず
export default async (actor: IRemoteUser, activity: IBlock): Promise<string> => {
// There is a block target in activity.object, which should be a local user that exists.
const dbResolver = new DbResolver();
const blockee = await dbResolver.getUserFromApId(activity.object);
@ -15,7 +15,7 @@ export default async (actor: CacheableRemoteUser, activity: IBlock): Promise<str
}
if (blockee.host != null) {
return 'skip: ブロックしようとしているユーザーはローカルユーザーではありません';
return 'skip: blockee is not local';
}
await block(await Users.findOneByOrFail({ id: actor.id }), await Users.findOneByOrFail({ id: blockee.id }));

View File

@ -1,11 +1,11 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { toArray, concat, unique } from '@/prelude/array.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { ICreate, getApId, isPost, getApType } from '../../type.js';
import { apLogger } from '../../logger.js';
import createNote from './note.js';
export default async (actor: CacheableRemoteUser, activity: ICreate, resolver: Resolver): Promise<void> => {
export default async (actor: IRemoteUser, activity: ICreate, resolver: Resolver): Promise<void> => {
const uri = getApId(activity);
apLogger.info(`Create: ${uri}`);

View File

@ -1,4 +1,4 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { getApLock } from '@/misc/app-lock.js';
import { extractDbHost } from '@/misc/convert-host.js';
import { StatusError } from '@/misc/fetch.js';
@ -9,7 +9,7 @@ import { getApId, IObject } from '@/remote/activitypub/type.js';
/**
* 稿
*/
export default async function(resolver: Resolver, actor: CacheableRemoteUser, note: IObject, silent = false): Promise<string> {
export default async function(resolver: Resolver, actor: IRemoteUser, note: IObject, silent = false): Promise<string> {
const uri = getApId(note);
if (typeof note === 'object') {

View File

@ -1,9 +1,9 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { Users } from '@/models/index.js';
import { apLogger } from '@/remote/activitypub/logger.js';
import { deleteAccount } from '@/services/delete-account.js';
export async function deleteActor(actor: CacheableRemoteUser, uri: string): Promise<string> {
export async function deleteActor(actor: IRemoteUser, uri: string): Promise<string> {
apLogger.info(`Deleting the Actor: ${uri}`);
if (actor.uri !== uri) {
@ -16,7 +16,7 @@ export async function deleteActor(actor: CacheableRemoteUser, uri: string): Prom
// anyway, the user is gone now so dont care
return 'ok: gone';
}
if (user.isDeleted) {
if (user.isDeleted != null) {
// the actual deletion already happened by an admin, just delete the record
await Users.delete(actor.id);
} else {

View File

@ -1,4 +1,4 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { toSingle } from '@/prelude/array.js';
import { IDelete, getApId, isTombstone, IObject, validPost, validActor } from '@/remote/activitypub/type.js';
import { deleteActor } from './actor.js';
@ -7,7 +7,7 @@ import deleteNote from './note.js';
/**
*
*/
export default async (actor: CacheableRemoteUser, activity: IDelete): Promise<string> => {
export default async (actor: IRemoteUser, activity: IDelete): Promise<string> => {
if ('actor' in activity && actor.uri !== activity.actor) {
throw new Error('invalid actor');
}

View File

@ -1,11 +1,11 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { deleteNotes } from '@/services/note/delete.js';
import { getApLock } from '@/misc/app-lock.js';
import { deleteMessage } from '@/services/messages/delete.js';
import { DbResolver } from '@/remote/activitypub/db-resolver.js';
import { apLogger } from '@/remote/activitypub/logger.js';
export default async function(actor: CacheableRemoteUser, uri: string): Promise<string> {
export default async function(actor: IRemoteUser, uri: string): Promise<string> {
apLogger.info(`Deleting the Note: ${uri}`);
const unlock = await getApLock(uri);

View File

@ -1,13 +1,14 @@
import { In } from 'typeorm';
import config from '@/config/index.js';
import { genId } from '@/misc/gen-id.js';
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { AbuseUserReports, Users } from '@/models/index.js';
import { IFlag, getApIds } from '@/remote/activitypub/type.js';
export default async (actor: CacheableRemoteUser, activity: IFlag): Promise<string> => {
// objectは `(User|Note) | (User|Note)[]` だけど、全パターンDBスキーマと対応させられないので
// 対象ユーザーは一番最初のユーザー として あとはコメントとして格納する
export default async (actor: IRemoteUser, activity: IFlag): Promise<string> => {
// The object is `(User|Note) | (User|Note)[]`, but since the database schema
// cannot be made to handle every possible case, the target user is the first user
// and everything else is stored by URL.
const uris = getApIds(activity.object);
const userIds = uris.filter(uri => uri.startsWith(config.url + '/users/')).map(uri => uri.split('/').pop()!);

View File

@ -1,9 +1,9 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import follow from '@/services/following/create.js';
import { IFollow } from '../type.js';
import { DbResolver } from '../db-resolver.js';
export default async (actor: CacheableRemoteUser, activity: IFollow): Promise<string> => {
export default async (actor: IRemoteUser, activity: IFollow): Promise<string> => {
const dbResolver = new DbResolver();
const followee = await dbResolver.getUserFromApId(activity.object);

View File

@ -1,4 +1,4 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { toArray } from '@/prelude/array.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { extractDbHost } from '@/misc/convert-host.js';
@ -21,7 +21,7 @@ import block from './block/index.js';
import flag from './flag/index.js';
import { move } from './move/index.js';
export async function performActivity(actor: CacheableRemoteUser, activity: IObject, resolver: Resolver): Promise<void> {
export async function performActivity(actor: IRemoteUser, activity: IObject, resolver: Resolver): Promise<void> {
if (isCollectionOrOrderedCollection(activity)) {
for (const item of toArray(isCollection(activity) ? activity.items : activity.orderedItems)) {
const act = await resolver.resolve(item);
@ -38,7 +38,7 @@ export async function performActivity(actor: CacheableRemoteUser, activity: IObj
}
}
async function performOneActivity(actor: CacheableRemoteUser, activity: IObject, resolver: Resolver): Promise<void> {
async function performOneActivity(actor: IRemoteUser, activity: IObject, resolver: Resolver): Promise<void> {
if (actor.isSuspended) return;
if (typeof activity.id !== 'undefined') {

View File

@ -1,9 +1,10 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { createReaction } from '@/services/note/reaction/create.js';
import { ILike, getApId } from '../type.js';
import { fetchNote, extractEmojis } from '../models/note.js';
import { fetchNote } from '../models/note.js';
import { extractEmojis } from '../models/tag.js';
export default async (actor: CacheableRemoteUser, activity: ILike) => {
export default async (actor: IRemoteUser, activity: ILike) => {
const targetUri = getApId(activity.object);
const note = await fetchNote(targetUri);

View File

@ -1,12 +1,12 @@
import { IsNull } from 'typeorm';
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { resolvePerson } from '@/remote/activitypub/models/person.js';
import { Followings, Users } from '@/models/index.js';
import { createNotification } from '@/services/create-notification.js';
import Resolver from '../../resolver.js';
import { IMove, isActor, getApId } from '../../type.js';
export async function move(actor: CacheableRemoteUser, activity: IMove, resolver: Resolver): Promise<void> {
export async function move(actor: IRemoteUser, activity: IMove, resolver: Resolver): Promise<void> {
// actor is not move origin
if (activity.object == null || getApId(activity.object) !== actor.uri) return;

View File

@ -1,10 +1,10 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { isSelfHost, extractDbHost } from '@/misc/convert-host.js';
import { MessagingMessages } from '@/models/index.js';
import { readUserMessagingMessage } from '@/server/api/common/read-messaging-message.js';
import { IRead, getApId } from '../type.js';
export const performReadActivity = async (actor: CacheableRemoteUser, activity: IRead): Promise<string> => {
export const performReadActivity = async (actor: IRemoteUser, activity: IRead): Promise<string> => {
const id = await getApId(activity.object);
if (!isSelfHost(extractDbHost(id))) {

View File

@ -1,12 +1,12 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { remoteReject } from '@/services/following/reject.js';
import { relayRejected } from '@/services/relay.js';
import { Users } from '@/models/index.js';
import { IFollow } from '../../type.js';
import { DbResolver } from '../../db-resolver.js';
export default async (actor: CacheableRemoteUser, activity: IFollow): Promise<string> => {
// ※ activityはこっちから投げたフォローリクエストなので、activity.actorは存在するローカルユーザーである必要がある
export default async (actor: IRemoteUser, activity: IFollow): Promise<string> => {
// activity is a follow request started by this server, so activity.actor must be an existing local user.
const dbResolver = new DbResolver();
const follower = await dbResolver.getUserFromApId(activity.actor);

View File

@ -1,10 +1,10 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { apLogger } from '../../logger.js';
import { IReject, isFollow, getApType } from '../../type.js';
import rejectFollow from './follow.js';
export default async (actor: CacheableRemoteUser, activity: IReject, resolver: Resolver): Promise<string> => {
export default async (actor: IRemoteUser, activity: IReject, resolver: Resolver): Promise<string> => {
const uri = activity.id || activity;
apLogger.info(`Reject: ${uri}`);

View File

@ -1,10 +1,10 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { removePinned } from '@/services/i/pin.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { IRemove } from '../../type.js';
import { resolveNote } from '../../models/note.js';
export default async (actor: CacheableRemoteUser, activity: IRemove, resolver: Resolver): Promise<void> => {
export default async (actor: IRemoteUser, activity: IRemove, resolver: Resolver): Promise<void> => {
if ('actor' in activity && actor.uri !== activity.actor) {
throw new Error('invalid actor');
}

View File

@ -1,10 +1,10 @@
import unfollow from '@/services/following/delete.js';
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { Followings } from '@/models/index.js';
import { DbResolver } from '@/remote/activitypub/db-resolver.js';
import { IAccept } from '@/remote/activitypub/type.js';
export default async (actor: CacheableRemoteUser, activity: IAccept): Promise<string> => {
export default async (actor: IRemoteUser, activity: IAccept): Promise<string> => {
const dbResolver = new DbResolver();
const follower = await dbResolver.getUserFromApId(activity.object);

View File

@ -1,9 +1,9 @@
import { Notes } from '@/models/index.js';
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { deleteNotes } from '@/services/note/delete.js';
import { IAnnounce, getApId } from '@/remote/activitypub/type.js';
export const undoAnnounce = async (actor: CacheableRemoteUser, activity: IAnnounce): Promise<string> => {
export const undoAnnounce = async (actor: IRemoteUser, activity: IAnnounce): Promise<string> => {
const uri = getApId(activity);
const note = await Notes.findOneBy({

View File

@ -1,10 +1,10 @@
import unblock from '@/services/blocking/delete.js';
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { Users } from '@/models/index.js';
import { IBlock } from '@/remote/activitypub/type.js';
import { DbResolver } from '@/remote/activitypub/db-resolver.js';
export default async (actor: CacheableRemoteUser, activity: IBlock): Promise<string> => {
export default async (actor: IRemoteUser, activity: IBlock): Promise<string> => {
const dbResolver = new DbResolver();
const blockee = await dbResolver.getUserFromApId(activity.object);

View File

@ -1,11 +1,11 @@
import unfollow from '@/services/following/delete.js';
import { cancelFollowRequest } from '@/services/following/requests/cancel.js';
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { FollowRequests, Followings } from '@/models/index.js';
import { IFollow } from '@/remote/activitypub/type.js';
import { DbResolver } from '@/remote/activitypub/db-resolver.js';
export default async (actor: CacheableRemoteUser, activity: IFollow): Promise<string> => {
export default async (actor: IRemoteUser, activity: IFollow): Promise<string> => {
const dbResolver = new DbResolver();
const followee = await dbResolver.getUserFromApId(activity.object);

View File

@ -1,4 +1,4 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { apLogger } from '@/remote/activitypub/logger.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { IUndo, isFollow, isBlock, isLike, isAnnounce, getApType, isAccept } from '@/remote/activitypub/type.js';
@ -8,7 +8,7 @@ import undoLike from './like.js';
import undoAccept from './accept.js';
import { undoAnnounce } from './announce.js';
export default async (actor: CacheableRemoteUser, activity: IUndo, resolver: Resolver): Promise<string> => {
export default async (actor: IRemoteUser, activity: IUndo, resolver: Resolver): Promise<string> => {
if ('actor' in activity && actor.uri !== activity.actor) {
throw new Error('invalid actor');
}

View File

@ -1,4 +1,4 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { deleteReaction } from '@/services/note/reaction/delete.js';
import { ILike, getApId } from '@/remote/activitypub/type.js';
import { fetchNote } from '@/remote/activitypub/models/note.js';
@ -6,7 +6,7 @@ import { fetchNote } from '@/remote/activitypub/models/note.js';
/**
* Process Undo.Like activity
*/
export default async (actor: CacheableRemoteUser, activity: ILike) => {
export default async (actor: IRemoteUser, activity: ILike) => {
const targetUri = getApId(activity.object);
const note = await fetchNote(targetUri);

View File

@ -1,4 +1,4 @@
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { getApId, getApType, IUpdate, isActor } from '@/remote/activitypub/type.js';
import { apLogger } from '@/remote/activitypub/logger.js';
import { updateQuestion } from '@/remote/activitypub/models/question.js';
@ -8,7 +8,7 @@ import { updatePerson } from '@/remote/activitypub/models/person.js';
/**
* Updateアクティビティを捌きます
*/
export default async (actor: CacheableRemoteUser, activity: IUpdate, resolver: Resolver): Promise<string> => {
export default async (actor: IRemoteUser, activity: IUpdate, resolver: Resolver): Promise<string> => {
if ('actor' in activity && actor.uri !== activity.actor) {
return 'skip: invalid actor';
}

View File

@ -1,12 +1,12 @@
import { Cache } from '@/misc/cache.js';
import { UserPublickeys } from '@/models/index.js';
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { UserPublickey } from '@/models/entities/user-publickey.js';
import { uriPersonCache, userByIdCache } from '@/services/user-cache.js';
import { createPerson } from '@/remote/activitypub/models/person.js';
export type AuthUser = {
user: CacheableRemoteUser;
user: IRemoteUser;
key: UserPublickey;
};

View File

@ -1,5 +1,5 @@
import { uploadFromUrl } from '@/services/drive/upload-from-url.js';
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { fetchMeta } from '@/misc/fetch-meta.js';
import { DriveFile } from '@/models/entities/drive-file.js';
import { DriveFiles } from '@/models/index.js';
@ -11,7 +11,7 @@ import { apLogger } from '../logger.js';
/**
* Imageを作成します
*/
export async function createImage(actor: CacheableRemoteUser, value: any, resolver: Resolver): Promise<DriveFile> {
export async function createImage(actor: IRemoteUser, value: any, resolver: Resolver): Promise<DriveFile> {
// 投稿者が凍結されていたらスキップ
if (actor.isSuspended) {
throw new Error('actor has been suspended');
@ -58,7 +58,7 @@ export async function createImage(actor: CacheableRemoteUser, value: any, resolv
* If the target Image is registered in FoundKey, return it; otherwise, fetch it from the remote server and return it.
* Fetch the image from the remote server, register it in FoundKey and return it.
*/
export async function resolveImage(actor: CacheableRemoteUser, value: any, resolver: Resolver): Promise<DriveFile> {
export async function resolveImage(actor: IRemoteUser, value: any, resolver: Resolver): Promise<DriveFile> {
// TODO
// Fetch from remote server and register it.

View File

@ -1,17 +1,17 @@
import promiseLimit from 'promise-limit';
import { toArray, unique } from '@/prelude/array.js';
import { CacheableUser } from '@/models/entities/user.js';
import { User } from '@/models/entities/user.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { IObject, isMention, IApMention } from '../type.js';
import { resolvePerson } from './person.js';
export async function extractApMentions(tags: IObject | IObject[] | null | undefined, resolver: Resolver): Promise<CacheableUser[]> {
export async function extractApMentions(tags: IObject | IObject[] | null | undefined, resolver: Resolver): Promise<User[]> {
const hrefs = unique(extractApMentionObjects(tags).map(x => x.href as string));
const limit = promiseLimit<CacheableUser | null>(2);
const limit = promiseLimit<User | null>(2);
const mentionedUsers = (await Promise.all(
hrefs.map(x => limit(() => resolvePerson(x, resolver).catch(() => null))),
)).filter((x): x is CacheableUser => x != null);
)).filter((x): x is User => x != null);
return mentionedUsers;
}

View File

@ -2,13 +2,13 @@ import promiseLimit from 'promise-limit';
import config from '@/config/index.js';
import post from '@/services/note/create.js';
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { unique, toArray, toSingle } from '@/prelude/array.js';
import { vote } from '@/services/note/polls/vote.js';
import { DriveFile } from '@/models/entities/drive-file.js';
import { deliverQuestionUpdate } from '@/services/note/polls/update.js';
import { extractDbHost, toPuny } from '@/misc/convert-host.js';
import { Emojis, Polls, MessagingMessages } from '@/models/index.js';
import { extractDbHost } from '@/misc/convert-host.js';
import { Polls, MessagingMessages } from '@/models/index.js';
import { Note } from '@/models/entities/note.js';
import { Emoji } from '@/models/entities/emoji.js';
import { genId } from '@/misc/gen-id.js';
@ -19,12 +19,12 @@ import { fromHtml } from '@/mfm/from-html.js';
import { shouldBlockInstance } from '@/misc/should-block-instance.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { parseAudience } from '../audience.js';
import { IObject, getOneApId, getApId, getOneApHrefNullable, validPost, IPost, isEmoji, getApType } from '../type.js';
import { IObject, getOneApId, getApId, getOneApHrefNullable, isPost, IPost, getApType } from '../type.js';
import { DbResolver } from '../db-resolver.js';
import { apLogger } from '../logger.js';
import { resolvePerson } from './person.js';
import { resolveImage } from './image.js';
import { extractApHashtags, extractQuoteUrl } from './tag.js';
import { extractApHashtags, extractQuoteUrl, extractEmojis } from './tag.js';
import { extractPollFromQuestion } from './question.js';
import { extractApMentions } from './mention.js';
@ -33,7 +33,7 @@ export function validateNote(object: IObject): Error | null {
return new Error('invalid Note: object is null');
}
if (!validPost.includes(getApType(object))) {
if (!isPost(object)) {
return new Error(`invalid Note: invalid object type ${getApType(object)}`);
}
@ -52,10 +52,63 @@ export function validateNote(object: IObject): Error | null {
if (attributedToHost !== expectHost) {
return new Error(`invalid Note: attributedTo has different host. expected: ${expectHost}, actual: ${attributedToHost}`);
}
if (attributedToHost === config.hostname) {
return new Error('invalid Note: by local author');
}
return null;
}
/**
* Function to process the content of a note, reusable in createNote and updateNote.
*/
async function processContent(note: IPost, quoteUri: string | null):
Promise<{
cw: string | null,
files: DriveFile[],
text: string | null,
apEmoji: Emoji[],
apHashtags: string[],
url: string,
name: string
}>
{
// Attachments handling
// TODO: attachments are not necessarily images
const limit = promiseLimit(2);
const attachments = toArray(note.attachment);
const files = note.attachment
// If the note is marked as sensitive, the images should be marked sensitive too.
.map(attach => attach.sensitive |= note.sensitive)
? (await Promise.all(note.attachment.map(x => limit(() => resolveImage(actor, x, resolver)) as Promise<DriveFile>)))
.filter(image => image != null)
: [];
// text parsing
let text: string | null = null;
if (note.source?.mediaType === 'text/x.misskeymarkdown' && typeof note.source.content === 'string') {
text = note.source.content;
} else if (typeof note.content === 'string') {
text = fromHtml(note.content, quoteUri);
}
const emojis = await extractEmojis(note.tag || [], extractDbHost(getApId(note))).catch(e => {
apLogger.info(`extractEmojis: ${e}`);
return [] as Emoji[];
});
return {
cw: note.summary === '' ? null : note.summary,
files,
text,
apEmojis: emojis.map(emoji => emoji.name),
apHashtags: await extractApHashtags(note.tag),
url: getOneApHrefNullable(note.url),
name: note.name,
};
}
/**
* Fetch Note.
*
@ -74,13 +127,7 @@ export async function createNote(value: string | IObject, resolver: Resolver, si
const err = validateNote(object);
if (err) {
apLogger.error(`${err.message}`, {
resolver: {
history: resolver.getHistory(),
},
value,
object,
});
apLogger.error(`${err.message}`);
throw new Error('invalid note');
}
@ -91,7 +138,7 @@ export async function createNote(value: string | IObject, resolver: Resolver, si
apLogger.info(`Creating the Note: ${note.id}`);
// 投稿者をフェッチ
const actor = await resolvePerson(getOneApId(note.attributedTo), resolver) as CacheableRemoteUser;
const actor = await resolvePerson(getOneApId(note.attributedTo), resolver) as IRemoteUser;
// 投稿者が凍結されていたらスキップ
if (actor.isSuspended) {
@ -102,33 +149,17 @@ export async function createNote(value: string | IObject, resolver: Resolver, si
let visibility = noteAudience.visibility;
const visibleUsers = noteAudience.visibleUsers;
// Audience (to, cc) が指定されてなかった場合
// If audience(to,cc) was not specified
if (visibility === 'specified' && visibleUsers.length === 0) {
if (typeof value === 'string') { // 入力がstringならばresolverでGETが発生している
// こちらから匿名GET出来たものならばpublic
visibility = 'public';
}
// TODO derive audience from context (e.g. whose inbox this was in?)
throw new Error('audience not understood');
}
let isTalk = note._misskey_talk && visibility === 'specified';
const apMentions = await extractApMentions(note.tag, resolver);
const apHashtags = await extractApHashtags(note.tag);
// 添付ファイル
// TODO: attachmentは必ずしもImageではない
// TODO: attachmentは必ずしも配列ではない
// Noteがsensitiveなら添付もsensitiveにする
const limit = promiseLimit(2);
note.attachment = Array.isArray(note.attachment) ? note.attachment : note.attachment ? [note.attachment] : [];
const files = note.attachment
.map(attach => attach.sensitive = note.sensitive)
? (await Promise.all(note.attachment.map(x => limit(() => resolveImage(actor, x, resolver)) as Promise<DriveFile>)))
.filter(image => image != null)
: [];
// リプライ
// Reply handling
const reply: Note | null = note.inReplyTo
? await resolveNote(note.inReplyTo, resolver).then(x => {
if (x == null) {
@ -138,7 +169,7 @@ export async function createNote(value: string | IObject, resolver: Resolver, si
return x;
}
}).catch(async e => {
// トークだったらinReplyToのエラーは無視
// ignore inReplyTo if it is a messaging message
const uri = getApId(note.inReplyTo);
if (uri.startsWith(config.url + '/')) {
const id = uri.split('/').pop();
@ -203,16 +234,6 @@ export async function createNote(value: string | IObject, resolver: Resolver, si
}
}
const cw = note.summary === '' ? null : note.summary;
// text parsing
let text: string | null = null;
if (note.source?.mediaType === 'text/x.misskeymarkdown' && typeof note.source.content === 'string') {
text = note.source.content;
} else if (typeof note.content === 'string') {
text = fromHtml(note.content, quote?.uri);
}
// vote
if (reply && reply.hasPoll) {
const poll = await Polls.findOneByOrFail({ noteId: reply.id });
@ -224,7 +245,7 @@ export async function createNote(value: string | IObject, resolver: Resolver, si
apLogger.info(`vote from AP: actor=${actor.username}@${actor.host}, note=${note.id}, choice=${name}`);
await vote(actor, reply, index);
// リモートフォロワーにUpdate配信
// Federate an Update to other servers
deliverQuestionUpdate(reply.id);
}
return null;
@ -235,40 +256,36 @@ export async function createNote(value: string | IObject, resolver: Resolver, si
}
}
const emojis = await extractEmojis(note.tag || [], actor.host).catch(e => {
apLogger.info(`extractEmojis: ${e}`);
return [] as Emoji[];
});
const apEmojis = emojis.map(emoji => emoji.name);
const poll = await extractPollFromQuestion(note, resolver).catch(() => undefined);
const processedContent = await processContent(note, quote?.uri);
if (isTalk) {
for (const recipient of visibleUsers) {
await createMessage(actor, recipient, undefined, text || undefined, (files && files.length > 0) ? files[0] : null, object.id);
return null;
await createMessage(
actor,
recipient,
undefined,
processedContent.text,
processedContent.files[0] ?? null,
object.id
);
}
return null;
} else {
return await post(actor, {
...processedContent,
createdAt: note.published ? new Date(note.published) : null,
reply,
renote: quote,
localOnly: false,
visibility,
visibleUsers,
apMentions,
poll,
uri: note.id,
}, silent);
}
return await post(actor, {
createdAt: note.published ? new Date(note.published) : null,
files,
reply,
renote: quote,
name: note.name,
cw,
text,
localOnly: false,
visibility,
visibleUsers,
apMentions,
apHashtags,
apEmojis,
poll,
uri: note.id,
url: getOneApHrefNullable(note.url),
}, silent);
}
/**
@ -307,59 +324,3 @@ export async function resolveNote(value: string | IObject, resolver: Resolver):
unlock();
}
}
export async function extractEmojis(tags: IObject | IObject[], idnHost: string): Promise<Emoji[]> {
const host = toPuny(idnHost);
if (!tags) return [];
const eomjiTags = toArray(tags).filter(isEmoji);
return await Promise.all(eomjiTags.map(async tag => {
const name = tag.name!.replace(/^:/, '').replace(/:$/, '');
tag.icon = toSingle(tag.icon);
const exists = await Emojis.findOneBy({
host,
name,
});
if (exists) {
if ((tag.updated != null && exists.updatedAt == null)
|| (tag.id != null && exists.uri == null)
|| (tag.updated != null && exists.updatedAt != null && new Date(tag.updated) > exists.updatedAt)
|| (tag.icon!.url !== exists.originalUrl)
) {
await Emojis.update({
host,
name,
}, {
uri: tag.id,
originalUrl: tag.icon!.url,
publicUrl: tag.icon!.url,
updatedAt: new Date(),
});
return await Emojis.findOneBy({
host,
name,
}) as Emoji;
}
return exists;
}
apLogger.info(`register emoji host=${host}, name=${name}`);
return await Emojis.insert({
id: genId(),
host,
name,
uri: tag.id,
originalUrl: tag.icon!.url,
publicUrl: tag.icon!.url,
updatedAt: new Date(),
aliases: [],
} as Partial<Emoji>).then(x => Emojis.findOneByOrFail(x.identifiers[0]));
}));
}

View File

@ -6,7 +6,7 @@ import { registerOrFetchInstanceDoc } from '@/services/register-or-fetch-instanc
import { Note } from '@/models/entities/note.js';
import { updateUsertags } from '@/services/update-hashtag.js';
import { Users, Instances, Followings, UserProfiles, UserPublickeys } from '@/models/index.js';
import { User, IRemoteUser, CacheableUser } from '@/models/entities/user.js';
import { User, IRemoteUser, User } from '@/models/entities/user.js';
import { Emoji } from '@/models/entities/emoji.js';
import { UserNotePining } from '@/models/entities/user-note-pining.js';
import { genId } from '@/misc/gen-id.js';
@ -27,8 +27,8 @@ import { fromHtml } from '@/mfm/from-html.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { apLogger } from '../logger.js';
import { isCollectionOrOrderedCollection, isCollection, IActor, getApId, getOneApHrefNullable, IObject, isPropertyValue, getApType, isActor } from '../type.js';
import { extractApHashtags } from './tag.js';
import { resolveNote, extractEmojis } from './note.js';
import { extractApHashtags, extractEmojis } from './tag.js';
import { resolveNote } from './note.js';
import { resolveImage } from './image.js';
const nameLength = 128;
@ -121,7 +121,7 @@ async function validateActor(x: IObject, resolver: Resolver): Promise<IActor> {
*
* If the target Person is registered in FoundKey, it is returned.
*/
export async function fetchPerson(uri: string): Promise<CacheableUser | null> {
export async function fetchPerson(uri: string): Promise<User | null> {
if (typeof uri !== 'string') throw new Error('uri is not string');
const cached = uriPersonCache.get(uri);
@ -217,7 +217,7 @@ export async function createPerson(value: string | IObject, resolver: Resolver):
} catch (e) {
// duplicate key error
if (isDuplicateKeyValueError(e)) {
// /users/@a => /users/:id のように入力がaliasなときにエラーになることがあるのを対応
// Fix an error when the input is an alias like /users/@a -> /users/:id
const u = await Users.findOneBy({
uri: person.id,
});
@ -394,7 +394,7 @@ export async function updatePerson(value: IObject | string, resolver: Resolver):
* If the target Person is registered in FoundKey, return it; otherwise, fetch it from a remote server and return it.
* Fetch the person from the remote server, register it in FoundKey, and return it.
*/
export async function resolvePerson(uri: string, resolver: Resolver, hint?: IObject): Promise<CacheableUser> {
export async function resolvePerson(uri: string, resolver: Resolver, hint?: IObject): Promise<User> {
if (typeof uri !== 'string') throw new Error('uri is not string');
//#region このサーバーに既に登録されていたらそれを返す

View File

@ -1,7 +1,11 @@
import { toArray } from '@/prelude/array.js';
import { IObject, isHashtag, IApHashtag, isLink, ILink } from '../type.js';
import { toArray, toSingle } from '@/prelude/array.js';
import { IObject, isHashtag, IApHashtag, isLink, ILink, isEmoji } from '../type.js';
import { toPuny } from '@/misc/convert-host.js';
import { Emojis } from '@/models/index.js';
import { Emoji } from '@/models/entities/emoji.js';
import { apLogger } from '@/remote/activitypub/logger.js';
export function extractApHashtags(tags: IObject | IObject[] | null | undefined) {
export function extractApHashtags(tags: IObject | IObject[] | null | undefined): string[] {
if (tags == null) return [];
const hashtags = extractApHashtagObjects(tags);
@ -47,3 +51,59 @@ export function extractQuoteUrl(tags: IObject | IObject[] | null | undefined): s
// If there is more than one quote, we just pick the first/a random one.
else return quotes[0].href;
}
export async function extractEmojis(tags: IObject | IObject[], idnHost: string): Promise<Emoji[]> {
const host = toPuny(idnHost);
if (!tags) return [];
const eomjiTags = toArray(tags).filter(isEmoji);
return await Promise.all(eomjiTags.map(async tag => {
const name = tag.name!.replace(/^:/, '').replace(/:$/, '');
tag.icon = toSingle(tag.icon);
const exists = await Emojis.findOneBy({
host,
name,
});
if (exists) {
if ((tag.updated != null && exists.updatedAt == null)
|| (tag.id != null && exists.uri == null)
|| (tag.updated != null && exists.updatedAt != null && new Date(tag.updated) > exists.updatedAt)
|| (tag.icon!.url !== exists.originalUrl)
) {
await Emojis.update({
host,
name,
}, {
uri: tag.id,
originalUrl: tag.icon!.url,
publicUrl: tag.icon!.url,
updatedAt: new Date(),
});
return await Emojis.findOneBy({
host,
name,
}) as Emoji;
}
return exists;
}
apLogger.info(`register emoji host=${host}, name=${name}`);
return await Emojis.insert({
id: genId(),
host,
name,
uri: tag.id,
originalUrl: tag.icon!.url,
publicUrl: tag.icon!.url,
updatedAt: new Date(),
aliases: [],
} as Partial<Emoji>).then(x => Emojis.findOneByOrFail(x.identifiers[0]));
}));
}

View File

@ -1,11 +1,11 @@
import { DAY } from '@/const.js';
import { CacheableRemoteUser } from '@/models/entities/user.js';
import { IRemoteUser } from '@/models/entities/user.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
import { IObject } from './type.js';
import { performActivity } from './kernel/index.js';
import { updatePerson } from './models/person.js';
export async function perform(actor: CacheableRemoteUser, activity: IObject, resolver: Resolver): Promise<void> {
export async function perform(actor: IRemoteUser, activity: IObject, resolver: Resolver): Promise<void> {
await performActivity(actor, activity, resolver);
// And while I'm at it, I'll update the remote user information if it's out of date.

View File

@ -6,7 +6,7 @@ import { renderActivity } from '@/remote/activitypub/renderer/index.js';
import renderOrderedCollection from '@/remote/activitypub/renderer/ordered-collection.js';
import renderOrderedCollectionPage from '@/remote/activitypub/renderer/ordered-collection-page.js';
import renderFollowUser from '@/remote/activitypub/renderer/follow-user.js';
import { Users, Followings, UserProfiles } from '@/models/index.js';
import { Users, Followings } from '@/models/index.js';
import { Following } from '@/models/entities/following.js';
import { setResponseType } from '../activitypub.js';
@ -31,19 +31,12 @@ export default async (ctx: Router.RouterContext) => {
return;
}
//#region Check ff visibility
const profile = await UserProfiles.findOneByOrFail({ userId: user.id });
if (profile.ffVisibility === 'private') {
ctx.status = 403;
ctx.set('Cache-Control', 'public, max-age=30');
return;
} else if (profile.ffVisibility === 'followers') {
const ffVisible = await Users.areFollowersVisibleTo(user, null);
if (!ffVisible) {
ctx.status = 403;
ctx.set('Cache-Control', 'public, max-age=30');
return;
}
//#endregion
const limit = 10;
const partOf = `${config.url}/users/${userId}/followers`;

View File

@ -6,7 +6,7 @@ import { renderActivity } from '@/remote/activitypub/renderer/index.js';
import renderOrderedCollection from '@/remote/activitypub/renderer/ordered-collection.js';
import renderOrderedCollectionPage from '@/remote/activitypub/renderer/ordered-collection-page.js';
import renderFollowUser from '@/remote/activitypub/renderer/follow-user.js';
import { Users, Followings, UserProfiles } from '@/models/index.js';
import { Users, Followings } from '@/models/index.js';
import { Following } from '@/models/entities/following.js';
import { setResponseType } from '../activitypub.js';
@ -31,19 +31,12 @@ export default async (ctx: Router.RouterContext) => {
return;
}
//#region Check ff visibility
const profile = await UserProfiles.findOneByOrFail({ userId: user.id });
if (profile.ffVisibility === 'private') {
ctx.status = 403;
ctx.set('Cache-Control', 'public, max-age=30');
return;
} else if (profile.ffVisibility === 'followers') {
const ffVisible = await Users.areFollowersVisibleTo(user, null);
if (!ffVisible) {
ctx.status = 403;
ctx.set('Cache-Control', 'public, max-age=30');
return;
}
//#endregion
const limit = 10;
const partOf = `${config.url}/users/${userId}/following`;

View File

@ -1,7 +1,7 @@
import Koa from 'koa';
import { IEndpoint } from './endpoints.js';
import authenticate, { AuthenticationError } from './authenticate.js';
import { authenticate, AuthenticationError } from './authenticate.js';
import call from './call.js';
import { ApiError } from './error.js';
@ -45,7 +45,10 @@ export async function handler(endpoint: IEndpoint, ctx: Koa.Context): Promise<vo
if (e instanceof AuthenticationError) {
new ApiError('AUTHENTICATION_FAILED', e.message).apply(ctx, endpoint.name);
} else {
new ApiError().apply(ctx, endpoint.name);
new ApiError('INTERNAL_ERROR', {
e: e.message,
stack: e.stack,
}).apply(ctx, endpoint.name);
}
});
}

View File

@ -1,4 +1,4 @@
import { CacheableLocalUser } from '@/models/entities/user.js';
import { ILocalUser } from '@/models/entities/user.js';
import { Users, AccessTokens } from '@/models/index.js';
import { AccessToken } from '@/models/entities/access-token.js';
import { userByIdCache, localUserByNativeTokenCache } from '@/services/user-cache.js';
@ -11,7 +11,7 @@ export class AuthenticationError extends Error {
}
}
export default async (authorization: string | null | undefined, bodyToken: string | null | undefined): Promise<[CacheableLocalUser | null | undefined, AccessToken | null | undefined]> => {
export async function authenticate(authorization: string | null | undefined, bodyToken: string | null | undefined): Promise<[ILocalUser | null | undefined, AccessToken | null | undefined]> {
let maybeToken: string | null = null;
// check if there is an authorization header set
@ -66,4 +66,4 @@ export default async (authorization: string | null | undefined, bodyToken: strin
return [user, accessToken];
}
};
}

View File

@ -1,14 +1,14 @@
import { performance } from 'perf_hooks';
import Koa from 'koa';
import { CacheableLocalUser } from '@/models/entities/user.js';
import { ILocalUser } from '@/models/entities/user.js';
import { AccessToken } from '@/models/entities/access-token.js';
import { getIpHash } from '@/misc/get-ip-hash.js';
import { limiter } from './limiter.js';
import endpoints, { IEndpointMeta } from './endpoints.js';
import { endpoints, IEndpointMeta } from './endpoints.js';
import { ApiError } from './error.js';
import { apiLogger } from './logger.js';
export default async (endpoint: string, user: CacheableLocalUser | null | undefined, token: AccessToken | null | undefined, data: any, ctx?: Koa.Context) => {
export default async (endpoint: string, user: ILocalUser | null | undefined, token: AccessToken | null | undefined, data: any, ctx?: Koa.Context) => {
const isSecure = user != null && token == null;
const isModerator = user != null && (user.isModerator || user.isAdmin);
@ -82,15 +82,7 @@ export default async (endpoint: string, user: CacheableLocalUser | null | undefi
if (e instanceof ApiError) {
throw e;
} else {
apiLogger.error(`Internal error occurred in ${ep.name}: ${e.message}`, {
ep: ep.name,
ps: data,
e: {
message: e.message,
code: e.name,
stack: e.stack,
},
});
apiLogger.error(`Internal error occurred in ${ep.name}: ${e.message}`);
throw new ApiError('INTERNAL_ERROR', {
e: {
message: e.message,

View File

@ -32,7 +32,7 @@ export async function getNote(noteId: Note['id'], me: { id: User['id'] } | null)
export async function getUser(userId: User['id'], includeSuspended = false) {
const user = await Users.findOneBy({
id: userId,
isDeleted: false,
isDeleted: IsNull(),
...(includeSuspended ? {} : {isSuspended: false}),
});
@ -50,7 +50,7 @@ export async function getRemoteUser(userId: User['id'], includeSuspended = false
const user = await Users.findOneBy({
id: userId,
host: Not(IsNull()),
isDeleted: false,
isDeleted: IsNull(),
...(includeSuspended ? {} : {isSuspended: false}),
});
@ -68,7 +68,7 @@ export async function getLocalUser(userId: User['id'], includeSuspended = false)
const user = await Users.findOneBy({
id: userId,
host: IsNull(),
isDeleted: false,
isDeleted: IsNull(),
...(includeSuspended ? {} : {isSuspended: false}),
});

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