How nikkel/gitaway works
gitaway wraps Git so users can keep their repository remotes unchanged: git away classifies the command and resolves a profile, checks whether the server is reachable at home by its pinned SSH host key, then either runs Git directly or routes that command through a local proxy and an in-process WireGuard tunnel. Separate CLI capabilities support guided setup, profile and key management, and a persistent tunnel for the server’s web interface. Several runtime modules are unsampled; those branches are included where the README or source index supports them, without inferring internal calls.
Main entry points: away.rs Away workflow · mod.rs CLI dispatcher · setup_cmd.rs Guided setup · tunnel_cmd.rs Tunnel command
Components 25
CLI commands
- CLI dispatcher
src/cli/mod.rs - Guided setup
src/cli/setup_cmd.rs - Profile commands
src/cli/profile_cmd.rs - Tunnel command
src/cli/tunnel_cmd.rs - Home check command
src/cli/check_cmd.rs
Profiles and secrets
- Profile model
src/config/profile.rs - Config store
src/config/store.rs - Profile resolution
src/config/resolve.rs - Key commands
src/cli/key_cmd.rs - Device key store
src/keys/store.rs - VPN config import
src/transport/client_config.rs
Git command routing
- Away workflow
src/cli/away.rs - Git command classification
src/git/classify.rs - Repository profile lookup
src/git/repo.rs - Git process runner
src/git/runner.rs - Git proxy environment
src/proxy/git_env.rs
Home and tunnel
- Pinned-key home check
src/home_check.rs - Per-command proxy
src/proxy/mod.rs - SOCKS server
src/proxy/socks.rs - Transport interface
src/transport/mod.rs - WireGuard tunnel
src/transport/wireguard/mod.rs - Web access guard
src/cli/web_guard.rs
Other components
- User
- Self-hosted Git server
- Installed Git
Connections 33
- User → CLI dispatcher: invokes
README.md - CLI dispatcher → Away workflow: dispatches
src/cli/mod.rs - CLI dispatcher → Guided setup: dispatches
src/cli/mod.rs - CLI dispatcher → Profile commands: dispatches
src/cli/mod.rs - CLI dispatcher → Tunnel command: dispatches
src/cli/mod.rs - CLI dispatcher → Home check command: dispatches
src/cli/mod.rs - CLI dispatcher → Key commands: dispatches
src/cli/mod.rs - Guided setup → VPN config import: imports config
src/cli/setup_cmd.rs - Guided setup → Config store: creates profile
src/cli/setup_cmd.rs - Guided setup → Pinned-key home check: checks server
src/cli/setup_cmd.rs - Profile commands → Config store: manages profiles
src/cli/profile_cmd.rs - Key commands → Device key store: manages keys
- Config store → Profile model: parses profiles
src/config/store.rs - Away workflow → Git command classification: classifies command
src/cli/mod.rs - Away workflow → Repository profile lookup: queries repository
src/cli/away.rs - Away workflow → Profile resolution: resolves profile
- Away workflow → Pinned-key home check: checks home
- Away workflow → Git process runner: runs Git
src/cli/away.rs - Away workflow → Per-command proxy: starts proxy
src/cli/away.rs - Away workflow → Git proxy environment: configures Git
src/cli/away.rs - Git process runner → Installed Git: executes
README.md - Git proxy environment → Installed Git: sets proxy options
README.md - Per-command proxy → SOCKS server: accepts connections
src/proxy/mod.rs - Per-command proxy → Transport interface: opens tunnel streams
src/proxy/mod.rs - Transport interface → WireGuard tunnel: implements
src/transport/mod.rs - Transport interface → Device key store: loads tunnel secrets
src/transport/mod.rs - Pinned-key home check → Profile model: uses profile settings
src/home_check.rs - Tunnel command → Pinned-key home check: checks server
src/cli/tunnel_cmd.rs - Tunnel command → Web access guard: guards web access
src/cli/tunnel_cmd.rs - Tunnel command → Transport interface: opens persistent tunnel
src/cli/tunnel_cmd.rs - Web access guard → Self-hosted Git server: serves web access
- WireGuard tunnel → Self-hosted Git server: connects through VPN
- WireGuard tunnel → Device key store: uses device key
src/transport/wireguard/mod.rs