aboutsummaryrefslogtreecommitdiffstats
path: root/nix
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* 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 submission goes into the incoming directory wholetv5 days1-0/+2
| | | | | | | | 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: locations in source liststv5 days1-1/+1
| | | | | | | | | 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.
* enstate: validators and renderers in a sandboxtv5 days1-0/+2
| | | | | | | | | | | 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.
* enstate: bash completiontv5 days1-0/+6
| | | | | | 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: --apply starts the unit that runs --migrate again if it failedtv5 days1-0/+2
| | | | | | | 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 days1-0/+3
| | | | | | 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: config with placeholders in parenthesestv5 days1-1/+1
| | | | | | 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: --stage, a submission for the next generationtv5 days1-0/+25
| | | | | | | | | | 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.
* nix: the package, a NixOS module, its VM testtv5 days3-0/+496
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.