Skip to main content

Crate horto_os_ui_shared

Crate horto_os_ui_shared 

Source
Expand description

Horto box setup engine: modular versioned steps, kits, and ops.

Surfaces (CLI, TUI, status-api) call this crate; they do not embed step logic.

§Examples

Dry-run the full pipeline against temporary host paths:

use horto_os_ui_shared::{setup_run, ApplyMode, HostContext, HostPaths, SetupKind};
use std::path::PathBuf;

let root = PathBuf::from("/tmp/horto-doc-example");
let _ = std::fs::create_dir_all(root.join("active_setup"));
let paths = HostPaths {
    active_setup: root.join("active_setup"),
    backup: root.join("backup"),
    docker: root.join("docker"),
    etc: root.join("etc"),
    lease_file: root.join("dnsmasq.leases"),
};
let mut ctx = HostContext::new(ApplyMode::DryRun, SetupKind::Full).with_paths(paths);
setup_run(&mut ctx, SetupKind::Full).expect("dry-run");
assert!(!ctx.logs.is_empty());

Re-exports§

pub use build_info::footer_line;
pub use build_info::GIT_COMMIT;
pub use build_info::LONG_VERSION;
pub use build_info::VERSION;
pub use context::require_root_for_apply;
pub use context::ApplyMode;
pub use context::HostContext;
pub use context::NonInteractivePrompts;
pub use context::PlannedAction;
pub use context::PromptsProvider;
pub use context::StdioPrompts;
pub use error::HortoError;
pub use error::Result;
pub use ops::backup::backup_disk;
pub use ops::backup::backup_etc_initial;
pub use ops::backup::backup_etc_timestamped;
pub use ops::backup::backup_shrink;
pub use ops::backup::backup_status;
pub use ops::backup::list_timestamped_etc_backups;
pub use ops::backup::plan_disk_backup;
pub use ops::backup::probe_disk_backup;
pub use ops::backup::BackupStatus;
pub use ops::backup::DiskBackupFlags;
pub use ops::backup::DiskBackupOpts;
pub use ops::backup::DiskBackupProbe;
pub use ops::backup::EtcBackupReport;
pub use ops::backup::ShrinkBackupOpts;
pub use ops::catalog::describe_container;
pub use ops::catalog::describe_service;
pub use ops::doctor::doctor;
pub use ops::doctor::DoctorFlags;
pub use ops::doctor::DoctorReport;
pub use ops::leases::export_dhcp_leases;
pub use ops::leases::read_leases;
pub use ops::leases::LeaseEntry;
pub use ops::runner::setup_run;
pub use ops::runner::setup_step;
pub use ops::status::box_status;
pub use ops::status::service_urls;
pub use ops::status::setup_status;
pub use ops::status::BoxStatus;
pub use ops::status::SetupStatusReport;
pub use ops::status::UrlInfo;
pub use paths::HostPaths;
pub use pipeline::lookup;
pub use pipeline::pipeline;
pub use pipeline::SetupKind;
pub use remote::classify_ssh_failure;
pub use remote::finish_save_api_token;
pub use remote::format_surfaces_report;
pub use remote::http_get_label;
pub use remote::install_ecosystem_after_embedded_apply;
pub use remote::install_ecosystem_services;
pub use remote::local_api_token_path;
pub use remote::normalize_cli_version;
pub use remote::offer_save_api_token;
pub use remote::parse_api_token_drop;
pub use remote::parse_remote_json;
pub use remote::probe_api_surface;
pub use remote::probe_cli_surface;
pub use remote::probe_mcp_surface;
pub use remote::probe_remote_cli;
pub use remote::probe_ssh_access;
pub use remote::probe_ssh_surface;
pub use remote::probe_surfaces;
pub use remote::pull_remote_api_token;
pub use remote::read_local_api_token;
pub use remote::remote_box_snapshot;
pub use remote::remote_cli_version_is_current;
pub use remote::remote_doctor;
pub use remote::remote_doctor_report_banner;
pub use remote::remote_ensure_ssh_key;
pub use remote::remote_install_key_banner;
pub use remote::remote_install_payload;
pub use remote::remote_probe_arch;
pub use remote::remote_progress_message;
pub use remote::remote_reboot;
pub use remote::remote_reboot_with_sudo_password;
pub use remote::remote_run_banner_detail;
pub use remote::remote_run_cli;
pub use remote::remote_setup_run;
pub use remote::remote_setup_status;
pub use remote::remote_upload_cli;
pub use remote::resolve_local_ecosystem_bins;
pub use remote::usable_api_token_hex;
pub use remote::wants_reboot_now;
pub use remote::write_api_token_file;
pub use remote::ApiSurfaceProbe;
pub use remote::BoxArch;
pub use remote::CliSurfaceProbe;
pub use remote::EcosystemInstallChoice;
pub use remote::LocalBins;
pub use remote::McpHostProbe;
pub use remote::ProcessRunner;
pub use remote::RemoteBoxCliStatus;
pub use remote::RemoteBoxSnapshot;
pub use remote::RemoteCliProbe;
pub use remote::RemoteOptions;
pub use remote::RemoteOptionsInput;
pub use remote::RemoteRunFlags;
pub use remote::RemoteRunOutcome;
pub use remote::RemoteRunRequest;
pub use remote::SshEnv;
pub use remote::SshSession;
pub use remote::SshSurfaceProbe;
pub use remote::SurfaceProbeReport;
pub use remote::SystemProcessRunner;
pub use remote::BOX_BIN_NAMES;
pub use remote::DEFAULT_GITHUB_REPO;
pub use remote::DEFAULT_INSTALL_DIR;
pub use remote::DEFAULT_REMOTE_AGENT_DIR;
pub use remote::MIN_API_TOKEN_HEX_LEN;
pub use resume::is_stale;
pub use resume::StepStatus;
pub use step::Step;
pub use tracing_init::init_tracing;
pub use kits::docker::docker_available;
pub use kits::docker::docker_rebuild;
pub use kits::docker::list_containers;
pub use kits::docker::parse_docker_ps_lines;
pub use kits::docker::resolve_stack;
pub use kits::docker::ContainerInfo;

Modules§

build_info
Package version and git commit baked at compile time.
context
Host execution context for setup steps: apply vs dry-run, paths, logs, prompts.
embed
Embedded assets/ tree (config templates and docker_source) via rust-embed.
error
Typed setup/ops errors for the Horto engine.
kits
Host interaction kits (apt, systemd, fs, templates, docker, env files).
ops
High-level ops composed from kits and steps (backup, doctor, leases, runner, status).
paths
Host filesystem layout (HostPaths) for setup and day-2 ops.
pipeline
Ordered Full / Minimal step registries and id lookup.
remote
Remote apply path: PC shells out to OpenSSH and runs the CLI agent on a box.
resume
Persist and query per-step completion for setup resume.
step
Versioned setup step trait implemented by modules under crate::steps.
steps
Versioned setup steps (s1–s7, m1, d0–d2).
tracing_init
Process-wide tracing-subscriber install for Horto binaries.