Repository navigation
Feat/desktop in container - #5
Conversation
xtask is a workspace member, so cargo must load its manifest even when building only cve-server.
Dockerfile.desktop builds the Tauri app on Linux and runs it on Xvfb, served to the browser through x11vnc + noVNC on 127.0.0.1:6080. Lets people use the GUI without installing it on the host. - Own ignore file: the default .dockerignore drops the UI and icons. - LTO off for this image: the fat-LTO link OOMs a 6 GB Podman VM.
Fazmin
left a comment
There was a problem hiding this comment.
Thanks for putting this together! Being able to try the desktop app in a throwaway container is a really nice option while the builds still aren't signed, and good catch on the headless Dockerfile. It's been broken since xtask joined the workspace, so that fix alone is worth having.
There's one thing I'd like changed before I merge: x11vnc runs with -nopw. Publishing on 127.0.0.1 keeps it off the network, but websockify doesn't check the Origin header. Any web page open in the same browser can open a WebSocket to ws://127.0.0.1:6080 and drive the app, and the app has the API keys from .env loaded. The same is true for anyone on the LAN if someone leaves the 127.0.0.1: off the -p flag. Could the container generate a random VNC password at start-up (or take one from something like VNC_PASSWORD) and print it to the log? noVNC prompts for it, so it's only one extra step for whoever's using it. A line in the README about it would be great too.
One small thing, not blocking: if Xvfb fails to start, the until [ -e /tmp/.X11-unix/X99 ] loop spins forever without saying anything. A timeout with an error message would make that much easier to debug.
Happy to merge once the password is in. Thanks again!
websockify skips Origin checks, so with -nopw any page open in the browser could drive the app over ws://127.0.0.1:6080. Use VNC_PASSWORD if set, otherwise generate one and print it to the log. - Fail after 10s with an error if Xvfb never creates the display.
|
Hello @Fazmin, Pushed in d12a16b:
I tested it with the full image. Over the WebSocket on 6080, sent with a foreign Origin header, the server only offers password login. A wrong password is rejected and the logged one is accepted. I also made Xvfb fail on purpose, and the container exits after 10 seconds with the error message. Let me know if you'd like anything else changed. |
|
Merged! Thank you so much for this, and for testing it so thoroughly with the full image and a foreign Origin. It's a really nice way for people to try the app safely. Thanks again! |
Summary
Adds
Dockerfile.desktopso you can try the desktop app without installing it: it runs in a container and you use it from the browser over noVNC at127.0.0.1:6080. The builds aren't signed yet, so I wanted to test it in a sandbox first. Also fixes the headlessDockerfile, which wasn't copyingxtaskand so failed before building anything.Type of change
Related issue
Closes #
Testing
cargo test -p cve-core -p cve-server)cargo test -p cve-core -p cve-serverandcargo check -p cve-intel-desktopAPI keys
.env.examplewith instructionscrates/cve-core/src/sources.rs) and README.mdChecklist
cve-core; adapters (MCP/REST/CLI/Tauri) stay thin