Commit graph

1817 commits

Author SHA1 Message Date
Hazelnoot
479e6daa1d add role policy "canViewFederation" 2025-08-18 16:52:06 -04:00
Marie
aff1603788 merge: Return request errors for /streaming in-band instead of in HTTP (!1168)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1168

Closes #591

Approved-by: Hazelnoot <acomputerdog@gmail.com>
Approved-by: Marie <github@yuugi.dev>
2025-08-16 19:23:49 +00:00
Marie
d872c6608f merge: Allow restricting announcement to a set of roles (!1161)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1161

Closes #682

Approved-by: Hazelnoot <acomputerdog@gmail.com>
Approved-by: Marie <github@yuugi.dev>
2025-08-16 08:11:08 +00:00
наб
155d2920b6
Dispose of the stream even if it gets closed early 2025-08-11 23:53:30 +02:00
наб
5aceeb31e7
Return request errors for /streaming in-band instead of in HTTP
Closes #591
2025-08-11 23:53:30 +02:00
наб
e22ae591b6
SignupApiService: logIp() additional logging 2025-08-11 23:53:14 +02:00
наб
132c25b271
Log IP addresses used during registration
Closes #836
2025-08-11 23:53:13 +02:00
наб
b61c1d5b27
forRoles IS NOT NULL, coalesce to empty=unrestricted 2025-08-11 23:53:05 +02:00
наб
f3b5c3f447
Allow restricting announcement to a set of roles. Fix MkRoleSelectDialog only respecting publicOnly half the time
Closes #682
2025-08-11 23:53:05 +02:00
dakkar
8f7629a819 Merge branch 'stable' into stable-2025.4.4-to-develop 2025-08-02 10:34:25 +01:00
Hazelnoot
823fdf2745 merge: Fix link verification for actors without a url field *FOR STABLE* (!1193)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1193

Approved-by: Hazelnoot <acomputerdog@gmail.com>
2025-07-27 18:01:58 +00:00
Hazelnoot
84ca3621d8 fix users/report-abuse endpoint being really slow 2025-07-27 18:08:38 +01:00
Hazelnoot
2c8c422cb6 include profile URI for link verification 2025-07-27 18:03:35 +01:00
Hazelnoot
534a25ddbf fix users/report-abuse endpoint being really slow 2025-07-27 12:04:42 -04:00
Hazelnoot
07295ad62d merge: Split descriptions. (!1167)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1167

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
2025-07-27 15:29:41 +00:00
Hazelnoot
6173a827f7 merge: Deduplicate job queues (!1190)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1190

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
2025-07-27 15:28:18 +00:00
Marie
ae65642ffb merge: StreamingApiServerService: handle websocket errors from client gracefully (!1166)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1166

Approved-by: Hazelnoot <acomputerdog@gmail.com>
Approved-by: Marie <github@yuugi.dev>
2025-07-27 14:28:05 +00:00
Marie
41be003d79 merge: Slightly optimize i/update-remote-user endpoint by fetching from cache (!1185)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1185

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
2025-07-27 14:23:06 +00:00
Hazelnoot
b6c8f4f876 merge: Add more "detail" flags to API endpoints (!1186)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1186

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
2025-07-27 14:22:11 +00:00
Marie
9363842084 merge: Prevent Mastodon API error when not fetching reply or renote (resolves #1125) (!1170)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1170

Closes #1125

Approved-by: Hazelnoot <acomputerdog@gmail.com>
Approved-by: Marie <github@yuugi.dev>
2025-07-27 14:19:26 +00:00
Marie
1d9184f76e merge: lowercase username for UsedUsernamesRepository - fixes #1161 (!1173)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1173

Closes #1161

Approved-by: Hazelnoot <acomputerdog@gmail.com>
Approved-by: Marie <github@yuugi.dev>
2025-07-27 14:18:53 +00:00
Hazelnoot
6ed0033559 merge: Fix duplicate ModLog entries from admin/delete-all-files-of-a-user endpoint (!1177)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1177

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
2025-07-27 14:18:39 +00:00
Marie
a53196c407 merge: Limit chat messages based on maxNoteLength (!1188)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1188

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
2025-07-27 14:17:36 +00:00
Marie
195f1adbc9 merge: Use bucket rate limit for posts and chat messages (!1187)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1187

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
2025-07-27 14:17:14 +00:00
Hazelnoot
42807cb3fb merge: Increase rate limit (allow more calls) for import endpoints (!1184)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1184

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
2025-07-27 14:15:19 +00:00
Hazelnoot
4b29d59a9b de-duplicate import jobs 2025-07-26 19:34:58 -04:00
Hazelnoot
591c6d603f use bucket rate limit for posts and chat messages 2025-07-26 19:10:22 -04:00
Hazelnoot
b71cd6c2c8 limit chat messages based on maxNoteLength instead of hardcoded 2000 chars 2025-07-26 19:06:39 -04:00
dakkar
97e7011622 lowercase username for UsedUsernamesRepository - fixes #1161 2025-07-22 20:39:44 +01: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
2b7c74c63c include profile URI for link verification 2025-07-21 15:55:36 -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
наб
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
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
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
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
45bf8262aa
implement optional confetti on announcements 2025-07-07 20:03:28 +01:00
dakkar
c927c30567 mark grouped notifs by oldest id - sort-of fix 1139
Misskey's code does the same, but our groups behave differently enough
that this may be not the best choice

for example, let's say we have:

- notifications 1-5 for reaction to note A
- notifications 6-8 for reaction to note B
- notifications 9-12 for reaction to note A
- notification 13-19 for non-groupable events
- notification 20 for reaction to note A

and that events happened one every minute (so the last notification is
from 20 minutes ago)

client requests the most recent 10 notifications; we fetch
notifications 1-10, and reply:

- grouped id 6 for reactions 6-8 to note B
- grouped id 10 for reactions 1-5, 9-10 to note A

then the client requests 10 more notifications, untilId=10; we fetch
notifications 11-20, and reply:

- non-grouped notifications 13-19
- grouped id 20 for reactions 11,12,20 to note A

because we sort by id, and also the `createdAt` marks the _newest_
event in each group, the client will then show:

  6 reactions to note B, 6 minutes ago
  4 reactions to note A, 1 minute ago
  notifications 13-19, 13 minutes to 19 minutes ago
  3 reactions to note A, 11 minutes ago

I don't know how to make this work better ☹
2025-07-03 14:16:20 +01: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
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
Hazelnoot
d7b94e756d fix websockets not working 2025-06-26 09:32:14 -04:00