| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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).
|
| | |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
| |
--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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
The receptor makes the state directory 0700 whoever created it (a
deploy copying into incoming/, say), and the module has tmpfiles keep it
so.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
--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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
/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.
|
| |
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|