Skip to content

Console: LAN access setting and -lan flag - #1

Merged
jthy10 merged 2 commits into
mainfrom
lan-access
Oct 15, 2026
Merged

jthy10 merged 2 commits into
mainfrom
lan-access

Conversation

@jthy10

@jthy10 jthy10 commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Makes it easy to open the dashboard from a phone or another computer on the same network.

What changes

  • Settings → Use on other devices: a checkbox, off by default. When it's on, the page shows "Go to https://:8787 on any device connected to your network."
  • -lan flag turns it on and remembers the choice; -lan=false turns it off. The setting is stored in the database (lan_access).
  • Toggling it moves only the web console: it rebinds on 0.0.0.0 at the same port, with HTTPS from the self-signed certificate. Scanning keeps running and so does privilege dropping. If the new address can't be bound, it goes back to the old one. Sessions start fresh, and the browser is sent to the new URL.
  • The LAN address also appears as "Web app" under Gateway in the sidebar Network card, on the Capabilities page, and in the terminal (at startup and after each toggle).

Safety

  • You still need your own password first. The checkbox is disabled while the generated one is in use, -lan refuses to start, and a saved setting is held back with a warning.
  • -addr overrides the setting (the toggle shows as locked); -addr with -lan is an error.

Testing

No Go toolchain locally, so this relies on CI for build, vet and tests. New tests cover flag parsing, the saved setting, switching at runtime over the API, and the password rule. The UI changes haven't been checked in a browser yet.

Opening the console to other devices took -addr, a password from the
environment and -tls-self-signed. Now there's a switch under Settings
("Use on other devices") and a -lan flag; -lan=false turns it off. The
choice is stored in the database and kept across restarts.

Turning it on moves only the web console, not the scanner: it rebinds
on every interface at the same port, over HTTPS with the self-signed
certificate. If the new address can't be bound, it goes back to the old
one. Your own password is still required first. -addr overrides the
setting and can't be combined with -lan.

The address for other devices is shown under Settings, as "Web app" in
the sidebar's Network card, on the Capabilities page and in the
terminal.
Go reports a 0.0.0.0 listener as [::], so the dashboard URL came out as
https://[::1]:8787/ with -addr 0.0.0.0 or LAN access on.
@jthy10
jthy10 merged commit 73de748 into main Oct 15, 2026
5 checks passed
@jthy10
jthy10 deleted the lan-access branch October 15, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant