- auth: POST /auth validates PAM, returns session token - auth: GET /me validates Bearer token, returns username - auth: POST /logout destroys session - auth: POST /users creates Linux user via useradd+chpasswd - session.c: in-memory token store (1024 slots, pthread mutex, /dev/urandom tokens) - user.c: fork/exec useradd + chpasswd with username validation - ui: login overlay shown until authenticated (x-cloak) - ui: token persisted in sessionStorage, validated on page load - ui: username displayed in dock after login - ui: apps only load after successful auth Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
13 lines
254 B
Makefile
13 lines
254 B
Makefile
CC = gcc
|
|
CFLAGS = -Wall -Wextra -O2
|
|
LIBS = -lpam -lmicrohttpd -lpthread
|
|
SRC = src/main.c src/pam_auth.c src/session.c src/user.c
|
|
OUT = crimata-auth
|
|
|
|
.PHONY: all clean
|
|
|
|
all:
|
|
$(CC) $(CFLAGS) $(SRC) $(LIBS) -o $(OUT)
|
|
|
|
clean:
|
|
rm -f $(OUT)
|