Commit Graph

38 Commits

Author SHA1 Message Date
dependabot[bot]
4ace8ef04e Bump ws from 8.16.0 to 8.17.1
Bumps [ws](https://github.com/websockets/ws) from 8.16.0 to 8.17.1.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/8.16.0...8.17.1)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-30 14:20:32 -04:00
modeco80
432e75d42a cvmts: Use npm versions of superqemu/nodejs-rfb.
We publish them now, so let's use them in cvmts!

Additionally, this removes the 'shared' module entirely, since it has little purpose anymore. The logger is replaced with pino (because superqemu uses pino for logging itself).
2024-07-16 08:29:52 -04:00
modeco80
e28bb3a9d7 remove connect/view gating (for now) 2024-07-11 20:49:49 -04:00
modeco80
ddf4d97511 qemu: more refactoring
qmp client is now much more robust (and doesn't fight over itself as much). this should
hopefully completely eliminate the case where display connects but qmp is half connected.

i also forgot QemuDisplay actually emits an event on connection, so we can just use that to
wait for when the display connects. which allows us to set the started state there instead of praying
when the qmp client connects that we are connected to the display roughly at the same time.

i also gated some stuff to require vm state in the server. this is a bit rickity, but does seem to work.
2024-07-11 20:33:50 -04:00
modeco80
25b32b23b7 qemu: More fun refactoring
The QMP client has been refactored slightly, mostly just to clean up its
edges slightly.

QemuVM however has seen a big refactor, especially connecting to QMP.
Flattening out this logic is something I should have done a long time ago.

This seemingly has finally hammered out the bugs, although time will tell.
2024-07-11 03:24:22 -04:00
modeco80
227a171110 qemu: Completely rewrite QMP client from scratch
It sucked. The new one is using Sans I/O principles, so it does not
directly do I/O or talk to a net.Socket directly (instead, QemuVM implements
the layer to do I/O). This means in the future this library could actually
be tested, but for now, I'm not bothering with that.

There's also some other cleanups that were bothering me.
2024-07-10 22:20:12 -04:00
modeco80
048f08b00b actually make vm swich displays properly or whatever 2024-07-10 18:43:35 -04:00
modeco80
bee25b5381 Fix the ability for IPData refcount to go negative 2024-07-10 18:32:05 -04:00
Elijah R
a2f450b374 move binprotocol to submodule (server) 2024-06-25 21:24:08 -04:00
Elijah R
3384e47e20 use msgpackr instead of @ygoe/msgpack 2024-06-25 20:09:34 -04:00
Elijah R
fe830afdeb add support for binary JPEG (server) 2024-06-25 19:56:28 -04:00
modeco80
2cc2c6ddf2 cvmts: "fix" panics in cvm-rs 2024-06-23 02:55:05 -04:00
Elijah R
1a5a0cd407 add geoip country flag support 2024-06-23 02:24:03 -04:00
Elijah R
85a86327f4 add missing XFF warning, remove ipdata check from WSServer because CollabVMServer already does that 2024-06-23 02:24:03 -04:00
modeco80
dda72cad91 cvmts: quth => auth 2024-06-22 21:27:28 -04:00
modeco80
09d41617ed prettier reformat for merge (and remove jpeg-turbo Again) 2024-06-22 21:26:49 -04:00
modeco80
b8ed177885 cvm-rs: merge guac and jpeg libs together into one
doesn't really need to be two seperate libraries. also preperation for other funnies

the build script has been replaced with a much saner justfile which uses much saner "yarn workspace" invocations instead of blindly cding all over the place
2024-06-22 21:14:05 -04:00
modeco80
87a377a10f cvmts: replace jpeg-turbo native module with new rust module
This module also does threadpooling internally, so we don't need Piscina anymore (which I'm pretty sure was actually bottlenecking.)
2024-06-20 03:20:56 -04:00
modeco80
39521a4b1d misc stuff from production
(also refactors qemu a bit)
2024-06-19 23:30:29 -04:00
modeco80
97de887518 cvmts: Actually unref ipdata on disconnect 2024-06-19 18:26:27 -04:00
modeco80
fa23aa7432 cvmts: nope I have to fix it properly 2024-06-19 18:20:41 -04:00
modeco80
e798ff5c86 bandaid fix time 2024-06-19 18:16:16 -04:00
modeco80
0d34bb1c8e cvmts/qemu: support snapshots properly 2024-06-19 18:03:10 -04:00
modeco80
b485e7f689 cvmts: reimplement connection limit using ipdata 2024-06-19 17:56:55 -04:00
modeco80
4e50106585 cvmts: replace guacamole decoder with a node native module written in rust 2024-06-19 01:36:07 -04:00
Elijah R
794b801628 add VNCVM 2024-06-11 13:46:24 -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
2e05504e4a hastily hand merge yellowcode vote patch thing
Co-Authored-By: yellows111 <ice_ice@email.com>
2024-05-01 08:08:43 -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