Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #986 +/- ##
==========================================
+ Coverage 41.41% 41.47% +0.06%
==========================================
Files 134 134
Lines 12321 12334 +13
==========================================
+ Hits 5103 5116 +13
Misses 6672 6672
Partials 546 546 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates tray-mode startup behavior to enforce a single running instance, expose LAN-reachable URLs when binding wildcard hosts, and make the UI use same-origin API calls for wildcard bindings.
Changes:
- Default HTTP binding changes from
localhostto wildcard/empty host. - Tray mode now computes reachable URLs, logs them, and attempts single-instance handling on Unix/Windows.
- UI config injection now returns a relative API base for wildcard hosts and adds tests for URL generation.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
internal/controller/httpapi/ui.go |
Adds wildcard host detection and API base URL construction via net.JoinHostPort. |
internal/controller/httpapi/ui_test.go |
Adds tests for API base URL generation. |
config/config.go |
Makes HTTP_HOST optional and defaults it to wildcard binding. |
config/config_test.go |
Updates default host expectation. |
cmd/app/tray.go |
Adds reachable URL discovery, tray startup logging, and single-instance invocation flow. |
cmd/app/tray_windows.go |
Adds named-mutex based single-instance handling and browser/message surfacing. |
cmd/app/tray_unix.go |
Adds flock-based single-instance handling and lock FD inheritance across re-exec. |
cmd/app/tray_test.go |
Adds tray helper tests for wildcard hosts and virtual interface filtering. |
.env.example |
Documents empty HTTP_HOST as binding all interfaces. |
Comments suppressed due to low confidence (2)
cmd/app/tray.go:49
- The PR description says the tray menu enumerates every reachable URL, but this still passes only
primaryURLintotray.Config, whose menu renders a single status/open URL. The startup log lists all URLs, but the tray UI does not expose the additional LAN addresses.
trayManager := tray.New(tray.Config{
AppName: "DMT Console",
URL: primaryURL,
Headless: isHeadlessBuild,
cmd/app/tray_windows.go:36
- If creating the named mutex fails, the function returns and startup proceeds without single-instance protection, so duplicate tray processes can still race on the HTTP port. Treat mutex creation failures as startup errors or provide a fallback rather than silently disabling the guard.
handle, _, lastErr := createMutex.Call(0, 0, uintptr(unsafe.Pointer(namePtr)))
if handle == 0 {
return
A second invocation now detects the running instance via a per-user flock (Unix) or named mutex (Windows), opens the existing tray's URL in the browser, and exits cleanly rather than racing on port 8181. The lock FD is inherited across the background re-exec so it survives parent exit. Default HTTP_HOST changes from "localhost" to wildcard so the tray is reachable from other devices on the LAN. The tray menu and startup log enumerate every routable IPv4, filtering virtual bridges (docker, veth, br-, tun/tap, virbr, vmnet, vboxnet, wg, zt, awdl, llw) and deduping. When bound to a wildcard, the UI's injected ##CONSOLE_SERVER_API## resolves to a relative URL so same-origin fetches match the user's actual host/SNI. Refs: Package Console as an installer #870
graikhel-intel
approved these changes
May 18, 2026
|
🎉 This PR is included in version 1.27.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
5 tasks
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.
A second invocation now detects the running instance via a per-user
flock (Unix) or named mutex (Windows), opens the existing tray's URL
in the browser, and exits cleanly rather than racing on port 8181.
The lock FD is inherited across the background re-exec so it survives
parent exit.
Default HTTP_HOST changes from "localhost" to wildcard so the tray
is reachable from other devices on the LAN. The tray menu and
startup log enumerate every routable IPv4, filtering virtual bridges
(docker, veth, br-, tun/tap, virbr, vmnet, vboxnet, wg, zt, awdl,
llw) and deduping.
When bound to a wildcard, the UI's injected ##CONSOLE_SERVER_API##
resolves to a relative URL so same-origin fetches match the user's
actual host/SNI.
Refs: Package Console as an installer #870