Commit graph

9922 commits

Author SHA1 Message Date
Hazelnoot
ba9ec3bcee verify URLs in DownloadService 2025-07-21 16:16:33 -04:00
Hazelnoot
dac310b540 use shared URL verification in verifyLinkFields 2025-07-21 16:16:32 -04:00
Hazelnoot
15f6c6ca93 validate all URLs before fetch 2025-07-21 16:16:32 -04:00
Hazelnoot
f163e15602 move user.lastFetchedAt to UserLite 2025-07-21 16:13:00 -04:00
Hazelnoot
69402e3abb move user.updateAt to UserLite 2025-07-21 16:13:00 -04:00
Hazelnoot
3dbfb4fa20 add "detail" flag to more user endpoints 2025-07-21 16:13:00 -04:00
Hazelnoot
34dcb1c51c optimize i/update-remote-user endpoint by fetching from cache 2025-07-21 16:12:32 -04:00
Hazelnoot
5a9bf50424 increase rate limit for import endpoints to 1 per minute 2025-07-21 16:12:19 -04:00
Hazelnoot
d2ec40fb87 scale rate limit dripRate with factor 2025-07-21 15:57:30 -04:00
Hazelnoot
2b7c74c63c include profile URI for link verification 2025-07-21 15:55:36 -04:00
Hazelnoot
4346bac05f check for null jobs in QueueService.queueGetJobs 2025-07-21 15:55:00 -04:00
Hazelnoot
223198a0fb fix admin/delete-all-files-of-a-user endpoint recording a log entry for every single file 2025-07-21 15:54:49 -04:00
Hazelnoot
ed68230811 merge: Add importCompleted notification. Send importCompleted when antenna/customEmoji/muting/userList is imported (!1165)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1165

