Add configuration to web UI #22
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
keyop-go/nfq_forwarder#22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We would like to be able to view the current configuration from the Web UI as well as the current connections. Ideally we should also be able to edit the configuration too and restart the service if needed, but that may need to be split out to a separate ticket.
changed the description
mentioned in issue #25
Scope
Splitting per your own hedge in the description: this ticket covers viewing the config only.
Editing + restarting is split out to #25, since it's a meaningfully bigger and more sensitive
piece of work (no live-reload path exists today - "restart" means a real process restart via
systemctl --user restart, from an authenticated web request against a process holding realcapabilities - and any edit needs the same validation
config.LoadFromFilealready does beforeit's ever written to disk or acted on). That deserves its own design pass rather than being
bolted onto a view-only page.
Plan
webUIServercurrently only receivesconfig.WebUI(used once, to build the session store, andnever stored) - not the full running
*config.Configuration. Nothing else in the request pathhas access to it either.
newWebUIServer/runWebUIto take the fullappConfig *config.Configurationinstead of justappConfig.WebUI(removing the now-redundant separateparam), store it on
webUIServer, update the one call site inNFQForwarderMain.GET /config(page, wrapped inrequireSessionPage- same as the dashboard)GET /api/config(JSON, wrapped inrequireSessionAPI- same as/api/tunnels)webUITunnelpattern) rather thanraw-marshaling the config struct - global settings, the web UI's own settings, the
defaultssection, and a table of connections. Since
LoadFromFilealready resolves defaults into eachConnectionat load time, the connections table shows the effective, already-mergedper-connection config for free - no extra resolution logic needed. New
config.htmltemplatereusing
status.html's existing.card/table CSS, plus a small nav link between the two pagesso it reads as one coherent site rather than a bolted-on extra page.
password/token field anywhere, SSH auth is key-file-based (a path, not embedded key
material), and web UI auth delegates to PAM. The one thing worth a design note:
SSHKeyPath/KnownHostsPathcould contain a username in an absolute path if explicitly set -not a new exposure though, since anyone who can pass PAM auth for this OS account already has
shell access to read the real config file directly; displaying it verbatim doesn't change the
trust boundary.
webui_handlers_test.gopattern - authenticated-200 andno-session-401/redirect for both the page and API routes.
docs/README.md's web UI section,CLAUDE.md's web UI design-notes bullet.Work happening on branch
issue22_webui_config; an MR will follow referencing this issue.mentioned in commit
5604aef9e6mentioned in merge request !68
mentioned in commit
646530d3ccFixed via MR !68 and released in v1.0.6 (https://gitlab.keyop.co.uk/keyop/go/nfq_forwarder/-/releases/v1.0.6). The web UI now has a read-only Configuration view (global settings, defaults, and each connection's effective config) alongside the existing connections dashboard. Editing the config + restarting the service was split out into #25, since it needs its own design/security pass.
mentioned in commit
6ecbdd9b1cmentioned in merge request !69