host-identity-cli 1.1.1

Command-line interface for host-identity: print a stable host UUID across platforms, clouds, and Kubernetes
Documentation
[package]
name = "host-identity-cli"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
authors.workspace = true
description = "Command-line interface for host-identity: print a stable host UUID across platforms, clouds, and Kubernetes"
readme = "README.md"
keywords = ["host-id", "machine-id", "identity", "uuid", "cli"]
categories = ["command-line-utilities"]
documentation = "https://docs.rs/host-identity-cli"

[lib]
name = "host_identity_cli"
path = "src/lib.rs"

[[bin]]
# Renamed from `hostid` to avoid colliding with coreutils `hostid(1)`
# (numeric host identifier from gethostid(3)), which ships on every
# Linux distro and the BSDs.
name = "host-identity"
path = "src/main.rs"

[features]
# Library-mirrored defaults. The CLI exposes `--network` at runtime to
# opt into cloud and Kubernetes sources; the feature set below controls
# which sources are compiled in.
default = ["container", "network"]
container = ["host-identity/container"]
# Pull in an HTTP client and every cloud + k8s source at build time.
# Cloud sources stay dormant at runtime until the user passes `--network`.
network = [
    "dep:ureq",
    "dep:http",
    "host-identity/aws",
    "host-identity/gcp",
    "host-identity/azure",
    "host-identity/digitalocean",
    "host-identity/hetzner",
    "host-identity/oci",
    "host-identity/openstack",
    "host-identity/k8s",
]

[dependencies]
host-identity = { workspace = true }
clap = { version = "4", features = ["derive"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
anyhow = "1"
ureq = { version = "2", optional = true }
http = { version = "1", optional = true }

[lints]
workspace = true

# Debian/Ubuntu packaging — consumed by `cargo deb` in release CI.
# Paths are relative to the workspace root because release CI invokes
# cargo-deb with `--no-build` against a staged layout that mirrors the
# workspace (binary under target/<triple>/release/, man pages under
# man/).
[package.metadata.deb]
name = "host-identity"
maintainer = "Elijah Zupancic <elijah@zupancic.name>"
section = "utils"
priority = "optional"
extended-description = """\
Print a stable host UUID across platforms, clouds, and Kubernetes.

host-identity resolves a deterministic UUID for a machine by walking
a set of sources (machine-id, DMI product UUID, cloud metadata,
container identifiers, Kubernetes node/pod UIDs) and returning the
first one that proves the host's identity.\
"""
assets = [
    ["target/release/host-identity", "usr/bin/", "755"],
    ["../../man/host-identity.1", "usr/share/man/man1/", "644"],
    ["../../man/host-identity-audit.1", "usr/share/man/man1/", "644"],
    ["../../man/host-identity-resolve.1", "usr/share/man/man1/", "644"],
    ["../../man/host-identity-sources.1", "usr/share/man/man1/", "644"],
    ["../../README.md", "usr/share/doc/host-identity/README.md", "644"],
    ["../../LICENSE-APACHE", "usr/share/doc/host-identity/LICENSE-APACHE", "644"],
    ["../../LICENSE-MIT", "usr/share/doc/host-identity/LICENSE-MIT", "644"],
    ["../../THIRD-PARTY-LICENSES.md", "usr/share/doc/host-identity/THIRD-PARTY-LICENSES.md", "644"],
]

# RHEL/Rocky/Fedora/Amazon Linux packaging — consumed by
# `cargo generate-rpm` in release CI. Source paths are resolved
# relative to this crate's Cargo.toml when `-p host-identity-cli` is
# passed (matching cargo-deb's behaviour), hence the `../../` prefix
# for anything that lives at the workspace root.
[package.metadata.generate-rpm]
name = "host-identity"
summary = "Stable host UUID across platforms, clouds, and Kubernetes"
license = "Apache-2.0 OR MIT"
vendor = "Elijah Zupancic"
url = "https://github.com/dekobon/host-identity"
# `doc = true` marks a file as `%doc` in the generated spec, which
# Fedora's container images (and any system with `tsflags=nodocs` in
# dnf.conf) filter out on install. Keep `%doc` only on the README —
# man pages are the CLI's discoverability surface, and the LICENSE /
# THIRD-PARTY-LICENSES files are compliance artefacts. None of those
# are optional.
assets = [
    { source = "../../target/release/host-identity", dest = "/usr/bin/host-identity", mode = "755" },
    { source = "../../man/host-identity.1", dest = "/usr/share/man/man1/host-identity.1", mode = "644" },
    { source = "../../man/host-identity-audit.1", dest = "/usr/share/man/man1/host-identity-audit.1", mode = "644" },
    { source = "../../man/host-identity-resolve.1", dest = "/usr/share/man/man1/host-identity-resolve.1", mode = "644" },
    { source = "../../man/host-identity-sources.1", dest = "/usr/share/man/man1/host-identity-sources.1", mode = "644" },
    { source = "../../README.md", dest = "/usr/share/doc/host-identity/README.md", mode = "644", doc = true },
    { source = "../../LICENSE-APACHE", dest = "/usr/share/doc/host-identity/LICENSE-APACHE", mode = "644" },
    { source = "../../LICENSE-MIT", dest = "/usr/share/doc/host-identity/LICENSE-MIT", mode = "644" },
    { source = "../../THIRD-PARTY-LICENSES.md", dest = "/usr/share/doc/host-identity/THIRD-PARTY-LICENSES.md", mode = "644" },
]
auto-req = "disabled"