Start machine terminals at the su login prompt instead of tmux
A new terminal runs su -l for the server's own account in its PTY, so the operator types the account password before getting a shell. Opening is refused when su is missing, the server runs as root, or su opens a shell without asking. The Pipelines-owned tmux backing, its reattach and its persisted session names are removed: terminals end with the server and are listed as ended. A starting server ends leftover pipelines-term_* sessions on tmux -L pipelines only.
This commit is contained in:
+15
-9
@@ -1298,20 +1298,26 @@ Interactive login shells on a server's machine, independent of chats (the
|
||||
app's terminal panel). Every request carries `terminal_request`
|
||||
`{terminal_id?, cwd?, cols?, rows?, data?, after?}`:
|
||||
|
||||
- `terminal_open {cwd, cols, rows}` starts `$SHELL -l` (else `/bin/sh`) in
|
||||
`cwd` (default home; it must be an existing folder inside home) and replies
|
||||
with `terminal`. Where `tmux` is installed the shell runs in its own session
|
||||
of a Pipelines-owned tmux server (`tmux -L pipelines`, never the operator's
|
||||
own), so it outlives a server restart and the next server reattaches it.
|
||||
At most 8 running terminals per machine.
|
||||
- `terminal_open {cwd, cols, rows}` starts the machine's login prompt for the
|
||||
server's own account (`su -l <user>` in a PTY; macOS and Linux) and replies
|
||||
with `terminal` once the password prompt shows. The operator types that
|
||||
account's password into the terminal (the PTY hides it); the account's login
|
||||
shell then starts in `cwd` (default home; it must be an existing folder
|
||||
inside home). A wrong password ends the terminal with a reason. The open is
|
||||
refused, never replaced by an unauthenticated shell, when su is missing, the
|
||||
server runs as root, or su opens a shell without asking. Terminals end with
|
||||
the server process and are then listed as ended; run tmux inside one to
|
||||
keep work across restarts. A starting server ends the `pipelines-term_*`
|
||||
sessions an earlier server left on its own tmux socket (`tmux -L
|
||||
pipelines`), never the operator's tmux. At most 8 running terminals per
|
||||
machine.
|
||||
- `terminal_list` replies with `terminals` (running and ended, oldest first).
|
||||
- `terminal_input {terminal_id, data}` writes UTF-8 input (at most 16 KiB);
|
||||
`terminal_resize {terminal_id, cols, rows}` resizes. Neither is logged.
|
||||
- `terminal_output {terminal_id, after}` replies with the retained output (1
|
||||
MiB tail) from byte `after` of the stream named `stream`; a restarted server
|
||||
starts a new stream at zero. Opening or reading subscribes the connection to
|
||||
MiB tail) from byte `after` of the stream named `stream`. Opening or reading subscribes the connection to
|
||||
the terminal's output frames.
|
||||
- `terminal_close {terminal_id}` kills the shell and its tmux session.
|
||||
- `terminal_close {terminal_id}` kills the login or shell.
|
||||
- Pushed `terminal_event {terminal_id, output, offset, end}` (output) or
|
||||
`{terminal_id, terminal}` (opened, title, exited, closed).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user