feat: users, roles and per-area permissions, production demo image
The controller checks every route against the signed-in user's role, with levels none, view, control and edit per area. Guests get the permissions of a built-in guest role. Auth stays off until the first user exists; LED_ADMIN_USER and LED_ADMIN_PASSWORD create the first admin. Sessions are cookies, passwords are PBKDF2-SHA256, and logins lock per username after five failures. The simulator's WebSocket checks the view permission at handshake and per frame; /ws needs devices control. The web UI gets a sign-in button, a sign-in prompt on refused changes, and a users and roles screen. Also: the device build gets the bridge include path and forward type it was missing, Dockerfile.sim runs non-root, and Dockerfile.prod with docker-compose.prod.yml runs the controller on an internal network behind Caddy for HTTPS. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
02440be55d
commit
f0615dc1b7
26 files changed
+2116
-23
No files matched your search
+2
-1
@@ -2,6 +2,7 @@
|
||||
// start/stop (whether mic beats time sequences), tracking reset and bar anchoring. There is one input,
|
||||
// the I2S microphone, so device selection is stored but changes nothing.
|
||||
|
||||
#include "auth.h"
|
||||
#include "audio_api.h"
|
||||
|
||||
#include <math.h>
|
||||
@@ -367,7 +368,7 @@ esp_err_t audio_api_register(httpd_handle_t server)
|
||||
static const httpd_method_t METHODS[] = { HTTP_GET, HTTP_POST, HTTP_PUT };
|
||||
for (size_t m = 0; m < 3; m++) {
|
||||
httpd_uri_t u = { .uri = "/api/audio/*", .method = METHODS[m], .handler = audio_handler };
|
||||
esp_err_t err = httpd_register_uri_handler(server, &u);
|
||||
esp_err_t err = auth_register_uri(server, &u);
|
||||
if (err != ESP_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user