Releases: jtprogru/hostsctl
Releases · jtprogru/hostsctl
Release list
v0.2.0
The documentation and the binary now say the same thing. Most of this release is that reconciliation: where the two disagreed, whichever side was wrong was changed.
Added
Validation rules, a reference page listing everythinghostsctl checkreports and whether it blocks a write. The previous list inHow it workscovered five of the rules out of about twenty.- The documentation site's landing page now links to every page, grouped the way the sidebar is. It used to be a splash screen with one link and no sidebar.
- The generated command reference opens with an index of every top-level command.
hostsctl manis no longer hidden from--help. It was documented on the site while being invisible in the CLI.
Changed
hostsctl checkexits with3when the config has errors, the same codeapplyalready used. It used to exit with the generic1, which contradicted the documented contract that3means "a human has to fix the config".- The reference pages are assembled by
make genfrom prose indocs/src/parts/plus the binary's output, and land directly in the content collection instead of being imported into an.mdxwrapper. Imported content is invisible to the table of contents, which is why a page with forty commands used to list two entries in it. settings.targetis documented accurately:$HOSTSCTL_TARGETsupplies the default when the key is absent rather than overriding it, andhostsctl initalways writes the key out.
Fixed
- The generated command reference no longer contains clap's automatic
helpsubcommand tree — roughly half the page was entries likehostsctl group help rm, which document nothing. - A config error was printed twice by
hostsctl check: once by the planner, once by the command itself. hostsctl backup prunewithout write access to the backup directory reported that it had deleted nothing instead of asking forsudoand exiting with4.hostsctl init --frompromised to import the managed block as well as the*.hostsfiles of a directory; it only ever imported the files. The help text now says so.- Counts in messages are no longer pluralised as
1 errors. - A command name in a heading is no longer rendered as an inline-code chip at heading size, wide tables scroll instead of running into the edge of the column, and every page asked for a favicon that did not exist.
- The list of commands that need root was missing
backup pruneandmigrate. scripts/install.shresolves the latest tag by following the redirect fromgithub.com/.../releases/latestinstead of callingapi.github.com, which is rate limited per IP for unauthenticated callers — behind a shared NAT the script could fail with "cannot determine the latest release" through no fault of the caller.make release-prepstamps the version on macOS too. It used a GNU-onlysedaddress that BSDsedignores while exiting successfully, so on macOS the target reported "stamped" and leftCargo.tomlalone.
Install
brew install jtprogru/tap/hostsctl
cargo install hostsctl --version 0.2.0
curl -fsSL https://raw.githubusercontent.com/jtprogru/hostsctl/main/scripts/install.sh | shEvery archive carries a keyless cosign signature (.bundle) and a SLSA build
provenance attestation; checksums.txt lists the sha256 of each one.
v0.1.0
First release. hostsctl keeps /etc/hosts entries in a YAML config and renders them into a block between markers; everything outside those markers is carried over byte for byte.
Added
- A YAML config at
~/.config/hostsctl/config.yaml(overridable with--configor$HOSTSCTL_CONFIG) holding groups of entries. A group is enabled or disabled as a whole, and an entry maps N addresses to M hostnames, so one name on several addresses stays several lines in/etc/hosts. - Zone files:
includeattaches files next to the config, in either plain hosts syntax (.hosts, one group per file, comments preserved) or YAML (.yaml). Edits made through the CLI go back to the file the group came from, in that file's own format, and a file that did not change is not rewritten. - Remote blocklists:
source addattaches a hosts list as a group, withrewrite_ipand an allowlist. Lists are cached under~/.cache/hostsctl/sources/and refreshed withsource update, which honoursETag.applyreads only the cache and never touches the network, so its result does not depend on connectivity. - Backups: a snapshot of the target is taken before every write, including before a restore.
backup list,backup restore [ID]andbackup prunemanage them, andsettings.keep_backupsbounds how many are kept. check, a linter for what/etc/hostswould silently ignore: wildcards, ports and paths in a hostname, invalid addresses, an address repeated inside one entry, and a name already defined outside the managed block.- Safety guarantees: writes are atomic (temporary file,
fsync,rename) and preserve the target's mode and owner; the result is refused unless it still contains127.0.0.1 localhost; a legacyhosts-syncblock is visible to the tool but is never removed without--drop-legacyormigrate. - Under
sudo, the config and cache are still read from the invoking user's home directory (resolved throughSUDO_USERin passwd), and files created as root are handed back to that user. migrateandimportto move an existinghosts-syncsetup or loose*.hostsfiles into the config.- Shell completions for bash, zsh, fish, elvish and PowerShell, plus a man page.
- A documented exit-code contract:
0ok,1generic failure,2usage,3config error,4permission,5I/O,6network. - A documentation site at https://jtprogru.github.io/hostsctl/, English with a Russian locale. The command reference and the exit-code table are generated from the code, and CI fails when the committed copies drift.
- Release archives for Linux (
x86_64/aarch64, glibc and musl) and macOS (Apple silicon and Intel), each with a keyless cosign signature, a SLSA build-provenance attestation and an entry inchecksums.txt. Distributed through Homebrew, crates.io,scripts/install.shand the archives themselves.
Install
brew install jtprogru/tap/hostsctl
cargo install hostsctl --version 0.1.0
curl -fsSL https://raw.githubusercontent.com/jtprogru/hostsctl/main/scripts/install.sh | shEvery archive carries a keyless cosign signature (.bundle) and a SLSA build
provenance attestation; checksums.txt lists the sha256 of each one.