Skip to main content

Module vps

Module vps 

Source
Expand description

VPS record CRUD and persistence (XDG + atomic TOML + flock).

No .env at runtime. Schema v3 English wire (dual-read PT legacy).

Modules§

model
Data model for VpsRecord (schema v3).

Structs§

ConfigFile
Full configuration file.
ConfigLayer
Winning configuration layer (doctor).
ExecOptions
Common remote execution options.

Functions§

build_connection_config
Builds ConnectionConfig from a VpsRecord.
default_config_path
Returns the config file path honoring SSH_CLI_HOME.
find_by_name
Busca um registro de VPS por name.
load
Loads the configuration file (returns empty if missing).
read_active_vps
Reads the active VPS name.
read_secret_stdin
Reads a password line from stdin (no extra echo).
resolve_config_path
Resolves the config file path from an optional override.
run_connect
Sets the active VPS by writing its name to <config_dir>/active (sibling file).
run_exec
Runs a shell command on a VPS over SSH.
run_exec_with_client
Testable version of run_exec.
run_health_check
Health-check SSH. One-shot health-check with auth parity (GAP-SSH-CLI-006) and TOFU (M1).
run_secrets_command
Dispatcher one-shot de secrets status|init|reencrypt.
run_su_exec
Runs a command via su - one-shot (consumes su_password).
run_sudo_exec
Runs a command with sudo (packed via sh -c).
run_sudo_exec_with_client
Testable version of sudo-exec.
run_vps_command
Dispatcher dos subcomandos vps.
save
Saves the configuration file atomically with flock and 0o600.
use_json
JSON efetivo a partir de flag local e format global (IO-001/002).
winning_layer
Resolves and describes the winning config layer.
write_atomic
Writes bytes to path atomically (tempfile + fsync + rename + 0o600).