Commit Graph

97 Commits

Author SHA1 Message Date
modeco80
4e50106585 cvmts: replace guacamole decoder with a node native module written in rust 2024-06-19 01:36:07 -04:00
Elijah R
a4247bbcc3 Merge branch 'master' into crusttest-refactoring
yes i know this is an ugly empty merge commit, I could NOT get it to rebase without creating massive vomit
2024-06-11 14:23:57 -04:00
Elijah R
794b801628 add VNCVM 2024-06-11 13:46:24 -04:00
Elijah R
1c0ee235dd add global build script 2024-06-11 12:44:39 -04:00
Elijah R
565bf7d9b5 improve on connection logging 2024-05-27 00:10:56 -04:00
Elijah R
8add016b60 implement TCP server, reimplement maxConnections except it now kicks the oldest connection 2024-05-27 00:06:05 -04:00
Elijah R
7053973205 abstract websocket to allow additional transport layers 2024-05-26 23:19:55 -04:00
modeco80
173ee8149f auth: Make more resilant to backend failures 2024-05-26 16:33:35 -04:00
modeco80
e184bfb085 qemu: fix qmp disconnection semi properly
this is actually something i need to push to crusttest as well, because
this will affect it as well, though not as badly because it will only break certain buttons
2024-05-22 17:56:04 -04:00
modeco80
2e05504e4a hastily hand merge yellowcode vote patch thing
Co-Authored-By: yellows111 <ice_ice@email.com>
2024-05-01 08:08:43 -04:00
Elijah R
8452f8d220 nice one declan 2024-04-24 14:34:03 -04:00
modeco80
e03bf57ede .. ok, i guess one node buffer can't be moved but the other magically can. 2024-04-24 04:38:47 -04:00
modeco80
a904f26961 abstract jpeg encoding away from "WSServer"
Additionally make thumbnail encoding threadpooled as well, just so it (probably) doesn't block as much.
2024-04-24 04:18:05 -04:00
modeco80
ddae307874 chore: reformat all code with prettier 2024-04-24 03:50:17 -04:00
modeco80
bcbf7db8d9 misc patches done to get everything to play ball
also adds editorconfig
2024-04-24 03:41:32 -04:00
modeco80
db97a62046 move jpeg encoding to a worker thread pool
this also switches cvmts back to building with tsc, mostly because
I couldn't get parcel's worker interop to work at all.
2024-04-23 19:43:42 -04:00
modeco80
59d5331b68 replace dirname with a hack that should behave like before
the '@ts-expect-error' is to silence tsc just in case, since this function does in fact exist during bundling. techinically the real solution would be to declare it but /shrug
2024-04-23 10:42:36 -04:00
modeco80
cb297e15c4 Giant refactoring (or at least the start)
In short:
- cvmts is now bundled/built via parcel and inside of a npm/yarn workspace with multiple nodejs projects
- cvmts now uses the crusttest QEMU management and RFB library (or a fork, if you so prefer).
- cvmts does NOT use node-canvas anymore, instead we opt for the same route crusttest took and just encode jpegs ourselves from the RFB provoded framebuffer via jpeg-turbo. this means funnily enough sharp is back for more for thumbnails, but actually seems to WORK this time
- IPData is now managed in a very similar way to the original cvm 1.2 implementation where a central manager and reference count exist. tbh it wouldn't be that hard to implement multinode either, but for now, I'm not going to take much time on doing that.

this refactor is still incomplete. please do not treat it as generally available while it's not on the default branch. if you want to use it (and report bugs or send fixes) feel free to, but while it may "just work" in certain situations it may be very broken in others.

