Terminal: Ctrl+C copies a selection (else ^C), Ctrl+V pastes, over http too; drop Log out everywhere

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Mitchell-Johnson
2026-09-19 10:44:17 -07:00
co-authored by Claude Fable 5.1
parent d7ed4d8549
commit d3f2a83249
6 changed files with 28 additions and 28 deletions
-10
View File
@@ -107,7 +107,6 @@ func New(cfg *config.Config, sessions *auth.Sessions, mgr *term.Manager, col *me
m.HandleFunc("POST /api/machines/{name}/update", s.auth(s.updateMachine))
m.HandleFunc("POST /api/machines-update-all", s.auth(s.updateAllMachines))
m.HandleFunc("POST /api/logout", s.auth(s.logout))
m.HandleFunc("POST /api/logout/all", s.auth(s.logoutAll))
m.HandleFunc("GET /api/me", s.auth(s.me))
m.HandleFunc("GET /api/terminals", s.auth(s.listTerminals))
m.HandleFunc("POST /api/terminals", s.auth(s.createTerminal))
@@ -709,15 +708,6 @@ func (s *Server) logout(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(204)
}
// logoutAll ends every session, this one included: a lost phone, a borrowed laptop.
// Tokens are not sessions and are untouched; revoke those by name.
func (s *Server) logoutAll(w http.ResponseWriter, r *http.Request) {
n := s.sessions.DeleteAll()
log.Printf("all %d session(s) ended (from %s)", n, clientIP(r))
s.setCookie(w, r, "", -1)
jsonOK(w, 200, map[string]int{"ended": n})
}
// clientKey is the address the limiter buckets by: the first X-Forwarded-For hop when a
// reverse proxy set it, else the socket peer.
func clientKey(r *http.Request) string {