Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web configuration UI #35

Open
scottlamb opened this issue Mar 9, 2018 · 5 comments
Open

web configuration UI #35

scottlamb opened this issue Mar 9, 2018 · 5 comments
Labels
enhancement javascript Pull requests that update Javascript code rust Rust backend work required
Milestone

Comments

@scottlamb
Copy link
Owner

scottlamb commented Mar 9, 2018

The TUI moonfire-nvr config is a decent way of configuring the system for now, but long-term I'd like all configuration to be done through the web UI:

  • lots of Javascript work to do for this
  • new JSON interfaces to define (split to JSON API for configuration #153)
  • server refactoring: the Streamer and Syncer interfaces in the server don't have any teardown logic, aren't exposed to the web UI in any way, etc. (split to JSON API for configuration #153 also)
  • needs to be authenticated, [edit: this is done as part of user authentication #26] and have a notion of a config permission (easy)
  • need a way to bootstrap the authentication if not moonfire-nvr config. I'm thinking a simple CLI for user manipulation which authenticates to the server over a Unix domain socket protected via file permissions or SO_PEERCRED.
@scottlamb scottlamb added this to the wishlist milestone Mar 9, 2018
scottlamb added a commit that referenced this issue Jun 19, 2019
(I also considered the names "capabilities" and "scopes", but I think
"permissions" is the most widely understood.)

This is increasingly necessary as the web API becomes more capable.
Among other things, it allows:

* non-administrator users who can view but not access camera passwords
  or change any state
* workers that update signal state based on cameras' built-in motion
  detection or a security system's events but don't need to view videos
* control over what can be done without authenticating

Currently session permissions are just copied from user permissions, but
you can also imagine admin sessions vs not, as a checkbox when signing
in. This would match the standard Unix workflow of using a
non-administrative session most of the time.

Relevant to my current signals work (#28) and to the addition of an
administrative API (#35, including #66).
@scottlamb
Copy link
Owner Author

Regarding the final bullet point about Unix domain sockets, see: seanmonstar/reqwest#39

@scottlamb
Copy link
Owner Author

There are a lot of usability problems in the existing config interface, as described in this comment. I'd love to address those in a web based-UI, where there's more screen real estate for explanation.

@clydebarrow
Copy link
Contributor

I'm willing to tackle the UI side of this. However there is AFAIK currently no exposed JSON API to manipulate the config data, so this would be a prerequisite. Should that be split out as a separate issue? I have no Rust experience.

@scottlamb
Copy link
Owner Author

Awesome. Very glad to have your help. I Filed #153 for the server-side work, and I'll start working through it soon.

@scottlamb
Copy link
Owner Author

@sky1e continuing our conversation from #276:

@scottlamb wrote: FYI, in case you have too many more TUI config improvements in mind, I should warn you: I'd ultimately like to switch everything to web-based config (#35).

@sky1e wrote: I was presuming that even with a decent web ui, the TUI wouldn't just be removed. There are advantages to having a UI that requires nothing but terminal access to the server, as an option.

I actually am imagining having it configured only over HTTP (never having to shut down the server), and dropping the TUI/cursive entirely. Ultimately Moonfire isn't that useful without HTTP access. I'd like to have a really nice, unified UI that has tooltips, previews of cameras as you're setting them up, etc. And just to have a super light-weight binary (I'm planning on dropping the Docker container stuff too).

Can you be more specific about the advantages you see of a terminal-based UI? I mostly see one: it can be a way of bootstrapping authentication. I've been planning to address that in a few ways:

  • you can get an authenticated HTTP endpoint on localhost by Unix socket authentication + ssh -L localhost:8080:/var/lib/moonfire-nvr/sock moonfire-nvr@nvr-host (as mentioned in the config reference).
  • we could have a very basic CLI (not curses-like TUI, I'm thinking simpler) that adds/removes users via a local Unix auth socket on a running Moonfire.
  • and/or it could use its local Unix auth socket privileged access to create a "configuration token": basically something you paste into the web interface to get access before any user accounts are even set up.

@scottlamb scottlamb added javascript Pull requests that update Javascript code and removed js labels Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement javascript Pull requests that update Javascript code rust Rust backend work required
Projects
None yet
Development

No branches or pull requests

2 participants