gui, lib/api: Use effective listen address for no auth warning

This adds a field `guiAddressUsed` to the system status response, that
holds the current listening address actually in use. This may be
different from the one stored in the config because it may have been
overridden by environment or command line flag.

The GUI now checks this field to see if we are listening on localhost.
If we are not, the authentication required warning is displayed,
regardless of the *configured* listening address.
This commit is contained in:
Jakob Borg committed 2019-09-20 16:23:33 +02:00
1 parent 1398fbb681
commit db0ba2555a
2 files changed
+24 -9

No files matched your search

+1
View File
@@ -913,6 +913,7 @@ func (s *service) getSystemStatus(w http.ResponseWriter, r *http.Request) {
res["uptime"] = s.urService.UptimeS()
res["startTime"] = ur.StartTime
res["guiAddressOverridden"] = s.cfg.GUI().IsOverridden()
res["guiAddressUsed"] = s.cfg.GUI().Address()
sendJSON(w, res)
}