Closes #891

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Hazelnoot <acomputerdog@gmail.com>
2025-07-21 18:42:29 +00:00
Hazelnoot
31344bb816 merge: Add docstrings for Sharkey components (!1172)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1172

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Hazelnoot <acomputerdog@gmail.com>
2025-07-21 15:40:30 +00:00
наб
d954b8d138
StreamingApiServerService: handle websocket errors from client gracefully
$ nc -C tarta.nabijaczleweli.xyz 12122
  GET /streaming?_t=1752534314122 HTTP/1.1
  Host: tarta.nabijaczleweli.xyz:12122
  User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0
  Accept: */*
  Accept-Language: en-GB,en;q=0.5
  Accept-Encoding: gzip, deflate
  Sec-WebSocket-Version: 13
  Sec-WebSocket-Extensions: permessage-deflate
  Sec-WebSocket-Key: AAAAAAAAAAAAAAAAAAAAAA==
  Connection: keep-alive, Upgrade
  Pragma: no-cache
  Cache-Control: no-cache
  Upgrade: websocket
the parameters almost don't matter so long as the server
replies with an upgrade, then press enter once or twice,
at which point the server will have crashed after
  INFO 1  [core nest]             NestFactory: Starting Nest application...
  ERR  *  [core]          Uncaught exception (uncaughtException): RangeError: Invalid WebSocket frame: invalid opcode 13
      at Receiver.getInfo (/srv/Sharkey/node_modules/.pnpm/ws@8.18.1_bufferutil@4.0.9_utf-8-validate@6.0.5/node_modules/ws/lib/receiver.js:311:26)
      at Receiver.startLoop (/srv/Sharkey/node_modules/.pnpm/ws@8.18.1_bufferutil@4.0.9_utf-8-validate@6.0.5/node_modules/ws/lib/receiver.js:155:16)
      at Receiver._write (/srv/Sharkey/node_modules/.pnpm/ws@8.18.1_bufferutil@4.0.9_utf-8-validate@6.0.5/node_modules/ws/lib/receiver.js:94:10)
      at writeOrBuffer (node:internal/streams/writable:572:12)
      at _write (node:internal/streams/writable:501:10)
      at Writable.write (node:internal/streams/writable:510:10)
      at Socket.socketOnData (/srv/Sharkey/node_modules/.pnpm/ws@8.18.1_bufferutil@4.0.9_utf-8-validate@6.0.5/node_modules/ws/lib/websocket.js:1355:35)
      at Socket.emit (node:events:518:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Readable.push (node:internal/streams/readable:392:5)
      at TCP.onStreamRead (node:internal/stream_base_commons:189:23) {
    code: 'WS_ERR_INVALID_OPCODE',
    [Symbol(status-code)]: 1002
  }
  INFO *  [core]          The process is going to exit with code 1
  node:events:496
        throw er; // Unhandled 'error' event
        ^

  RangeError: Invalid WebSocket frame: invalid opcode 13
      at Receiver.getInfo (/srv/Sharkey/node_modules/.pnpm/ws@8.18.1_bufferutil@4.0.9_utf-8-validate@6.0.5/node_modules/ws/lib/receiver.js:311:26)
      at Receiver.startLoop (/srv/Sharkey/node_modules/.pnpm/ws@8.18.1_bufferutil@4.0.9_utf-8-validate@6.0.5/node_modules/ws/lib/receiver.js:155:16)
      at Receiver._write (/srv/Sharkey/node_modules/.pnpm/ws@8.18.1_bufferutil@4.0.9_utf-8-validate@6.0.5/node_modules/ws/lib/receiver.js:94:10)
      at writeOrBuffer (node:internal/streams/writable:572:12)
      at _write (node:internal/streams/writable:501:10)
      at Writable.write (node:internal/streams/writable:510:10)
      at Socket.socketOnData (/srv/Sharkey/node_modules/.pnpm/ws@8.18.1_bufferutil@4.0.9_utf-8-validate@6.0.5/node_modules/ws/lib/websocket.js:1355:35)
      at Socket.emit (node:events:518:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Readable.push (node:internal/streams/readable:392:5)
      at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
  Emitted 'error' event on WebSocket instance at:
      at Receiver.receiverOnError (/srv/Sharkey/node_modules/.pnpm/ws@8.18.1_bufferutil@4.0.9_utf-8-validate@6.0.5/node_modules/ws/lib/websocket.js:1199:15)
      at Receiver.emit (node:events:518:28)
      at emitErrorNT (node:internal/streams/destroy:170:8)
      at emitErrorCloseNT (node:internal/streams/destroy:129:3)
      at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
    code: 'WS_ERR_INVALID_OPCODE',
    [Symbol(status-code)]: 1002
  }

  Node.js v22.14.0
   ELIFECYCLE  Command failed with exit code 1.

This works through some reverse proxies (HAProxy, Caddy),
but not through others (Cloudflare, nginx, Apache(?))

Instead, just hang up if the client violates protocol

Fixes https://101010.pl/@nabijaczleweli/114854334401159070
2025-07-21 17:39:41 +02:00
Hazelnoot
6d73171dfe merge: Reject duplicate mod actions (!1157)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1157

Closes #768

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Hazelnoot <acomputerdog@gmail.com>
2025-07-21 14:59:49 +00:00
bunnybeam
705e65e2d2
clarify that SkNote files are in the Sharkey style 2025-07-17 21:31:46 +01:00
bunnybeam
ff477e3bc7
changes to docstrings based on feedback 2025-07-17 21:28:17 +01:00
bunnybeam
184d116632
add docstrings for components beginning with Sk, along with DynamicNotes 2025-07-17 17:38:45 +01:00
dakkar
8b1a0f1226 replace URL path for inlined SearchMarkers - fixes #1154
The search index looks like:

```ts
[
 {
   id: 'foo', label: 'security',
   path: '/settings/security', inlining: ['2fa'],
 },
 {
   id: '2fa',
   label: 'two-factor auth',
   path: '/settings/2fa', // guessed wrong by the index generation
 },
 {
   id: 'aaaa',
   parentId: '2fa',
   label: 'totp',
 },
 …
]
```

This file post-processes that index and re-parents the inlined
sections. Problem was, it left the (wrong) `path` untouched.

Replacing the `path` makes the search work fine.
2025-07-17 16:36:50 +01:00
Emily Fox
b58bd4b9c9 prevent mastodon api error when not fetching reply or renote (resolves #1125)
Use of inner joins for `reply.user` and `renote.user` meant fetching a base
note would always fail when asked to query reply or renote information.
2025-07-16 12:07:38 -05:00
наб
6abbf955fc
Uniquify exportEntityName and importEntityName 2025-07-16 18:32:19 +02:00
наб
a00a3c6841
Add importCompleted notification. Send importCompleted when antenna/customEmoji/muting/userList is imported
The only userImportableEntities that don't notify
are blocking and following because they fork off a batch of single

Closes #891
2025-07-16 18:32:18 +02:00
piuvas
c97fafa071
requested changes. 2025-07-16 12:43:35 -03:00
piuvas
1696e31797
initial split descriptions impl. 2025-07-15 18:37:29 -03:00
bunnybeam
55022826cf
consistent styling for duplicate mod action checks 2025-07-14 19:40:04 +01:00
bunnybeam
92d87f955f
remove index on confetti column 2025-07-14 19:32:42 +01:00
bunnybeam
0191ea8844
fix admin/unnsfw-user not working 2025-07-10 22:49:00 +01:00
bunnybeam
eca81b6494
add various checks to avoid duplicate mod actions 2025-07-10 18:29:57 +01:00
bunnybeam
d023fb3389
return instead of erroring when suspending a suspended user 2025-07-10 16:19:55 +01:00
bunnybeam
7581b5b40b
prevent suspending a user who is already suspended 2025-07-10 15:45:21 +01:00
bunnybeam
7ee0245cdc
remove empty onMounted and unnecessary log line 2025-07-10 13:48:47 +01:00
bunnybeam
89b5901e46
disable confetti switch on banner announcements 2025-07-08 21:47:22 +01:00
bunnybeam
a8db24e074
add confetti on dialog announcements 2025-07-08 20:41:07 +01:00
bunnybeam
e1bd8c5909
remove old logging lines 2025-07-07 21:41:29 +01:00
bunnybeam
45bf8262aa
implement optional confetti on announcements 2025-07-07 20:03:28 +01:00
Hazelnoot
c0b93364c0 disable outgoing mastodon quotes 2025-07-04 12:54:52 -04:00
Lilly Schramm
0f6c5d27ec fix: Do Not NULL Descriptions 2025-06-30 08:47:44 +02:00
Hazelnoot
be1063238f merge: Enable NestJS shutdown hooks for clean exit (!1145)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1145

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
2025-06-29 19:23:55 +00:00
dakkar
13d045d813 merge: misskey 2025.5.0 (!1028)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1028

Approved-by: Hazelnoot <acomputerdog@gmail.com>
Approved-by: Marie <github@yuugi.dev>
2025-06-29 09:54:12 +00:00
Marie
fad58ddc1c merge: unique constraint for registry_item - fixes #1121 (!1139)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1139

Closes #1121

Approved-by: Hazelnoot <acomputerdog@gmail.com>
Approved-by: Marie <github@yuugi.dev>
2025-06-28 22:49:51 +00:00
Marie
f4fe14f5b7 merge: feat: Add Bio Length Setting (!1136)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1136

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
2025-06-28 22:47:41 +00:00
Marie
559a7566ab merge: smarter "clean remote files" - fixes #801 (!1143)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1143

Closes #801

Approved-by: Hazelnoot <acomputerdog@gmail.com>
Approved-by: Marie <github@yuugi.dev>
2025-06-28 22:47:27 +00:00
dakkar
a450f801cf warn about extra db load 2025-06-27 11:16:56 +01:00
Hazelnoot
957116d04a merge: Hide muted threads and notes from timelines (!1142)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1142

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
2025-06-26 17:38:15 +00:00
Hazelnoot
d7b94e756d fix websockets not working 2025-06-26 09:32:14 -04:00
Hazelnoot
088fe15be5 improve shutdown logic somewhat 2025-06-25 22:51:32 -04:00
Hazelnoot
168a364162 fix redis listener leak in StreamingApiServerService.ts 2025-06-25 22:51:16 -04:00
Hazelnoot
4e609478f8 add additional shutdown logging 2025-06-25 22:16:26 -04:00
Hazelnoot
c79d66d48b fix disposal of ServerStatsService and QueueStatsService 2025-06-25 22:16:06 -04:00