Repository navigation
Optional desktop app for running the server - #6
Merged
Merged
Conversation
main.rs held every step from the snapshot store to the graceful stop. A second binary could not reuse any of it. `server.rs` now holds it. `Server::start` restores rooms, spawns the snapshot writer and the autopilot, and binds the listener. `run_until` serves until its future resolves, then closes every socket and writes pending snapshots. A failed start returns a `StartError` rather than exiting. The CLI still prints the Docker ownership hint and exits on a bad state directory. A window can show the error and let the operator try again. A stop now aborts the snapshot writer and the autopilot, so a process that starts the server twice does not keep the first pair running. `addr` reports the bound port, which matters when the caller asks for 0. The missing-token warning drops the flag name, since a window has no flags. Made-with: Bunny
`simple-confidence-monitor-gui` runs the server from a window, for an operator who does not want a terminal. It sits behind the `gui` Cargo feature, so the default build, the static Linux builds and the Docker image pull in none of it. The window sets the port, the bind address, the token, the state directory and mDNS. It starts and stops the server. It lists each room with its viewer and console counts, and opens the stage display, the console or the agenda in the default browser. A console link carries the token. A log panel shows the last 2,000 lines. It uses egui through eframe 0.35. eframe 0.36 needs Rust 1.95, and the documented minimum is 1.94. egui keeps the app in Rust and in one build. The data it shows is already in the `Hub`. Tauri would show the console in a window, which a browser already does. The app remembers every field except the token, so the token never sits in a plain file. Closing the window, or Ctrl-C from a terminal, stops the server gracefully, and pending snapshots land first. A release build on Windows opens no console window. `make gui` runs it, and `make lint` now lints it too. Made-with: Bunny
The test job runs clippy with the `gui` feature. A new `build-gui` job builds a release binary for x86_64 Linux (glibc), Apple Silicon macOS and x86_64 Windows, and uploads each one as a run artifact. Linux needs the X11 and xkbcommon headers that eframe lists, so both jobs install them first. A release does not ship the desktop app yet. The new matrix stays out of the ci.yml and release.yml sync check, which compares only the CLI build matrix. Made-with: Bunny
operations.md gains a section for the desktop app. It covers which flag each field stands for, what the app remembers and where, and what closing the window does. The README shows how to build it and links there. architecture.md describes `server.rs` and the app. development.md adds both to the layout, the Linux build headers, `make gui`, and the second clippy pass. release.md lists the new CI checks. Made-with: Bunny
A bare binary opens in Terminal on a double click. `bundle.sh` in `packaging/macos` wraps the binary in `Simple Confidence Monitor.app`. It stamps the crate version into `Info.plist`, then signs the bundle ad hoc. The linker signs only the binary, so Info.plist sits outside its seal. Signing the bundle as a whole covers both. A downloaded copy is still not notarized, so Gatekeeper blocks it until its quarantine flag is cleared. `make app` builds the release binary and the bundle into `target/release`. Made-with: Bunny
Each `build-gui` artifact now opens with a double click. macOS uploads the `.app` and Windows uploads the `.exe`. Linux uploads a `.tar.gz`. upload-artifact drops file modes, so the Linux binary and the executable inside the `.app` would arrive without their execute bit. The `.app` is zipped with `ditto`, which keeps the modes and the bundle signature, and Linux uses tar. A Windows `.exe` needs no mode, so it goes up as is. Made-with: Bunny
operations.md lists what each CI artifact holds, and how to clear the quarantine flag that keeps Gatekeeper from opening a downloaded copy. The README and development.md add `make app` and the packaging folder. release.md says how CI packages each build. Made-with: Bunny
The app showed the generic icon everywhere. `packaging/icon/icon.svg` is now the single source. It is a stopwatch on a blue tile, with a crown at the top. The ring runs green for the first 75%, amber for the next 15% and red for the last 10%. Navy cuts mark each color change, and the hand points into the red. `make icons` renders the SVG through Quick Look, because ImageMagick's own SVG renderer drops gradients and strokes. It writes the macOS `AppIcon.icns`, the Windows `app.ico` and a 256 px PNG. The generated files are committed, so a build needs neither tool. Each platform gets the icon its own way. The `.app` bundle carries the `.icns`. On Windows, `build.rs` uses `winresource` to embed the `.ico` in the executable. The window gets the PNG through eframe, which sets the title bar and taskbar icon on Linux and Windows. winresource is an optional build dependency behind the `gui` feature, so the CLI build does not pull it in. Made-with: Bunny
development.md adds `make icons`, build.rs, and the icon and Windows folders under packaging to the layout. Made-with: Bunny
`LogBuffer::append` asked the window to repaint while it still held the log lock. Anything that logs from inside that call would take the same std mutex again on the same thread, which hangs the app. Nothing was seen to hang, but the window toolkit owns that path, not this code. The append now copies the window handle under the lock, releases the lock, then asks for the repaint. Made-with: Bunny
The desktop app's own logic had no tests. The log buffer now has tests for a line split across writes, several lines in one write, the 2,000-line cap and clear. percent_encode has tests for unreserved characters, query delimiters and non-ASCII text. They sit in the binary rather than under tests/, because a binary's modules are out of reach of an integration test. `make test` runs them. Made-with: Bunny
The Test step runs the library and its integration tests only. A new step runs the tests inside the desktop app binary, with the gui feature on. Made-with: Bunny
A server with no token, bound to an address other machines can reach, lets anyone on the network control every room. The only sign was one log line, which scrolls away. The status bar now says so in amber for as long as the server runs that way, and says how to fix it. Binding to this computer only does not raise the warning, since nothing off the machine can reach the server. Made-with: Bunny
The CLI ships for Intel Macs, so the desktop app gets the same target. The macOS runner cross-compiles to x86_64-apple-darwin and bundles the result into its own zipped .app. Made-with: Bunny
The README puts the log and picker paragraph back after the Docker setup it describes, ahead of the desktop app. operations.md lists the Intel Mac artifact and the amber warning the window shows while it serves the network without a token. release.md adds the app's unit tests and the second macOS build to the CI checks. Made-with: Bunny
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An optional desktop app runs the server from a window. It sets the port, the
token, the state directory and mDNS. It starts and stops the server, lists
rooms with their connected screens, and shows the log. It sits behind the
guiCargo feature, so the CLI, the static Linux builds and the Docker image do not
change.
What changed
server: startup and shutdown move out ofmain.rsintoServer::startandrun_until, which both binaries share. A failed startreturns a
StartErrorinstead of exiting. A stop also ends the snapshotwriter and the autopilot, so the app can restart on another port.
bin/gui: the egui app, on eframe 0.35. eframe 0.36 needs Rust 1.95, and thedocumented minimum is 1.94. The app remembers every field except the token.
Closing the window or Ctrl-C stops the server the same way Ctrl-C stops the
CLI. While the server is open to the network with no token, an amber warning
shows under the status line.
packaging:make appbuilds a signedSimple Confidence Monitor.app.icon.svgis the source for every icon file.make iconsrebuilds the.icns, the.icoand the window PNG from it, andbuild.rsembeds the.icoin the Windows.exe.clippyand the unit tests run over the app. A newbuild-guijobbuilds it for Linux, macOS on Apple Silicon and Intel, and Windows. Each
build uploads as an artifact you can open with a double click: a zipped
.app, the.exe, or a.tar.gzon Linux.Why
An operator on a venue laptop should not need a terminal to run a show. The
browser screens stay where they are. The app opens them in the browser rather
than drawing its own console.
egui won over Tauri because the app is a control panel for the server, and its
data already lives in Rust. Tauri's main gain would be the console in a
window, which the browser already does. Per-change rationale is in the commit
bodies.
How it was tested
make lintis clean on Rust 1.94 and 1.97.1, with and withoutgui.make testis clean: 369 Rust tests, including the newtests/server.rsand the app's unit tests, and 115 JavaScript tests.
console counts matched.
.appthroughopenand quit it with a quit Apple Event.codesign --verify --deep --strictpasses on both the Apple Silicon and theIntel bundle.
Not covered yet
build-guijobs, and of the Windows icon embedding.
release.yml sync check until it does.
.appis not notarized.docs/operations.mdgives thecommand that clears its quarantine flag.
Bunny helped with this PR and is one step closer to world domination...