Commit graph

32770 commits

Author SHA1 Message Date
bunnybeam
ec62953224
throw error when creating too many dialog announcements by updating one 2025-07-23 20:46:13 +01:00
Hazelnoot
f70a3469bd fix error in UserSuspendService.freezeAll and UserSuspendService.unFreezeAll caused by TypeORM bug 2025-07-23 15:45:32 -04:00
bunnybeam
c811f3a9b9
add check to prevent creating too many dialog announcements 2025-07-23 18:40:15 +01:00
dakkar
ed26a7723e update translation index 2025-07-23 14:22:22 +01:00
dakkar
ab7fd2a7b0 allow editing trustedDomains and sync across devices 2025-07-23 14:22:22 +01:00
dakkar
df0f682518 make trustedDomains persist across reloads
we can't just write to `prefer.s.*`, we need to `.commit`

also, there's no need to use the reactive view (`prefer.r.*`) in
non-reactive contexts
2025-07-23 10:46:01 +01:00
dakkar
ab8d58ee5a link from README to the new contribution guidelines 2025-07-23 09:29:31 +01:00
dakkar
97e7011622 lowercase username for UsedUsernamesRepository - fixes #1161 2025-07-22 20:39:44 +01:00
Hazelnoot
63bac24ece allow HTTP connections to private IPs 2025-07-21 16:16:33 -04:00
Hazelnoot
fba171840f refactor actor validation to reduce code duplication 2025-07-21 16:16:33 -04:00
Hazelnoot
8107f7f576 move CaptchaError to a separate file to avoid circular import errors 2025-07-21 16:16:33 -04:00
Hazelnoot
f1038c42e8 add comment about validation in verify-field-link.ts 2025-07-21 16:16:33 -04:00
Hazelnoot
255ecd8427 remove unused console logging fallbacks 2025-07-21 16:16:33 -04:00
Hazelnoot
637fa254e5 use logger instead of console for uncaughtException debug lines 2025-07-21 16:16:33 -04:00
Hazelnoot
b38351e28a add workarounds for node-fetch crashes 2025-07-21 16:16:33 -04:00
Hazelnoot
1758b5b3be fix URL errors from incorrect validation in validateActor 2025-07-21 16:16:33 -04:00
Hazelnoot
48fa42b362 re-use parsed URI in validateActor 2025-07-21 16:16:33 -04:00
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
c190dfa6bc fix incorrect error logging in UrlPreviewService 2025-07-21 15:56:17 -04:00
Hazelnoot
ec44c44ca4 fix incorrect error logging in ApPersonService 2025-07-21 15:56:17 -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
Hazelnoot
5a10298896 merge: Implement optional confetti on announcements (!1156)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1156

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Hazelnoot <acomputerdog@gmail.com>
2025-07-21 14:58:29 +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
Vavency
8864269d7c [frontend] SkModPlayer Minor cleanup
Hide the shame of webkit.
2025-07-17 21:36:26 +03:00
bunnybeam
184d116632
add docstrings for components beginning with Sk, along with DynamicNotes 2025-07-17 17:38:45 +01:00
Vavency
30316e543c [frontend] SkModPlayer CSS adjustment. 2025-07-17 19:17:13 +03:00
Vavency
13b22cb70b [frontend] SkModPlayer change number row from maxHeight to height to fix early clipping. 2025-07-17 18:50:14 +03: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
Vavency
9dbd2a6bb4 Merge branch Sharkey:develop into trackeropt 2025-07-17 15:04:33 +00:00
Vavency
4ae3d7453b [frontend] SkModPlayer fix togglePattern not properly skipping optimizations. 2025-07-17 18:02:10 +03:00
Vavency
d61b1e2910 [frontend] SkModPlayer fix toggleVisible completely breaking display. 2025-07-17 14:34:51 +03:00
Vavency
89d396b491 [frontend] SkModPlayer better handling of different display sizes. 2025-07-17 13:43:49 +03:00
Vavency
dfc2e2a9a7 [frontend] SkModPlayer implement webkit scroll hack. 2025-07-17 13:10:04 +03:00
Vavency
046cb125f2 [frontend] SkModPlayer stop a potential infinite nextTick recursion. 2025-07-16 22:19:27 +03:00
Vavency
912f5eb44b [frontend] SkModPlayer fix currentColumn not updating. 2025-07-16 22:08:39 +03:00