Repository navigation
Console: LAN access setting and -lan flag - #1
Merged
Merged
Conversation
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.
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.
Makes it easy to open the dashboard from a phone or another computer on the same network.
What changes
-lanflag turns it on and remembers the choice;-lan=falseturns it off. The setting is stored in the database (lan_access).0.0.0.0at 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.Safety
-lanrefuses to start, and a saved setting is held back with a warning.-addroverrides the setting (the toggle shows as locked);-addrwith-lanis 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.