Skip to content

Latest commit

 

History

History
36 lines (30 loc) · 2.25 KB

File metadata and controls

36 lines (30 loc) · 2.25 KB

Repository Guidelines

Project Structure & Module Organization

  • bin/tt.sh: Main Bash script that builds a multi-hop SSH tunnel using a generated, temporary SSH config.
  • example-tt-chain.conf: Sample config showing LOCAL_PORT, REMOTE_HOST, REMOTE_PORT, and HOST_CHAIN.
  • README.md and LICENSE: Usage overview and license.

Build, Test, and Development Commands

  • Run locally: task run CONFIG=./example-tt-chain.conf
    • Starts a local forward from LOCAL_PORT to REMOTE_HOST:REMOTE_PORT through the HOST_CHAIN.
  • Lint: task lint
    • Runs shellcheck on bin/tt.sh (override with SHELLCHECK=/path/to/shellcheck).
  • Format: task format

Coding Style & Naming Conventions

  • Language: Bash with set -euo pipefail for safety.
  • Indentation: 2 spaces; avoid tabs.
  • Naming: Prefer lowercase, hyphen-separated file names (e.g., tt.sh), and uppercase for exported config vars (e.g., LOCAL_PORT).
  • Config files: .conf Bash-compatible files that can be sourced; keep simple key/value plus the HOST_CHAIN array.

Testing Guidelines

  • Smoke test: Use a safe target or dummy host and verify the printed SSH command without establishing a real connection (Ctrl+C to exit).
  • Static checks: bash -n bin/tt.sh (syntax), shellcheck bin/tt.sh (lint).
  • Optional dry-run: ssh -G can help inspect computed SSH options for a hop if needed.

Commit & Pull Request Guidelines

  • Commit messages: Short, present-tense summaries (e.g., “Update README”, “Port forwarding update”). Keep under ~72 chars.
  • PRs should include: clear description, rationale, sample config used, and relevant logs/output (redact hosts/keys). Link related issues.
  • Scope changes narrowly; avoid bundling unrelated edits.

Security & Configuration Tips

  • Do not commit secrets or private keys. Reference keys from ~/.ssh/*.pem in config (see example-tt-chain.conf).
  • File permissions: private keys should be 0600. Keep configs outside version control if they include sensitive hosts.
  • Host verification: The tool disables strict host key checking in its temporary SSH config for ease of use. For stricter environments, review and adjust before use.