feat: terminal as a chosen OS user, create users from the panel (0.0.2)

- agent reports the OS user it runs as (enroll + poll header)
- per-machine terminal user on the edit page; defaults to the agent's own user (root on Linux)
- create a new user from the panel: name, password, optional sudo group
- show the reason in the terminal when a shell fails to start
- bump version to 0.0.2
This commit is contained in:
redtea committed 2026-10-13 01:28:57 +03:00
1 parent be7fbabd9e
commit 3dde07f403
18 files changed
+530 -45

No files matched your search

+2 -1
View File
@@ -34,7 +34,7 @@ func bearerToken(r *http.Request) string {
// enroll creates a new agent record for a valid enroll secret and returns the
// generated id plus a one-time plaintext token (only the hash is stored).
func (s *Server) enroll(name, hostname, os, arch, version string) (id, token string, err error) {
func (s *Server) enroll(name, hostname, os, arch, version, runUser string) (id, token string, err error) {
id = randToken()[:16]
token = randToken()
a := Agent{
@@ -44,6 +44,7 @@ func (s *Server) enroll(name, hostname, os, arch, version string) (id, token str
OS: os,
Arch: arch,
Version: version,
RunUser: runUser,
TokenHash: hashToken(token),
}
if err = s.db.CreateAgent(a); err != nil {