(yes, I know windows support is partially totaled by this; it's something that can and will be fixed)
2024-04-23 09:57:02 -04:00
modeco80
820ef05832 chore: Remove reference to "fs" dummy package
Not needed.

This will end up landing again anyways in a major refactoring job,
but for now I'm making the change here because it's a one line change.
2024-04-23 07:14:13 -04:00
yellows111
97878c51b4 add perm settings for guest voting
i'm mad that this wasn't thought about
2024-04-22 17:42:07 -04:00
modeco80
28dddfc363 fix registered users' ability to bypass automute
ditto... oops.
2024-04-22 08:40:25 -04:00
NonameVM
223ff614d1 Add Admin Opcode 25 : Send Server Messages (#19)
* Add Admin Code 25 : XSS Message As Server (why?)

Added the ability to send messages from the server name (without username), with XSS. 
Accepts 1 string argument : message text

* remove redundant switch statement and add check for msgArr length

---------

Co-authored-by: Elijah R <62162399+elijahr2411@users.noreply.github.com>
2024-04-11 13:40:04 -04:00
Elijah R
5d4f9b472e add license 2024-04-11 12:04:40 -04:00
Elijah R
0c3d482e82 reject logins before user connects to node 2024-04-08 19:23:44 -04:00
Elijah R
0821ac89e8 - move auth announcement to on socket open
- don't send system message to a user without a username since it was likely an automated attempt by the webapp
2024-04-08 19:23:44 -04:00
Elijah R
f89492cfcd Implement account authentication (server) 2024-04-08 19:23:44 -04:00
Elijah R
b815bf8874 detect fake origin headers 2024-03-31 13:36:55 -04:00
Elijah R
05e5ea44a0 Remove all instances of ts-ignore (#10)
Co-authored-by: Elijah R <elijah@computernewb.com>
2024-03-31 13:36:28 -04:00
Elijah R
73ab61ffaf Don't allow login if the user has no username 2024-02-07 10:50:58 -05:00
dakrk
0b0c0a5ed6 Handle ban command arguments as array
This provides a much more reliable way to handle arguments with spaces,
such as usernames.

The ban process's stdout and stderr are now redirected to the server,
in case they have output that would be good in the server's logs.
2023-10-22 15:42:39 +01:00
MDMCK10
43fddbc521 Various bug fixes and small additions
IMPORTANT:
This commit contains new config options.
Make sure your local config file is up to date with config.example.toml to avoid issues.

CHANGELOG:
- Fix crash exploit caused by abnormally long WebSocket messages
- Added config option for limiting the maximum amount of active connections from the same IP
- Made per-IP turn limiter configurable
- Fixed an issue where vote updates were not sent to clients in some cases
- Added warning about using qmpSockDir on Windows hosts
- Updated dependencies
- Removed unused code/imports
2023-09-12 00:25:57 +02:00
Elijah
d80d2c8ed9 don't send resolution changes to non-staff while screen hidden 2023-09-02 18:08:41 -04:00
Elijah
1cf2c4830f add hide screen opcode 2023-09-02 17:54:44 -04:00
Elijah
0814d9c3ed bump to es2022 2023-09-02 17:53:53 -04:00
Elijah
bae17c6a52 add turn whitelist and password support 2023-06-05 21:59:37 -04:00
Elijah
1cb19e93f9 no need to use a primitive splitting method when execa has it built in. Fixes a bug on windows when the path to QEMU has spaces 2023-06-05 21:59:16 -04:00
MDMCK10
ababbf57b5 Add (optional) Origin header check 2023-05-25 15:59:16 +02:00
MDMCK10
c66bd6d2ee We don't need that to be there anymore 2023-05-06 16:50:25 +02:00
dakrk
3f753c60da Trim usernames
Previously it was possible to "impersonate" (to those not looking closely) other users by putting whitespace before or after the name of choice. This commit eliminates that.
2023-05-06 15:21:18 +01:00
dakrk
41bf76ab0d Configurable chat history length
The previous default of 5 messages is utterly lame and didn't provide enough context to anything, and was also a downgrade from the old server as that had 10 messages by default (of which we're now going back to with this change).
2023-05-01 15:03:14 +01:00
MDMCK10
b7cba2f572 Change rename ratelimit to 3/60s 2023-04-27 16:30:28 +02:00
MDMCK10
dcee5bd157 We don't need that. 2023-04-07 20:36:56 +02:00
MDMCK10
432b8204f1 Let's try this again. 2023-04-06 21:59:37 +02:00
MDMCK10
3f2c814f1b Maybe not.
This commit reverts 31706c7, 983860f, 90b91bc.
2023-04-06 21:11:27 +02:00
MDMCK10
31706c7b93 fix small bug 2023-04-06 12:38:25 +02:00
MDMCK10
983860ff02 I hate race conditions 2023-04-05 20:34:15 +02:00
MDMCK10
90b91bc0e4 No more QMP deadlocks? It's more likely than you think. 2023-04-05 19:33:25 +02:00
MDMCK10
ef2e226803 Only allow one active turn per IP address 2023-04-05 17:04:21 +02:00
MDMCK10
a57e299988 Fix stupid bug 2023-03-30 20:30:07 +02:00
MDMCK10
7c62a3414a New opcode: view 2023-03-28 18:13:43 +02:00