Repository navigation
Add a slow wide sweep of loopback ports outside the watched range - #14
Merged
Merged
Conversation
A supervised Sweeper walks 127.0.0.1 ports 1-65535 apart from the main scan, skipping the watched range and the dashboard port. It probes 32 ports per batch, 4 at a time, pauses a second between batches, and waits an hour between passes. Findings record TCP or HTTP status and the listener's process name; no screenshots are taken. The HTTP probe now reports :tcp_only for listeners that answer neither HTTP nor HTTPS, and treats a loopback self-connection as closed. An "Other ports" panel at the bottom left shows progress, the next pass and the ports found, with a switch that stops or restarts the sweep at once. The switch is saved in its own `sweep` file, on by default. The updater's smoke instance keeps the sweep off. CLAUDE.md, AGENTS.md and the README describe the new boundary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts resolved in favor of the redesign: scan progress keeps its scan-strip styles and the render tests use render_assigns, now with the sweep assigns. The Other ports panel now uses the redesign's tokens and badges. On desktop the collapsed chip sits at the foot of the rail, which reserves room for it, and opens into a card above it. Below 760 px it is in the page flow before the footer, so it never covers content. Escape closes the open panel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sweeper started each batch with Task.Supervisor.async_nolink, so when the sweeper stopped, a batch in flight kept probing. In tests it outlived its recorder and crashed. The sweeper now traps exits and shuts down the running batch in terminate/2. The sweeper tests are now deterministic. The findings test sweeps 5 ports instead of 931. The pacing test uses a 60 s pause instead of racing a 200 ms one. The probe recorder is supervised, so ExUnit stops it after the sweeper. A new test checks that stopping the sweeper stops its probes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
What
A background wide sweep finds services outside the watched range (for example 8080 or 64xxx), plus a small Other ports panel at the bottom left with an on/off switch.
LocalWebMonitorex.Sweeper: a supervised GenServer, separate fromMonitor/Scanner. It walks127.0.0.1ports 1–65535, skipping the watched range and the dashboard port. It probes 32 ports per batch with at most 4 concurrent probes and a 4 s timeout per probe, pauses 1 s between batches, and waits 1 h between passes. The first pass starts 1 min after boot. Probing runs in aTaskSupervisortask, so the GenServer always answers. Measured locally: ~24 ports/s, so a full pass takes ~45 min, and the dev BEAM stayed at ~0.2% CPU.Sweeper.Finding) record whether a port answers HTTP (scheme, status, title) or only TCP, plus the listener's process name fromProcessInspector(onelsof/pscall per batch that found something). No screenshots.PortProbegains a:tcp_onlyresult.PortProbe.Httpreturns it for listeners that answer neither HTTP nor HTTPS. It now also treats a loopback self-connection (source port == target port, which can happen when sweeping the ephemeral range) as closed, so no phantom ports show up.Scannerstill ignores everything but{:ok, service}.Settings.read_sweep/save_sweep, stored ason/offin~/.config/localwebmonitorex/sweep(override:LOCALWEBMONITOREX_SWEEP_CONFIG). It is validated before writing, and a missing or invalid file means on. It defaults to on because the owner asked for this, and the rate is fixed, low and loopback-only.Sweeper.set_enabled/1saves the switch and applies it at once: turning it off kills the running batch and clears findings, and turning it on starts a pass immediately, without a restart.LocalWebMonitorexWeb.SweepPanel): a collapsed chip ("Other ports", count, % or next time, "Off") expands into progress or the next pass time, the list of found ports (HTTP status or TCP, process name, open link for HTTP), and therole=switchtoggle. + prefills the watched-range form to cover that port and opens Settings without saving anything.offto its throwawaysweepfile.CLAUDE.md,AGENTS.mdand the README describe the new boundary. The main scan still probes only the watched range.Sweeperis the single approved exception, and it stays loopback-only, paced and switchable. The endpoint stays on127.0.0.1.Validation
settings_test,port_probe/http_test, newsweeper_test(exclusion, TCP/HTTP plus process names, pacing between batches, pass interval, closed ports dropped, off stops immediately and on restarts, off at start) anddashboard_live_sweep_test(collapse/expand, list, toggle persists, the + hint does not save).mix test(92 tests after the sync, 0 failures),mix format --check-formatted,mix compile --warnings-as-errors,node --test assets/js/theme.test.mjs,test/shell/update_from_main_test.sh.PORT=4105with a scratch sweep file, at 1440 px and 375 px in light and dark: no horizontal overflow (scrollWidth == 375), 44 px touch targets on mobile, switch exposed asswitch "Wide sweep", no console errors. The only console warnings were preview captures, because this worktree has nonode_modules. Screenshots were not committed.Notes
mainafter Redesign the overview around scan status and honest limits #11 (merge5511181). The panel uses the redesign tokens and.badgestyles. On desktop the collapsed chip sits at the foot of the rail, which reserves 92 px for it, and opens into a card above. Below 760 px it sits in the page flow before the footer, so it never covers content. Escape closes it. Re-checked in WebKit at 1440, 900 and 375 px, light and dark. The page has no horizontal overflow, and the chip does not overlap the rail card or the footer. There were no console errors.~/.config/localwebmonitorex/with the installed instance. Toggling the sweep in dev writes the sharedsweepfile unlessLOCALWEBMONITOREX_SWEEP_CONFIGis set.🤖 Generated with Claude Code