Commit Graph

29 Commits

Author SHA1 Message Date
modeco80
072fd06918 cvmts: fix display event handler duplication
By only adding event handlers when the display is first lazily initalized.
2024-09-19 04:11:25 -04:00
modeco80
210e36f430 cvmts: fix memory leak
javascript blows chunks
2024-09-12 13:11:12 -04:00
modeco80
b66810a227 it is nullable now so this comment doesn't make sense anymore 2024-08-23 07:29:32 -04:00
modeco80
e839f7f5aa better display/vm stuff
- moved superqemu's "QemuDisplay" here; the VNC VM and Qemu both share it (and it has been renamed to a less goofy dumb name)

- VNC VM has been heavily refactored to just use the VNC display we have (this means only one source of truth, less bugs, and it's generally just Better to share the code imho). this means that future plans to abstract this further (or implement the client in cvm-rs in general) won't cause any explosions, or require duplicate effort

- vms are now in src/vm/... just better organization

- superqemu doesn't manage a display anymore (or care about it, other than making sure the socket is unlinked on stop). Instead now it provides info for us to setup our own VNC client. This is also why we provide our own shim interface

This currently relies on a alpha version of superqemu.

Before this is merged into cvmts main I will publish a stable tag and point cvmts to that new version
2024-08-23 07:26:23 -04:00
modeco80
a521f4c873 Queue rect updates for each frame (and.. maybe? do rects in parallel)
both superqemu and vncvm have supported this but I never did it for some reason. its noticably faster than before. testing seems to imply that its actually slightly faster without the batcher enabled (maybe because it's actually able to split the work now if I had to guess)
2024-08-20 01:05:44 -04:00
Elijah R
2b50d4c834 fix turn passwords when auth is enabled 2024-08-09 22:38:32 -04:00
Elijah R
64d4774d00 chore: comment config.example.toml and format code with prettier/cargo 2024-08-04 15:50:00 -04:00
Elijah R
b0c23c3cdf Add internal banning (cvmban) using MySQL 2024-08-04 15:32:43 -04:00
Elijah R
11380f00cf unfuck vncvm 2024-08-01 18:13:06 -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
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
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
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