Commit graph

93 commits

Author SHA1 Message Date
cbfd866122 server: make fetcher key non-null 2022-12-08 23:19:39 -05:00
350f21d955
server: fix typing for skippedInstances query 2022-12-07 16:41:34 -05:00
2afe54c121
eslint: allow backticks to avoid escaping single/double quotes 2022-12-07 16:27:39 -05:00
b66f7550ab
server: auto-fix lints 2022-12-07 13:39:21 -05:00
0f3f42eb39
remove rndstr dependency
This dependency was unused in the client.

The use of it in the server can be replaced entirely by the
secureRndstr function, with some slight modifications.

That function could probably be refactored a bit more as well.
2022-12-07 18:08:09 +01:00
c1a51547a9 BREAKING: server: remove wildcard blocking and instead block subdomains (#269)
Co-authored-by: Francis Dinh <normandy@biribiri.dev>
Reviewed-on: FoundKeyGang/FoundKey#269
Changelog: Changed
2022-12-05 17:55:38 +00:00
18cf228f89
server: readd "fetch meta only once in skippedInstances""
This reverts commit e446a11bb7.

Turns out this wasn't really the source of the referenced issue and
someone was able to run with the original commit fine, so adding this
back for now.
2022-12-03 05:13:30 -05:00
e446a11bb7
Revert "server: fetch meta only once in skippedInstances"
This reverts commit 81d63720f2 since it
seems to cause a ReferenceError for some reason.

Ref: https://toot.site/@jeder/109447151582516733
2022-12-03 02:13:18 -05:00
81d63720f2
server: fetch meta only once in skippedInstances 2022-12-02 09:26:14 -05:00
5e6b51094e
server: fix instance skipping
This should actually make instance skipping work properly since
shouldBlockInstance is now properly awaited on now.
2022-12-02 09:10:56 -05:00
b3e34795c0
require punycode conversion beforehand for admins 2022-12-01 12:07:43 -05:00
a35c98bbd5
server: encode non-ascii domains in punycode in matchHost 2022-12-01 11:34:11 -05:00
075e251822
server: add wildcard matching to blocked hosts
This adds in wildcard matching. For instance:
- `*.bad.tld` will match: `very.bad.tld`
- `bad.*` will match: `bad.something`
- `*.bad.*` will match: `very.bad.evil`

Changelog: Changed
2022-12-01 11:29:02 -05:00
01fa4332c2
server: set vapid keys on initial setup 2022-11-21 22:30:34 +01:00
9e2553909e
server: use time constants 2022-11-20 23:15:40 +01:00
4183c429e6
server: rewrite skipped instances query in raw SQL
This should hopefully improve performance somewhat.

Reviewed-on: FoundKeyGang/FoundKey#230
Changelog: Changed
2022-11-18 22:02:47 +01:00
28aa440bcc
server: correctly await promises when updating server info
When not awaiting promises, truncating the table and inserting again
can sometimes not work due to race conditions.
2022-11-18 20:52:19 +01:00
c0d5678039
backend: fix lints in various misc modules
Mostly adding return types and also fixing a type error.
2022-11-16 19:48:16 -05:00
629b865789
backend: add return type to getAntennas 2022-11-16 19:44:20 -05:00
b958be77b6
fixup server: refactor meta caching
fix: setting meta does not keep cache synced.
fix: handle initially empty meta table.
2022-11-16 20:36:22 +01:00
9f6be8d557
server: refactor meta caching
This removes the "caching" that re-fetches the instance meta information
from the database every 10 seconds.
2022-11-14 22:12:32 +01:00
9d9b2da6cc
fix parameter for cache fetcher 2022-11-13 20:31:24 +01:00
d1ec058d5c
server: refactor Cache to hold fetcher as attribute
Instead of having to pass the fetcher every time you want to fetch
something, the fetcher is stored in an attribute of the Cache.
2022-11-13 19:39:30 +01:00
131c12a30b
server: refactor prefetchEmojis
Exiting earlier might slightly improve performance.
2022-11-13 18:24:15 +01:00
5b61941e4c
server: skip instances that proclaimed themself dead via HTTP 410
Changelog: Fixed
2022-11-10 00:23:30 +01:00
ca90cedba0
server: reduce dead instance detection to 7 days 2022-11-09 18:47:28 +01:00
c282ed7683
Narrow type of isPureRenote
As side effect of that, a non-null assertion can be removed.

Co-authored-by: Johann150 <johann.galle@protonmail.com>
2022-10-30 17:38:56 +01:00
2aafe8fc9f
server: avoid adding suspended instances to deliver queue
This should reduce the performance hit when adding large numbers of
instances to the deliver queue by making the check for suspended and
dead instances a bulk operation.

Changelog: Changed
Reviewed-on: FoundKeyGang/FoundKey#215
2022-10-29 22:58:04 +02:00
4b6c3b2f37
properly await promise 2022-10-19 15:26:37 +02:00
fbf7ea07c9
server refactor: centrally load locale
To reduce code duplication, the locales are loaded in @/misc/i18n.ts
directly instead of importing it in each file using it separately.
2022-10-19 12:30:23 +02:00
3aa1d3bf97
backend: update DB_MAX_IMAGE_COMMENT_LENGTH
This was increased to 2048 characters in
186d693385.
2022-10-17 17:49:48 -04:00
c414f24a2c feat: per-user renote muting
Changelog: Added
2022-10-11 10:42:39 +00:00
30faeb73d2 backend: Fix type errors in genId
I checked on NodeJS locally and `Math.min` was coercing the Dates to numbers,
I'm just making it more obvious (to the typechecker as well)
2022-10-10 20:50:04 +02:00
6ce4b3fe2f
fix some lints
Many of these were fixed automatically with eslint --fix.

Some of them (e.g. adding return types to functions) were done manually.
2022-08-11 00:09:29 +02:00
7a80015225
fix lint "no-param-reassign" 2022-08-10 16:36:54 +02:00
09a7eabda1
backend: fix lint "no-throw-literal" 2022-08-04 11:00:02 +02:00
e2bf2715a6
fix spelling error 2022-08-04 10:20:48 +02:00
c8f49bae76
fix lint "object-shorthand" 2022-08-03 14:58:24 +02:00
37e47a257e
fix lints "import/order" and "import/no-duplicate"
Also simplified some import paths by replacing relative with absolute paths.
2022-08-03 14:05:50 +02:00
a6df127d3b
fix lint "quotes" 2022-08-02 23:25:36 +02:00
fbcea23ef6
fix ReferenceError in renote.ts 2022-08-02 21:23:16 +02:00
ec4fe55acf
refactor: reusable function for pure renote detection
There was some code to detect if a note is a quote renote. However this
code was unused and it seems the kind of reversed detection of checking
if something is a pure renote is more useful.
2022-08-01 00:05:10 +02:00
233c39dbad
fix lints 2022-07-27 08:16:52 +02:00
Chloe Kudryavtsev
0f6d94f1e7 backend: improve mutes and blocks
Mutes and blocks now also apply recursively to replies and renotes.
Furthermore, any mentioned user being muted or blocked will also apply.
2022-07-26 08:12:49 -04:00
128d0f0d4e
remove isHidden and its uses
The `isHidden` attribute is not being set any more and is thus removed.
Handling in the client is no longer necessary.
2022-07-23 22:28:39 +02:00
f476d149a6 remove alternative ID generation
Although these are configurable, there seems to be no benefit of being
able to configure these. The expected use of configuration methods other
than "aid" is expected to be low.
2022-07-13 21:30:21 +00:00
9b008b9684
refactor: remove duplicate code (#8895) 2022-07-13 12:52:45 +02:00
912c19222e
fix lints 2022-07-13 10:42:16 +02:00
00fe1d341b
enhance: word mute checks CW (#8873) 2022-07-13 10:16:38 +02:00
tamaina
37581ea831 feat: Add Badge Image to Push Notification (#8012)
* fix

* nanka iroiro

* wip

* wip

* fix lint

* fix loginId

* fix

* refactor

* refactor

* remove follow action

* clean up

* Revert "remove follow action"

This reverts commit defbb416480905af2150d1c92f10d8e1d1288c0a.

* Revert "clean up"

This reverts commit f94919cb9cff41e274044fc69c56ad36a33974f2.

* remove fetch specification

* renoteの条件追加

* apiFetch => cli

* bypass fetch?

* fix

* refactor: use path alias

* temp: add submodule

* remove submodule

* enhane: unison-reloadに指定したパスに移動できるように

* null

* null

* feat: ログインするアカウントのIDをクエリ文字列で指定する機能

* null

* await?

* rename

* rename

* Update read.ts

* merge

* get-note-summary

* fix

* swパッケージに

* add missing packages

* fix getNoteSummary

* add webpack-cli

* ✌️

* remove plugins

* sw-inject分離したがテストしてない

* fix notification.vue

* remove a blank line

* disconnect intersection observer

* disconnect2

* fix notification.vue

* remove a blank line

* disconnect intersection observer

* disconnect2

* fix

* ✌️

* clean up config

* typesを戻した

* backend/src/web/index.ts

* notification-badges

* add scripts

* change create-notification.ts

* Update packages/client/src/components/notification.vue

Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>

* disconnect

* oops

* Failed to load the script unexpectedly回避
sw.jsとlib.tsを分離してみた

* truncate notification

* Update packages/client/src/ui/_common_/common.vue

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>

* clean up

* clean up

* refactor

* キャッシュ対策

* Truncate push notification message

* fix

* クライアントがあったらストリームに接続しているということなので通知しない判定の位置を修正

* components/drive-file-thumbnail.vue

* components/drive-select-dialog.vue

* components/drive-window.vue

* merge

* fix

* Service Workerのビルドにesbuildを使うようにする

* return createEmptyNotification()

* fix

* fix

* i18n.ts

* update

* ✌️

* remove ts-loader

* fix

* fix

* enhance: Service Workerを常に登録するように

* pollEnded

* pollEnded

* URLをsw.jsに戻す

* clean up

* fix lint

* changelog

* alpha-test

* also with twemoji

* add isMimeImage function

* catch

* Colour => Color

* char2file => char2filePath

* Update autocomplete.vue

* remove clone?

Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
2022-07-09 05:52:01 -04:00