Skip to content

gateway: login-shell entry + -c dispatch #111

Description

@pgebheim

Foundation for the Transport-B epic (#110).

What

In src/main.rs, before Cli::parse(), detect login-shell invocation and enter gateway mode:

  • argv0 basename starts with - (OpenSSH login shell), OR args are ["lilbox","-c",<cmd>] (both OpenSSH and Tailscale SSH pass a command this way).
  • Source the command: -c arg → $SSH_ORIGINAL_COMMAND (preserve feat(gateway): exe.dev-style remote box provisioning over SSH #108's forced-command path) → else interactive usage.
  • All paths funnel into the EXISTING authorize() in src/commands/gateway.rs unchanged.

Acceptance

  • lilbox -c "ls" and a dash-argv0 invocation dispatch through the allowlist; normal lilbox <subcmd> unaffected.
  • Interactive (no -c, no env command) prints usage — detected by absence of -c, NOT tty (a client can ssh -t host cmd).
  • feat(gateway): exe.dev-style remote box provisioning over SSH #108's SSH_ORIGINAL_COMMAND path still works. Unit tests for the arg-detection.

Source-confirmed (spike #109): Tailscale SSH runs shell -c "cmd" and never sets $SSH_ORIGINAL_COMMAND.

Depends on: none (foundation).
Parent: #110 (epic). Spike: #109. Base branch for #108's gateway code. Integration branch: 110-transport-b-tailnet-gateway — target it, NOT main.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions