aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* docs: examples, from sops-nix and agenix to enstatecomparisontv4 days2-1/+329
| | | | | | | | | | | A sops-nix configuration (a secret, restartUnits, a template) and an agenix one as enstate's slots, views and source lists, the sops and age files as sources while moving; a secret's owner as systemd's business (LoadCredential=); delivering with a small script and nixos-rebuild, deploy-rs, Colmena, wire, Clan (its vars as the source, by clan vars get) and krops; changing a secret without deploying; and what doesn't move yet (early state, closures for images, users' secrets).
* docs: what protects state against what, and two kinds of encryptiontv4 days1-7/+98
| | | | | | | | | | State never travels through Nix's paths. Encryption protects only where its key isn't: against whoever has the disk, a key on it protects nothing. So, apart: submissions encrypted to the host's ssh key, for ways that aren't ssh (8.2); entries sealed to the host's TPM by systemd's credentials, at rest, then opaque to renderers (8.3); and plain entries, which full-disk encryption protects (8.4). 8.1 says against what each protects, and when to use which.
* docs: enstate compared with sops-nix, agenix, Clan and otherstv4 days3-7/+230
| | | | | | | | | sops-nix, agenix, ragenix, agenix-rekey, vaultix, the nix-secrets pattern, and Clan's vars: how they work, a table against enstate, what enstate does differently on purpose, and what it could learn (encryption at rest, encrypted submissions, generators, outdated values, when state is needed). From what was known of them on 2026-12-01; what isn't certain says so. Linked from design.md, section 1, and the README.
* docs: source lists from a host's configurationtv4 days1-1/+7
|
* nix: source lists from the slots' sourcestv4 days1-0/+57
| | | | | | | | | | A slot's source says where a deployment gets its entry, on the deploying host: a source, or { location = NAME; VAR = …; }. enstate.locations holds locations for every source list, and enstate.sourceLists, read only, gives a source list per channel from the slots with a source, complete if every slot of the channel has one: for the deploying host to evaluate and pack, not part of the system. As hrm's own module had it, so hrm can use this instead.
* enstate: refused submissions, visibletv4 days6-65/+407
| | | | | | | | | | | | | | A submission the switch refuses is moved to STATE/refused/NAME with NAME.json next to it: when, and why ("refused" if nothing more). The check's message names the waiting submission's path. --status lists what waits in the incoming directory, planned against the running generation (one the check refused stays waiting, and refuses switches while it does), and what was refused, with the reasons (and --json as data); it exits with 1 if something needs attention: a refused submission, a waiting one the running generation would refuse, an unfilled required slot, so that a deployment running it notices. --forget NAME removes a waiting or refused submission. After hrm's review.
* docs: refused submissions are visibletv4 days1-4/+8
|
* nix: the check before a switch runs for boot, tootv4 days2-7/+11
| | | | | | | | | A generation whose required slots the state can't fill doesn't become the next boot's default either: tools like Clan run switch-to-configuration boot before switch, so the check refused only once the generation was the boot default already. Staging a generation for a later reboot works by a submission waiting in incomingDir, which the check plans. dry-activate stays unchecked. A line of the VM test (not run).
* docs: a generation the state can't serve doesn't become the boot defaulttv4 days1-1/+1
|
* docs: a submission goes into the incoming directory wholetv5 days4-2/+11
| | | | | | | | Names starting with a dot are skipped there, so a provider copies a submission under one and renames it within the incoming directory: a receptor looking at it meanwhile (enstate.service, a check) never sees half a submission. Said in the design, the module's incomingDir, the store; and a test that a dot name is left alone.
* enstate: --pack --dry-run, every problem of a source listtv5 days5-138/+436
| | | | | | | | | | | Reads every source and writes nothing: every problem, not just the first, by address, with kind, location and variables, and the source, as text or JSON (--json): an item the schema has no slot for, a record in a type without records, a required slot without an item, a location that doesn't exist, a source that can't be read (with what it said), a record that isn't JSON. Exit status 1 if there are problems. --pack itself refuses with the same list; --out isn't for a dry run, --json only for one. The completion offers accordingly.
* docs: --pack --dry-run, what keeps a source list from a submissiontv5 days1-0/+10
|
* enstate: locations in source liststv5 days4-29/+258
| | | | | | | | | A source declared once (locations, or in files of them the source list includes), which items use by name: their other fields are its variables, $(var:NAME) in its placeholders, as data (continuum's config at 45b0676). Its paths are relative to the file that declares it. A location that doesn't exist, a variable that isn't text, fields without a location, a location declared twice are errors.
* docs: locations in source lists, and no generatorstv5 days1-2/+29
| | | | | | | | A location is a source declared once and used by many items, with variables from each item's fields ($(var:NAME), once the config crate has them), read only. Making values that don't exist yet is the source's business, which knows its layout, its recipients, and how each kind of key is made: enstate doesn't generate.
* enstate: validators and renderers in a sandboxtv5 days11-25/+188
| | | | | | | | | | | By bubblewrap: everything read-only but OUT (and IN bound again after a fresh /tmp), a new /dev and /proc, namespaces of their own (no network), no capabilities, a new session, gone with the receptor. The setting sandbox is bwrap (found in the receptor's PATH, as the programs' environment is empty), or none; the module sets its bubblewrap. The tests run their programs in it where bubblewrap can make one (not in Nix's build sandbox), and a test checks that a program can't write outside OUT, nor into IN, and has no network nor environment.
* docs: programs run in a sandboxtv5 days1-2/+3
|
* enstate: a setting the command doesn't use, as an argument, is an errortv5 days3-8/+51
| | | | | | | --state-dir and --run-dir with --pack, --systemctl but with --apply and --migrate, --unit but with --apply. From a configuration file, which holds them for every command, they are fine. The completion offers each command the settings it uses.
* enstate: bash completiontv5 days3-2/+75
| | | | | | A command until one is given, then the options it takes (each once, but --config and --unset), and for PATH a submission (a directory) or a source list (a file). The package installs it.
* enstate: --pack warns of an entry from text with placeholderstv5 days3-5/+18
| | | | | | Text loses its trailing line breaks, which a key or a certificate rarely should; a whole-value source (cmd:…, file:…, or a table) takes an entry byte-exact. The warning says so, and the entry goes in as asked.
* enstate: --apply starts the unit that runs --migrate again if it failedtv5 days4-1/+51
| | | | | | | The setting unit names it (the module: enstate.service). After a boot without state it failed; an accepted --apply starts it (--no-block, with the lock released), so it serves the views and is no longer failed.
* enstate: the state directory is root'stv5 days3-1/+15
| | | | | | The receptor makes the state directory 0700 whoever created it (a deploy copying into incoming/, say), and the module has tmpfiles keep it so.
* enstate: snapshots flushed to disk before they are put in placetv5 days1-3/+32
| | | | | | A new snapshot's files and directories are flushed before the link to it is replaced, and the link before the old snapshot goes: a crash leaves the old snapshot or the new one, whole.
* enstate: config with placeholders in parenthesestv5 days3-2/+9
| | | | | | The config crate at continuum's 34434f7 takes $(env:…), $(cmd:…) and $(file:…) as well as ${…}, so a source list may use either. A test packs a $(cmd: …) source.
* nix: the switch serves the views when there is something to servetv5 days2-11/+92
| | | | | | | | | | | | | | enstate.service reruns on a switch when the schema changes. A unit of its own, enstate-switch.service, takes what waits otherwise: a submission in incomingDir, or one staged. switch-to-configuration restarts sysinit-reactivation.target on every switch, which starts it, and triggering conditions keep it from running when nothing waits. The check before a switch uses the new generation's enstate, schema and configuration, and runs on a host without enstate, too: its first switch's state can wait in incomingDir. Subtests of the VM test: staged under an unchanged schema, brought by the switch (without the warning the activation-restart-list gives); a waiting submission taken by the switch that needs it; one refused refusing it.
* enstate: submissions waiting for the next switchtv5 days8-12/+279
| | | | | | | | | | | --migrate first takes the submissions in STATE/incoming, in the order of their names: planned against the schema, stored if accepted (their views follow with the rest), removed, and moved to STATE/refused if refused, which refuses the migration. A dry run (the check before a switch) does so on a copy of the snapshots, changing nothing. --stage leaves a marker, STATE/migrate-due, for the next switch to migrate even if the schema doesn't change; --migrate removes it. Scratch directories are cleaned up without following the symbolic links in them.
* enstate: --stage, a submission for the next generationtv5 days6-6/+166
| | | | | | | | | | Plans against --schema, stores the snapshot under it, and puts no views in place and runs no reactions: the running generation goes on as it is, keeping what it has no slot for, and the switch (--migrate) brings the new views. The way to fill a required slot a generation adds before switching to it, and to bring a host's first state: with the new system's enstate, schema and configuration. Tests, and a subtest of the VM test that does so.
* docs: submissions for the next generationtv5 days1-3/+16
| | | | | | | | A submission for a generation not yet switched to waits in an incoming directory, which the check before the switch plans against the new schema and the switch takes; or it is staged, with the new generation's receptor, and stored without views or reactions. Either way the switch brings the views, and a host's first switch its state.
* docs: services read views; enstate doesn't configure themtv5 days1-5/+11
| | | | | | | The sketch of the NixOS side: services point at the views' paths, which the module names, as they like (LoadCredential=, a configuration file); whether they are restarted when a view changes is up to reactions, since a configuration may restart them itself.
* nix: the package, a NixOS module, its VM testtv5 days5-2/+515
| | | | | | | | | | | | | The module makes the schema from options (/etc/enstate/schema.json), every slot its own view unless it says otherwise, and names the views' paths (read-only `path` options) for the services that read them. It configures none of them: a service whose LoadCredential= reads a view is ordered after the unit that puts the views in place, by itself. That unit runs --migrate at boot and when the schema changes; the check before a switch is --migrate --dry-run against the new schema. The test: a consumer with a LoadCredential= of its own; apply from a source list, rotate, switch across a rename and back, a switch refused, a reboot.
* enstate: the system's configuration firsttv5 days1-1/+11
| | | | | | /etc/enstate/config.json, if it exists, before --config files and arguments: the NixOS module writes the state and run directories there, so an operator's enstate finds them.
* enstate: reactions after applying, and after a switchtv5 days6-20/+65
| | | | | | | | | | After applying, units are restarted or reloaded, and started if they aren't running: they may have failed for want of their views. That happens with the store's lock released: a unit restarted may want the one that runs --migrate, which waits for the lock. After a switch, --migrate runs from the unit that units using views are ordered after, so only running units react, without waiting for them (--no-block try-restart, try-reload-or-restart).
* enstate: --migrate, renames both ways, kept entriestv5 days11-217/+923
| | | | | | | | | | | | | What a generation sees of a snapshot accepted under another schema: same name and type, renamedFrom, a rename in the stored schema read backwards, and entries kept, with their types, in the snapshot's kept/. Plans start from what is seen, and store it under the running schema; a generation change rewrites no snapshot. --migrate (and --dry-run) says what each channel sees, refuses for required slots nothing fills, puts the views in place and runs their reactions; --materialize and --status go by what is seen, too. A view made from an unfilled required slot isn't there. The rollback cases of migrations.md that need no converters or steps are tests.
* docs: what is kept goes once its slot is filled anewtv5 days1-4/+7
| | | | | | | A kept entry fills a slot of its name and type after a rollback, but once that slot is filled anew it is older than what is there, and goes: the rule of migrations.md case 3, for every kept entry. --migrate takes --dry-run, for the check before a switch.
* enstate: the receptor and the provider, a first versiontv5 days19-6/+3908
| | | | | | | | | | One program on a library: --plan and --apply of submissions (complete and partial, items required and optional, groups, removal, the chain as order), validators of types and across slots, views put in place by replacing a link, their reactions by systemctl; --status, --materialize; and --pack, a submission from a source list in JSON or TOML, by the config crate's sources. Programs by the protocol of design.md 5.2; tests with shell scripts as validators and renderers.
* docs: required slots before validators, commands as optionstv6 days1-22/+26
| | | | | | | | | The plan checks that required slots are filled before it runs the validators, so they are given filled slots. The receptor's and the provider's commands are options (--plan, --apply, --pack, ...), as our tools' are. An item in a group is as required as its group, and the manifest has no checksums yet. A plan says of secret views, and of files that aren't text, which files differ, as diffutils does.
* docs: design draft 4, programs and sourcestv6 days2-125/+340
| | | | | | | | | | A protocol for validators, renderers, converters and steps (a directory with an invocation and channels/CHANNEL/SLOT, objections as JSON lines); every slot holds a file, its type a media type, so format and type versions go; validators across slots; submissions in the same layout, with removal and the chain as order proposed; and enstate pack, with source lists in JSON or TOML by continuum's config crate. Case 2 of migrations.md now has two types and converters between them.
* docs: design draft 3, migrations on papertv8 days3-167/+358
| | | | | | | | Partial submissions with required and optional items and groups, plan before apply, formats by media type, a protocol for renderers, host names by a resolver, refuse as the only policy; and the rule that a generation change never rewrites the snapshot, which the cases in migrations.md need.
* init: design draft 2, state objectstv8 days3-0/+352