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:
@@ -66,12 +66,6 @@ type Options struct {
|
||||
// False keeps the previous behaviour (tests, embedded servers): a stopping
|
||||
// server interrupts its runs and the next start marks them interrupted.
|
||||
DetachSessions bool
|
||||
// TerminalTmuxSocket names the Pipelines-owned tmux server machine
|
||||
// terminals live in (empty: "pipelines"); TerminalWithoutTmux runs
|
||||
// shells as direct children even where tmux is installed. Tests set
|
||||
// them so they never share the real server's tmux sessions.
|
||||
TerminalTmuxSocket string
|
||||
TerminalWithoutTmux bool
|
||||
}
|
||||
|
||||
// Handler serves the persistent connection with default options. Canceling ctx
|
||||
@@ -150,18 +144,15 @@ func HandlerWithOptions(ctx context.Context, options Options, stores ...*pipelin
|
||||
hub.startShellRunner(ctx, store)
|
||||
}
|
||||
// Machine terminals are recorded beside the operator sessions, in the
|
||||
// same store; a previous process's tmux-backed shells are reattached.
|
||||
// same store; the ones a previous process left running are listed as
|
||||
// ended.
|
||||
var terminalRecords terminalStore
|
||||
if len(stores) > 0 {
|
||||
terminalRecords = stores[0]
|
||||
} else if store, ok := registry.(terminalStore); ok {
|
||||
terminalRecords = store
|
||||
}
|
||||
var terminalTmuxServer *terminalTmux
|
||||
if !options.TerminalWithoutTmux {
|
||||
terminalTmuxServer = findTerminalTmux(options.TerminalTmuxSocket)
|
||||
}
|
||||
terminals := newTerminalManager(ctx, terminalRecords, terminalTmuxServer)
|
||||
terminals := newTerminalManager(ctx, terminalRecords)
|
||||
terminals.recover(ctx)
|
||||
acks := newAttentionAckHub()
|
||||
var ackStore attentionAckStore
|
||||
|
||||
Reference in New Issue
Block a user