fix: clipboard HTTP fallback + direct mDNS PTR query (no avahi-daemon) - #75
Merged
Merged
Conversation
## Clipboard copy over HTTP navigator.clipboard.writeText() requires a secure context (HTTPS or localhost). Home-lab deployments on http://192.168.x.x:8000 silently got nothing. Added copyViaExecCommand() helper as a fallback in both Layout.tsx and SettingsPage.tsx — tries Clipboard API first, falls back to textarea + execCommand on non-secure contexts. ## mDNS hostname resolution in container avahi-resolve is a D-Bus client; it delegates to avahi-daemon via /run/dbus/system_bus_socket, which is not mounted inside the container. Works on the host but never resolves from inside Docker regardless of network_mode: host. Replace _avahi_resolve() with _mdns_ptr_query(): sends a raw DNS PTR query directly to the mDNS multicast group (224.0.0.251:5353) over UDP. No daemon, no D-Bus, no system config — just a socket on the host network namespace. Handles compression pointers, QU unicast responses, and all socket errors gracefully. Also removes avahi-utils from the Dockerfile (no longer needed). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Two bugs fixed
1. Version copy silently fails on HTTP
navigator.clipboard.writeText()is HTTPS/localhost-only. Home-lab users onhttp://192.168.x.x:8000clicked the version badge and got nothing.Fix: Added
copyViaExecCommand()helper inLayout.tsxandSettingsPage.tsx. Tries the Clipboard API first; falls back totextarea + execCommandon non-secure contexts.2. mDNS hostname resolution never worked in Docker
avahi-resolveis a D-Bus client — it callsavahi-daemonvia/run/dbus/system_bus_socket, which is not mounted in the container. Works on the host, always silent-fails inside Docker regardless ofnetwork_mode: host.Fix: Replaced
_avahi_resolve()with_mdns_ptr_query():224.0.0.251:5353over UDPavahi-utilsfrom the Dockerfile (no longer needed)Testing