Commit Graph

37 Commits

Author SHA1 Message Date
restitux aa2d92a7ae frontend: add admin panel for user and permission management
Admin-only page at /admin with:
- Create user form (username, password, admin toggle)
- User list table with edit and delete actions
- Inline user editing (change password, toggle admin role)
- Inline permission editor with per-app checkboxes grouped by server
- Access guarded by checking is_admin from /api/auth/me

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 15:36:29 +00:00
restitux 786579a7d8 frontend: attach auth credentials to all API requests
Add Authorization Bearer header to all fetch calls (apps, stream
start). Handle 401 responses by clearing token and redirecting to
login. Pass stream_token from the stream start response through to
the WebTransport URL as a query parameter for proxy authentication.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 15:36:29 +00:00
restitux af9359bbdf frontend: add login page and auth guard
Add authentication flow to the frontend:
- authStore with token management (localStorage persistence)
- Login page with username/password form at /login
- Layout-level auth guard that redirects to /login when no valid
  session exists, validates token on load via GET /api/auth/me
- Top navigation bar showing username and admin link when applicable

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 15:36:29 +00:00
restitux b8c705554f backend: add single-use token auth for spawned stream proxies
Generate a random 256-bit token when spawning a proxy process, pass
it as a CLI argument, and return it to the client in the stream start
response. The proxy validates the token on WebTransport connect and
consumes it after first use, preventing replay. A wrong token attempt
also consumes the token for security. Includes 5 unit tests for token
validation logic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 15:36:29 +00:00
restitux 826a3b59c9 backend: gate existing endpoints behind auth and app permissions
Move /api/pair, /api/apps, and /api/stream/start under the session
auth middleware so they require a valid session token. Add app-level
permission filtering: non-admin users only see and can stream apps
they have been explicitly granted access to. Admins bypass all
permission checks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 15:12:22 +00:00
restitux 22f9405229 backend: add user management system with SQLite database
Add authentication and authorization infrastructure:
- SQLite database (db.rs) with users, sessions, and app permissions tables
- Password hashing with argon2
- Session-based auth with random 256-bit tokens
- Auth middleware (session validation) and admin middleware
- Login/logout/me endpoints
- Admin CRUD endpoints for user and permission management
- Auto-seed default admin user on first run
- 23 unit tests covering all DB operations

Existing API endpoints are not yet gated behind auth.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 02:34:02 +00:00
restitux e80543144a backend and frontend: support out of order chunks + now it's performant on chrome 2025-08-12 02:20:46 -06:00
restitux 7afd8db8d8 backend and frontend: port frame sending to flatbuffers 2025-08-10 21:02:03 -06:00
restitux 209c1cffc4 frontend: port video decoding to web worker 2025-08-10 02:53:16 -06:00
restitux a78bb2460e frontend: refactor input functions to their own file 2025-08-10 01:29:56 -06:00
restitux d5e341e232 frontend: support input + refactoring 2025-08-10 01:24:39 -06:00
restitux 9afd4e63c4 backend: forward keyboard and mouse input from client 2025-08-10 01:23:41 -06:00
restitux d4777fcf08 frontend: stream and fullscreen cleanup 2025-08-09 14:22:34 -06:00
restitux 9f9bb68e22 frontend: improve stream UI and add fullscreen 2025-08-09 01:35:09 -06:00
restitux 411c1c74e6 backend: handle server-info request failure 2025-08-09 01:12:44 -06:00
restitux 31481c6812 frontend: improve launch UI and refactor stream to new page 2025-08-08 00:18:38 -06:00
restitux 2b5b6f190d backend: handle app already running logic + refactor response 2025-08-08 00:18:14 -06:00
restitux a11a12828c frontend: video streaming now works!!
- changed the backend to append the buffers together and dispatch them
  as such (this is what moonlight-embedded does)
- fixed the frontend trying to playback an empty buffer because types
  are hard (this is why I should have used protobuf...)
2025-07-21 02:06:55 -06:00
restitux 7a2b0fd4d6 frontend: add svelte frontend 2025-07-20 23:51:54 -06:00
restitux a01ec82833 docker: add caddy setup for testing 2025-07-20 23:51:29 -06:00
restitux ac67658ad2 backend: send decoder packets as json 2025-07-20 23:51:19 -06:00
restitux 52e594f916 frontend: bad improvements 2025-07-20 23:51:03 -06:00
restitux fae7971f2b backend: refactor proxy code 2025-07-20 16:44:23 -06:00
restitux a11b4deb31 meta: WebTransport now works
- added a small frontend for starting
- added logic to serve the frontend
- split out the gamestream logic into a separate process
- added logic to scaffold the separate proxy process
2025-07-20 14:08:47 -06:00
restitux 188005ab11 backend: add support for receiving a gamestream stream 2025-07-20 01:13:28 -06:00
restitux e3892e7134 backend: fix pair blocking on update state 2025-07-19 12:38:09 -06:00
restitux 053ed8c054 meta: renamed config to state and wrapped in a server object 2025-07-18 18:07:33 -06:00
restitux 6ae459ddf5 backend: blocked pairing server with duplicate name 2025-07-18 17:44:42 -06:00
restitux 0edf7c60c1 meta: cleanup and added apps endpoint
- Added (working) apps endpoint
- Added config file (actually a state file) wrapper to handle shared
  mutability
- Refactored base url and http get shared code into common
- Added tracing based logging and converted debug statemets to it
- More things that I forgot
2025-07-18 17:23:54 -06:00
restitux 5391d6c6dd meta: cleanup and use new AppResult type 2025-07-15 19:35:49 -06:00
restitux a1f33b5de3 certs: cleanup logic and add new util functions 2025-07-15 19:04:14 -06:00
restitux b4e22e09b8 certs: refactor certificate logic into module 2025-07-05 16:41:45 -06:00
restitux 8857e226fe Replace axum with salvo 2025-07-01 23:10:58 -06:00
restitux d9aa724b90 Certificates from successful pair are now saved to disk 2025-07-01 21:54:30 -06:00
restitux 9b34307103 Server now returns paired == 1 2025-06-29 20:34:13 -06:00
restitux 7ec5e1ad90 More progress and cleanup 2025-06-27 00:34:46 -06:00
restitux 9232c0414a Initial Commit (it doesn't work) 2025-06-26 19:35:13 -06:00