Commit Graph

25 Commits

Author SHA1 Message Date
okayurisotto e35a370af0
refactor(backend): `core/activitypub` (#11247)
* eslint: `explicit-function-return-type`

* eslint: `no-unnecessary-condition`

* eslint: `eslint-disable-next-line`

* eslint: `no-unused-vars`

* eslint: `comma-dangle`

* eslint: `import/order`

* cleanup: unnecessary non-null assertion

* cleanup: `IActivity`に`actor`は常に存在するようなので

* cleanup: unnecessary `as`

* cleanup: unnecessary `Promise.resolve`

* cleanup

* refactor: `String.prototype.match()`である必要がない部分をよりシンプルな書き方に変更

* refactor: よりよい型定義

* refactor: よりよい型定義

- `LdSignature`の`normalize`メソッドでの使われ方から、
	- `data`引数の型定義を`any`から`JsonLdDocument`へ修正
	- `getLoader`メソッドの返り値の型定義の一部を`any`から`RemoteDocument`へ修正
		- `contextUrl`が不正な値(`null`)となっていたことが判明したため`undefined`へ修正
		- `document`の型と合わせるために`CONTEXTS`の型定義の一部を`unknown`から`JsonLd`へ修正
			- とりあえず`satisfies`を使用
		- `document`の型と合わせるために`fetchDocument`メソッドの返り値の型定義の一部を`unknown`から`JsonLd`へ修正
			- どうしようもなく`as`を使用

* refactor: 型ガードを使うことでnon-null assertionをやめた

* refactor: non-null assertionをやめた

`.filter()`で行っている型ガードなどの文脈から、より適しているだろうと思われる書き方に変更した。

* refactor: 型ガードを使うことで`as`をやめた

* refactor: `as`をやめた

* refactor: よりよい型定義

- `id`は`null`とのunionになっていたが、`null`を渡している場面はなかった
	- またおそらくこのメソッドは`IOrderedCollection`を返すため、そちらに合わせて`null`とのunionをやめた
		- `IOrderedCollection`とはまだ型に相違がある
- `totalItems`をコメントや使われ方を元に`number`へ推論

* refactor: `for-of` -> `Array.prototype.map`

* refactor: `delete`演算子を使わない形に
2023-07-13 12:48:34 +09:00
syuilo 081a14d6f3 perf(backend): use limit() instead of take() 2023-07-08 16:53:07 +09:00
syuilo db1098a180 feat(backend): カスタム絵文字ごとに連合するかどうか設定できるように 2023-05-18 18:48:35 +09:00
Namekuji d28866f71a
enhance: account migration (#10592)
* copy block and mute then create follow and unfollow jobs

* copy block and mute and update lists when detecting an account has moved

* no need to care promise orders

* refactor updating actor and target

* automatically accept if a locked account had accepted an old account

* fix exception format

* prevent the old account from calling some endpoints

* do not unfollow when moving

* adjust following and follower counts

* check movedToUri when receiving a follow request

* skip if no need to adjust

* Revert "disable account migration"

This reverts commit 2321214c98.

* fix translation specifier

* fix checking alsoKnownAs and uri

* fix updating account

* fix refollowing locked account

* decrease followersCount if followed by the old account

* adjust following and followers counts when unfollowing

* fix copying mutings

* prohibit moved account from moving again

* fix move service

* allow app creation after moving

* fix lint

* remove unnecessary field

* fix cache update

* add e2e test

* add e2e test of accepting the new account automatically

* force follow if any error happens

* remove unnecessary joins

* use Array.map instead of for const of

* ユーザーリストの移行は追加のみを行う

* nanka iroiro

* fix misskey-js?

* ✌️

* 移行を行ったアカウントからのフォローリクエストの自動許可を調整

* newUriを外に出す

* newUriを外に出す2

* clean up

* fix newUri

* prevent moving if the destination account has already moved

* set alsoKnownAs via /i/update

* fix database initialization

* add return type

* prohibit updating alsoKnownAs after moving

* skip to add to alsoKnownAs if toUrl is known

* skip adding to the list if it already has

* use Acct.parse instead

* rename error code

* 🎨

* 制限を5から10に緩和

* movedTo(Uri), alsoKnownAsはユーザーidを返すように

* test api res

* fix

* 元アカウントはミュートし続ける

* 🎨

* unfollow

* fix

* getUserUriをUserEntityServiceに

* ?

* job!

* 🎨

* instance => server

* accountMovedShort, forbiddenBecauseYouAreMigrated

* accountMovedShort

* fix test

* import, pin禁止

* 実績を凍結する

* clean up

* ✌️

* change message

* ブロック, フォロー, ミュート, リストのインポートファイルの制限を32MiBに

* Revert "ブロック, フォロー, ミュート, リストのインポートファイルの制限を32MiBに"

This reverts commit 3bd7be35d8aa455cb01ae58f8172a71a50485db1.

* validateAlsoKnownAs

* 移行後2時間以内はインポート可能なファイルサイズを拡大

* clean up

* どうせactorをupdatePersonで更新するならupdatePersonしか移行処理を発行しないことにする

* handle error?

* リモートからの移行処理の条件を是正

* log, port

* fix

* fix

* enhance(dev): non-production環境でhttpサーバー間でもユーザー、ノートの連合が可能なように

* refactor (use checkHttps)

* MISSKEY_WEBFINGER_USE_HTTP

* Environment Variable readme

* NEVER USE IN PRODUCTION

* fix punyHost

* fix indent

* fix

* experimental

---------

Co-authored-by: tamaina <tamaina@hotmail.co.jp>
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
2023-04-30 00:09:29 +09:00
hutchisr b7d056fb22
Use unique identifier for each follow request (#10600)
Co-authored-by: anemone <anemoneya@icloud.com>
2023-04-12 20:22:50 +09:00
syuilo 28647de196 enhance(backend): improve userkeypair cache 2023-04-05 12:10:40 +09:00
syuilo 1b21bad202 refactor 2023-02-13 15:50:22 +09:00
syuilo 451bc0b444 refactor: fix types 2023-02-12 18:47:30 +09:00
momoirodouhu f28aea9e30
add cors header to ActivityPubServerService.ts (#9888)
* add cors header to ActivityPubServerService.ts

* Update CHANGELOG.md
2023-02-12 08:22:42 +09:00
syuilo 5facd11592 refactor: fix types 2023-02-09 11:02:37 +09:00
syuilo 21331e53fe refactor: fix types 2023-02-09 10:46:01 +09:00
syuilo 225dbec8b9 64kb 2022-12-25 14:56:59 +09:00
syuilo ab1a433400 fix 2022-12-25 14:53:50 +09:00
syuilo b518c35e00 fix(server): Ap inboxの最大ペイロードサイズを256kbに制限 2022-12-25 14:52:42 +09:00
syuilo 145c15f0d9 fix(server): add missing vary header
Fix #9393
2022-12-23 08:50:58 +09:00
Kagami Sascha Rosylight 4b98920f02
Fix import related TypeScript errors (#9321)
* Add missing @types packages

* Fix TS1272 type only imports

* Fix TS2821 import assertion
2022-12-14 00:01:45 +09:00
syuilo d8611506cf inboxが処理できない問題を多分修正 2022-12-06 09:21:36 +09:00
syuilo bbb49457f9 refactor: introduce bindThis decorator to bind this automaticaly 2022-12-04 15:03:09 +09:00
syuilo 8950114f7d refactor: remove needless const notation 2022-12-04 10:32:12 +09:00
syuilo 22ccb0fa71 refactor 2022-12-04 10:16:03 +09:00
syuilo 3a7182bfb5
Fastify (#9106)
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fix

* Update SignupApiService.ts

* wip

* wip

* Update ClientServerService.ts

* wip

* wip

* wip

* Update WellKnownServerService.ts

* wip

* wip

* update des

* wip

* Update ApiServerService.ts

* wip

* update deps

* Update WellKnownServerService.ts

* wip

* update deps

* Update ApiCallService.ts

* Update ApiCallService.ts

* Update ApiServerService.ts
2022-12-03 19:42:05 +09:00
syuilo 174a8b1b3e fixes 2022-09-23 06:21:31 +09:00
syuilo 01d4d55e78 fix import type 2022-09-21 05:33:11 +09:00
syuilo a2eac9fff6 test 2022-09-19 03:11:50 +09:00
syuilo b75184ec8e
なんかもうめっちゃ変えた 2022-09-18 03:27:08 +09:00